From b008cbc27ab1cf3d02464b5b252243f3960db0e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 02:13:15 +0000 Subject: [PATCH] chore(deps): bump github.com/docker/docker Bumps [github.com/docker/docker](https://github.com/docker/docker) from 28.1.1+incompatible to 28.2.2+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](https://github.com/docker/docker/compare/v28.1.1...v28.2.2) --- updated-dependencies: - dependency-name: github.com/docker/docker dependency-version: 28.2.2+incompatible dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 12 +- go.sum | 24 +- .../Microsoft/go-winio/backuptar/doc.go | 3 - .../Microsoft/go-winio/backuptar/strconv.go | 70 - .../Microsoft/go-winio/backuptar/tar.go | 508 - .../containerd-shim-runhcs-v1/options/doc.go | 1 - .../options/runhcs.pb.go | 661 - .../options/runhcs.proto | 124 - .../Microsoft/hcsshim/pkg/ociwclayer/doc.go | 3 - .../hcsshim/pkg/ociwclayer/export.go | 110 - .../hcsshim/pkg/ociwclayer/import.go | 154 - .../containerd/api/runtime/sandbox/v1/doc.go | 17 - .../api/runtime/sandbox/v1/sandbox.pb.go | 1645 - .../api/runtime/sandbox/v1/sandbox.proto | 149 - .../api/runtime/sandbox/v1/sandbox_grpc.pb.go | 417 - .../runtime/sandbox/v1/sandbox_ttrpc.pb.go | 172 - .../services/containers/v1/containers.pb.go | 1178 - .../services/containers/v1/containers.proto | 181 - .../containers/v1/containers_grpc.pb.go | 316 - .../containers/v1/containers_ttrpc.pb.go | 174 - .../api/services/containers/v1/doc.go | 17 - .../api/services/content/v1/content.pb.go | 1788 - .../api/services/content/v1/content.proto | 330 - .../services/content/v1/content_grpc.pb.go | 571 - .../services/content/v1/content_ttrpc.pb.go | 311 - .../containerd/api/services/content/v1/doc.go | 17 - .../api/services/diff/v1/diff.pb.go | 524 - .../api/services/diff/v1/diff.proto | 90 - .../api/services/diff/v1/diff_grpc.pb.go | 153 - .../api/services/diff/v1/diff_ttrpc.pb.go | 60 - .../containerd/api/services/diff/v1/doc.go | 17 - .../containerd/api/services/events/v1/doc.go | 23 - .../api/services/events/v1/events.pb.go | 341 - .../api/services/events/v1/events.proto | 62 - .../api/services/events/v1/events_grpc.pb.go | 241 - .../api/services/events/v1/events_ttrpc.pb.go | 124 - .../containerd/api/services/images/v1/docs.go | 17 - .../api/services/images/v1/images.pb.go | 964 - .../api/services/images/v1/images.proto | 149 - .../api/services/images/v1/images_grpc.pb.go | 268 - .../api/services/images/v1/images_ttrpc.pb.go | 109 - .../api/services/introspection/v1/doc.go | 17 - .../introspection/v1/introspection.pb.go | 811 - .../introspection/v1/introspection.proto | 133 - .../introspection/v1/introspection_grpc.pb.go | 192 - .../v1/introspection_ttrpc.pb.go | 77 - .../containerd/api/services/leases/v1/doc.go | 17 - .../api/services/leases/v1/leases.pb.go | 961 - .../api/services/leases/v1/leases.proto | 116 - .../api/services/leases/v1/leases_grpc.pb.go | 308 - .../api/services/leases/v1/leases_ttrpc.pb.go | 125 - .../api/services/namespaces/v1/doc.go | 17 - .../services/namespaces/v1/namespace.pb.go | 867 - .../services/namespaces/v1/namespace.proto | 107 - .../namespaces/v1/namespace_grpc.pb.go | 252 - .../namespaces/v1/namespace_ttrpc.pb.go | 109 - .../containerd/api/services/sandbox/v1/doc.go | 17 - .../api/services/sandbox/v1/sandbox.pb.go | 2407 -- .../api/services/sandbox/v1/sandbox.proto | 204 - .../services/sandbox/v1/sandbox_grpc.pb.go | 625 - .../services/sandbox/v1/sandbox_ttrpc.pb.go | 272 - .../api/services/snapshots/v1/doc.go | 17 - .../api/services/snapshots/v1/snapshots.pb.go | 1715 - .../api/services/snapshots/v1/snapshots.proto | 179 - .../snapshots/v1/snapshots_grpc.pb.go | 460 - .../snapshots/v1/snapshots_ttrpc.pb.go | 242 - .../api/services/streaming/v1/doc.go | 17 - .../api/services/streaming/v1/streaming.pb.go | 175 - .../api/services/streaming/v1/streaming.proto | 31 - .../streaming/v1/streaming_grpc.pb.go | 140 - .../streaming/v1/streaming_ttrpc.pb.go | 97 - .../containerd/api/services/tasks/v1/doc.go | 17 - .../api/services/tasks/v1/tasks.pb.go | 2359 -- .../api/services/tasks/v1/tasks.proto | 227 - .../api/services/tasks/v1/tasks_grpc.pb.go | 692 - .../api/services/tasks/v1/tasks_ttrpc.pb.go | 301 - .../api/services/transfer/v1/doc.go | 17 - .../api/services/transfer/v1/transfer.pb.go | 274 - .../api/services/transfer/v1/transfer.proto | 39 - .../services/transfer/v1/transfer_grpc.pb.go | 108 - .../services/transfer/v1/transfer_ttrpc.pb.go | 45 - .../containerd/api/services/version/v1/doc.go | 18 - .../api/services/version/v1/version.pb.go | 187 - .../api/services/version/v1/version.proto | 33 - .../services/version/v1/version_grpc.pb.go | 108 - .../services/version/v1/version_ttrpc.pb.go | 45 - .../containerd/api/types/runc/options/doc.go | 17 - .../api/types/runc/options/next.pb.txt | 175 - .../api/types/runc/options/oci.pb.go | 491 - .../api/types/runc/options/oci.proto | 63 - .../containerd/api/types/task/doc.go | 18 - .../containerd/api/types/task/task.pb.go | 406 - .../containerd/api/types/task/task.proto | 55 - .../containerd/api/types/transfer/doc.go | 18 - .../api/types/transfer/imagestore.pb.go | 451 - .../api/types/transfer/imagestore.proto | 82 - .../api/types/transfer/importexport.pb.go | 320 - .../api/types/transfer/importexport.proto | 52 - .../api/types/transfer/progress.pb.go | 219 - .../api/types/transfer/progress.proto | 32 - .../api/types/transfer/registry.pb.go | 624 - .../api/types/transfer/registry.proto | 97 - .../api/types/transfer/streaming.pb.go | 226 - .../api/types/transfer/streaming.proto | 29 - .../containerd/containerd/v2/client/client.go | 985 - .../containerd/v2/client/client_opts.go | 277 - .../containerd/v2/client/container.go | 553 - .../v2/client/container_checkpoint_opts.go | 155 - .../containerd/v2/client/container_opts.go | 331 - .../v2/client/container_opts_unix.go | 147 - .../v2/client/container_restore_opts.go | 150 - .../containerd/v2/client/containerstore.go | 209 - .../containerd/containerd/v2/client/diff.go | 35 - .../containerd/containerd/v2/client/events.go | 125 - .../containerd/containerd/v2/client/export.go | 31 - .../containerd/containerd/v2/client/grpc.go | 52 - .../containerd/containerd/v2/client/image.go | 436 - .../containerd/v2/client/image_store.go | 149 - .../containerd/containerd/v2/client/import.go | 269 - .../containerd/v2/client/install.go | 127 - .../containerd/v2/client/install_opts.go | 47 - .../containerd/containerd/v2/client/lease.go | 54 - .../containerd/v2/client/namespaces.go | 122 - .../containerd/v2/client/process.go | 280 - .../containerd/containerd/v2/client/pull.go | 301 - .../containerd/v2/client/sandbox.go | 236 - .../containerd/v2/client/services.go | 244 - .../containerd/v2/client/signals.go | 83 - .../v2/client/snapshotter_opts_unix.go | 162 - .../v2/client/snapshotter_opts_windows.go | 27 - .../containerd/containerd/v2/client/task.go | 785 - .../containerd/v2/client/task_opts.go | 228 - .../containerd/v2/client/task_opts_unix.go | 80 - .../containerd/v2/client/transfer.go | 40 - .../v2/core/content/proxy/content_reader.go | 71 - .../v2/core/content/proxy/content_store.go | 324 - .../v2/core/content/proxy/content_writer.go | 155 - .../containerd/v2/core/diff/diff.go | 148 - .../containerd/v2/core/diff/proxy/differ.go | 100 - .../containerd/v2/core/diff/stream.go | 191 - .../containerd/v2/core/diff/stream_unix.go | 164 - .../containerd/v2/core/diff/stream_windows.go | 181 - .../containerd/v2/core/events/events.go | 80 - .../v2/core/events/proxy/remote_events.go | 224 - .../v2/core/images/archive/exporter.go | 589 - .../v2/core/images/archive/importer.go | 420 - .../v2/core/images/archive/reference.go | 114 - .../v2/core/images/usage/calculator.go | 167 - .../v2/core/introspection/introspection.go | 30 - .../v2/core/introspection/proxy/remote.go | 110 - .../containerd/v2/core/leases/context.go | 40 - .../containerd/v2/core/leases/grpc.go | 58 - .../containerd/v2/core/leases/id.go | 43 - .../containerd/v2/core/leases/lease.go | 104 - .../v2/core/leases/proxy/manager.go | 135 - .../v2/core/remotes/docker/auth/fetch.go | 234 - .../v2/core/remotes/docker/auth/parse.go | 200 - .../v2/core/remotes/docker/authorizer.go | 387 - .../v2/core/remotes/docker/converter.go | 85 - .../v2/core/remotes/docker/errcode.go | 283 - .../v2/core/remotes/docker/errdesc.go | 154 - .../v2/core/remotes/docker/fetcher.go | 609 - .../v2/core/remotes/docker/handler.go | 149 - .../v2/core/remotes/docker/httpreadseeker.go | 178 - .../v2/core/remotes/docker/pusher.go | 565 - .../v2/core/remotes/docker/registry.go | 264 - .../v2/core/remotes/docker/resolver.go | 924 - .../v2/core/remotes/docker/resolver_unix.go | 28 - .../core/remotes/docker/resolver_windows.go | 30 - .../v2/core/remotes/docker/scope.go | 101 - .../v2/core/remotes/docker/status.go | 101 - .../v2/core/remotes/errors/errors.go | 55 - .../containerd/v2/core/remotes/handlers.go | 396 - .../containerd/v2/core/remotes/resolver.go | 118 - .../containerd/v2/core/sandbox/bridge.go | 81 - .../containerd/v2/core/sandbox/controller.go | 143 - .../containerd/v2/core/sandbox/helpers.go | 69 - .../v2/core/sandbox/proxy/controller.go | 222 - .../containerd/v2/core/sandbox/proxy/store.go | 96 - .../containerd/v2/core/sandbox/store.go | 118 - .../v2/core/snapshots/proxy/convert.go | 90 - .../v2/core/snapshots/proxy/proxy.go | 192 - .../v2/core/streaming/proxy/streaming.go | 129 - .../containerd/v2/core/streaming/streaming.go | 47 - .../v2/core/transfer/proxy/transfer.go | 165 - .../v2/core/transfer/streaming/reader.go | 121 - .../v2/core/transfer/streaming/stream.go | 210 - .../v2/core/transfer/streaming/writer.go | 130 - .../containerd/v2/core/transfer/transfer.go | 178 - .../containerd/v2/core/unpack/unpacker.go | 599 - .../containerd/v2/defaults/defaults.go | 32 - .../containerd/v2/defaults/defaults_darwin.go | 22 - .../v2/defaults/defaults_freebsd.go | 22 - .../containerd/v2/defaults/defaults_linux.go | 38 - .../containerd/v2/defaults/defaults_unix.go | 27 - .../v2/defaults/defaults_unix_nolinux.go | 38 - .../v2/defaults/defaults_windows.go | 53 - .../containerd/containerd/v2/defaults/doc.go | 19 - .../containerd/v2/internal/cleanup/context.go | 52 - .../containerd/v2/internal/kmutex/kmutex.go | 105 - .../containerd/v2/internal/kmutex/noop.go | 33 - .../containerd/v2/internal/userns/idmap.go | 175 - .../containerd/v2/pkg/archive/link_default.go | 25 - .../containerd/v2/pkg/archive/link_freebsd.go | 34 - .../containerd/v2/pkg/archive/tar.go | 817 - .../containerd/v2/pkg/archive/tar_freebsd.go | 46 - .../containerd/v2/pkg/archive/tar_mostunix.go | 55 - .../containerd/v2/pkg/archive/tar_opts.go | 111 - .../v2/pkg/archive/tar_opts_linux.go | 52 - .../v2/pkg/archive/tar_opts_windows.go | 79 - .../containerd/v2/pkg/archive/tar_unix.go | 203 - .../containerd/v2/pkg/archive/tar_windows.go | 107 - .../v2/pkg/archive/tarheader/tarheader.go | 82 - .../pkg/archive/tarheader/tarheader_unix.go | 75 - .../containerd/v2/pkg/archive/time.go | 54 - .../containerd/v2/pkg/archive/time_unix.go | 38 - .../containerd/v2/pkg/archive/time_windows.go | 41 - .../containerd/containerd/v2/pkg/cio/io.go | 356 - .../containerd/v2/pkg/cio/io_unix.go | 195 - .../containerd/v2/pkg/cio/io_windows.go | 197 - .../containerd/v2/pkg/dialer/dialer.go | 74 - .../containerd/v2/pkg/dialer/dialer_unix.go | 43 - .../v2/pkg/dialer/dialer_windows.go | 47 - .../containerd/v2/pkg/epoch/context.go | 41 - .../containerd/v2/pkg/epoch/epoch.go | 67 - .../containerd/v2/pkg/protobuf/compare.go | 41 - .../containerd/v2/pkg/protobuf/proto/proto.go | 30 - .../containerd/v2/pkg/protobuf/timestamp.go | 36 - .../containerd/v2/pkg/protobuf/types/types.go | 28 - .../containerd/v2/pkg/reference/reference.go | 156 - .../containerd/v2/pkg/rootfs/apply.go | 186 - .../containerd/v2/pkg/rootfs/diff.go | 67 - .../containerd/v2/pkg/rootfs/init.go | 116 - .../containerd/v2/pkg/rootfs/init_linux.go | 130 - .../containerd/v2/pkg/rootfs/init_other.go | 23 - .../containerd/v2/pkg/tracing/helpers.go | 85 - .../containerd/v2/pkg/tracing/log.go | 82 - .../containerd/v2/pkg/tracing/tracing.go | 132 - .../v2/plugins/services/services.go | 40 - .../containerd/containerd/v2/plugins/types.go | 105 - .../containerd/v2/version/version.go | 41 - .../containerd/errdefs/pkg/errhttp/http.go | 96 + .../github.com/containerd/fifo/.gitattributes | 1 - vendor/github.com/containerd/fifo/.gitignore | 2 - .../github.com/containerd/fifo/.golangci.yml | 36 - vendor/github.com/containerd/fifo/LICENSE | 201 - vendor/github.com/containerd/fifo/Makefile | 24 - vendor/github.com/containerd/fifo/errors.go | 28 - vendor/github.com/containerd/fifo/fifo.go | 268 - .../containerd/fifo/handle_linux.go | 98 - .../containerd/fifo/handle_nolinux.go | 64 - vendor/github.com/containerd/fifo/raw.go | 114 - vendor/github.com/containerd/fifo/readme.md | 46 - vendor/github.com/containerd/fifo/utils.go | 35 - .../containerd/plugin/.golangci.yml | 32 - vendor/github.com/containerd/plugin/LICENSE | 191 - vendor/github.com/containerd/plugin/README.md | 19 - .../github.com/containerd/plugin/context.go | 199 - vendor/github.com/containerd/plugin/plugin.go | 178 - vendor/github.com/docker/docker/AUTHORS | 8 +- vendor/github.com/docker/docker/api/common.go | 2 +- .../github.com/docker/docker/api/swagger.yaml | 188 +- .../docker/api/types/backend/backend.go | 2 +- .../docker/docker/api/types/backend/build.go | 4 +- .../docker/docker/api/types/build/build.go | 91 + .../docker/docker/api/types/build/cache.go | 52 + .../docker/api/types/build/disk_usage.go | 8 + .../docker/docker/api/types/client.go | 171 - .../docker/api/types/container/container.go | 4 +- .../docker/api/types/container/disk_usage.go | 8 + .../docker/api/types/container/health.go | 36 +- .../docker/api/types/container/hostconfig.go | 4 +- .../docker/api/types/container/state.go | 64 + .../docker/api/types/image/disk_usage.go | 8 + .../docker/api/types/image/image_inspect.go | 3 +- .../docker/docker/api/types/image/opts.go | 1 + .../api/types/plugins/logdriver/entry.pb.go | 755 - .../api/types/plugins/logdriver/entry.proto | 16 - .../docker/api/types/plugins/logdriver/gen.go | 3 - .../docker/api/types/plugins/logdriver/io.go | 87 - .../docker/docker/api/types/swarm/config.go | 18 +- .../docker/docker/api/types/swarm/node.go | 11 + .../docker/docker/api/types/swarm/secret.go | 18 +- .../docker/docker/api/types/swarm/service.go | 72 +- .../docker/docker/api/types/swarm/swarm.go | 7 + .../docker/docker/api/types/swarm/task.go | 6 + .../docker/api/types/system/disk_usage.go | 17 + .../docker/docker/api/types/system/info.go | 12 +- .../docker/docker/api/types/time/timestamp.go | 10 +- .../docker/docker/api/types/types.go | 82 +- .../docker/api/types/types_deprecated.go | 126 + .../docker/api/types/volume/disk_usage.go | 8 + .../docker/docker/builder/builder.go | 3 +- .../docker/builder/dockerfile/builder.go | 12 +- .../builder/dockerfile/containerbackend.go | 14 +- .../docker/docker/builder/dockerfile/copy.go | 4 +- .../docker/builder/dockerfile/copy_unix.go | 5 +- .../docker/builder/dockerfile/evaluator.go | 4 +- .../docker/builder/dockerfile/internals.go | 6 +- .../docker/builder/remotecontext/archive.go | 4 +- .../docker/builder/remotecontext/git.go | 20 +- .../builder/remotecontext/git/gitutils.go | 6 +- .../builder/remotecontext/lazycontext.go | 20 +- .../docker/builder/remotecontext/remote.go | 15 +- .../docker/docker/client/build_prune.go | 6 +- .../docker/docker/client/client_interfaces.go | 29 +- .../docker/docker/client/config_create.go | 5 +- .../docker/docker/client/config_list.go | 3 +- .../github.com/docker/docker/client/errors.go | 50 +- .../docker/docker/client/image_build.go | 14 +- .../docker/docker/client/image_pull.go | 4 +- .../docker/docker/client/image_push.go | 4 +- .../docker/docker/client/image_remove.go | 8 + .../docker/docker/client/image_search.go | 4 +- .../docker/docker/client/node_list.go | 3 +- .../docker/docker/client/node_remove.go | 4 +- .../github.com/docker/docker/client/ping.go | 3 +- .../docker/docker/client/plugin_install.go | 8 +- .../docker/docker/client/request.go | 11 +- .../docker/docker/client/secret_create.go | 9 +- .../docker/docker/client/secret_list.go | 3 +- .../docker/docker/client/service_create.go | 3 +- .../docker/docker/client/service_inspect.go | 3 +- .../docker/docker/client/service_list.go | 3 +- .../docker/docker/client/service_update.go | 3 +- .../docker/client/swarm_get_unlock_key.go | 8 +- .../docker/docker/client/task_list.go | 3 +- .../github.com/docker/docker/client/utils.go | 4 +- .../docker/container/archive_windows.go | 82 - .../docker/docker/container/attach_context.go | 35 - .../docker/docker/container/container.go | 866 - .../docker/docker/container/container_unix.go | 448 - .../docker/container/container_windows.go | 209 - .../github.com/docker/docker/container/env.go | 43 - .../docker/docker/container/exec.go | 132 - .../docker/docker/container/health.go | 83 - .../docker/docker/container/history.go | 30 - .../docker/docker/container/memory_store.go | 95 - .../docker/docker/container/monitor.go | 50 - .../docker/docker/container/mounts_unix.go | 15 - .../docker/docker/container/mounts_windows.go | 8 - .../docker/docker/container/rwlayer.go | 16 - .../docker/docker/container/state.go | 454 - .../docker/docker/container/store.go | 28 - .../docker/docker/container/stream/attach.go | 183 - .../container/stream/bytespipe/buffer.go | 51 - .../container/stream/bytespipe/bytespipe.go | 188 - .../docker/docker/container/stream/streams.go | 187 - .../docker/container/stream/unbuffered.go | 49 - .../docker/docker/container/view.go | 518 - .../docker/daemon/graphdriver/fsdiff.go | 8 +- .../docker/docker/daemon/logger/adapter.go | 143 - .../docker/docker/daemon/logger/copier.go | 190 - .../docker/docker/daemon/logger/factory.go | 178 - .../daemon/logger/jsonfilelog/jsonfilelog.go | 182 - .../logger/jsonfilelog/jsonlog/jsonlog.go | 27 - .../jsonfilelog/jsonlog/jsonlogbytes.go | 125 - .../jsonfilelog/jsonlog/time_marshalling.go | 20 - .../docker/daemon/logger/jsonfilelog/read.go | 86 - .../docker/daemon/logger/local/config.go | 36 - .../docker/docker/daemon/logger/local/doc.go | 9 - .../docker/daemon/logger/local/local.go | 214 - .../docker/docker/daemon/logger/local/read.go | 210 - .../docker/daemon/logger/log_cache_opts.go | 29 - .../docker/docker/daemon/logger/logger.go | 134 - .../docker/daemon/logger/logger_error.go | 27 - .../logger/loggerutils/cache/local_cache.go | 124 - .../logger/loggerutils/cache/validate.go | 40 - .../daemon/logger/loggerutils/file_unix.go | 17 - .../daemon/logger/loggerutils/file_windows.go | 252 - .../daemon/logger/loggerutils/follow.go | 143 - .../daemon/logger/loggerutils/log_tag.go | 31 - .../daemon/logger/loggerutils/logfile.go | 914 - .../docker/daemon/logger/loggerutils/queue.go | 156 - .../daemon/logger/loggerutils/sharedtemp.go | 226 - .../docker/docker/daemon/logger/loginfo.go | 147 - .../docker/docker/daemon/logger/metrics.go | 21 - .../docker/docker/daemon/logger/plugin.go | 116 - .../docker/daemon/logger/plugin_unix.go | 23 - .../daemon/logger/plugin_unsupported.go | 12 - .../docker/docker/daemon/logger/proxy.go | 100 - .../docker/docker/daemon/logger/ring.go | 234 - .../daemon/logger/templates/templates.go | 50 - .../github.com/docker/docker/errdefs/doc.go | 2 +- .../docker/docker/errdefs/helpers.go | 32 +- .../docker/docker/errdefs/http_helpers.go | 8 +- vendor/github.com/docker/docker/errdefs/is.go | 127 +- .../docker/internal/cleanups/composite.go | 44 - .../docker/internal/multierror/multierror.go | 2 +- .../docker/docker/internal/safepath/common.go | 66 - .../docker/docker/internal/safepath/errors.go | 42 - .../docker/internal/safepath/join_linux.go | 149 - .../docker/internal/safepath/join_windows.go | 92 - .../internal/safepath/k8s_safeopen_linux.go | 112 - .../docker/internal/safepath/safepath.go | 63 - .../internal/unix_noeintr/epoll_linux.go | 37 - .../docker/internal/unix_noeintr/fs_unix.go | 85 - .../docker/internal/usergroup/add_linux.go | 4 +- .../docker/docker/layer/layer_store.go | 12 +- .../docker/docker/layer/migration.go | 54 +- .../docker/libcontainerd/types/types.go | 103 - .../docker/libcontainerd/types/types_linux.go | 33 - .../libcontainerd/types/types_windows.go | 37 - .../docker/docker/oci/devices_linux.go | 2 +- vendor/github.com/docker/docker/oci/oci.go | 2 +- .../docker/docker/pkg/homedir/homedir.go | 28 - .../docker/pkg/homedir/homedir_linux.go | 105 - .../docker/pkg/homedir/homedir_others.go | 32 - .../docker/docker/pkg/ioutils/readers.go | 4 +- .../docker/docker/pkg/ioutils/writeflusher.go | 4 +- .../docker/docker/pkg/plugingetter/getter.go | 52 - .../docker/docker/pkg/plugins/client.go | 270 - .../docker/docker/pkg/plugins/discovery.go | 186 - .../docker/pkg/plugins/discovery_unix.go | 31 - .../docker/pkg/plugins/discovery_windows.go | 11 - .../docker/docker/pkg/plugins/errors.go | 33 - .../docker/docker/pkg/plugins/plugins.go | 344 - .../docker/pkg/plugins/transport/http.go | 41 - .../docker/pkg/plugins/transport/mimetype.go | 6 - .../docker/pkg/progress/progressreader.go | 2 +- .../docker/docker/pkg/rootless/rootless.go | 8 - .../docker/docker/pkg/tailfile/tailfile.go | 220 - .../docker/pkg/tarsum/builder_context.go | 6 +- .../docker/restartmanager/restartmanager.go | 133 - .../docker/volume/mounts/lcow_parser.go | 66 - .../docker/volume/mounts/linux_parser.go | 495 - .../docker/docker/volume/mounts/mounts.go | 309 - .../docker/docker/volume/mounts/parser.go | 50 - .../docker/docker/volume/mounts/validate.go | 29 - .../docker/volume/mounts/volume_copy.go | 23 - .../docker/volume/mounts/volume_unix.go | 14 - .../docker/volume/mounts/volume_windows.go | 5 - .../docker/volume/mounts/windows_parser.go | 468 - .../github.com/docker/docker/volume/volume.go | 79 - vendor/github.com/docker/go-events/.gitignore | 24 - .../docker/go-events/CONTRIBUTING.md | 70 - vendor/github.com/docker/go-events/LICENSE | 201 - .../github.com/docker/go-events/MAINTAINERS | 46 - vendor/github.com/docker/go-events/README.md | 116 - .../github.com/docker/go-events/SECURITY.md | 36 - .../github.com/docker/go-events/broadcast.go | 178 - vendor/github.com/docker/go-events/channel.go | 61 - vendor/github.com/docker/go-events/errors.go | 10 - vendor/github.com/docker/go-events/event.go | 15 - vendor/github.com/docker/go-events/filter.go | 52 - vendor/github.com/docker/go-events/queue.go | 111 - vendor/github.com/docker/go-events/retry.go | 260 - vendor/github.com/docker/go-events/vendor.mod | 5 - vendor/github.com/docker/go-events/vendor.sum | 16 - .../gogo/protobuf/gogoproto/Makefile | 37 - .../github.com/gogo/protobuf/gogoproto/doc.go | 169 - .../gogo/protobuf/gogoproto/gogo.pb.go | 874 - .../gogo/protobuf/gogoproto/gogo.pb.golden | 45 - .../gogo/protobuf/gogoproto/gogo.proto | 144 - .../gogo/protobuf/gogoproto/helper.go | 415 - .../protoc-gen-gogo/descriptor/Makefile | 36 - .../protoc-gen-gogo/descriptor/descriptor.go | 118 - .../descriptor/descriptor.pb.go | 2865 -- .../descriptor/descriptor_gostring.gen.go | 752 - .../protoc-gen-gogo/descriptor/helper.go | 390 - .../gogo/protobuf/sortkeys/sortkeys.go | 101 - vendor/github.com/gogo/protobuf/types/any.go | 140 - .../github.com/gogo/protobuf/types/any.pb.go | 694 - .../github.com/gogo/protobuf/types/api.pb.go | 2134 -- vendor/github.com/gogo/protobuf/types/doc.go | 35 - .../gogo/protobuf/types/duration.go | 100 - .../gogo/protobuf/types/duration.pb.go | 517 - .../gogo/protobuf/types/duration_gogo.go | 100 - .../gogo/protobuf/types/empty.pb.go | 462 - .../gogo/protobuf/types/field_mask.pb.go | 738 - .../gogo/protobuf/types/protosize.go | 34 - .../gogo/protobuf/types/source_context.pb.go | 524 - .../gogo/protobuf/types/struct.pb.go | 2271 -- .../gogo/protobuf/types/timestamp.go | 130 - .../gogo/protobuf/types/timestamp.pb.go | 539 - .../gogo/protobuf/types/timestamp_gogo.go | 94 - .../github.com/gogo/protobuf/types/type.pb.go | 3355 -- .../gogo/protobuf/types/wrappers.pb.go | 2703 -- .../gogo/protobuf/types/wrappers_gogo.go | 300 - vendor/github.com/golang/protobuf/AUTHORS | 3 - .../github.com/golang/protobuf/CONTRIBUTORS | 3 - vendor/github.com/golang/protobuf/LICENSE | 28 - .../golang/protobuf/proto/buffer.go | 324 - .../golang/protobuf/proto/defaults.go | 63 - .../golang/protobuf/proto/deprecated.go | 113 - .../golang/protobuf/proto/discard.go | 58 - .../golang/protobuf/proto/extensions.go | 356 - .../golang/protobuf/proto/properties.go | 306 - .../github.com/golang/protobuf/proto/proto.go | 167 - .../golang/protobuf/proto/registry.go | 317 - .../golang/protobuf/proto/text_decode.go | 801 - .../golang/protobuf/proto/text_encode.go | 560 - .../github.com/golang/protobuf/proto/wire.go | 78 - .../golang/protobuf/proto/wrappers.go | 34 - .../hashicorp/go-immutable-radix/.gitignore | 24 - .../hashicorp/go-immutable-radix/CHANGELOG.md | 23 - .../hashicorp/go-immutable-radix/LICENSE | 363 - .../hashicorp/go-immutable-radix/README.md | 66 - .../hashicorp/go-immutable-radix/edges.go | 21 - .../hashicorp/go-immutable-radix/iradix.go | 676 - .../hashicorp/go-immutable-radix/iter.go | 205 - .../hashicorp/go-immutable-radix/node.go | 334 - .../hashicorp/go-immutable-radix/raw_iter.go | 78 - .../go-immutable-radix/reverse_iter.go | 239 - .../github.com/hashicorp/go-memdb/.gitignore | 26 - .../github.com/hashicorp/go-memdb/CODEOWNERS | 13 - vendor/github.com/hashicorp/go-memdb/LICENSE | 365 - .../github.com/hashicorp/go-memdb/README.md | 146 - .../github.com/hashicorp/go-memdb/changes.go | 37 - .../github.com/hashicorp/go-memdb/filter.go | 41 - vendor/github.com/hashicorp/go-memdb/index.go | 934 - vendor/github.com/hashicorp/go-memdb/memdb.go | 119 - .../github.com/hashicorp/go-memdb/schema.go | 117 - vendor/github.com/hashicorp/go-memdb/txn.go | 1024 - vendor/github.com/hashicorp/go-memdb/watch.go | 155 - .../hashicorp/go-memdb/watch_few.go | 120 - .../github.com/hashicorp/golang-lru/LICENSE | 364 - .../hashicorp/golang-lru/simplelru/lru.go | 177 - .../golang-lru/simplelru/lru_interface.go | 40 - vendor/github.com/moby/swarmkit/v2/LICENSE | 201 - .../moby/swarmkit/v2/agent/exec/controller.go | 360 - .../swarmkit/v2/agent/exec/controller_stub.go | 75 - .../moby/swarmkit/v2/agent/exec/errors.go | 79 - .../moby/swarmkit/v2/agent/exec/executor.go | 126 - .../github.com/moby/swarmkit/v2/api/README.md | 24 - .../moby/swarmkit/v2/api/api.pb.txt | 12158 ------- .../github.com/moby/swarmkit/v2/api/ca.pb.go | 2428 -- .../github.com/moby/swarmkit/v2/api/ca.proto | 72 - .../moby/swarmkit/v2/api/control.pb.go | 27581 ---------------- .../moby/swarmkit/v2/api/control.proto | 871 - .../moby/swarmkit/v2/api/deepcopy/copy.go | 59 - .../moby/swarmkit/v2/api/dispatcher.pb.go | 5182 --- .../moby/swarmkit/v2/api/dispatcher.proto | 251 - .../moby/swarmkit/v2/api/equality/equality.go | 67 - .../moby/swarmkit/v2/api/health.pb.go | 772 - .../moby/swarmkit/v2/api/health.proto | 34 - .../moby/swarmkit/v2/api/logbroker.pb.go | 3892 --- .../moby/swarmkit/v2/api/logbroker.proto | 188 - .../moby/swarmkit/v2/api/objects.pb.go | 10132 ------ .../moby/swarmkit/v2/api/objects.proto | 556 - .../moby/swarmkit/v2/api/raft.pb.go | 4579 --- .../moby/swarmkit/v2/api/raft.proto | 151 - .../moby/swarmkit/v2/api/resource.pb.go | 1227 - .../moby/swarmkit/v2/api/resource.proto | 34 - .../moby/swarmkit/v2/api/snapshot.pb.go | 1611 - .../moby/swarmkit/v2/api/snapshot.proto | 45 - .../moby/swarmkit/v2/api/specs.pb.go | 9304 ------ .../moby/swarmkit/v2/api/specs.proto | 581 - .../moby/swarmkit/v2/api/storeobject.go | 123 - .../moby/swarmkit/v2/api/types.pb.go | 27423 --------------- .../moby/swarmkit/v2/api/types.proto | 1691 - .../moby/swarmkit/v2/api/watch.pb.go | 4879 --- .../moby/swarmkit/v2/api/watch.proto | 155 - .../moby/swarmkit/v2/log/context.go | 99 - .../github.com/moby/swarmkit/v2/log/grpc.go | 31 - .../v2/manager/raftselector/raftselector.go | 19 - .../swarmkit/v2/protobuf/plugin/helpers.go | 11 - .../swarmkit/v2/protobuf/plugin/plugin.pb.go | 1273 - .../swarmkit/v2/protobuf/plugin/plugin.proto | 53 - .../moby/swarmkit/v2/protobuf/ptypes/doc.go | 3 - .../swarmkit/v2/protobuf/ptypes/timestamp.go | 17 - .../image-spec/identity/chainid.go | 67 - .../image-spec/identity/helpers.go | 40 - .../specs-go/features/features.go | 145 - .../github.com/opencontainers/selinux/LICENSE | 201 - .../opencontainers/selinux/go-selinux/doc.go | 13 - .../selinux/go-selinux/label/label.go | 48 - .../selinux/go-selinux/label/label_linux.go | 136 - .../selinux/go-selinux/label/label_stub.go | 44 - .../selinux/go-selinux/selinux.go | 322 - .../selinux/go-selinux/selinux_linux.go | 1301 - .../selinux/go-selinux/selinux_stub.go | 155 - .../selinux/go-selinux/xattrs_linux.go | 71 - .../selinux/pkg/pwalkdir/README.md | 56 - .../selinux/pkg/pwalkdir/pwalkdir.go | 123 - vendor/go.etcd.io/etcd/raft/v3/LICENSE | 202 - .../etcd/raft/v3/raftpb/confchange.go | 170 - .../etcd/raft/v3/raftpb/confstate.go | 44 - .../go.etcd.io/etcd/raft/v3/raftpb/raft.pb.go | 2988 -- .../go.etcd.io/etcd/raft/v3/raftpb/raft.proto | 187 - .../otel/semconv/v1.21.0/README.md | 3 - .../otel/semconv/v1.21.0/attribute_group.go | 1866 -- .../otel/semconv/v1.21.0/doc.go | 9 - .../otel/semconv/v1.21.0/event.go | 188 - .../otel/semconv/v1.21.0/exception.go | 9 - .../otel/semconv/v1.21.0/resource.go | 2299 -- .../otel/semconv/v1.21.0/schema.go | 9 - .../otel/semconv/v1.21.0/trace.go | 2484 -- .../grpc/health/grpc_health_v1/health.pb.go | 384 - .../health/grpc_health_v1/health_grpc.pb.go | 290 - .../internal/editionssupport/editions.go | 18 - .../protobuf/reflect/protodesc/desc.go | 286 - .../protobuf/reflect/protodesc/desc_init.go | 288 - .../reflect/protodesc/desc_resolve.go | 291 - .../reflect/protodesc/desc_validate.go | 359 - .../protobuf/reflect/protodesc/editions.go | 181 - .../protobuf/reflect/protodesc/proto.go | 271 - .../types/gofeaturespb/go_features.pb.go | 311 - vendor/modules.txt | 142 +- 599 files changed, 1008 insertions(+), 233362 deletions(-) delete mode 100644 vendor/github.com/Microsoft/go-winio/backuptar/doc.go delete mode 100644 vendor/github.com/Microsoft/go-winio/backuptar/strconv.go delete mode 100644 vendor/github.com/Microsoft/go-winio/backuptar/tar.go delete mode 100644 vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/doc.go delete mode 100644 vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go delete mode 100644 vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto delete mode 100644 vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/doc.go delete mode 100644 vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/export.go delete mode 100644 vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/import.go delete mode 100644 vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox.proto delete mode 100644 vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox_grpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox_ttrpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/containers/v1/containers.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/containers/v1/containers.proto delete mode 100644 vendor/github.com/containerd/containerd/api/services/containers/v1/containers_grpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/containers/v1/containers_ttrpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/containers/v1/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/content/v1/content.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/content/v1/content.proto delete mode 100644 vendor/github.com/containerd/containerd/api/services/content/v1/content_grpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/content/v1/content_ttrpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/content/v1/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/diff/v1/diff.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/diff/v1/diff.proto delete mode 100644 vendor/github.com/containerd/containerd/api/services/diff/v1/diff_grpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/diff/v1/diff_ttrpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/diff/v1/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/events/v1/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/events/v1/events.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/events/v1/events.proto delete mode 100644 vendor/github.com/containerd/containerd/api/services/events/v1/events_grpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/events/v1/events_ttrpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/images/v1/docs.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/images/v1/images.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/images/v1/images.proto delete mode 100644 vendor/github.com/containerd/containerd/api/services/images/v1/images_grpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/images/v1/images_ttrpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/introspection/v1/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection.proto delete mode 100644 vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection_grpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection_ttrpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/leases/v1/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/leases/v1/leases.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/leases/v1/leases.proto delete mode 100644 vendor/github.com/containerd/containerd/api/services/leases/v1/leases_grpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/leases/v1/leases_ttrpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/namespaces/v1/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace.proto delete mode 100644 vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace_grpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace_ttrpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/sandbox/v1/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/sandbox/v1/sandbox.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/sandbox/v1/sandbox.proto delete mode 100644 vendor/github.com/containerd/containerd/api/services/sandbox/v1/sandbox_grpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/sandbox/v1/sandbox_ttrpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/snapshots/v1/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto delete mode 100644 vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots_grpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots_ttrpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/streaming/v1/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/streaming/v1/streaming.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/streaming/v1/streaming.proto delete mode 100644 vendor/github.com/containerd/containerd/api/services/streaming/v1/streaming_grpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/streaming/v1/streaming_ttrpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/tasks/v1/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.proto delete mode 100644 vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks_grpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks_ttrpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/transfer/v1/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/transfer/v1/transfer.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/transfer/v1/transfer.proto delete mode 100644 vendor/github.com/containerd/containerd/api/services/transfer/v1/transfer_grpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/transfer/v1/transfer_ttrpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/version/v1/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/version/v1/version.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/version/v1/version.proto delete mode 100644 vendor/github.com/containerd/containerd/api/services/version/v1/version_grpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/services/version/v1/version_ttrpc.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/types/runc/options/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/types/runc/options/next.pb.txt delete mode 100644 vendor/github.com/containerd/containerd/api/types/runc/options/oci.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/types/runc/options/oci.proto delete mode 100644 vendor/github.com/containerd/containerd/api/types/task/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/types/task/task.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/types/task/task.proto delete mode 100644 vendor/github.com/containerd/containerd/api/types/transfer/doc.go delete mode 100644 vendor/github.com/containerd/containerd/api/types/transfer/imagestore.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/types/transfer/imagestore.proto delete mode 100644 vendor/github.com/containerd/containerd/api/types/transfer/importexport.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/types/transfer/importexport.proto delete mode 100644 vendor/github.com/containerd/containerd/api/types/transfer/progress.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/types/transfer/progress.proto delete mode 100644 vendor/github.com/containerd/containerd/api/types/transfer/registry.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/types/transfer/registry.proto delete mode 100644 vendor/github.com/containerd/containerd/api/types/transfer/streaming.pb.go delete mode 100644 vendor/github.com/containerd/containerd/api/types/transfer/streaming.proto delete mode 100644 vendor/github.com/containerd/containerd/v2/client/client.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/client_opts.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/container.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/container_checkpoint_opts.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/container_opts.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/container_opts_unix.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/container_restore_opts.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/containerstore.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/diff.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/events.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/export.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/grpc.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/image.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/image_store.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/import.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/install.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/install_opts.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/lease.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/namespaces.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/process.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/pull.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/sandbox.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/services.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/signals.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/snapshotter_opts_unix.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/snapshotter_opts_windows.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/task.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/task_opts.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/task_opts_unix.go delete mode 100644 vendor/github.com/containerd/containerd/v2/client/transfer.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/content/proxy/content_reader.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/content/proxy/content_store.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/content/proxy/content_writer.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/diff/diff.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/diff/proxy/differ.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/diff/stream.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/diff/stream_unix.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/diff/stream_windows.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/events/events.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/events/proxy/remote_events.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/images/archive/exporter.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/images/archive/importer.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/images/archive/reference.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/images/usage/calculator.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/introspection/introspection.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/introspection/proxy/remote.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/leases/context.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/leases/grpc.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/leases/id.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/leases/lease.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/leases/proxy/manager.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/docker/auth/fetch.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/docker/auth/parse.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/docker/authorizer.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/docker/converter.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/docker/errcode.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/docker/errdesc.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/docker/handler.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/docker/httpreadseeker.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/docker/pusher.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/docker/registry.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver_unix.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver_windows.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/docker/scope.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/docker/status.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/errors/errors.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/handlers.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/remotes/resolver.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/sandbox/bridge.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/sandbox/controller.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/sandbox/helpers.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/sandbox/proxy/controller.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/sandbox/proxy/store.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/sandbox/store.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/snapshots/proxy/convert.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/snapshots/proxy/proxy.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/streaming/proxy/streaming.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/streaming/streaming.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/transfer/proxy/transfer.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/transfer/streaming/reader.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/transfer/streaming/stream.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/transfer/streaming/writer.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/transfer/transfer.go delete mode 100644 vendor/github.com/containerd/containerd/v2/core/unpack/unpacker.go delete mode 100644 vendor/github.com/containerd/containerd/v2/defaults/defaults.go delete mode 100644 vendor/github.com/containerd/containerd/v2/defaults/defaults_darwin.go delete mode 100644 vendor/github.com/containerd/containerd/v2/defaults/defaults_freebsd.go delete mode 100644 vendor/github.com/containerd/containerd/v2/defaults/defaults_linux.go delete mode 100644 vendor/github.com/containerd/containerd/v2/defaults/defaults_unix.go delete mode 100644 vendor/github.com/containerd/containerd/v2/defaults/defaults_unix_nolinux.go delete mode 100644 vendor/github.com/containerd/containerd/v2/defaults/defaults_windows.go delete mode 100644 vendor/github.com/containerd/containerd/v2/defaults/doc.go delete mode 100644 vendor/github.com/containerd/containerd/v2/internal/cleanup/context.go delete mode 100644 vendor/github.com/containerd/containerd/v2/internal/kmutex/kmutex.go delete mode 100644 vendor/github.com/containerd/containerd/v2/internal/kmutex/noop.go delete mode 100644 vendor/github.com/containerd/containerd/v2/internal/userns/idmap.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/archive/link_default.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/archive/link_freebsd.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/archive/tar.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/archive/tar_freebsd.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/archive/tar_mostunix.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/archive/tar_opts.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/archive/tar_opts_linux.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/archive/tar_opts_windows.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/archive/tar_unix.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/archive/tar_windows.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/archive/tarheader/tarheader.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/archive/tarheader/tarheader_unix.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/archive/time.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/archive/time_unix.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/archive/time_windows.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/cio/io.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/cio/io_unix.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/cio/io_windows.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/dialer/dialer.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/dialer/dialer_unix.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/dialer/dialer_windows.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/epoch/context.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/epoch/epoch.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/protobuf/compare.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/protobuf/proto/proto.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/protobuf/timestamp.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/protobuf/types/types.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/reference/reference.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/rootfs/apply.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/rootfs/diff.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/rootfs/init.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/rootfs/init_linux.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/rootfs/init_other.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/tracing/helpers.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/tracing/log.go delete mode 100644 vendor/github.com/containerd/containerd/v2/pkg/tracing/tracing.go delete mode 100644 vendor/github.com/containerd/containerd/v2/plugins/services/services.go delete mode 100644 vendor/github.com/containerd/containerd/v2/plugins/types.go delete mode 100644 vendor/github.com/containerd/containerd/v2/version/version.go create mode 100644 vendor/github.com/containerd/errdefs/pkg/errhttp/http.go delete mode 100644 vendor/github.com/containerd/fifo/.gitattributes delete mode 100644 vendor/github.com/containerd/fifo/.gitignore delete mode 100644 vendor/github.com/containerd/fifo/.golangci.yml delete mode 100644 vendor/github.com/containerd/fifo/LICENSE delete mode 100644 vendor/github.com/containerd/fifo/Makefile delete mode 100644 vendor/github.com/containerd/fifo/errors.go delete mode 100644 vendor/github.com/containerd/fifo/fifo.go delete mode 100644 vendor/github.com/containerd/fifo/handle_linux.go delete mode 100644 vendor/github.com/containerd/fifo/handle_nolinux.go delete mode 100644 vendor/github.com/containerd/fifo/raw.go delete mode 100644 vendor/github.com/containerd/fifo/readme.md delete mode 100644 vendor/github.com/containerd/fifo/utils.go delete mode 100644 vendor/github.com/containerd/plugin/.golangci.yml delete mode 100644 vendor/github.com/containerd/plugin/LICENSE delete mode 100644 vendor/github.com/containerd/plugin/README.md delete mode 100644 vendor/github.com/containerd/plugin/context.go delete mode 100644 vendor/github.com/containerd/plugin/plugin.go create mode 100644 vendor/github.com/docker/docker/api/types/build/build.go create mode 100644 vendor/github.com/docker/docker/api/types/build/cache.go create mode 100644 vendor/github.com/docker/docker/api/types/build/disk_usage.go create mode 100644 vendor/github.com/docker/docker/api/types/container/disk_usage.go create mode 100644 vendor/github.com/docker/docker/api/types/container/state.go create mode 100644 vendor/github.com/docker/docker/api/types/image/disk_usage.go delete mode 100644 vendor/github.com/docker/docker/api/types/plugins/logdriver/entry.pb.go delete mode 100644 vendor/github.com/docker/docker/api/types/plugins/logdriver/entry.proto delete mode 100644 vendor/github.com/docker/docker/api/types/plugins/logdriver/gen.go delete mode 100644 vendor/github.com/docker/docker/api/types/plugins/logdriver/io.go create mode 100644 vendor/github.com/docker/docker/api/types/system/disk_usage.go create mode 100644 vendor/github.com/docker/docker/api/types/volume/disk_usage.go delete mode 100644 vendor/github.com/docker/docker/container/archive_windows.go delete mode 100644 vendor/github.com/docker/docker/container/attach_context.go delete mode 100644 vendor/github.com/docker/docker/container/container.go delete mode 100644 vendor/github.com/docker/docker/container/container_unix.go delete mode 100644 vendor/github.com/docker/docker/container/container_windows.go delete mode 100644 vendor/github.com/docker/docker/container/env.go delete mode 100644 vendor/github.com/docker/docker/container/exec.go delete mode 100644 vendor/github.com/docker/docker/container/health.go delete mode 100644 vendor/github.com/docker/docker/container/history.go delete mode 100644 vendor/github.com/docker/docker/container/memory_store.go delete mode 100644 vendor/github.com/docker/docker/container/monitor.go delete mode 100644 vendor/github.com/docker/docker/container/mounts_unix.go delete mode 100644 vendor/github.com/docker/docker/container/mounts_windows.go delete mode 100644 vendor/github.com/docker/docker/container/rwlayer.go delete mode 100644 vendor/github.com/docker/docker/container/state.go delete mode 100644 vendor/github.com/docker/docker/container/store.go delete mode 100644 vendor/github.com/docker/docker/container/stream/attach.go delete mode 100644 vendor/github.com/docker/docker/container/stream/bytespipe/buffer.go delete mode 100644 vendor/github.com/docker/docker/container/stream/bytespipe/bytespipe.go delete mode 100644 vendor/github.com/docker/docker/container/stream/streams.go delete mode 100644 vendor/github.com/docker/docker/container/stream/unbuffered.go delete mode 100644 vendor/github.com/docker/docker/container/view.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/adapter.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/copier.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/factory.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonfilelog.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog/jsonlog.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog/jsonlogbytes.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog/time_marshalling.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/jsonfilelog/read.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/local/config.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/local/doc.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/local/local.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/local/read.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/log_cache_opts.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/logger.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/logger_error.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/loggerutils/cache/local_cache.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/loggerutils/cache/validate.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/loggerutils/file_unix.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/loggerutils/file_windows.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/loggerutils/follow.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/loggerutils/log_tag.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/loggerutils/logfile.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/loggerutils/queue.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/loggerutils/sharedtemp.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/loginfo.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/metrics.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/plugin.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/plugin_unix.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/plugin_unsupported.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/proxy.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/ring.go delete mode 100644 vendor/github.com/docker/docker/daemon/logger/templates/templates.go delete mode 100644 vendor/github.com/docker/docker/internal/cleanups/composite.go delete mode 100644 vendor/github.com/docker/docker/internal/safepath/common.go delete mode 100644 vendor/github.com/docker/docker/internal/safepath/errors.go delete mode 100644 vendor/github.com/docker/docker/internal/safepath/join_linux.go delete mode 100644 vendor/github.com/docker/docker/internal/safepath/join_windows.go delete mode 100644 vendor/github.com/docker/docker/internal/safepath/k8s_safeopen_linux.go delete mode 100644 vendor/github.com/docker/docker/internal/safepath/safepath.go delete mode 100644 vendor/github.com/docker/docker/internal/unix_noeintr/epoll_linux.go delete mode 100644 vendor/github.com/docker/docker/internal/unix_noeintr/fs_unix.go delete mode 100644 vendor/github.com/docker/docker/libcontainerd/types/types.go delete mode 100644 vendor/github.com/docker/docker/libcontainerd/types/types_linux.go delete mode 100644 vendor/github.com/docker/docker/libcontainerd/types/types_windows.go delete mode 100644 vendor/github.com/docker/docker/pkg/homedir/homedir.go delete mode 100644 vendor/github.com/docker/docker/pkg/homedir/homedir_linux.go delete mode 100644 vendor/github.com/docker/docker/pkg/homedir/homedir_others.go delete mode 100644 vendor/github.com/docker/docker/pkg/plugingetter/getter.go delete mode 100644 vendor/github.com/docker/docker/pkg/plugins/client.go delete mode 100644 vendor/github.com/docker/docker/pkg/plugins/discovery.go delete mode 100644 vendor/github.com/docker/docker/pkg/plugins/discovery_unix.go delete mode 100644 vendor/github.com/docker/docker/pkg/plugins/discovery_windows.go delete mode 100644 vendor/github.com/docker/docker/pkg/plugins/errors.go delete mode 100644 vendor/github.com/docker/docker/pkg/plugins/plugins.go delete mode 100644 vendor/github.com/docker/docker/pkg/plugins/transport/http.go delete mode 100644 vendor/github.com/docker/docker/pkg/plugins/transport/mimetype.go delete mode 100644 vendor/github.com/docker/docker/pkg/rootless/rootless.go delete mode 100644 vendor/github.com/docker/docker/pkg/tailfile/tailfile.go delete mode 100644 vendor/github.com/docker/docker/restartmanager/restartmanager.go delete mode 100644 vendor/github.com/docker/docker/volume/mounts/lcow_parser.go delete mode 100644 vendor/github.com/docker/docker/volume/mounts/linux_parser.go delete mode 100644 vendor/github.com/docker/docker/volume/mounts/mounts.go delete mode 100644 vendor/github.com/docker/docker/volume/mounts/parser.go delete mode 100644 vendor/github.com/docker/docker/volume/mounts/validate.go delete mode 100644 vendor/github.com/docker/docker/volume/mounts/volume_copy.go delete mode 100644 vendor/github.com/docker/docker/volume/mounts/volume_unix.go delete mode 100644 vendor/github.com/docker/docker/volume/mounts/volume_windows.go delete mode 100644 vendor/github.com/docker/docker/volume/mounts/windows_parser.go delete mode 100644 vendor/github.com/docker/docker/volume/volume.go delete mode 100644 vendor/github.com/docker/go-events/.gitignore delete mode 100644 vendor/github.com/docker/go-events/CONTRIBUTING.md delete mode 100644 vendor/github.com/docker/go-events/LICENSE delete mode 100644 vendor/github.com/docker/go-events/MAINTAINERS delete mode 100644 vendor/github.com/docker/go-events/README.md delete mode 100644 vendor/github.com/docker/go-events/SECURITY.md delete mode 100644 vendor/github.com/docker/go-events/broadcast.go delete mode 100644 vendor/github.com/docker/go-events/channel.go delete mode 100644 vendor/github.com/docker/go-events/errors.go delete mode 100644 vendor/github.com/docker/go-events/event.go delete mode 100644 vendor/github.com/docker/go-events/filter.go delete mode 100644 vendor/github.com/docker/go-events/queue.go delete mode 100644 vendor/github.com/docker/go-events/retry.go delete mode 100644 vendor/github.com/docker/go-events/vendor.mod delete mode 100644 vendor/github.com/docker/go-events/vendor.sum delete mode 100644 vendor/github.com/gogo/protobuf/gogoproto/Makefile delete mode 100644 vendor/github.com/gogo/protobuf/gogoproto/doc.go delete mode 100644 vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go delete mode 100644 vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.golden delete mode 100644 vendor/github.com/gogo/protobuf/gogoproto/gogo.proto delete mode 100644 vendor/github.com/gogo/protobuf/gogoproto/helper.go delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/Makefile delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.go delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/helper.go delete mode 100644 vendor/github.com/gogo/protobuf/sortkeys/sortkeys.go delete mode 100644 vendor/github.com/gogo/protobuf/types/any.go delete mode 100644 vendor/github.com/gogo/protobuf/types/any.pb.go delete mode 100644 vendor/github.com/gogo/protobuf/types/api.pb.go delete mode 100644 vendor/github.com/gogo/protobuf/types/doc.go delete mode 100644 vendor/github.com/gogo/protobuf/types/duration.go delete mode 100644 vendor/github.com/gogo/protobuf/types/duration.pb.go delete mode 100644 vendor/github.com/gogo/protobuf/types/duration_gogo.go delete mode 100644 vendor/github.com/gogo/protobuf/types/empty.pb.go delete mode 100644 vendor/github.com/gogo/protobuf/types/field_mask.pb.go delete mode 100644 vendor/github.com/gogo/protobuf/types/protosize.go delete mode 100644 vendor/github.com/gogo/protobuf/types/source_context.pb.go delete mode 100644 vendor/github.com/gogo/protobuf/types/struct.pb.go delete mode 100644 vendor/github.com/gogo/protobuf/types/timestamp.go delete mode 100644 vendor/github.com/gogo/protobuf/types/timestamp.pb.go delete mode 100644 vendor/github.com/gogo/protobuf/types/timestamp_gogo.go delete mode 100644 vendor/github.com/gogo/protobuf/types/type.pb.go delete mode 100644 vendor/github.com/gogo/protobuf/types/wrappers.pb.go delete mode 100644 vendor/github.com/gogo/protobuf/types/wrappers_gogo.go delete mode 100644 vendor/github.com/golang/protobuf/AUTHORS delete mode 100644 vendor/github.com/golang/protobuf/CONTRIBUTORS delete mode 100644 vendor/github.com/golang/protobuf/LICENSE delete mode 100644 vendor/github.com/golang/protobuf/proto/buffer.go delete mode 100644 vendor/github.com/golang/protobuf/proto/defaults.go delete mode 100644 vendor/github.com/golang/protobuf/proto/deprecated.go delete mode 100644 vendor/github.com/golang/protobuf/proto/discard.go delete mode 100644 vendor/github.com/golang/protobuf/proto/extensions.go delete mode 100644 vendor/github.com/golang/protobuf/proto/properties.go delete mode 100644 vendor/github.com/golang/protobuf/proto/proto.go delete mode 100644 vendor/github.com/golang/protobuf/proto/registry.go delete mode 100644 vendor/github.com/golang/protobuf/proto/text_decode.go delete mode 100644 vendor/github.com/golang/protobuf/proto/text_encode.go delete mode 100644 vendor/github.com/golang/protobuf/proto/wire.go delete mode 100644 vendor/github.com/golang/protobuf/proto/wrappers.go delete mode 100644 vendor/github.com/hashicorp/go-immutable-radix/.gitignore delete mode 100644 vendor/github.com/hashicorp/go-immutable-radix/CHANGELOG.md delete mode 100644 vendor/github.com/hashicorp/go-immutable-radix/LICENSE delete mode 100644 vendor/github.com/hashicorp/go-immutable-radix/README.md delete mode 100644 vendor/github.com/hashicorp/go-immutable-radix/edges.go delete mode 100644 vendor/github.com/hashicorp/go-immutable-radix/iradix.go delete mode 100644 vendor/github.com/hashicorp/go-immutable-radix/iter.go delete mode 100644 vendor/github.com/hashicorp/go-immutable-radix/node.go delete mode 100644 vendor/github.com/hashicorp/go-immutable-radix/raw_iter.go delete mode 100644 vendor/github.com/hashicorp/go-immutable-radix/reverse_iter.go delete mode 100644 vendor/github.com/hashicorp/go-memdb/.gitignore delete mode 100644 vendor/github.com/hashicorp/go-memdb/CODEOWNERS delete mode 100644 vendor/github.com/hashicorp/go-memdb/LICENSE delete mode 100644 vendor/github.com/hashicorp/go-memdb/README.md delete mode 100644 vendor/github.com/hashicorp/go-memdb/changes.go delete mode 100644 vendor/github.com/hashicorp/go-memdb/filter.go delete mode 100644 vendor/github.com/hashicorp/go-memdb/index.go delete mode 100644 vendor/github.com/hashicorp/go-memdb/memdb.go delete mode 100644 vendor/github.com/hashicorp/go-memdb/schema.go delete mode 100644 vendor/github.com/hashicorp/go-memdb/txn.go delete mode 100644 vendor/github.com/hashicorp/go-memdb/watch.go delete mode 100644 vendor/github.com/hashicorp/go-memdb/watch_few.go delete mode 100644 vendor/github.com/hashicorp/golang-lru/LICENSE delete mode 100644 vendor/github.com/hashicorp/golang-lru/simplelru/lru.go delete mode 100644 vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/LICENSE delete mode 100644 vendor/github.com/moby/swarmkit/v2/agent/exec/controller.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/agent/exec/controller_stub.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/agent/exec/errors.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/agent/exec/executor.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/README.md delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/api.pb.txt delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/ca.pb.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/ca.proto delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/control.pb.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/control.proto delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/deepcopy/copy.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/dispatcher.pb.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/dispatcher.proto delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/equality/equality.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/health.pb.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/health.proto delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/logbroker.pb.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/logbroker.proto delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/objects.pb.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/objects.proto delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/raft.pb.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/raft.proto delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/resource.pb.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/resource.proto delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/snapshot.pb.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/snapshot.proto delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/specs.pb.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/specs.proto delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/storeobject.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/types.pb.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/types.proto delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/watch.pb.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/api/watch.proto delete mode 100644 vendor/github.com/moby/swarmkit/v2/log/context.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/log/grpc.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/manager/raftselector/raftselector.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/protobuf/plugin/helpers.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/protobuf/plugin/plugin.pb.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/protobuf/plugin/plugin.proto delete mode 100644 vendor/github.com/moby/swarmkit/v2/protobuf/ptypes/doc.go delete mode 100644 vendor/github.com/moby/swarmkit/v2/protobuf/ptypes/timestamp.go delete mode 100644 vendor/github.com/opencontainers/image-spec/identity/chainid.go delete mode 100644 vendor/github.com/opencontainers/image-spec/identity/helpers.go delete mode 100644 vendor/github.com/opencontainers/runtime-spec/specs-go/features/features.go delete mode 100644 vendor/github.com/opencontainers/selinux/LICENSE delete mode 100644 vendor/github.com/opencontainers/selinux/go-selinux/doc.go delete mode 100644 vendor/github.com/opencontainers/selinux/go-selinux/label/label.go delete mode 100644 vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go delete mode 100644 vendor/github.com/opencontainers/selinux/go-selinux/label/label_stub.go delete mode 100644 vendor/github.com/opencontainers/selinux/go-selinux/selinux.go delete mode 100644 vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go delete mode 100644 vendor/github.com/opencontainers/selinux/go-selinux/selinux_stub.go delete mode 100644 vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go delete mode 100644 vendor/github.com/opencontainers/selinux/pkg/pwalkdir/README.md delete mode 100644 vendor/github.com/opencontainers/selinux/pkg/pwalkdir/pwalkdir.go delete mode 100644 vendor/go.etcd.io/etcd/raft/v3/LICENSE delete mode 100644 vendor/go.etcd.io/etcd/raft/v3/raftpb/confchange.go delete mode 100644 vendor/go.etcd.io/etcd/raft/v3/raftpb/confstate.go delete mode 100644 vendor/go.etcd.io/etcd/raft/v3/raftpb/raft.pb.go delete mode 100644 vendor/go.etcd.io/etcd/raft/v3/raftpb/raft.proto delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.21.0/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go delete mode 100644 vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go delete mode 100644 vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go delete mode 100644 vendor/google.golang.org/protobuf/internal/editionssupport/editions.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/desc.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/editions.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/proto.go delete mode 100644 vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.pb.go diff --git a/go.mod b/go.mod index 105f4dbca4..e05999aad5 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/s3 v1.79.3 github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.9.1 github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589 - github.com/docker/docker v28.1.1+incompatible + github.com/docker/docker v28.2.2+incompatible github.com/go-git/go-billy/v5 v5.6.2 github.com/go-git/go-git/v5 v5.16.0 github.com/golang/mock v1.6.0 @@ -74,14 +74,12 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/containerd/continuity v0.4.5 // indirect - github.com/containerd/fifo v1.1.0 // indirect github.com/containerd/stargz-snapshotter/estargz v0.16.3 // indirect github.com/dimchansky/utfbom v1.1.1 // indirect github.com/docker/cli v28.1.1+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker-credential-helpers v0.9.3 // indirect github.com/docker/go-connections v0.5.0 // indirect - github.com/docker/go-events v0.0.0-20250114142523-c867878c5e32 // indirect github.com/docker/go-metrics v0.0.1 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/ePirat/docker-credential-gitlabci v1.0.0 @@ -90,12 +88,8 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.5.2 // indirect github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/gax-go/v2 v2.14.2 // indirect - github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-memdb v1.3.5 // indirect - github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect @@ -113,7 +107,6 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect github.com/opencontainers/runtime-spec v1.2.1 // indirect - github.com/opencontainers/selinux v1.12.0 // indirect github.com/prometheus/client_golang v1.22.0 // indirect github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.64.0 // indirect @@ -121,7 +114,6 @@ require ( github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/vbatts/tar-split v0.12.1 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect - go.etcd.io/etcd/raft/v3 v3.5.21 // indirect go.opencensus.io v0.24.0 // indirect golang.org/x/crypto v0.38.0 // indirect golang.org/x/sys v0.33.0 @@ -158,7 +150,6 @@ require ( github.com/containerd/errdefs/pkg v0.3.0 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containerd/platforms v1.0.0-rc.1 // indirect - github.com/containerd/plugin v1.0.0 // indirect github.com/containerd/ttrpc v1.2.7 // indirect github.com/containerd/typeurl/v2 v2.2.3 // indirect github.com/cyphar/filepath-securejoin v0.4.1 // indirect @@ -178,7 +169,6 @@ require ( github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/go-archive v0.1.0 // indirect - github.com/moby/swarmkit/v2 v2.0.0-20250103191802-8c1959736554 // indirect github.com/moby/sys/atomicwriter v0.1.0 // indirect github.com/moby/sys/reexec v0.1.0 // indirect github.com/moby/sys/user v0.4.0 // indirect diff --git a/go.sum b/go.sum index 19846efd16..c82137d9b7 100644 --- a/go.sum +++ b/go.sum @@ -168,14 +168,10 @@ github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= -github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY= -github.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/platforms v1.0.0-rc.1 h1:83KIq4yy1erSRgOVHNk1HYdPvzdJ5CnsWaRoJX4C41E= github.com/containerd/platforms v1.0.0-rc.1/go.mod h1:J71L7B+aiM5SdIEqmd9wp6THLVRzJGXfNuWCZCllLA4= -github.com/containerd/plugin v1.0.0 h1:c8Kf1TNl6+e2TtMHZt+39yAPDbouRH9WAToRjex483Y= -github.com/containerd/plugin v1.0.0/go.mod h1:hQfJe5nmWfImiqT1q8Si3jLv3ynMUIBB47bQ+KexvO8= github.com/containerd/stargz-snapshotter/estargz v0.16.3 h1:7evrXtoh1mSbGj/pfRccTampEyKpjpOnS3CyiV1Ebr8= github.com/containerd/stargz-snapshotter/estargz v0.16.3/go.mod h1:uyr4BfYfOj3G9WBVE8cOlQmXAbPN9VEQpBBeJIuOipU= github.com/containerd/ttrpc v1.2.7 h1:qIrroQvuOL9HQ1X6KHe2ohc7p+HP/0VE6XPU7elJRqQ= @@ -199,14 +195,12 @@ github.com/docker/cli v28.1.1+incompatible h1:eyUemzeI45DY7eDPuwUcmDyDj1pM98oD5M github.com/docker/cli v28.1.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v28.1.1+incompatible h1:49M11BFLsVO1gxY9UX9p/zwkE/rswggs8AdFmXQw51I= -github.com/docker/docker v28.1.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v28.2.2+incompatible h1:CjwRSksz8Yo4+RmQ339Dp/D2tGO5JxwYeqtMOEe0LDw= +github.com/docker/docker v28.2.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8= github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= -github.com/docker/go-events v0.0.0-20250114142523-c867878c5e32 h1:EHZfspsnLAz8Hzccd67D5abwLiqoqym2jz/jOS39mCk= -github.com/docker/go-events v0.0.0-20250114142523-c867878c5e32/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -318,16 +312,6 @@ github.com/googleapis/gax-go/v2 v2.14.2 h1:eBLnkZ9635krYIPD+ag1USrOAI0Nr0QYF3+/3 github.com/googleapis/gax-go/v2 v2.14.2/go.mod h1:ON64QhlJkhVtSqp4v1uaK92VyZ2gmvDQsweuyLV+8+w= github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 h1:e9Rjr40Z98/clHv5Yg79Is0NtosR5LXRvdr7o/6NwbA= github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1/go.mod h1:tIxuGz/9mpox++sgp9fJjHO0+q1X9/UOWd798aAm22M= -github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= -github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-memdb v1.3.5 h1:b3taDMxCBCBVgyRrS1AZVHO14ubMYZB++QpNhBg+Nyo= -github.com/hashicorp/go-memdb v1.3.5/go.mod h1:8IVKKBkVe+fxFgdFOYxzQQNjz+sWCyHCdIC/+5+Vy1Y= -github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= -github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -375,8 +359,6 @@ github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= -github.com/moby/swarmkit/v2 v2.0.0-20250103191802-8c1959736554 h1:DMHJbgyNZWyrPKYjCYt2IxEO7KA0eSd4fo6KQsv2W84= -github.com/moby/swarmkit/v2 v2.0.0-20250103191802-8c1959736554/go.mod h1:mTTGIAz/59OGZR5Qe+QByIe3Nxc+sSuJkrsStFhr6Lg= github.com/moby/sys/atomicwriter v0.1.0 h1:kw5D/EqkBwsBFi0ss9v1VG3wIkVhzGvLklJ+w3A14Sw= github.com/moby/sys/atomicwriter v0.1.0/go.mod h1:Ul8oqv2ZMNHOceF643P6FKPXeCmYtlQMvpizfsSoaWs= github.com/moby/sys/mount v0.3.4 h1:yn5jq4STPztkkzSKpZkLcmjue+bZJ0u2AuQY1iNI1Ww= @@ -512,8 +494,6 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zeebo/errs v1.4.0 h1:XNdoD/RRMKP7HD0UhJnIzUy74ISdGGxURlYG8HSWSfM= github.com/zeebo/errs v1.4.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= -go.etcd.io/etcd/raft/v3 v3.5.21 h1:dOmE0mT55dIUsX77TKBLq+RgyumsQuYeiRQnW/ylugk= -go.etcd.io/etcd/raft/v3 v3.5.21/go.mod h1:fmcuY5R2SNkklU4+fKVBQi2biVp5vafMrWUEj4TJ4Cs= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= diff --git a/vendor/github.com/Microsoft/go-winio/backuptar/doc.go b/vendor/github.com/Microsoft/go-winio/backuptar/doc.go deleted file mode 100644 index 965d52ab04..0000000000 --- a/vendor/github.com/Microsoft/go-winio/backuptar/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// This file only exists to allow go get on non-Windows platforms. - -package backuptar diff --git a/vendor/github.com/Microsoft/go-winio/backuptar/strconv.go b/vendor/github.com/Microsoft/go-winio/backuptar/strconv.go deleted file mode 100644 index 455fd798eb..0000000000 --- a/vendor/github.com/Microsoft/go-winio/backuptar/strconv.go +++ /dev/null @@ -1,70 +0,0 @@ -//go:build windows - -package backuptar - -import ( - "archive/tar" - "fmt" - "strconv" - "strings" - "time" -) - -// Functions copied from https://github.com/golang/go/blob/master/src/archive/tar/strconv.go -// as we need to manage the LIBARCHIVE.creationtime PAXRecord manually. -// Idea taken from containerd which did the same thing. - -// parsePAXTime takes a string of the form %d.%d as described in the PAX -// specification. Note that this implementation allows for negative timestamps, -// which is allowed for by the PAX specification, but not always portable. -func parsePAXTime(s string) (time.Time, error) { - const maxNanoSecondDigits = 9 - - // Split string into seconds and sub-seconds parts. - ss, sn := s, "" - if pos := strings.IndexByte(s, '.'); pos >= 0 { - ss, sn = s[:pos], s[pos+1:] - } - - // Parse the seconds. - secs, err := strconv.ParseInt(ss, 10, 64) - if err != nil { - return time.Time{}, tar.ErrHeader - } - if len(sn) == 0 { - return time.Unix(secs, 0), nil // No sub-second values - } - - // Parse the nanoseconds. - if strings.Trim(sn, "0123456789") != "" { - return time.Time{}, tar.ErrHeader - } - if len(sn) < maxNanoSecondDigits { - sn += strings.Repeat("0", maxNanoSecondDigits-len(sn)) // Right pad - } else { - sn = sn[:maxNanoSecondDigits] // Right truncate - } - nsecs, _ := strconv.ParseInt(sn, 10, 64) // Must succeed - if len(ss) > 0 && ss[0] == '-' { - return time.Unix(secs, -1*nsecs), nil // Negative correction - } - return time.Unix(secs, nsecs), nil -} - -// formatPAXTime converts ts into a time of the form %d.%d as described in the -// PAX specification. This function is capable of negative timestamps. -func formatPAXTime(ts time.Time) (s string) { - secs, nsecs := ts.Unix(), ts.Nanosecond() - if nsecs == 0 { - return strconv.FormatInt(secs, 10) - } - - // If seconds is negative, then perform correction. - sign := "" - if secs < 0 { - sign = "-" // Remember sign - secs = -(secs + 1) // Add a second to secs - nsecs = -(nsecs - 1e9) // Take that second away from nsecs - } - return strings.TrimRight(fmt.Sprintf("%s%d.%09d", sign, secs, nsecs), "0") -} diff --git a/vendor/github.com/Microsoft/go-winio/backuptar/tar.go b/vendor/github.com/Microsoft/go-winio/backuptar/tar.go deleted file mode 100644 index 7f852bbf81..0000000000 --- a/vendor/github.com/Microsoft/go-winio/backuptar/tar.go +++ /dev/null @@ -1,508 +0,0 @@ -//go:build windows -// +build windows - -package backuptar - -import ( - "archive/tar" - "encoding/base64" - "fmt" - "io" - "path/filepath" - "strconv" - "strings" - "time" - - "github.com/Microsoft/go-winio" - "golang.org/x/sys/windows" -) - -//nolint:deadcode,varcheck // keep unused constants for potential future use -const ( - cISUID = 0004000 // Set uid - cISGID = 0002000 // Set gid - cISVTX = 0001000 // Save text (sticky bit) - cISDIR = 0040000 // Directory - cISFIFO = 0010000 // FIFO - cISREG = 0100000 // Regular file - cISLNK = 0120000 // Symbolic link - cISBLK = 0060000 // Block special file - cISCHR = 0020000 // Character special file - cISSOCK = 0140000 // Socket -) - -const ( - hdrFileAttributes = "MSWINDOWS.fileattr" - hdrSecurityDescriptor = "MSWINDOWS.sd" - hdrRawSecurityDescriptor = "MSWINDOWS.rawsd" - hdrMountPoint = "MSWINDOWS.mountpoint" - hdrEaPrefix = "MSWINDOWS.xattr." - - hdrCreationTime = "LIBARCHIVE.creationtime" -) - -// zeroReader is an io.Reader that always returns 0s. -type zeroReader struct{} - -func (zeroReader) Read(b []byte) (int, error) { - for i := range b { - b[i] = 0 - } - return len(b), nil -} - -func copySparse(t *tar.Writer, br *winio.BackupStreamReader) error { - curOffset := int64(0) - for { - bhdr, err := br.Next() - if err == io.EOF { //nolint:errorlint - err = io.ErrUnexpectedEOF - } - if err != nil { - return err - } - if bhdr.Id != winio.BackupSparseBlock { - return fmt.Errorf("unexpected stream %d", bhdr.Id) - } - - // We can't seek backwards, since we have already written that data to the tar.Writer. - if bhdr.Offset < curOffset { - return fmt.Errorf("cannot seek back from %d to %d", curOffset, bhdr.Offset) - } - // archive/tar does not support writing sparse files - // so just write zeroes to catch up to the current offset. - if _, err = io.CopyN(t, zeroReader{}, bhdr.Offset-curOffset); err != nil { - return fmt.Errorf("seek to offset %d: %w", bhdr.Offset, err) - } - if bhdr.Size == 0 { - // A sparse block with size = 0 is used to mark the end of the sparse blocks. - break - } - n, err := io.Copy(t, br) - if err != nil { - return err - } - if n != bhdr.Size { - return fmt.Errorf("copied %d bytes instead of %d at offset %d", n, bhdr.Size, bhdr.Offset) - } - curOffset = bhdr.Offset + n - } - return nil -} - -// BasicInfoHeader creates a tar header from basic file information. -func BasicInfoHeader(name string, size int64, fileInfo *winio.FileBasicInfo) *tar.Header { - hdr := &tar.Header{ - Format: tar.FormatPAX, - Name: filepath.ToSlash(name), - Size: size, - Typeflag: tar.TypeReg, - ModTime: time.Unix(0, fileInfo.LastWriteTime.Nanoseconds()), - ChangeTime: time.Unix(0, fileInfo.ChangeTime.Nanoseconds()), - AccessTime: time.Unix(0, fileInfo.LastAccessTime.Nanoseconds()), - PAXRecords: make(map[string]string), - } - hdr.PAXRecords[hdrFileAttributes] = fmt.Sprintf("%d", fileInfo.FileAttributes) - hdr.PAXRecords[hdrCreationTime] = formatPAXTime(time.Unix(0, fileInfo.CreationTime.Nanoseconds())) - - if (fileInfo.FileAttributes & windows.FILE_ATTRIBUTE_DIRECTORY) != 0 { - hdr.Mode |= cISDIR - hdr.Size = 0 - hdr.Typeflag = tar.TypeDir - } - return hdr -} - -// SecurityDescriptorFromTarHeader reads the SDDL associated with the header of the current file -// from the tar header and returns the security descriptor into a byte slice. -func SecurityDescriptorFromTarHeader(hdr *tar.Header) ([]byte, error) { - if sdraw, ok := hdr.PAXRecords[hdrRawSecurityDescriptor]; ok { - sd, err := base64.StdEncoding.DecodeString(sdraw) - if err != nil { - // Not returning sd as-is in the error-case, as base64.DecodeString - // may return partially decoded data (not nil or empty slice) in case - // of a failure: https://github.com/golang/go/blob/go1.17.7/src/encoding/base64/base64.go#L382-L387 - return nil, err - } - return sd, nil - } - // Maintaining old SDDL-based behavior for backward compatibility. All new - // tar headers written by this library will have raw binary for the security - // descriptor. - if sddl, ok := hdr.PAXRecords[hdrSecurityDescriptor]; ok { - return winio.SddlToSecurityDescriptor(sddl) - } - return nil, nil -} - -// ExtendedAttributesFromTarHeader reads the EAs associated with the header of the -// current file from the tar header and returns it as a byte slice. -func ExtendedAttributesFromTarHeader(hdr *tar.Header) ([]byte, error) { - var eas []winio.ExtendedAttribute //nolint:prealloc // len(eas) <= len(hdr.PAXRecords); prealloc is wasteful - for k, v := range hdr.PAXRecords { - if !strings.HasPrefix(k, hdrEaPrefix) { - continue - } - data, err := base64.StdEncoding.DecodeString(v) - if err != nil { - return nil, err - } - eas = append(eas, winio.ExtendedAttribute{ - Name: k[len(hdrEaPrefix):], - Value: data, - }) - } - var eaData []byte - var err error - if len(eas) != 0 { - eaData, err = winio.EncodeExtendedAttributes(eas) - if err != nil { - return nil, err - } - } - return eaData, nil -} - -// EncodeReparsePointFromTarHeader reads the ReparsePoint structure from the tar header -// and encodes it into a byte slice. The file for which this function is called must be a -// symlink. -func EncodeReparsePointFromTarHeader(hdr *tar.Header) []byte { - _, isMountPoint := hdr.PAXRecords[hdrMountPoint] - rp := winio.ReparsePoint{ - Target: filepath.FromSlash(hdr.Linkname), - IsMountPoint: isMountPoint, - } - return winio.EncodeReparsePoint(&rp) -} - -// WriteTarFileFromBackupStream writes a file to a tar writer using data from a Win32 backup stream. -// -// This encodes Win32 metadata as tar pax vendor extensions starting with MSWINDOWS. -// -// The additional Win32 metadata is: -// -// - MSWINDOWS.fileattr: The Win32 file attributes, as a decimal value -// - MSWINDOWS.rawsd: The Win32 security descriptor, in raw binary format -// - MSWINDOWS.mountpoint: If present, this is a mount point and not a symlink, even though the type is '2' (symlink) -func WriteTarFileFromBackupStream(t *tar.Writer, r io.Reader, name string, size int64, fileInfo *winio.FileBasicInfo) error { - name = filepath.ToSlash(name) - hdr := BasicInfoHeader(name, size, fileInfo) - - // If r can be seeked, then this function is two-pass: pass 1 collects the - // tar header data, and pass 2 copies the data stream. If r cannot be - // seeked, then some header data (in particular EAs) will be silently lost. - var ( - restartPos int64 - err error - ) - sr, readTwice := r.(io.Seeker) - if readTwice { - if restartPos, err = sr.Seek(0, io.SeekCurrent); err != nil { - readTwice = false - } - } - - br := winio.NewBackupStreamReader(r) - var dataHdr *winio.BackupHeader - for dataHdr == nil { - bhdr, err := br.Next() - if err == io.EOF { //nolint:errorlint - break - } - if err != nil { - return err - } - switch bhdr.Id { - case winio.BackupData: - hdr.Mode |= cISREG - if !readTwice { - dataHdr = bhdr - } - case winio.BackupSecurity: - sd, err := io.ReadAll(br) - if err != nil { - return err - } - hdr.PAXRecords[hdrRawSecurityDescriptor] = base64.StdEncoding.EncodeToString(sd) - - case winio.BackupReparseData: - hdr.Mode |= cISLNK - hdr.Typeflag = tar.TypeSymlink - reparseBuffer, _ := io.ReadAll(br) - rp, err := winio.DecodeReparsePoint(reparseBuffer) - if err != nil { - return err - } - if rp.IsMountPoint { - hdr.PAXRecords[hdrMountPoint] = "1" - } - hdr.Linkname = rp.Target - - case winio.BackupEaData: - eab, err := io.ReadAll(br) - if err != nil { - return err - } - eas, err := winio.DecodeExtendedAttributes(eab) - if err != nil { - return err - } - for _, ea := range eas { - // Use base64 encoding for the binary value. Note that there - // is no way to encode the EA's flags, since their use doesn't - // make any sense for persisted EAs. - hdr.PAXRecords[hdrEaPrefix+ea.Name] = base64.StdEncoding.EncodeToString(ea.Value) - } - - case winio.BackupAlternateData, winio.BackupLink, winio.BackupPropertyData, winio.BackupObjectId, winio.BackupTxfsData: - // ignore these streams - default: - return fmt.Errorf("%s: unknown stream ID %d", name, bhdr.Id) - } - } - - err = t.WriteHeader(hdr) - if err != nil { - return err - } - - if readTwice { - // Get back to the data stream. - if _, err = sr.Seek(restartPos, io.SeekStart); err != nil { - return err - } - for dataHdr == nil { - bhdr, err := br.Next() - if err == io.EOF { //nolint:errorlint - break - } - if err != nil { - return err - } - if bhdr.Id == winio.BackupData { - dataHdr = bhdr - } - } - } - - // The logic for copying file contents is fairly complicated due to the need for handling sparse files, - // and the weird ways they are represented by BackupRead. A normal file will always either have a data stream - // with size and content, or no data stream at all (if empty). However, for a sparse file, the content can also - // be represented using a series of sparse block streams following the data stream. Additionally, the way sparse - // files are handled by BackupRead has changed in the OS recently. The specifics of the representation are described - // in the list at the bottom of this block comment. - // - // Sparse files can be represented in four different ways, based on the specifics of the file. - // - Size = 0: - // Previously: BackupRead yields no data stream and no sparse block streams. - // Recently: BackupRead yields a data stream with size = 0. There are no following sparse block streams. - // - Size > 0, no allocated ranges: - // BackupRead yields a data stream with size = 0. Following is a single sparse block stream with - // size = 0 and offset = . - // - Size > 0, one allocated range: - // BackupRead yields a data stream with size = containing the file contents. There are no - // sparse block streams. This is the case if you take a normal file with contents and simply set the - // sparse flag on it. - // - Size > 0, multiple allocated ranges: - // BackupRead yields a data stream with size = 0. Following are sparse block streams for each allocated - // range of the file containing the range contents. Finally there is a sparse block stream with - // size = 0 and offset = . - - if dataHdr != nil { //nolint:nestif // todo: reduce nesting complexity - // A data stream was found. Copy the data. - // We assume that we will either have a data stream size > 0 XOR have sparse block streams. - if dataHdr.Size > 0 || (dataHdr.Attributes&winio.StreamSparseAttributes) == 0 { - if size != dataHdr.Size { - return fmt.Errorf("%s: mismatch between file size %d and header size %d", name, size, dataHdr.Size) - } - if _, err = io.Copy(t, br); err != nil { - return fmt.Errorf("%s: copying contents from data stream: %w", name, err) - } - } else if size > 0 { - // As of a recent OS change, BackupRead now returns a data stream for empty sparse files. - // These files have no sparse block streams, so skip the copySparse call if file size = 0. - if err = copySparse(t, br); err != nil { - return fmt.Errorf("%s: copying contents from sparse block stream: %w", name, err) - } - } - } - - // Look for streams after the data stream. The only ones we handle are alternate data streams. - // Other streams may have metadata that could be serialized, but the tar header has already - // been written. In practice, this means that we don't get EA or TXF metadata. - for { - bhdr, err := br.Next() - if err == io.EOF { //nolint:errorlint - break - } - if err != nil { - return err - } - switch bhdr.Id { - case winio.BackupAlternateData: - if (bhdr.Attributes & winio.StreamSparseAttributes) != 0 { - // Unsupported for now, since the size of the alternate stream is not present - // in the backup stream until after the data has been read. - return fmt.Errorf("%s: tar of sparse alternate data streams is unsupported", name) - } - altName := strings.TrimSuffix(bhdr.Name, ":$DATA") - hdr = &tar.Header{ - Format: hdr.Format, - Name: name + altName, - Mode: hdr.Mode, - Typeflag: tar.TypeReg, - Size: bhdr.Size, - ModTime: hdr.ModTime, - AccessTime: hdr.AccessTime, - ChangeTime: hdr.ChangeTime, - } - err = t.WriteHeader(hdr) - if err != nil { - return err - } - _, err = io.Copy(t, br) - if err != nil { - return err - } - case winio.BackupEaData, winio.BackupLink, winio.BackupPropertyData, winio.BackupObjectId, winio.BackupTxfsData: - // ignore these streams - default: - return fmt.Errorf("%s: unknown stream ID %d after data", name, bhdr.Id) - } - } - return nil -} - -// FileInfoFromHeader retrieves basic Win32 file information from a tar header, using the additional metadata written by -// WriteTarFileFromBackupStream. -func FileInfoFromHeader(hdr *tar.Header) (name string, size int64, fileInfo *winio.FileBasicInfo, err error) { - name = hdr.Name - if hdr.Typeflag == tar.TypeReg { - size = hdr.Size - } - fileInfo = &winio.FileBasicInfo{ - LastAccessTime: windows.NsecToFiletime(hdr.AccessTime.UnixNano()), - LastWriteTime: windows.NsecToFiletime(hdr.ModTime.UnixNano()), - ChangeTime: windows.NsecToFiletime(hdr.ChangeTime.UnixNano()), - // Default to ModTime, we'll pull hdrCreationTime below if present - CreationTime: windows.NsecToFiletime(hdr.ModTime.UnixNano()), - } - if attrStr, ok := hdr.PAXRecords[hdrFileAttributes]; ok { - attr, err := strconv.ParseUint(attrStr, 10, 32) - if err != nil { - return "", 0, nil, err - } - fileInfo.FileAttributes = uint32(attr) - } else { - if hdr.Typeflag == tar.TypeDir { - fileInfo.FileAttributes |= windows.FILE_ATTRIBUTE_DIRECTORY - } - } - if creationTimeStr, ok := hdr.PAXRecords[hdrCreationTime]; ok { - creationTime, err := parsePAXTime(creationTimeStr) - if err != nil { - return "", 0, nil, err - } - fileInfo.CreationTime = windows.NsecToFiletime(creationTime.UnixNano()) - } - return name, size, fileInfo, err -} - -// WriteBackupStreamFromTarFile writes a Win32 backup stream from the current tar file. Since this function may process multiple -// tar file entries in order to collect all the alternate data streams for the file, it returns the next -// tar file that was not processed, or io.EOF is there are no more. -func WriteBackupStreamFromTarFile(w io.Writer, t *tar.Reader, hdr *tar.Header) (*tar.Header, error) { - bw := winio.NewBackupStreamWriter(w) - - sd, err := SecurityDescriptorFromTarHeader(hdr) - if err != nil { - return nil, err - } - if len(sd) != 0 { - bhdr := winio.BackupHeader{ - Id: winio.BackupSecurity, - Size: int64(len(sd)), - } - err := bw.WriteHeader(&bhdr) - if err != nil { - return nil, err - } - _, err = bw.Write(sd) - if err != nil { - return nil, err - } - } - - eadata, err := ExtendedAttributesFromTarHeader(hdr) - if err != nil { - return nil, err - } - if len(eadata) != 0 { - bhdr := winio.BackupHeader{ - Id: winio.BackupEaData, - Size: int64(len(eadata)), - } - err = bw.WriteHeader(&bhdr) - if err != nil { - return nil, err - } - _, err = bw.Write(eadata) - if err != nil { - return nil, err - } - } - - if hdr.Typeflag == tar.TypeSymlink { - reparse := EncodeReparsePointFromTarHeader(hdr) - bhdr := winio.BackupHeader{ - Id: winio.BackupReparseData, - Size: int64(len(reparse)), - } - err := bw.WriteHeader(&bhdr) - if err != nil { - return nil, err - } - _, err = bw.Write(reparse) - if err != nil { - return nil, err - } - } - - if hdr.Typeflag == tar.TypeReg { - bhdr := winio.BackupHeader{ - Id: winio.BackupData, - Size: hdr.Size, - } - err := bw.WriteHeader(&bhdr) - if err != nil { - return nil, err - } - _, err = io.Copy(bw, t) - if err != nil { - return nil, err - } - } - // Copy all the alternate data streams and return the next non-ADS header. - for { - ahdr, err := t.Next() - if err != nil { - return nil, err - } - if ahdr.Typeflag != tar.TypeReg || !strings.HasPrefix(ahdr.Name, hdr.Name+":") { - return ahdr, nil - } - bhdr := winio.BackupHeader{ - Id: winio.BackupAlternateData, - Size: ahdr.Size, - Name: ahdr.Name[len(hdr.Name):] + ":$DATA", - } - err = bw.WriteHeader(&bhdr) - if err != nil { - return nil, err - } - _, err = io.Copy(bw, t) - if err != nil { - return nil, err - } - } -} diff --git a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/doc.go b/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/doc.go deleted file mode 100644 index 0684d05963..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/doc.go +++ /dev/null @@ -1 +0,0 @@ -package options diff --git a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go b/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go deleted file mode 100644 index dfcd9b543d..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go +++ /dev/null @@ -1,661 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.35.2 -// protoc v5.26.0 -// source: github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto - -package options - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -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) -) - -type Options_DebugType int32 - -const ( - Options_NPIPE Options_DebugType = 0 - Options_FILE Options_DebugType = 1 - Options_ETW Options_DebugType = 2 -) - -// Enum value maps for Options_DebugType. -var ( - Options_DebugType_name = map[int32]string{ - 0: "NPIPE", - 1: "FILE", - 2: "ETW", - } - Options_DebugType_value = map[string]int32{ - "NPIPE": 0, - "FILE": 1, - "ETW": 2, - } -) - -func (x Options_DebugType) Enum() *Options_DebugType { - p := new(Options_DebugType) - *p = x - return p -} - -func (x Options_DebugType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Options_DebugType) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_enumTypes[0].Descriptor() -} - -func (Options_DebugType) Type() protoreflect.EnumType { - return &file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_enumTypes[0] -} - -func (x Options_DebugType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Options_DebugType.Descriptor instead. -func (Options_DebugType) EnumDescriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_rawDescGZIP(), []int{0, 0} -} - -type Options_SandboxIsolation int32 - -const ( - Options_PROCESS Options_SandboxIsolation = 0 - Options_HYPERVISOR Options_SandboxIsolation = 1 -) - -// Enum value maps for Options_SandboxIsolation. -var ( - Options_SandboxIsolation_name = map[int32]string{ - 0: "PROCESS", - 1: "HYPERVISOR", - } - Options_SandboxIsolation_value = map[string]int32{ - "PROCESS": 0, - "HYPERVISOR": 1, - } -) - -func (x Options_SandboxIsolation) Enum() *Options_SandboxIsolation { - p := new(Options_SandboxIsolation) - *p = x - return p -} - -func (x Options_SandboxIsolation) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Options_SandboxIsolation) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_enumTypes[1].Descriptor() -} - -func (Options_SandboxIsolation) Type() protoreflect.EnumType { - return &file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_enumTypes[1] -} - -func (x Options_SandboxIsolation) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Options_SandboxIsolation.Descriptor instead. -func (Options_SandboxIsolation) EnumDescriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_rawDescGZIP(), []int{0, 1} -} - -// Options are the set of customizations that can be passed at Create time. -type Options struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Enable debug tracing (sets the logrus log level to debug). This may be deprecated in the future, prefer - // log_level as this will override debug if both of them are set. - Debug bool `protobuf:"varint,1,opt,name=debug,proto3" json:"debug,omitempty"` - // debug tracing output type - DebugType Options_DebugType `protobuf:"varint,2,opt,name=debug_type,json=debugType,proto3,enum=containerd.runhcs.v1.Options_DebugType" json:"debug_type,omitempty"` - // registry key root for storage of the runhcs container state - RegistryRoot string `protobuf:"bytes,3,opt,name=registry_root,json=registryRoot,proto3" json:"registry_root,omitempty"` - // sandbox_image is the image to use for the sandbox that matches the - // sandbox_platform. - SandboxImage string `protobuf:"bytes,4,opt,name=sandbox_image,json=sandboxImage,proto3" json:"sandbox_image,omitempty"` - // sandbox_platform is a CRI setting that specifies the platform - // architecture for all sandbox's in this runtime. Values are - // 'windows/amd64' and 'linux/amd64'. - SandboxPlatform string `protobuf:"bytes,5,opt,name=sandbox_platform,json=sandboxPlatform,proto3" json:"sandbox_platform,omitempty"` - // sandbox_isolation is a CRI setting that specifies the isolation level of - // the sandbox. For Windows runtime PROCESS and HYPERVISOR are valid. For - // LCOW only HYPERVISOR is valid and default if omitted. - SandboxIsolation Options_SandboxIsolation `protobuf:"varint,6,opt,name=sandbox_isolation,json=sandboxIsolation,proto3,enum=containerd.runhcs.v1.Options_SandboxIsolation" json:"sandbox_isolation,omitempty"` - // boot_files_root_path is the path to the directory containing the LCOW - // kernel and root FS files. - BootFilesRootPath string `protobuf:"bytes,7,opt,name=boot_files_root_path,json=bootFilesRootPath,proto3" json:"boot_files_root_path,omitempty"` - // vm_processor_count is the default number of processors to create for the - // hypervisor isolated utility vm. - // - // The platform default if omitted is 2, unless the host only has a single - // core in which case it is 1. - VmProcessorCount int32 `protobuf:"varint,8,opt,name=vm_processor_count,json=vmProcessorCount,proto3" json:"vm_processor_count,omitempty"` - // vm_memory_size_in_mb is the default amount of memory to assign to the - // hypervisor isolated utility vm. - // - // The platform default is 1024MB if omitted. - VmMemorySizeInMb int32 `protobuf:"varint,9,opt,name=vm_memory_size_in_mb,json=vmMemorySizeInMb,proto3" json:"vm_memory_size_in_mb,omitempty"` - // GPUVHDPath is the path to the gpu vhd to add to the uvm - // when a container requests a gpu - GPUVHDPath string `protobuf:"bytes,10,opt,name=GPUVHDPath,proto3" json:"GPUVHDPath,omitempty"` - // scale_cpu_limits_to_sandbox indicates that container CPU limits should - // be adjusted to account for the difference in number of cores between the - // host and UVM. - ScaleCpuLimitsToSandbox bool `protobuf:"varint,11,opt,name=scale_cpu_limits_to_sandbox,json=scaleCpuLimitsToSandbox,proto3" json:"scale_cpu_limits_to_sandbox,omitempty"` - // default_container_scratch_size_in_gb is the default scratch size (sandbox.vhdx) - // to be used for containers. Every container will get a sandbox of `size_in_gb` assigned - // instead of the default of 20GB. - DefaultContainerScratchSizeInGb int32 `protobuf:"varint,12,opt,name=default_container_scratch_size_in_gb,json=defaultContainerScratchSizeInGb,proto3" json:"default_container_scratch_size_in_gb,omitempty"` - // default_vm_scratch_size_in_gb is the default scratch size (sandbox.vhdx) - // to be used for the UVM. This only applies to WCOW as LCOW doesn't mount a scratch - // specifically for the UVM. - DefaultVmScratchSizeInGb int32 `protobuf:"varint,13,opt,name=default_vm_scratch_size_in_gb,json=defaultVmScratchSizeInGb,proto3" json:"default_vm_scratch_size_in_gb,omitempty"` - // share_scratch specifies if we'd like to reuse scratch space between multiple containers. - // This currently only affects LCOW. The sandbox containers scratch space is re-used for all - // subsequent containers launched in the pod. - ShareScratch bool `protobuf:"varint,14,opt,name=share_scratch,json=shareScratch,proto3" json:"share_scratch,omitempty"` - // NCProxyAddr is the address of the network configuration proxy service. If omitted - // the network is setup locally. - NCProxyAddr string `protobuf:"bytes,15,opt,name=NCProxyAddr,proto3" json:"NCProxyAddr,omitempty"` - // log_level specifies the logrus log level for the shim. Supported values are a string representation of the - // logrus log levels: "trace", "debug", "info", "warn", "error", "fatal", "panic". This setting will override - // the `debug` field if both are specified, unless the level specified is also "debug", as these are equivalent. - LogLevel string `protobuf:"bytes,16,opt,name=log_level,json=logLevel,proto3" json:"log_level,omitempty"` - // io_retry_timeout_in_sec is the timeout in seconds for how long to try and reconnect to an upstream IO provider if a connection is lost. - // The typical example is if Containerd has restarted but is expected to come back online. A 0 for this field is interpreted as an infinite - // timeout. - IoRetryTimeoutInSec int32 `protobuf:"varint,17,opt,name=io_retry_timeout_in_sec,json=ioRetryTimeoutInSec,proto3" json:"io_retry_timeout_in_sec,omitempty"` - // default_container_annotations specifies a set of annotations that should be set for every workload container - DefaultContainerAnnotations map[string]string `protobuf:"bytes,18,rep,name=default_container_annotations,json=defaultContainerAnnotations,proto3" json:"default_container_annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // no_inherit_host_timezone specifies to skip inheriting the hosts time zone for WCOW UVMs and instead default to - // UTC. - NoInheritHostTimezone bool `protobuf:"varint,19,opt,name=no_inherit_host_timezone,json=noInheritHostTimezone,proto3" json:"no_inherit_host_timezone,omitempty"` - // scrub_logs enables removing environment variables and other potentially sensitive information from logs - ScrubLogs bool `protobuf:"varint,20,opt,name=scrub_logs,json=scrubLogs,proto3" json:"scrub_logs,omitempty"` -} - -func (x *Options) Reset() { - *x = Options{} - mi := &file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Options) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Options) ProtoMessage() {} - -func (x *Options) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Options.ProtoReflect.Descriptor instead. -func (*Options) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_rawDescGZIP(), []int{0} -} - -func (x *Options) GetDebug() bool { - if x != nil { - return x.Debug - } - return false -} - -func (x *Options) GetDebugType() Options_DebugType { - if x != nil { - return x.DebugType - } - return Options_NPIPE -} - -func (x *Options) GetRegistryRoot() string { - if x != nil { - return x.RegistryRoot - } - return "" -} - -func (x *Options) GetSandboxImage() string { - if x != nil { - return x.SandboxImage - } - return "" -} - -func (x *Options) GetSandboxPlatform() string { - if x != nil { - return x.SandboxPlatform - } - return "" -} - -func (x *Options) GetSandboxIsolation() Options_SandboxIsolation { - if x != nil { - return x.SandboxIsolation - } - return Options_PROCESS -} - -func (x *Options) GetBootFilesRootPath() string { - if x != nil { - return x.BootFilesRootPath - } - return "" -} - -func (x *Options) GetVmProcessorCount() int32 { - if x != nil { - return x.VmProcessorCount - } - return 0 -} - -func (x *Options) GetVmMemorySizeInMb() int32 { - if x != nil { - return x.VmMemorySizeInMb - } - return 0 -} - -func (x *Options) GetGPUVHDPath() string { - if x != nil { - return x.GPUVHDPath - } - return "" -} - -func (x *Options) GetScaleCpuLimitsToSandbox() bool { - if x != nil { - return x.ScaleCpuLimitsToSandbox - } - return false -} - -func (x *Options) GetDefaultContainerScratchSizeInGb() int32 { - if x != nil { - return x.DefaultContainerScratchSizeInGb - } - return 0 -} - -func (x *Options) GetDefaultVmScratchSizeInGb() int32 { - if x != nil { - return x.DefaultVmScratchSizeInGb - } - return 0 -} - -func (x *Options) GetShareScratch() bool { - if x != nil { - return x.ShareScratch - } - return false -} - -func (x *Options) GetNCProxyAddr() string { - if x != nil { - return x.NCProxyAddr - } - return "" -} - -func (x *Options) GetLogLevel() string { - if x != nil { - return x.LogLevel - } - return "" -} - -func (x *Options) GetIoRetryTimeoutInSec() int32 { - if x != nil { - return x.IoRetryTimeoutInSec - } - return 0 -} - -func (x *Options) GetDefaultContainerAnnotations() map[string]string { - if x != nil { - return x.DefaultContainerAnnotations - } - return nil -} - -func (x *Options) GetNoInheritHostTimezone() bool { - if x != nil { - return x.NoInheritHostTimezone - } - return false -} - -func (x *Options) GetScrubLogs() bool { - if x != nil { - return x.ScrubLogs - } - return false -} - -// ProcessDetails contains additional information about a process. This is the additional -// info returned in the Pids query. -type ProcessDetails struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ImageName string `protobuf:"bytes,1,opt,name=image_name,json=imageName,proto3" json:"image_name,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - KernelTime_100Ns uint64 `protobuf:"varint,3,opt,name=kernel_time_100_ns,json=kernelTime100Ns,proto3" json:"kernel_time_100_ns,omitempty"` - MemoryCommitBytes uint64 `protobuf:"varint,4,opt,name=memory_commit_bytes,json=memoryCommitBytes,proto3" json:"memory_commit_bytes,omitempty"` - MemoryWorkingSetPrivateBytes uint64 `protobuf:"varint,5,opt,name=memory_working_set_private_bytes,json=memoryWorkingSetPrivateBytes,proto3" json:"memory_working_set_private_bytes,omitempty"` - MemoryWorkingSetSharedBytes uint64 `protobuf:"varint,6,opt,name=memory_working_set_shared_bytes,json=memoryWorkingSetSharedBytes,proto3" json:"memory_working_set_shared_bytes,omitempty"` - ProcessID uint32 `protobuf:"varint,7,opt,name=process_id,json=processId,proto3" json:"process_id,omitempty"` - UserTime_100Ns uint64 `protobuf:"varint,8,opt,name=user_time_100_ns,json=userTime100Ns,proto3" json:"user_time_100_ns,omitempty"` - ExecID string `protobuf:"bytes,9,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` -} - -func (x *ProcessDetails) Reset() { - *x = ProcessDetails{} - mi := &file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ProcessDetails) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProcessDetails) ProtoMessage() {} - -func (x *ProcessDetails) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ProcessDetails.ProtoReflect.Descriptor instead. -func (*ProcessDetails) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_rawDescGZIP(), []int{1} -} - -func (x *ProcessDetails) GetImageName() string { - if x != nil { - return x.ImageName - } - return "" -} - -func (x *ProcessDetails) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *ProcessDetails) GetKernelTime_100Ns() uint64 { - if x != nil { - return x.KernelTime_100Ns - } - return 0 -} - -func (x *ProcessDetails) GetMemoryCommitBytes() uint64 { - if x != nil { - return x.MemoryCommitBytes - } - return 0 -} - -func (x *ProcessDetails) GetMemoryWorkingSetPrivateBytes() uint64 { - if x != nil { - return x.MemoryWorkingSetPrivateBytes - } - return 0 -} - -func (x *ProcessDetails) GetMemoryWorkingSetSharedBytes() uint64 { - if x != nil { - return x.MemoryWorkingSetSharedBytes - } - return 0 -} - -func (x *ProcessDetails) GetProcessID() uint32 { - if x != nil { - return x.ProcessID - } - return 0 -} - -func (x *ProcessDetails) GetUserTime_100Ns() uint64 { - if x != nil { - return x.UserTime_100Ns - } - return 0 -} - -func (x *ProcessDetails) GetExecID() string { - if x != nil { - return x.ExecID - } - return "" -} - -var File_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto protoreflect.FileDescriptor - -var file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_rawDesc = []byte{ - 0x0a, 0x4f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x69, 0x63, - 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x2f, 0x68, 0x63, 0x73, 0x73, 0x68, 0x69, 0x6d, 0x2f, 0x63, - 0x6d, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2d, 0x73, 0x68, - 0x69, 0x6d, 0x2d, 0x72, 0x75, 0x6e, 0x68, 0x63, 0x73, 0x2d, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x75, 0x6e, 0x68, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x14, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, - 0x6e, 0x68, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd9, 0x09, 0x0a, 0x07, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x12, 0x46, 0x0a, 0x0a, 0x64, 0x65, - 0x62, 0x75, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x68, - 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x44, 0x65, - 0x62, 0x75, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x64, 0x65, 0x62, 0x75, 0x67, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x61, 0x6e, 0x64, 0x62, - 0x6f, 0x78, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x29, 0x0a, 0x10, - 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x50, - 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x5b, 0x0a, 0x11, 0x73, 0x61, 0x6e, 0x64, 0x62, - 0x6f, 0x78, 0x5f, 0x69, 0x73, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, - 0x72, 0x75, 0x6e, 0x68, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x73, 0x6f, 0x6c, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x10, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x73, 0x6f, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x14, 0x62, 0x6f, 0x6f, 0x74, 0x5f, 0x66, 0x69, 0x6c, - 0x65, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x11, 0x62, 0x6f, 0x6f, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x6f, 0x6f, - 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x2c, 0x0a, 0x12, 0x76, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x63, - 0x65, 0x73, 0x73, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x10, 0x76, 0x6d, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x14, 0x76, 0x6d, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x6d, 0x62, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x10, 0x76, 0x6d, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x49, - 0x6e, 0x4d, 0x62, 0x12, 0x1e, 0x0a, 0x0a, 0x47, 0x50, 0x55, 0x56, 0x48, 0x44, 0x50, 0x61, 0x74, - 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x47, 0x50, 0x55, 0x56, 0x48, 0x44, 0x50, - 0x61, 0x74, 0x68, 0x12, 0x3c, 0x0a, 0x1b, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x5f, 0x63, 0x70, 0x75, - 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x61, 0x6e, 0x64, 0x62, - 0x6f, 0x78, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x43, - 0x70, 0x75, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x54, 0x6f, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x12, 0x4d, 0x0a, 0x24, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x73, 0x63, 0x72, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x73, - 0x69, 0x7a, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x67, 0x62, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x1f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x53, 0x63, 0x72, 0x61, 0x74, 0x63, 0x68, 0x53, 0x69, 0x7a, 0x65, 0x49, 0x6e, 0x47, 0x62, - 0x12, 0x3f, 0x0a, 0x1d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x6d, 0x5f, 0x73, - 0x63, 0x72, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x67, - 0x62, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x18, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x56, 0x6d, 0x53, 0x63, 0x72, 0x61, 0x74, 0x63, 0x68, 0x53, 0x69, 0x7a, 0x65, 0x49, 0x6e, 0x47, - 0x62, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x73, 0x63, 0x72, 0x61, 0x74, - 0x63, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, 0x53, - 0x63, 0x72, 0x61, 0x74, 0x63, 0x68, 0x12, 0x20, 0x0a, 0x0b, 0x4e, 0x43, 0x50, 0x72, 0x6f, 0x78, - 0x79, 0x41, 0x64, 0x64, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4e, 0x43, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x41, 0x64, 0x64, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, - 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x67, - 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x34, 0x0a, 0x17, 0x69, 0x6f, 0x5f, 0x72, 0x65, 0x74, 0x72, - 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x63, - 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x13, 0x69, 0x6f, 0x52, 0x65, 0x74, 0x72, 0x79, 0x54, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x49, 0x6e, 0x53, 0x65, 0x63, 0x12, 0x82, 0x01, 0x0a, 0x1d, - 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x5f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x12, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x72, 0x75, 0x6e, 0x68, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x1b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x37, 0x0a, 0x18, 0x6e, 0x6f, 0x5f, 0x69, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x5f, 0x68, - 0x6f, 0x73, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x13, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x15, 0x6e, 0x6f, 0x49, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x48, 0x6f, 0x73, - 0x74, 0x54, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x63, 0x72, - 0x75, 0x62, 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, - 0x63, 0x72, 0x75, 0x62, 0x4c, 0x6f, 0x67, 0x73, 0x1a, 0x4e, 0x0a, 0x20, 0x44, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 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, 0x22, 0x29, 0x0a, 0x09, 0x44, 0x65, 0x62, 0x75, - 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x4e, 0x50, 0x49, 0x50, 0x45, 0x10, 0x00, - 0x12, 0x08, 0x0a, 0x04, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x45, 0x54, - 0x57, 0x10, 0x02, 0x22, 0x2f, 0x0a, 0x10, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x73, - 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x4f, 0x43, 0x45, - 0x53, 0x53, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x48, 0x59, 0x50, 0x45, 0x52, 0x56, 0x49, 0x53, - 0x4f, 0x52, 0x10, 0x01, 0x22, 0xb6, 0x03, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6d, 0x61, - 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, - 0x74, 0x12, 0x2b, 0x0a, 0x12, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x5f, 0x31, 0x30, 0x30, 0x5f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x6b, - 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x31, 0x30, 0x30, 0x4e, 0x73, 0x12, 0x2e, - 0x0a, 0x13, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, - 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x6d, 0x65, 0x6d, - 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x46, - 0x0a, 0x20, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, - 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x62, 0x79, 0x74, - 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1c, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, - 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, - 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x1f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, - 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x73, 0x68, 0x61, - 0x72, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x1b, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x53, 0x65, - 0x74, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, - 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x10, 0x75, - 0x73, 0x65, 0x72, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x31, 0x30, 0x30, 0x5f, 0x6e, 0x73, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x31, - 0x30, 0x30, 0x4e, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x78, 0x65, 0x63, 0x5f, 0x69, 0x64, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x78, 0x65, 0x63, 0x49, 0x64, 0x42, 0x44, 0x5a, - 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x69, 0x63, 0x72, - 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x2f, 0x68, 0x63, 0x73, 0x73, 0x68, 0x69, 0x6d, 0x2f, 0x63, 0x6d, - 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2d, 0x73, 0x68, 0x69, - 0x6d, 0x2d, 0x72, 0x75, 0x6e, 0x68, 0x63, 0x73, 0x2d, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_rawDescOnce sync.Once - file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_rawDescData = file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_rawDesc -) - -func file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_rawDescGZIP() []byte { - file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_rawDescOnce.Do(func() { - file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_rawDescData) - }) - return file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_rawDescData -} - -var file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_goTypes = []any{ - (Options_DebugType)(0), // 0: containerd.runhcs.v1.Options.DebugType - (Options_SandboxIsolation)(0), // 1: containerd.runhcs.v1.Options.SandboxIsolation - (*Options)(nil), // 2: containerd.runhcs.v1.Options - (*ProcessDetails)(nil), // 3: containerd.runhcs.v1.ProcessDetails - nil, // 4: containerd.runhcs.v1.Options.DefaultContainerAnnotationsEntry - (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp -} -var file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_depIdxs = []int32{ - 0, // 0: containerd.runhcs.v1.Options.debug_type:type_name -> containerd.runhcs.v1.Options.DebugType - 1, // 1: containerd.runhcs.v1.Options.sandbox_isolation:type_name -> containerd.runhcs.v1.Options.SandboxIsolation - 4, // 2: containerd.runhcs.v1.Options.default_container_annotations:type_name -> containerd.runhcs.v1.Options.DefaultContainerAnnotationsEntry - 5, // 3: containerd.runhcs.v1.ProcessDetails.created_at:type_name -> google.protobuf.Timestamp - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { - file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_init() -} -func file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_init() { - if File_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_rawDesc, - NumEnums: 2, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_goTypes, - DependencyIndexes: file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_depIdxs, - EnumInfos: file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_enumTypes, - MessageInfos: file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_msgTypes, - }.Build() - File_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto = out.File - file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_rawDesc = nil - file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_goTypes = nil - file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_depIdxs = nil -} diff --git a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto b/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto deleted file mode 100644 index 8546c61507..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto +++ /dev/null @@ -1,124 +0,0 @@ -syntax = "proto3"; - -package containerd.runhcs.v1; - -import "google/protobuf/timestamp.proto"; - -option go_package = "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options"; - -// Options are the set of customizations that can be passed at Create time. -message Options { - // Enable debug tracing (sets the logrus log level to debug). This may be deprecated in the future, prefer - // log_level as this will override debug if both of them are set. - bool debug = 1; - - enum DebugType { - NPIPE = 0; - FILE = 1; - ETW = 2; - } - - // debug tracing output type - DebugType debug_type = 2; - - // registry key root for storage of the runhcs container state - string registry_root = 3; - - // sandbox_image is the image to use for the sandbox that matches the - // sandbox_platform. - string sandbox_image = 4; - - // sandbox_platform is a CRI setting that specifies the platform - // architecture for all sandbox's in this runtime. Values are - // 'windows/amd64' and 'linux/amd64'. - string sandbox_platform = 5; - - enum SandboxIsolation { - PROCESS = 0; - HYPERVISOR = 1; - } - - // sandbox_isolation is a CRI setting that specifies the isolation level of - // the sandbox. For Windows runtime PROCESS and HYPERVISOR are valid. For - // LCOW only HYPERVISOR is valid and default if omitted. - SandboxIsolation sandbox_isolation = 6; - - // boot_files_root_path is the path to the directory containing the LCOW - // kernel and root FS files. - string boot_files_root_path = 7; - - // vm_processor_count is the default number of processors to create for the - // hypervisor isolated utility vm. - // - // The platform default if omitted is 2, unless the host only has a single - // core in which case it is 1. - int32 vm_processor_count = 8; - - // vm_memory_size_in_mb is the default amount of memory to assign to the - // hypervisor isolated utility vm. - // - // The platform default is 1024MB if omitted. - int32 vm_memory_size_in_mb = 9; - - // GPUVHDPath is the path to the gpu vhd to add to the uvm - // when a container requests a gpu - string GPUVHDPath = 10; - - // scale_cpu_limits_to_sandbox indicates that container CPU limits should - // be adjusted to account for the difference in number of cores between the - // host and UVM. - bool scale_cpu_limits_to_sandbox = 11; - - // default_container_scratch_size_in_gb is the default scratch size (sandbox.vhdx) - // to be used for containers. Every container will get a sandbox of `size_in_gb` assigned - // instead of the default of 20GB. - int32 default_container_scratch_size_in_gb = 12; - - // default_vm_scratch_size_in_gb is the default scratch size (sandbox.vhdx) - // to be used for the UVM. This only applies to WCOW as LCOW doesn't mount a scratch - // specifically for the UVM. - int32 default_vm_scratch_size_in_gb = 13; - - // share_scratch specifies if we'd like to reuse scratch space between multiple containers. - // This currently only affects LCOW. The sandbox containers scratch space is re-used for all - // subsequent containers launched in the pod. - bool share_scratch = 14; - - // NCProxyAddr is the address of the network configuration proxy service. If omitted - // the network is setup locally. - string NCProxyAddr = 15; - - // log_level specifies the logrus log level for the shim. Supported values are a string representation of the - // logrus log levels: "trace", "debug", "info", "warn", "error", "fatal", "panic". This setting will override - // the `debug` field if both are specified, unless the level specified is also "debug", as these are equivalent. - string log_level = 16; - - // io_retry_timeout_in_sec is the timeout in seconds for how long to try and reconnect to an upstream IO provider if a connection is lost. - // The typical example is if Containerd has restarted but is expected to come back online. A 0 for this field is interpreted as an infinite - // timeout. - int32 io_retry_timeout_in_sec = 17; - - // default_container_annotations specifies a set of annotations that should be set for every workload container - map default_container_annotations = 18; - - // no_inherit_host_timezone specifies to skip inheriting the hosts time zone for WCOW UVMs and instead default to - // UTC. - bool no_inherit_host_timezone = 19; - - // scrub_logs enables removing environment variables and other potentially sensitive information from logs - bool scrub_logs = 20; -} - -// ProcessDetails contains additional information about a process. This is the additional -// info returned in the Pids query. -message ProcessDetails { - string image_name = 1; - google.protobuf.Timestamp created_at = 2; - uint64 kernel_time_100_ns = 3; - uint64 memory_commit_bytes = 4; - uint64 memory_working_set_private_bytes = 5; - uint64 memory_working_set_shared_bytes = 6; - uint32 process_id = 7; - uint64 user_time_100_ns = 8; - string exec_id = 9; -} diff --git a/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/doc.go b/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/doc.go deleted file mode 100644 index 0ec1aa05c4..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package ociwclayer provides functions for importing and exporting Windows -// container layers from and to their OCI tar representation. -package ociwclayer diff --git a/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/export.go b/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/export.go deleted file mode 100644 index 98807a14b8..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/export.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build windows - -package ociwclayer - -import ( - "archive/tar" - "context" - "errors" - "io" - "path/filepath" - - "github.com/Microsoft/go-winio/backuptar" - "github.com/Microsoft/hcsshim/internal/wclayer" -) - -// ExportLayerToTar writes an OCI layer tar stream from the provided on-disk layer. -// The caller must specify the parent layers, if any, ordered from lowest to -// highest layer. -// -// The layer will be mounted for this process, so the caller should ensure that -// it is not currently mounted. -func ExportLayerToTar(ctx context.Context, w io.Writer, path string, parentLayerPaths []string) error { - err := wclayer.ActivateLayer(ctx, path) - if err != nil { - return err - } - defer func() { - _ = wclayer.DeactivateLayer(ctx, path) - }() - - // Prepare and unprepare the layer to ensure that it has been initialized. - err = wclayer.PrepareLayer(ctx, path, parentLayerPaths) - if err != nil { - return err - } - err = wclayer.UnprepareLayer(ctx, path) - if err != nil { - return err - } - - r, err := wclayer.NewLayerReader(ctx, path, parentLayerPaths) - if err != nil { - return err - } - - err = writeTarFromLayer(ctx, r, w) - cerr := r.Close() - if err != nil { - return err - } - return cerr -} - -func writeTarFromLayer(ctx context.Context, r wclayer.LayerReader, w io.Writer) error { - linkRecords := make(map[[16]byte]string) - - t := tar.NewWriter(w) - for { - select { - case <-ctx.Done(): - return ctx.Err() - default: - } - - name, size, fileInfo, err := r.Next() - if errors.Is(err, io.EOF) { - break - } - if err != nil { - return err - } - if fileInfo == nil { - // Write a whiteout file. - hdr := &tar.Header{ - Name: filepath.ToSlash(filepath.Join(filepath.Dir(name), WhiteoutPrefix+filepath.Base(name))), - } - err := t.WriteHeader(hdr) - if err != nil { - return err - } - } else { - numberOfLinks, fileIDInfo, err := r.LinkInfo() - if err != nil { - return err - } - if numberOfLinks > 1 { - if linkName, ok := linkRecords[fileIDInfo.FileID]; ok { - // We've seen this file before, by another name, so put a hardlink in the tar stream. - hdr := backuptar.BasicInfoHeader(name, 0, fileInfo) - hdr.Mode = 0644 - hdr.Typeflag = tar.TypeLink - hdr.Linkname = linkName - if err := t.WriteHeader(hdr); err != nil { - return err - } - continue - } - - // All subsequent names for this file will be hard-linked to this name - linkRecords[fileIDInfo.FileID] = filepath.ToSlash(name) - } - - err = backuptar.WriteTarFileFromBackupStream(t, r, name, size, fileInfo) - if err != nil { - return err - } - } - } - return t.Close() -} diff --git a/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/import.go b/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/import.go deleted file mode 100644 index 17247f0c56..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/import.go +++ /dev/null @@ -1,154 +0,0 @@ -//go:build windows - -package ociwclayer - -import ( - "archive/tar" - "bufio" - "context" - "errors" - "io" - "os" - "path" - "path/filepath" - "strings" - - winio "github.com/Microsoft/go-winio" - "github.com/Microsoft/go-winio/backuptar" - "github.com/Microsoft/hcsshim/internal/wclayer" -) - -const WhiteoutPrefix = ".wh." - -var ( - // mutatedFiles is a list of files that are mutated by the import process - // and must be backed up and restored. - mutatedFiles = map[string]string{ - "UtilityVM/Files/EFI/Microsoft/Boot/BCD": "bcd.bak", - "UtilityVM/Files/EFI/Microsoft/Boot/BCD.LOG": "bcd.log.bak", - "UtilityVM/Files/EFI/Microsoft/Boot/BCD.LOG1": "bcd.log1.bak", - "UtilityVM/Files/EFI/Microsoft/Boot/BCD.LOG2": "bcd.log2.bak", - } -) - -// ImportLayerFromTar reads a layer from an OCI layer tar stream and extracts it to the -// specified path. The caller must specify the parent layers, if any, ordered -// from lowest to highest layer. -// -// The caller must ensure that the thread or process has acquired backup and -// restore privileges. -// -// This function returns the total size of the layer's files, in bytes. -func ImportLayerFromTar(ctx context.Context, r io.Reader, path string, parentLayerPaths []string) (int64, error) { - err := os.MkdirAll(path, 0) - if err != nil { - return 0, err - } - w, err := wclayer.NewLayerWriter(ctx, path, parentLayerPaths) - if err != nil { - return 0, err - } - n, err := writeLayerFromTar(ctx, r, w, path) - cerr := w.Close() - if err != nil { - return 0, err - } - if cerr != nil { - return 0, cerr - } - return n, nil -} - -func writeLayerFromTar(ctx context.Context, r io.Reader, w wclayer.LayerWriter, root string) (int64, error) { - t := tar.NewReader(r) - // CodeQL [SM03409] `internal\wclayer` uses `internal/safefile` to bind tar extraction to the layer's root directory - hdr, err := t.Next() - totalSize := int64(0) - buf := bufio.NewWriter(nil) - for err == nil { - select { - case <-ctx.Done(): - return 0, ctx.Err() - default: - } - - base := path.Base(hdr.Name) - if strings.HasPrefix(base, WhiteoutPrefix) { - name := path.Join(path.Dir(hdr.Name), base[len(WhiteoutPrefix):]) - err = w.Remove(filepath.FromSlash(name)) - if err != nil { - return 0, err - } - // CodeQL [SM03409] `internal\wclayer` uses `internal/safefile` to bind tar extraction to the layer's root directory - hdr, err = t.Next() - } else if hdr.Typeflag == tar.TypeLink { - err = w.AddLink(filepath.FromSlash(hdr.Name), filepath.FromSlash(hdr.Linkname)) - if err != nil { - return 0, err - } - // CodeQL [SM03409] `internal\wclayer` uses `internal/safefile` to bind tar extraction to the layer's root directory - hdr, err = t.Next() - } else { - var ( - name string - size int64 - fileInfo *winio.FileBasicInfo - ) - name, size, fileInfo, err = backuptar.FileInfoFromHeader(hdr) - if err != nil { - return 0, err - } - err = w.Add(filepath.FromSlash(name), fileInfo) - if err != nil { - return 0, err - } - hdr, err = writeBackupStreamFromTarAndSaveMutatedFiles(buf, w, t, hdr, root) - totalSize += size - } - } - if !errors.Is(err, io.EOF) { - return 0, err - } - return totalSize, nil -} - -// writeBackupStreamFromTarAndSaveMutatedFiles reads data from a tar stream and -// writes it to a backup stream, and also saves any files that will be mutated -// by the import layer process to a backup location. -func writeBackupStreamFromTarAndSaveMutatedFiles(buf *bufio.Writer, w io.Writer, t *tar.Reader, hdr *tar.Header, root string) (nextHdr *tar.Header, err error) { - var bcdBackup *os.File - var bcdBackupWriter *winio.BackupFileWriter - if backupPath, ok := mutatedFiles[hdr.Name]; ok { - bcdBackup, err = os.Create(filepath.Join(root, backupPath)) - if err != nil { - return nil, err - } - defer func() { - cerr := bcdBackup.Close() - if err == nil { - err = cerr - } - }() - - bcdBackupWriter = winio.NewBackupFileWriter(bcdBackup, false) - defer func() { - cerr := bcdBackupWriter.Close() - if err == nil { - err = cerr - } - }() - - buf.Reset(io.MultiWriter(w, bcdBackupWriter)) - } else { - buf.Reset(w) - } - - defer func() { - ferr := buf.Flush() - if err == nil { - err = ferr - } - }() - - return backuptar.WriteBackupStreamFromTarFile(buf, t, hdr) -} diff --git a/vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/doc.go b/vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/doc.go deleted file mode 100644 index f960350c16..0000000000 --- a/vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package sandbox diff --git a/vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox.pb.go b/vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox.pb.go deleted file mode 100644 index 8701fbae5c..0000000000 --- a/vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox.pb.go +++ /dev/null @@ -1,1645 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox.proto - -package sandbox - -import ( - types "github.com/containerd/containerd/api/types" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -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) -) - -type CreateSandboxRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - BundlePath string `protobuf:"bytes,2,opt,name=bundle_path,json=bundlePath,proto3" json:"bundle_path,omitempty"` - Rootfs []*types.Mount `protobuf:"bytes,3,rep,name=rootfs,proto3" json:"rootfs,omitempty"` - Options *anypb.Any `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"` - NetnsPath string `protobuf:"bytes,5,opt,name=netns_path,json=netnsPath,proto3" json:"netns_path,omitempty"` - Annotations map[string]string `protobuf:"bytes,6,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *CreateSandboxRequest) Reset() { - *x = CreateSandboxRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateSandboxRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateSandboxRequest) ProtoMessage() {} - -func (x *CreateSandboxRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[0] - 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 CreateSandboxRequest.ProtoReflect.Descriptor instead. -func (*CreateSandboxRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateSandboxRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *CreateSandboxRequest) GetBundlePath() string { - if x != nil { - return x.BundlePath - } - return "" -} - -func (x *CreateSandboxRequest) GetRootfs() []*types.Mount { - if x != nil { - return x.Rootfs - } - return nil -} - -func (x *CreateSandboxRequest) GetOptions() *anypb.Any { - if x != nil { - return x.Options - } - return nil -} - -func (x *CreateSandboxRequest) GetNetnsPath() string { - if x != nil { - return x.NetnsPath - } - return "" -} - -func (x *CreateSandboxRequest) GetAnnotations() map[string]string { - if x != nil { - return x.Annotations - } - return nil -} - -type CreateSandboxResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CreateSandboxResponse) Reset() { - *x = CreateSandboxResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateSandboxResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateSandboxResponse) ProtoMessage() {} - -func (x *CreateSandboxResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[1] - 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 CreateSandboxResponse.ProtoReflect.Descriptor instead. -func (*CreateSandboxResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{1} -} - -type StartSandboxRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` -} - -func (x *StartSandboxRequest) Reset() { - *x = StartSandboxRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StartSandboxRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartSandboxRequest) ProtoMessage() {} - -func (x *StartSandboxRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[2] - 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 StartSandboxRequest.ProtoReflect.Descriptor instead. -func (*StartSandboxRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{2} -} - -func (x *StartSandboxRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -type StartSandboxResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Pid uint32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` -} - -func (x *StartSandboxResponse) Reset() { - *x = StartSandboxResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StartSandboxResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartSandboxResponse) ProtoMessage() {} - -func (x *StartSandboxResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[3] - 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 StartSandboxResponse.ProtoReflect.Descriptor instead. -func (*StartSandboxResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{3} -} - -func (x *StartSandboxResponse) GetPid() uint32 { - if x != nil { - return x.Pid - } - return 0 -} - -func (x *StartSandboxResponse) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -type PlatformRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` -} - -func (x *PlatformRequest) Reset() { - *x = PlatformRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PlatformRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PlatformRequest) ProtoMessage() {} - -func (x *PlatformRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[4] - 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 PlatformRequest.ProtoReflect.Descriptor instead. -func (*PlatformRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{4} -} - -func (x *PlatformRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -type PlatformResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Platform *types.Platform `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` -} - -func (x *PlatformResponse) Reset() { - *x = PlatformResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PlatformResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PlatformResponse) ProtoMessage() {} - -func (x *PlatformResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[5] - 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 PlatformResponse.ProtoReflect.Descriptor instead. -func (*PlatformResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{5} -} - -func (x *PlatformResponse) GetPlatform() *types.Platform { - if x != nil { - return x.Platform - } - return nil -} - -type StopSandboxRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - TimeoutSecs uint32 `protobuf:"varint,2,opt,name=timeout_secs,json=timeoutSecs,proto3" json:"timeout_secs,omitempty"` -} - -func (x *StopSandboxRequest) Reset() { - *x = StopSandboxRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StopSandboxRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StopSandboxRequest) ProtoMessage() {} - -func (x *StopSandboxRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[6] - 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 StopSandboxRequest.ProtoReflect.Descriptor instead. -func (*StopSandboxRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{6} -} - -func (x *StopSandboxRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *StopSandboxRequest) GetTimeoutSecs() uint32 { - if x != nil { - return x.TimeoutSecs - } - return 0 -} - -type StopSandboxResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *StopSandboxResponse) Reset() { - *x = StopSandboxResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StopSandboxResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StopSandboxResponse) ProtoMessage() {} - -func (x *StopSandboxResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[7] - 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 StopSandboxResponse.ProtoReflect.Descriptor instead. -func (*StopSandboxResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{7} -} - -type UpdateSandboxRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - Resources *anypb.Any `protobuf:"bytes,2,opt,name=resources,proto3" json:"resources,omitempty"` - Annotations map[string]string `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *UpdateSandboxRequest) Reset() { - *x = UpdateSandboxRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateSandboxRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateSandboxRequest) ProtoMessage() {} - -func (x *UpdateSandboxRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[8] - 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 UpdateSandboxRequest.ProtoReflect.Descriptor instead. -func (*UpdateSandboxRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{8} -} - -func (x *UpdateSandboxRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *UpdateSandboxRequest) GetResources() *anypb.Any { - if x != nil { - return x.Resources - } - return nil -} - -func (x *UpdateSandboxRequest) GetAnnotations() map[string]string { - if x != nil { - return x.Annotations - } - return nil -} - -type WaitSandboxRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` -} - -func (x *WaitSandboxRequest) Reset() { - *x = WaitSandboxRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WaitSandboxRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WaitSandboxRequest) ProtoMessage() {} - -func (x *WaitSandboxRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[9] - 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 WaitSandboxRequest.ProtoReflect.Descriptor instead. -func (*WaitSandboxRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{9} -} - -func (x *WaitSandboxRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -type WaitSandboxResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ExitStatus uint32 `protobuf:"varint,1,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` - ExitedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=exited_at,json=exitedAt,proto3" json:"exited_at,omitempty"` -} - -func (x *WaitSandboxResponse) Reset() { - *x = WaitSandboxResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WaitSandboxResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WaitSandboxResponse) ProtoMessage() {} - -func (x *WaitSandboxResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[10] - 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 WaitSandboxResponse.ProtoReflect.Descriptor instead. -func (*WaitSandboxResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{10} -} - -func (x *WaitSandboxResponse) GetExitStatus() uint32 { - if x != nil { - return x.ExitStatus - } - return 0 -} - -func (x *WaitSandboxResponse) GetExitedAt() *timestamppb.Timestamp { - if x != nil { - return x.ExitedAt - } - return nil -} - -type UpdateSandboxResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateSandboxResponse) Reset() { - *x = UpdateSandboxResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateSandboxResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateSandboxResponse) ProtoMessage() {} - -func (x *UpdateSandboxResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[11] - 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 UpdateSandboxResponse.ProtoReflect.Descriptor instead. -func (*UpdateSandboxResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{11} -} - -type SandboxStatusRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - Verbose bool `protobuf:"varint,2,opt,name=verbose,proto3" json:"verbose,omitempty"` -} - -func (x *SandboxStatusRequest) Reset() { - *x = SandboxStatusRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SandboxStatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SandboxStatusRequest) ProtoMessage() {} - -func (x *SandboxStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[12] - 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 SandboxStatusRequest.ProtoReflect.Descriptor instead. -func (*SandboxStatusRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{12} -} - -func (x *SandboxStatusRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *SandboxStatusRequest) GetVerbose() bool { - if x != nil { - return x.Verbose - } - return false -} - -type SandboxStatusResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - Pid uint32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"` - State string `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"` - Info map[string]string `protobuf:"bytes,4,rep,name=info,proto3" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - ExitedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=exited_at,json=exitedAt,proto3" json:"exited_at,omitempty"` - Extra *anypb.Any `protobuf:"bytes,7,opt,name=extra,proto3" json:"extra,omitempty"` -} - -func (x *SandboxStatusResponse) Reset() { - *x = SandboxStatusResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SandboxStatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SandboxStatusResponse) ProtoMessage() {} - -func (x *SandboxStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[13] - 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 SandboxStatusResponse.ProtoReflect.Descriptor instead. -func (*SandboxStatusResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{13} -} - -func (x *SandboxStatusResponse) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *SandboxStatusResponse) GetPid() uint32 { - if x != nil { - return x.Pid - } - return 0 -} - -func (x *SandboxStatusResponse) GetState() string { - if x != nil { - return x.State - } - return "" -} - -func (x *SandboxStatusResponse) GetInfo() map[string]string { - if x != nil { - return x.Info - } - return nil -} - -func (x *SandboxStatusResponse) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *SandboxStatusResponse) GetExitedAt() *timestamppb.Timestamp { - if x != nil { - return x.ExitedAt - } - return nil -} - -func (x *SandboxStatusResponse) GetExtra() *anypb.Any { - if x != nil { - return x.Extra - } - return nil -} - -type PingRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` -} - -func (x *PingRequest) Reset() { - *x = PingRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PingRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PingRequest) ProtoMessage() {} - -func (x *PingRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[14] - 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 PingRequest.ProtoReflect.Descriptor instead. -func (*PingRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{14} -} - -func (x *PingRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -type PingResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *PingResponse) Reset() { - *x = PingResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PingResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PingResponse) ProtoMessage() {} - -func (x *PingResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[15] - 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 PingResponse.ProtoReflect.Descriptor instead. -func (*PingResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{15} -} - -type ShutdownSandboxRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` -} - -func (x *ShutdownSandboxRequest) Reset() { - *x = ShutdownSandboxRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ShutdownSandboxRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ShutdownSandboxRequest) ProtoMessage() {} - -func (x *ShutdownSandboxRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[16] - 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 ShutdownSandboxRequest.ProtoReflect.Descriptor instead. -func (*ShutdownSandboxRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{16} -} - -func (x *ShutdownSandboxRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -type ShutdownSandboxResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ShutdownSandboxResponse) Reset() { - *x = ShutdownSandboxResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ShutdownSandboxResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ShutdownSandboxResponse) ProtoMessage() {} - -func (x *ShutdownSandboxResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[17] - 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 ShutdownSandboxResponse.ProtoReflect.Descriptor instead. -func (*ShutdownSandboxResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{17} -} - -type SandboxMetricsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` -} - -func (x *SandboxMetricsRequest) Reset() { - *x = SandboxMetricsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SandboxMetricsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SandboxMetricsRequest) ProtoMessage() {} - -func (x *SandboxMetricsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[18] - 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 SandboxMetricsRequest.ProtoReflect.Descriptor instead. -func (*SandboxMetricsRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{18} -} - -func (x *SandboxMetricsRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -type SandboxMetricsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Metrics *types.Metric `protobuf:"bytes,1,opt,name=metrics,proto3" json:"metrics,omitempty"` -} - -func (x *SandboxMetricsResponse) Reset() { - *x = SandboxMetricsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SandboxMetricsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SandboxMetricsResponse) ProtoMessage() {} - -func (x *SandboxMetricsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[19] - 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 SandboxMetricsResponse.ProtoReflect.Descriptor instead. -func (*SandboxMetricsResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{19} -} - -func (x *SandboxMetricsResponse) GetMetrics() *types.Metric { - if x != nil { - return x.Metrics - } - return nil -} - -var File_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDesc = []byte{ - 0x0a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x73, - 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x61, 0x6e, 0x64, - 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x39, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xfe, 0x02, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, - 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, - 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x75, 0x6e, 0x64, 0x6c, - 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x75, - 0x6e, 0x64, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x2f, 0x0a, 0x06, 0x72, 0x6f, 0x6f, 0x74, - 0x66, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x74, 0x66, 0x73, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, - 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, - 0x6e, 0x73, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, - 0x65, 0x74, 0x6e, 0x73, 0x50, 0x61, 0x74, 0x68, 0x12, 0x66, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x44, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, - 0x6d, 0x65, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 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, - 0x22, 0x17, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x0a, 0x13, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x22, - 0x63, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x64, 0x41, 0x74, 0x22, 0x30, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, - 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, - 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x22, 0x4a, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x70, 0x6c, - 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x22, 0x56, 0x0a, 0x12, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, - 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, - 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x6f, - 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x74, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x74, - 0x6f, 0x70, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x91, 0x02, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6e, 0x64, - 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, - 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x09, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, - 0x6e, 0x79, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x66, 0x0a, - 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, - 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, - 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x22, 0x33, 0x0a, 0x12, 0x57, 0x61, 0x69, 0x74, 0x53, 0x61, 0x6e, - 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, - 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x22, 0x6f, 0x0a, 0x13, 0x57, 0x61, - 0x69, 0x74, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x65, 0x78, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x37, 0x0a, 0x09, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x17, 0x0a, 0x15, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4f, 0x0a, 0x14, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, - 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x62, 0x6f, 0x73, 0x65, 0x22, 0x8b, 0x03, 0x0a, 0x15, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x10, - 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x70, 0x69, 0x64, - 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x52, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x37, 0x0a, 0x09, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x2a, - 0x0a, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x41, 0x6e, 0x79, 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x1a, 0x37, 0x0a, 0x09, 0x49, 0x6e, - 0x66, 0x6f, 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, 0x22, 0x2c, 0x0a, 0x0b, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, - 0x64, 0x22, 0x0e, 0x0a, 0x0c, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x37, 0x0a, 0x16, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x53, 0x61, 0x6e, - 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, - 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x53, 0x68, - 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x0a, 0x15, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, - 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x22, 0x4c, 0x0a, - 0x16, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, - 0x63, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x72, - 0x69, 0x63, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x32, 0xbd, 0x08, 0x0a, 0x07, - 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, 0x7a, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x61, - 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, - 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, - 0x6d, 0x65, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x77, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x61, 0x6e, 0x64, - 0x62, 0x6f, 0x78, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x61, 0x6e, - 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x61, 0x6e, - 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x08, - 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x61, - 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x61, - 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x74, 0x0a, 0x0b, 0x53, 0x74, 0x6f, - 0x70, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x61, - 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x61, 0x6e, - 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, - 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, - 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x74, 0x0a, 0x0b, 0x57, 0x61, 0x69, 0x74, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, 0x31, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, - 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x57, - 0x61, 0x69, 0x74, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, - 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, - 0x31, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7a, 0x0a, 0x0d, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x61, 0x6e, 0x64, - 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, - 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x61, 0x6e, 0x64, - 0x62, 0x6f, 0x78, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x66, 0x0a, 0x0b, 0x50, 0x69, 0x6e, 0x67, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x12, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, - 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, - 0x65, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x80, 0x01, 0x0a, 0x0f, 0x53, 0x68, - 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, 0x35, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, - 0x6d, 0x65, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, - 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x53, 0x61, 0x6e, - 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7d, 0x0a, 0x0e, - 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x34, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, - 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x74, 0x72, - 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x41, 0x5a, 0x3f, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x73, 0x61, 0x6e, 0x64, - 0x62, 0x6f, 0x78, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescData = file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes = make([]protoimpl.MessageInfo, 23) -var file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_goTypes = []interface{}{ - (*CreateSandboxRequest)(nil), // 0: containerd.runtime.sandbox.v1.CreateSandboxRequest - (*CreateSandboxResponse)(nil), // 1: containerd.runtime.sandbox.v1.CreateSandboxResponse - (*StartSandboxRequest)(nil), // 2: containerd.runtime.sandbox.v1.StartSandboxRequest - (*StartSandboxResponse)(nil), // 3: containerd.runtime.sandbox.v1.StartSandboxResponse - (*PlatformRequest)(nil), // 4: containerd.runtime.sandbox.v1.PlatformRequest - (*PlatformResponse)(nil), // 5: containerd.runtime.sandbox.v1.PlatformResponse - (*StopSandboxRequest)(nil), // 6: containerd.runtime.sandbox.v1.StopSandboxRequest - (*StopSandboxResponse)(nil), // 7: containerd.runtime.sandbox.v1.StopSandboxResponse - (*UpdateSandboxRequest)(nil), // 8: containerd.runtime.sandbox.v1.UpdateSandboxRequest - (*WaitSandboxRequest)(nil), // 9: containerd.runtime.sandbox.v1.WaitSandboxRequest - (*WaitSandboxResponse)(nil), // 10: containerd.runtime.sandbox.v1.WaitSandboxResponse - (*UpdateSandboxResponse)(nil), // 11: containerd.runtime.sandbox.v1.UpdateSandboxResponse - (*SandboxStatusRequest)(nil), // 12: containerd.runtime.sandbox.v1.SandboxStatusRequest - (*SandboxStatusResponse)(nil), // 13: containerd.runtime.sandbox.v1.SandboxStatusResponse - (*PingRequest)(nil), // 14: containerd.runtime.sandbox.v1.PingRequest - (*PingResponse)(nil), // 15: containerd.runtime.sandbox.v1.PingResponse - (*ShutdownSandboxRequest)(nil), // 16: containerd.runtime.sandbox.v1.ShutdownSandboxRequest - (*ShutdownSandboxResponse)(nil), // 17: containerd.runtime.sandbox.v1.ShutdownSandboxResponse - (*SandboxMetricsRequest)(nil), // 18: containerd.runtime.sandbox.v1.SandboxMetricsRequest - (*SandboxMetricsResponse)(nil), // 19: containerd.runtime.sandbox.v1.SandboxMetricsResponse - nil, // 20: containerd.runtime.sandbox.v1.CreateSandboxRequest.AnnotationsEntry - nil, // 21: containerd.runtime.sandbox.v1.UpdateSandboxRequest.AnnotationsEntry - nil, // 22: containerd.runtime.sandbox.v1.SandboxStatusResponse.InfoEntry - (*types.Mount)(nil), // 23: containerd.types.Mount - (*anypb.Any)(nil), // 24: google.protobuf.Any - (*timestamppb.Timestamp)(nil), // 25: google.protobuf.Timestamp - (*types.Platform)(nil), // 26: containerd.types.Platform - (*types.Metric)(nil), // 27: containerd.types.Metric -} -var file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_depIdxs = []int32{ - 23, // 0: containerd.runtime.sandbox.v1.CreateSandboxRequest.rootfs:type_name -> containerd.types.Mount - 24, // 1: containerd.runtime.sandbox.v1.CreateSandboxRequest.options:type_name -> google.protobuf.Any - 20, // 2: containerd.runtime.sandbox.v1.CreateSandboxRequest.annotations:type_name -> containerd.runtime.sandbox.v1.CreateSandboxRequest.AnnotationsEntry - 25, // 3: containerd.runtime.sandbox.v1.StartSandboxResponse.created_at:type_name -> google.protobuf.Timestamp - 26, // 4: containerd.runtime.sandbox.v1.PlatformResponse.platform:type_name -> containerd.types.Platform - 24, // 5: containerd.runtime.sandbox.v1.UpdateSandboxRequest.resources:type_name -> google.protobuf.Any - 21, // 6: containerd.runtime.sandbox.v1.UpdateSandboxRequest.annotations:type_name -> containerd.runtime.sandbox.v1.UpdateSandboxRequest.AnnotationsEntry - 25, // 7: containerd.runtime.sandbox.v1.WaitSandboxResponse.exited_at:type_name -> google.protobuf.Timestamp - 22, // 8: containerd.runtime.sandbox.v1.SandboxStatusResponse.info:type_name -> containerd.runtime.sandbox.v1.SandboxStatusResponse.InfoEntry - 25, // 9: containerd.runtime.sandbox.v1.SandboxStatusResponse.created_at:type_name -> google.protobuf.Timestamp - 25, // 10: containerd.runtime.sandbox.v1.SandboxStatusResponse.exited_at:type_name -> google.protobuf.Timestamp - 24, // 11: containerd.runtime.sandbox.v1.SandboxStatusResponse.extra:type_name -> google.protobuf.Any - 27, // 12: containerd.runtime.sandbox.v1.SandboxMetricsResponse.metrics:type_name -> containerd.types.Metric - 0, // 13: containerd.runtime.sandbox.v1.Sandbox.CreateSandbox:input_type -> containerd.runtime.sandbox.v1.CreateSandboxRequest - 2, // 14: containerd.runtime.sandbox.v1.Sandbox.StartSandbox:input_type -> containerd.runtime.sandbox.v1.StartSandboxRequest - 4, // 15: containerd.runtime.sandbox.v1.Sandbox.Platform:input_type -> containerd.runtime.sandbox.v1.PlatformRequest - 6, // 16: containerd.runtime.sandbox.v1.Sandbox.StopSandbox:input_type -> containerd.runtime.sandbox.v1.StopSandboxRequest - 9, // 17: containerd.runtime.sandbox.v1.Sandbox.WaitSandbox:input_type -> containerd.runtime.sandbox.v1.WaitSandboxRequest - 12, // 18: containerd.runtime.sandbox.v1.Sandbox.SandboxStatus:input_type -> containerd.runtime.sandbox.v1.SandboxStatusRequest - 14, // 19: containerd.runtime.sandbox.v1.Sandbox.PingSandbox:input_type -> containerd.runtime.sandbox.v1.PingRequest - 16, // 20: containerd.runtime.sandbox.v1.Sandbox.ShutdownSandbox:input_type -> containerd.runtime.sandbox.v1.ShutdownSandboxRequest - 18, // 21: containerd.runtime.sandbox.v1.Sandbox.SandboxMetrics:input_type -> containerd.runtime.sandbox.v1.SandboxMetricsRequest - 1, // 22: containerd.runtime.sandbox.v1.Sandbox.CreateSandbox:output_type -> containerd.runtime.sandbox.v1.CreateSandboxResponse - 3, // 23: containerd.runtime.sandbox.v1.Sandbox.StartSandbox:output_type -> containerd.runtime.sandbox.v1.StartSandboxResponse - 5, // 24: containerd.runtime.sandbox.v1.Sandbox.Platform:output_type -> containerd.runtime.sandbox.v1.PlatformResponse - 7, // 25: containerd.runtime.sandbox.v1.Sandbox.StopSandbox:output_type -> containerd.runtime.sandbox.v1.StopSandboxResponse - 10, // 26: containerd.runtime.sandbox.v1.Sandbox.WaitSandbox:output_type -> containerd.runtime.sandbox.v1.WaitSandboxResponse - 13, // 27: containerd.runtime.sandbox.v1.Sandbox.SandboxStatus:output_type -> containerd.runtime.sandbox.v1.SandboxStatusResponse - 15, // 28: containerd.runtime.sandbox.v1.Sandbox.PingSandbox:output_type -> containerd.runtime.sandbox.v1.PingResponse - 17, // 29: containerd.runtime.sandbox.v1.Sandbox.ShutdownSandbox:output_type -> containerd.runtime.sandbox.v1.ShutdownSandboxResponse - 19, // 30: containerd.runtime.sandbox.v1.Sandbox.SandboxMetrics:output_type -> containerd.runtime.sandbox.v1.SandboxMetricsResponse - 22, // [22:31] is the sub-list for method output_type - 13, // [13:22] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_init() } -func file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_init() { - if File_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateSandboxRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateSandboxResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartSandboxRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartSandboxResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlatformRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlatformResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StopSandboxRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StopSandboxResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateSandboxRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WaitSandboxRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WaitSandboxResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateSandboxResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SandboxStatusRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SandboxStatusResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PingRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PingResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ShutdownSandboxRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ShutdownSandboxResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SandboxMetricsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SandboxMetricsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDesc, - NumEnums: 0, - NumMessages: 23, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto = out.File - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_rawDesc = nil - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_goTypes = nil - file_github_com_containerd_containerd_api_runtime_sandbox_v1_sandbox_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox.proto b/vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox.proto deleted file mode 100644 index 0cf801c909..0000000000 --- a/vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox.proto +++ /dev/null @@ -1,149 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.runtime.sandbox.v1; - -import "google/protobuf/any.proto"; -import "google/protobuf/timestamp.proto"; - -import "github.com/containerd/containerd/api/types/mount.proto"; -import "github.com/containerd/containerd/api/types/platform.proto"; -import "github.com/containerd/containerd/api/types/metrics.proto"; - -option go_package = "github.com/containerd/containerd/api/runtime/sandbox/v1;sandbox"; - -// Sandbox is an optional interface that shim may implement to support sandboxes environments. -// A typical example of sandbox is microVM or pause container - an entity that groups containers and/or -// holds resources relevant for this group. -service Sandbox { - // CreateSandbox will be called right after sandbox shim instance launched. - // It is a good place to initialize sandbox environment. - rpc CreateSandbox(CreateSandboxRequest) returns (CreateSandboxResponse); - - // StartSandbox will start a previously created sandbox. - rpc StartSandbox(StartSandboxRequest) returns (StartSandboxResponse); - - // Platform queries the platform the sandbox is going to run containers on. - // containerd will use this to generate a proper OCI spec. - rpc Platform(PlatformRequest) returns (PlatformResponse); - - // StopSandbox will stop existing sandbox instance - rpc StopSandbox(StopSandboxRequest) returns (StopSandboxResponse); - - // WaitSandbox blocks until sandbox exits. - rpc WaitSandbox(WaitSandboxRequest) returns (WaitSandboxResponse); - - // SandboxStatus will return current status of the running sandbox instance - rpc SandboxStatus(SandboxStatusRequest) returns (SandboxStatusResponse); - - // PingSandbox is a lightweight API call to check whether sandbox alive. - rpc PingSandbox(PingRequest) returns (PingResponse); - - // ShutdownSandbox must shutdown shim instance. - rpc ShutdownSandbox(ShutdownSandboxRequest) returns (ShutdownSandboxResponse); - - // SandboxMetrics retrieves metrics about a sandbox instance. - rpc SandboxMetrics(SandboxMetricsRequest) returns (SandboxMetricsResponse); -} - -message CreateSandboxRequest { - string sandbox_id = 1; - string bundle_path = 2; - repeated containerd.types.Mount rootfs = 3; - google.protobuf.Any options = 4; - string netns_path = 5; - map annotations = 6; -} - -message CreateSandboxResponse {} - -message StartSandboxRequest { - string sandbox_id = 1; -} - -message StartSandboxResponse { - uint32 pid = 1; - google.protobuf.Timestamp created_at = 2; -} - -message PlatformRequest { - string sandbox_id = 1; -} - -message PlatformResponse { - containerd.types.Platform platform = 1; -} - -message StopSandboxRequest { - string sandbox_id = 1; - uint32 timeout_secs = 2; -} - -message StopSandboxResponse {} - -message UpdateSandboxRequest { - string sandbox_id = 1; - google.protobuf.Any resources = 2; - map annotations = 3; -} - -message WaitSandboxRequest { - string sandbox_id = 1; -} - -message WaitSandboxResponse { - uint32 exit_status = 1; - google.protobuf.Timestamp exited_at = 2; -} - -message UpdateSandboxResponse {} - -message SandboxStatusRequest { - string sandbox_id = 1; - bool verbose = 2; -} - -message SandboxStatusResponse { - string sandbox_id = 1; - uint32 pid = 2; - string state = 3; - map info = 4; - google.protobuf.Timestamp created_at = 5; - google.protobuf.Timestamp exited_at = 6; - google.protobuf.Any extra = 7; -} - -message PingRequest { - string sandbox_id = 1; -} - -message PingResponse {} - -message ShutdownSandboxRequest { - string sandbox_id = 1; -} - -message ShutdownSandboxResponse {} - -message SandboxMetricsRequest { - string sandbox_id = 1; -} - -message SandboxMetricsResponse { - containerd.types.Metric metrics = 1; -} diff --git a/vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox_grpc.pb.go b/vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox_grpc.pb.go deleted file mode 100644 index ae5b9a1e9e..0000000000 --- a/vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox_grpc.pb.go +++ /dev/null @@ -1,417 +0,0 @@ -//go:build !no_grpc - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.1 -// source: github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox.proto - -package sandbox - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// SandboxClient is the client API for Sandbox service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type SandboxClient interface { - // CreateSandbox will be called right after sandbox shim instance launched. - // It is a good place to initialize sandbox environment. - CreateSandbox(ctx context.Context, in *CreateSandboxRequest, opts ...grpc.CallOption) (*CreateSandboxResponse, error) - // StartSandbox will start a previously created sandbox. - StartSandbox(ctx context.Context, in *StartSandboxRequest, opts ...grpc.CallOption) (*StartSandboxResponse, error) - // Platform queries the platform the sandbox is going to run containers on. - // containerd will use this to generate a proper OCI spec. - Platform(ctx context.Context, in *PlatformRequest, opts ...grpc.CallOption) (*PlatformResponse, error) - // StopSandbox will stop existing sandbox instance - StopSandbox(ctx context.Context, in *StopSandboxRequest, opts ...grpc.CallOption) (*StopSandboxResponse, error) - // WaitSandbox blocks until sandbox exits. - WaitSandbox(ctx context.Context, in *WaitSandboxRequest, opts ...grpc.CallOption) (*WaitSandboxResponse, error) - // SandboxStatus will return current status of the running sandbox instance - SandboxStatus(ctx context.Context, in *SandboxStatusRequest, opts ...grpc.CallOption) (*SandboxStatusResponse, error) - // PingSandbox is a lightweight API call to check whether sandbox alive. - PingSandbox(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) - // ShutdownSandbox must shutdown shim instance. - ShutdownSandbox(ctx context.Context, in *ShutdownSandboxRequest, opts ...grpc.CallOption) (*ShutdownSandboxResponse, error) - // SandboxMetrics retrieves metrics about a sandbox instance. - SandboxMetrics(ctx context.Context, in *SandboxMetricsRequest, opts ...grpc.CallOption) (*SandboxMetricsResponse, error) -} - -type sandboxClient struct { - cc grpc.ClientConnInterface -} - -func NewSandboxClient(cc grpc.ClientConnInterface) SandboxClient { - return &sandboxClient{cc} -} - -func (c *sandboxClient) CreateSandbox(ctx context.Context, in *CreateSandboxRequest, opts ...grpc.CallOption) (*CreateSandboxResponse, error) { - out := new(CreateSandboxResponse) - err := c.cc.Invoke(ctx, "/containerd.runtime.sandbox.v1.Sandbox/CreateSandbox", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *sandboxClient) StartSandbox(ctx context.Context, in *StartSandboxRequest, opts ...grpc.CallOption) (*StartSandboxResponse, error) { - out := new(StartSandboxResponse) - err := c.cc.Invoke(ctx, "/containerd.runtime.sandbox.v1.Sandbox/StartSandbox", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *sandboxClient) Platform(ctx context.Context, in *PlatformRequest, opts ...grpc.CallOption) (*PlatformResponse, error) { - out := new(PlatformResponse) - err := c.cc.Invoke(ctx, "/containerd.runtime.sandbox.v1.Sandbox/Platform", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *sandboxClient) StopSandbox(ctx context.Context, in *StopSandboxRequest, opts ...grpc.CallOption) (*StopSandboxResponse, error) { - out := new(StopSandboxResponse) - err := c.cc.Invoke(ctx, "/containerd.runtime.sandbox.v1.Sandbox/StopSandbox", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *sandboxClient) WaitSandbox(ctx context.Context, in *WaitSandboxRequest, opts ...grpc.CallOption) (*WaitSandboxResponse, error) { - out := new(WaitSandboxResponse) - err := c.cc.Invoke(ctx, "/containerd.runtime.sandbox.v1.Sandbox/WaitSandbox", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *sandboxClient) SandboxStatus(ctx context.Context, in *SandboxStatusRequest, opts ...grpc.CallOption) (*SandboxStatusResponse, error) { - out := new(SandboxStatusResponse) - err := c.cc.Invoke(ctx, "/containerd.runtime.sandbox.v1.Sandbox/SandboxStatus", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *sandboxClient) PingSandbox(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) { - out := new(PingResponse) - err := c.cc.Invoke(ctx, "/containerd.runtime.sandbox.v1.Sandbox/PingSandbox", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *sandboxClient) ShutdownSandbox(ctx context.Context, in *ShutdownSandboxRequest, opts ...grpc.CallOption) (*ShutdownSandboxResponse, error) { - out := new(ShutdownSandboxResponse) - err := c.cc.Invoke(ctx, "/containerd.runtime.sandbox.v1.Sandbox/ShutdownSandbox", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *sandboxClient) SandboxMetrics(ctx context.Context, in *SandboxMetricsRequest, opts ...grpc.CallOption) (*SandboxMetricsResponse, error) { - out := new(SandboxMetricsResponse) - err := c.cc.Invoke(ctx, "/containerd.runtime.sandbox.v1.Sandbox/SandboxMetrics", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// SandboxServer is the server API for Sandbox service. -// All implementations must embed UnimplementedSandboxServer -// for forward compatibility -type SandboxServer interface { - // CreateSandbox will be called right after sandbox shim instance launched. - // It is a good place to initialize sandbox environment. - CreateSandbox(context.Context, *CreateSandboxRequest) (*CreateSandboxResponse, error) - // StartSandbox will start a previously created sandbox. - StartSandbox(context.Context, *StartSandboxRequest) (*StartSandboxResponse, error) - // Platform queries the platform the sandbox is going to run containers on. - // containerd will use this to generate a proper OCI spec. - Platform(context.Context, *PlatformRequest) (*PlatformResponse, error) - // StopSandbox will stop existing sandbox instance - StopSandbox(context.Context, *StopSandboxRequest) (*StopSandboxResponse, error) - // WaitSandbox blocks until sandbox exits. - WaitSandbox(context.Context, *WaitSandboxRequest) (*WaitSandboxResponse, error) - // SandboxStatus will return current status of the running sandbox instance - SandboxStatus(context.Context, *SandboxStatusRequest) (*SandboxStatusResponse, error) - // PingSandbox is a lightweight API call to check whether sandbox alive. - PingSandbox(context.Context, *PingRequest) (*PingResponse, error) - // ShutdownSandbox must shutdown shim instance. - ShutdownSandbox(context.Context, *ShutdownSandboxRequest) (*ShutdownSandboxResponse, error) - // SandboxMetrics retrieves metrics about a sandbox instance. - SandboxMetrics(context.Context, *SandboxMetricsRequest) (*SandboxMetricsResponse, error) - mustEmbedUnimplementedSandboxServer() -} - -// UnimplementedSandboxServer must be embedded to have forward compatible implementations. -type UnimplementedSandboxServer struct { -} - -func (UnimplementedSandboxServer) CreateSandbox(context.Context, *CreateSandboxRequest) (*CreateSandboxResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateSandbox not implemented") -} -func (UnimplementedSandboxServer) StartSandbox(context.Context, *StartSandboxRequest) (*StartSandboxResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method StartSandbox not implemented") -} -func (UnimplementedSandboxServer) Platform(context.Context, *PlatformRequest) (*PlatformResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Platform not implemented") -} -func (UnimplementedSandboxServer) StopSandbox(context.Context, *StopSandboxRequest) (*StopSandboxResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method StopSandbox not implemented") -} -func (UnimplementedSandboxServer) WaitSandbox(context.Context, *WaitSandboxRequest) (*WaitSandboxResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method WaitSandbox not implemented") -} -func (UnimplementedSandboxServer) SandboxStatus(context.Context, *SandboxStatusRequest) (*SandboxStatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SandboxStatus not implemented") -} -func (UnimplementedSandboxServer) PingSandbox(context.Context, *PingRequest) (*PingResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PingSandbox not implemented") -} -func (UnimplementedSandboxServer) ShutdownSandbox(context.Context, *ShutdownSandboxRequest) (*ShutdownSandboxResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ShutdownSandbox not implemented") -} -func (UnimplementedSandboxServer) SandboxMetrics(context.Context, *SandboxMetricsRequest) (*SandboxMetricsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SandboxMetrics not implemented") -} -func (UnimplementedSandboxServer) mustEmbedUnimplementedSandboxServer() {} - -// UnsafeSandboxServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to SandboxServer will -// result in compilation errors. -type UnsafeSandboxServer interface { - mustEmbedUnimplementedSandboxServer() -} - -func RegisterSandboxServer(s grpc.ServiceRegistrar, srv SandboxServer) { - s.RegisterService(&Sandbox_ServiceDesc, srv) -} - -func _Sandbox_CreateSandbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateSandboxRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SandboxServer).CreateSandbox(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.runtime.sandbox.v1.Sandbox/CreateSandbox", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SandboxServer).CreateSandbox(ctx, req.(*CreateSandboxRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Sandbox_StartSandbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StartSandboxRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SandboxServer).StartSandbox(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.runtime.sandbox.v1.Sandbox/StartSandbox", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SandboxServer).StartSandbox(ctx, req.(*StartSandboxRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Sandbox_Platform_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PlatformRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SandboxServer).Platform(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.runtime.sandbox.v1.Sandbox/Platform", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SandboxServer).Platform(ctx, req.(*PlatformRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Sandbox_StopSandbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StopSandboxRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SandboxServer).StopSandbox(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.runtime.sandbox.v1.Sandbox/StopSandbox", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SandboxServer).StopSandbox(ctx, req.(*StopSandboxRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Sandbox_WaitSandbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WaitSandboxRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SandboxServer).WaitSandbox(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.runtime.sandbox.v1.Sandbox/WaitSandbox", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SandboxServer).WaitSandbox(ctx, req.(*WaitSandboxRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Sandbox_SandboxStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SandboxStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SandboxServer).SandboxStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.runtime.sandbox.v1.Sandbox/SandboxStatus", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SandboxServer).SandboxStatus(ctx, req.(*SandboxStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Sandbox_PingSandbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PingRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SandboxServer).PingSandbox(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.runtime.sandbox.v1.Sandbox/PingSandbox", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SandboxServer).PingSandbox(ctx, req.(*PingRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Sandbox_ShutdownSandbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ShutdownSandboxRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SandboxServer).ShutdownSandbox(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.runtime.sandbox.v1.Sandbox/ShutdownSandbox", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SandboxServer).ShutdownSandbox(ctx, req.(*ShutdownSandboxRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Sandbox_SandboxMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SandboxMetricsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SandboxServer).SandboxMetrics(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.runtime.sandbox.v1.Sandbox/SandboxMetrics", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SandboxServer).SandboxMetrics(ctx, req.(*SandboxMetricsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Sandbox_ServiceDesc is the grpc.ServiceDesc for Sandbox service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Sandbox_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.runtime.sandbox.v1.Sandbox", - HandlerType: (*SandboxServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateSandbox", - Handler: _Sandbox_CreateSandbox_Handler, - }, - { - MethodName: "StartSandbox", - Handler: _Sandbox_StartSandbox_Handler, - }, - { - MethodName: "Platform", - Handler: _Sandbox_Platform_Handler, - }, - { - MethodName: "StopSandbox", - Handler: _Sandbox_StopSandbox_Handler, - }, - { - MethodName: "WaitSandbox", - Handler: _Sandbox_WaitSandbox_Handler, - }, - { - MethodName: "SandboxStatus", - Handler: _Sandbox_SandboxStatus_Handler, - }, - { - MethodName: "PingSandbox", - Handler: _Sandbox_PingSandbox_Handler, - }, - { - MethodName: "ShutdownSandbox", - Handler: _Sandbox_ShutdownSandbox_Handler, - }, - { - MethodName: "SandboxMetrics", - Handler: _Sandbox_SandboxMetrics_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox.proto", -} diff --git a/vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox_ttrpc.pb.go b/vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox_ttrpc.pb.go deleted file mode 100644 index 65bab2dfcc..0000000000 --- a/vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox_ttrpc.pb.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox.proto -package sandbox - -import ( - context "context" - ttrpc "github.com/containerd/ttrpc" -) - -type TTRPCSandboxService interface { - CreateSandbox(context.Context, *CreateSandboxRequest) (*CreateSandboxResponse, error) - StartSandbox(context.Context, *StartSandboxRequest) (*StartSandboxResponse, error) - Platform(context.Context, *PlatformRequest) (*PlatformResponse, error) - StopSandbox(context.Context, *StopSandboxRequest) (*StopSandboxResponse, error) - WaitSandbox(context.Context, *WaitSandboxRequest) (*WaitSandboxResponse, error) - SandboxStatus(context.Context, *SandboxStatusRequest) (*SandboxStatusResponse, error) - PingSandbox(context.Context, *PingRequest) (*PingResponse, error) - ShutdownSandbox(context.Context, *ShutdownSandboxRequest) (*ShutdownSandboxResponse, error) - SandboxMetrics(context.Context, *SandboxMetricsRequest) (*SandboxMetricsResponse, error) -} - -func RegisterTTRPCSandboxService(srv *ttrpc.Server, svc TTRPCSandboxService) { - srv.RegisterService("containerd.runtime.sandbox.v1.Sandbox", &ttrpc.ServiceDesc{ - Methods: map[string]ttrpc.Method{ - "CreateSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req CreateSandboxRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.CreateSandbox(ctx, &req) - }, - "StartSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req StartSandboxRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.StartSandbox(ctx, &req) - }, - "Platform": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req PlatformRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Platform(ctx, &req) - }, - "StopSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req StopSandboxRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.StopSandbox(ctx, &req) - }, - "WaitSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req WaitSandboxRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.WaitSandbox(ctx, &req) - }, - "SandboxStatus": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req SandboxStatusRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.SandboxStatus(ctx, &req) - }, - "PingSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req PingRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.PingSandbox(ctx, &req) - }, - "ShutdownSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ShutdownSandboxRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.ShutdownSandbox(ctx, &req) - }, - "SandboxMetrics": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req SandboxMetricsRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.SandboxMetrics(ctx, &req) - }, - }, - }) -} - -type ttrpcsandboxClient struct { - client *ttrpc.Client -} - -func NewTTRPCSandboxClient(client *ttrpc.Client) TTRPCSandboxService { - return &ttrpcsandboxClient{ - client: client, - } -} - -func (c *ttrpcsandboxClient) CreateSandbox(ctx context.Context, req *CreateSandboxRequest) (*CreateSandboxResponse, error) { - var resp CreateSandboxResponse - if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "CreateSandbox", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcsandboxClient) StartSandbox(ctx context.Context, req *StartSandboxRequest) (*StartSandboxResponse, error) { - var resp StartSandboxResponse - if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "StartSandbox", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcsandboxClient) Platform(ctx context.Context, req *PlatformRequest) (*PlatformResponse, error) { - var resp PlatformResponse - if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "Platform", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcsandboxClient) StopSandbox(ctx context.Context, req *StopSandboxRequest) (*StopSandboxResponse, error) { - var resp StopSandboxResponse - if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "StopSandbox", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcsandboxClient) WaitSandbox(ctx context.Context, req *WaitSandboxRequest) (*WaitSandboxResponse, error) { - var resp WaitSandboxResponse - if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "WaitSandbox", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcsandboxClient) SandboxStatus(ctx context.Context, req *SandboxStatusRequest) (*SandboxStatusResponse, error) { - var resp SandboxStatusResponse - if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "SandboxStatus", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcsandboxClient) PingSandbox(ctx context.Context, req *PingRequest) (*PingResponse, error) { - var resp PingResponse - if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "PingSandbox", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcsandboxClient) ShutdownSandbox(ctx context.Context, req *ShutdownSandboxRequest) (*ShutdownSandboxResponse, error) { - var resp ShutdownSandboxResponse - if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "ShutdownSandbox", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcsandboxClient) SandboxMetrics(ctx context.Context, req *SandboxMetricsRequest) (*SandboxMetricsResponse, error) { - var resp SandboxMetricsResponse - if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "SandboxMetrics", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.pb.go b/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.pb.go deleted file mode 100644 index aab9e45b12..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.pb.go +++ /dev/null @@ -1,1178 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/containers/v1/containers.proto - -package containers - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - emptypb "google.golang.org/protobuf/types/known/emptypb" - fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -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) -) - -type Container struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // ID is the user-specified identifier. - // - // This field may not be updated. - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Labels provides an area to include arbitrary data on containers. - // - // The combined size of a key/value pair cannot exceed 4096 bytes. - // - // Note that to add a new value to this field, read the existing set and - // include the entire result in the update call. - Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Image contains the reference of the image used to build the - // specification and snapshots for running this container. - // - // If this field is updated, the spec and rootfs needed to updated, as well. - Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` - // Runtime specifies which runtime to use for executing this container. - Runtime *Container_Runtime `protobuf:"bytes,4,opt,name=runtime,proto3" json:"runtime,omitempty"` - // Spec to be used when creating the container. This is runtime specific. - Spec *anypb.Any `protobuf:"bytes,5,opt,name=spec,proto3" json:"spec,omitempty"` - // Snapshotter specifies the snapshotter name used for rootfs - Snapshotter string `protobuf:"bytes,6,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` - // SnapshotKey specifies the snapshot key to use for the container's root - // filesystem. When starting a task from this container, a caller should - // look up the mounts from the snapshot service and include those on the - // task create request. - // - // Snapshots referenced in this field will not be garbage collected. - // - // This field is set to empty when the rootfs is not a snapshot. - // - // This field may be updated. - SnapshotKey string `protobuf:"bytes,7,opt,name=snapshot_key,json=snapshotKey,proto3" json:"snapshot_key,omitempty"` - // CreatedAt is the time the container was first created. - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - // UpdatedAt is the last time the container was mutated. - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - // Extensions allow clients to provide zero or more blobs that are directly - // associated with the container. One may provide protobuf, json, or other - // encoding formats. The primary use of this is to further decorate the - // container object with fields that may be specific to a client integration. - // - // The key portion of this map should identify a "name" for the extension - // that should be unique against other extensions. When updating extension - // data, one should only update the specified extension using field paths - // to select a specific map key. - Extensions map[string]*anypb.Any `protobuf:"bytes,10,rep,name=extensions,proto3" json:"extensions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Sandbox ID this container belongs to. - Sandbox string `protobuf:"bytes,11,opt,name=sandbox,proto3" json:"sandbox,omitempty"` -} - -func (x *Container) Reset() { - *x = Container{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Container) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Container) ProtoMessage() {} - -func (x *Container) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[0] - 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 Container.ProtoReflect.Descriptor instead. -func (*Container) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescGZIP(), []int{0} -} - -func (x *Container) GetID() string { - if x != nil { - return x.ID - } - return "" -} - -func (x *Container) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -func (x *Container) GetImage() string { - if x != nil { - return x.Image - } - return "" -} - -func (x *Container) GetRuntime() *Container_Runtime { - if x != nil { - return x.Runtime - } - return nil -} - -func (x *Container) GetSpec() *anypb.Any { - if x != nil { - return x.Spec - } - return nil -} - -func (x *Container) GetSnapshotter() string { - if x != nil { - return x.Snapshotter - } - return "" -} - -func (x *Container) GetSnapshotKey() string { - if x != nil { - return x.SnapshotKey - } - return "" -} - -func (x *Container) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *Container) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -func (x *Container) GetExtensions() map[string]*anypb.Any { - if x != nil { - return x.Extensions - } - return nil -} - -func (x *Container) GetSandbox() string { - if x != nil { - return x.Sandbox - } - return "" -} - -type GetContainerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GetContainerRequest) Reset() { - *x = GetContainerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetContainerRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetContainerRequest) ProtoMessage() {} - -func (x *GetContainerRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[1] - 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 GetContainerRequest.ProtoReflect.Descriptor instead. -func (*GetContainerRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescGZIP(), []int{1} -} - -func (x *GetContainerRequest) GetID() string { - if x != nil { - return x.ID - } - return "" -} - -type GetContainerResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Container *Container `protobuf:"bytes,1,opt,name=container,proto3" json:"container,omitempty"` -} - -func (x *GetContainerResponse) Reset() { - *x = GetContainerResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetContainerResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetContainerResponse) ProtoMessage() {} - -func (x *GetContainerResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[2] - 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 GetContainerResponse.ProtoReflect.Descriptor instead. -func (*GetContainerResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescGZIP(), []int{2} -} - -func (x *GetContainerResponse) GetContainer() *Container { - if x != nil { - return x.Container - } - return nil -} - -type ListContainersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Filters contains one or more filters using the syntax defined in the - // containerd filter package. - // - // The returned result will be those that match any of the provided - // filters. Expanded, containers that match the following will be - // returned: - // - // filters[0] or filters[1] or ... or filters[n-1] or filters[n] - // - // If filters is zero-length or nil, all items will be returned. - Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` -} - -func (x *ListContainersRequest) Reset() { - *x = ListContainersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListContainersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListContainersRequest) ProtoMessage() {} - -func (x *ListContainersRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[3] - 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 ListContainersRequest.ProtoReflect.Descriptor instead. -func (*ListContainersRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescGZIP(), []int{3} -} - -func (x *ListContainersRequest) GetFilters() []string { - if x != nil { - return x.Filters - } - return nil -} - -type ListContainersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Containers []*Container `protobuf:"bytes,1,rep,name=containers,proto3" json:"containers,omitempty"` -} - -func (x *ListContainersResponse) Reset() { - *x = ListContainersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListContainersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListContainersResponse) ProtoMessage() {} - -func (x *ListContainersResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[4] - 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 ListContainersResponse.ProtoReflect.Descriptor instead. -func (*ListContainersResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescGZIP(), []int{4} -} - -func (x *ListContainersResponse) GetContainers() []*Container { - if x != nil { - return x.Containers - } - return nil -} - -type CreateContainerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Container *Container `protobuf:"bytes,1,opt,name=container,proto3" json:"container,omitempty"` -} - -func (x *CreateContainerRequest) Reset() { - *x = CreateContainerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateContainerRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateContainerRequest) ProtoMessage() {} - -func (x *CreateContainerRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[5] - 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 CreateContainerRequest.ProtoReflect.Descriptor instead. -func (*CreateContainerRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescGZIP(), []int{5} -} - -func (x *CreateContainerRequest) GetContainer() *Container { - if x != nil { - return x.Container - } - return nil -} - -type CreateContainerResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Container *Container `protobuf:"bytes,1,opt,name=container,proto3" json:"container,omitempty"` -} - -func (x *CreateContainerResponse) Reset() { - *x = CreateContainerResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateContainerResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateContainerResponse) ProtoMessage() {} - -func (x *CreateContainerResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[6] - 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 CreateContainerResponse.ProtoReflect.Descriptor instead. -func (*CreateContainerResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescGZIP(), []int{6} -} - -func (x *CreateContainerResponse) GetContainer() *Container { - if x != nil { - return x.Container - } - return nil -} - -// UpdateContainerRequest updates the metadata on one or more container. -// -// The operation should follow semantics described in -// https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/field-mask, -// unless otherwise qualified. -type UpdateContainerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Container provides the target values, as declared by the mask, for the update. - // - // The ID field must be set. - Container *Container `protobuf:"bytes,1,opt,name=container,proto3" json:"container,omitempty"` - // UpdateMask specifies which fields to perform the update on. If empty, - // the operation applies to all fields. - UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` -} - -func (x *UpdateContainerRequest) Reset() { - *x = UpdateContainerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateContainerRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateContainerRequest) ProtoMessage() {} - -func (x *UpdateContainerRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[7] - 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 UpdateContainerRequest.ProtoReflect.Descriptor instead. -func (*UpdateContainerRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescGZIP(), []int{7} -} - -func (x *UpdateContainerRequest) GetContainer() *Container { - if x != nil { - return x.Container - } - return nil -} - -func (x *UpdateContainerRequest) GetUpdateMask() *fieldmaskpb.FieldMask { - if x != nil { - return x.UpdateMask - } - return nil -} - -type UpdateContainerResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Container *Container `protobuf:"bytes,1,opt,name=container,proto3" json:"container,omitempty"` -} - -func (x *UpdateContainerResponse) Reset() { - *x = UpdateContainerResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateContainerResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateContainerResponse) ProtoMessage() {} - -func (x *UpdateContainerResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[8] - 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 UpdateContainerResponse.ProtoReflect.Descriptor instead. -func (*UpdateContainerResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescGZIP(), []int{8} -} - -func (x *UpdateContainerResponse) GetContainer() *Container { - if x != nil { - return x.Container - } - return nil -} - -type DeleteContainerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *DeleteContainerRequest) Reset() { - *x = DeleteContainerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteContainerRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteContainerRequest) ProtoMessage() {} - -func (x *DeleteContainerRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[9] - 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 DeleteContainerRequest.ProtoReflect.Descriptor instead. -func (*DeleteContainerRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescGZIP(), []int{9} -} - -func (x *DeleteContainerRequest) GetID() string { - if x != nil { - return x.ID - } - return "" -} - -type ListContainerMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Container *Container `protobuf:"bytes,1,opt,name=container,proto3" json:"container,omitempty"` -} - -func (x *ListContainerMessage) Reset() { - *x = ListContainerMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListContainerMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListContainerMessage) ProtoMessage() {} - -func (x *ListContainerMessage) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[10] - 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 ListContainerMessage.ProtoReflect.Descriptor instead. -func (*ListContainerMessage) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescGZIP(), []int{10} -} - -func (x *ListContainerMessage) GetContainer() *Container { - if x != nil { - return x.Container - } - return nil -} - -type Container_Runtime struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name is the name of the runtime. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Options specify additional runtime initialization options. - Options *anypb.Any `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` -} - -func (x *Container_Runtime) Reset() { - *x = Container_Runtime{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Container_Runtime) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Container_Runtime) ProtoMessage() {} - -func (x *Container_Runtime) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[12] - 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 Container_Runtime.ProtoReflect.Descriptor instead. -func (*Container_Runtime) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescGZIP(), []int{0, 1} -} - -func (x *Container_Runtime) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Container_Runtime) GetOptions() *anypb.Any { - if x != nil { - return x.Options - } - return nil -} - -var File_github_com_containerd_containerd_api_services_containers_v1_containers_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDesc = []byte{ - 0x0a, 0x4c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, - 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, - 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8f, 0x06, 0x0a, - 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x50, 0x0a, 0x06, 0x6c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x14, 0x0a, 0x05, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, - 0x67, 0x65, 0x12, 0x4e, 0x0a, 0x07, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x2e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x07, 0x72, 0x75, 0x6e, 0x74, 0x69, - 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x20, 0x0a, 0x0b, - 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x12, 0x21, - 0x0a, 0x0c, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4b, 0x65, - 0x79, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x5c, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 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, 0x4d, 0x0a, 0x07, 0x52, 0x75, - 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, - 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x53, 0x0a, 0x0f, 0x45, 0x78, 0x74, - 0x65, 0x6e, 0x73, 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, 0x2a, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x25, - 0x0a, 0x13, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x62, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, - 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0x31, 0x0a, 0x15, 0x4c, 0x69, 0x73, - 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x66, 0x0a, 0x16, - 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x73, 0x22, 0x64, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4a, - 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, - 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0x65, 0x0a, 0x17, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x22, 0xa1, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4a, 0x0a, 0x09, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x65, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x4a, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0x28, 0x0a, 0x16, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x62, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x4a, - 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, - 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x32, 0xe4, 0x05, 0x0a, 0x0a, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x76, 0x0a, 0x03, 0x47, 0x65, 0x74, - 0x12, 0x36, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x7b, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x38, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x81, - 0x01, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x38, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x30, 0x01, 0x12, 0x7f, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x39, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x7f, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x39, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x39, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2f, 0x76, 0x31, - 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescData = file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_goTypes = []interface{}{ - (*Container)(nil), // 0: containerd.services.containers.v1.Container - (*GetContainerRequest)(nil), // 1: containerd.services.containers.v1.GetContainerRequest - (*GetContainerResponse)(nil), // 2: containerd.services.containers.v1.GetContainerResponse - (*ListContainersRequest)(nil), // 3: containerd.services.containers.v1.ListContainersRequest - (*ListContainersResponse)(nil), // 4: containerd.services.containers.v1.ListContainersResponse - (*CreateContainerRequest)(nil), // 5: containerd.services.containers.v1.CreateContainerRequest - (*CreateContainerResponse)(nil), // 6: containerd.services.containers.v1.CreateContainerResponse - (*UpdateContainerRequest)(nil), // 7: containerd.services.containers.v1.UpdateContainerRequest - (*UpdateContainerResponse)(nil), // 8: containerd.services.containers.v1.UpdateContainerResponse - (*DeleteContainerRequest)(nil), // 9: containerd.services.containers.v1.DeleteContainerRequest - (*ListContainerMessage)(nil), // 10: containerd.services.containers.v1.ListContainerMessage - nil, // 11: containerd.services.containers.v1.Container.LabelsEntry - (*Container_Runtime)(nil), // 12: containerd.services.containers.v1.Container.Runtime - nil, // 13: containerd.services.containers.v1.Container.ExtensionsEntry - (*anypb.Any)(nil), // 14: google.protobuf.Any - (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp - (*fieldmaskpb.FieldMask)(nil), // 16: google.protobuf.FieldMask - (*emptypb.Empty)(nil), // 17: google.protobuf.Empty -} -var file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_depIdxs = []int32{ - 11, // 0: containerd.services.containers.v1.Container.labels:type_name -> containerd.services.containers.v1.Container.LabelsEntry - 12, // 1: containerd.services.containers.v1.Container.runtime:type_name -> containerd.services.containers.v1.Container.Runtime - 14, // 2: containerd.services.containers.v1.Container.spec:type_name -> google.protobuf.Any - 15, // 3: containerd.services.containers.v1.Container.created_at:type_name -> google.protobuf.Timestamp - 15, // 4: containerd.services.containers.v1.Container.updated_at:type_name -> google.protobuf.Timestamp - 13, // 5: containerd.services.containers.v1.Container.extensions:type_name -> containerd.services.containers.v1.Container.ExtensionsEntry - 0, // 6: containerd.services.containers.v1.GetContainerResponse.container:type_name -> containerd.services.containers.v1.Container - 0, // 7: containerd.services.containers.v1.ListContainersResponse.containers:type_name -> containerd.services.containers.v1.Container - 0, // 8: containerd.services.containers.v1.CreateContainerRequest.container:type_name -> containerd.services.containers.v1.Container - 0, // 9: containerd.services.containers.v1.CreateContainerResponse.container:type_name -> containerd.services.containers.v1.Container - 0, // 10: containerd.services.containers.v1.UpdateContainerRequest.container:type_name -> containerd.services.containers.v1.Container - 16, // 11: containerd.services.containers.v1.UpdateContainerRequest.update_mask:type_name -> google.protobuf.FieldMask - 0, // 12: containerd.services.containers.v1.UpdateContainerResponse.container:type_name -> containerd.services.containers.v1.Container - 0, // 13: containerd.services.containers.v1.ListContainerMessage.container:type_name -> containerd.services.containers.v1.Container - 14, // 14: containerd.services.containers.v1.Container.Runtime.options:type_name -> google.protobuf.Any - 14, // 15: containerd.services.containers.v1.Container.ExtensionsEntry.value:type_name -> google.protobuf.Any - 1, // 16: containerd.services.containers.v1.Containers.Get:input_type -> containerd.services.containers.v1.GetContainerRequest - 3, // 17: containerd.services.containers.v1.Containers.List:input_type -> containerd.services.containers.v1.ListContainersRequest - 3, // 18: containerd.services.containers.v1.Containers.ListStream:input_type -> containerd.services.containers.v1.ListContainersRequest - 5, // 19: containerd.services.containers.v1.Containers.Create:input_type -> containerd.services.containers.v1.CreateContainerRequest - 7, // 20: containerd.services.containers.v1.Containers.Update:input_type -> containerd.services.containers.v1.UpdateContainerRequest - 9, // 21: containerd.services.containers.v1.Containers.Delete:input_type -> containerd.services.containers.v1.DeleteContainerRequest - 2, // 22: containerd.services.containers.v1.Containers.Get:output_type -> containerd.services.containers.v1.GetContainerResponse - 4, // 23: containerd.services.containers.v1.Containers.List:output_type -> containerd.services.containers.v1.ListContainersResponse - 10, // 24: containerd.services.containers.v1.Containers.ListStream:output_type -> containerd.services.containers.v1.ListContainerMessage - 6, // 25: containerd.services.containers.v1.Containers.Create:output_type -> containerd.services.containers.v1.CreateContainerResponse - 8, // 26: containerd.services.containers.v1.Containers.Update:output_type -> containerd.services.containers.v1.UpdateContainerResponse - 17, // 27: containerd.services.containers.v1.Containers.Delete:output_type -> google.protobuf.Empty - 22, // [22:28] is the sub-list for method output_type - 16, // [16:22] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_init() } -func file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_init() { - if File_github_com_containerd_containerd_api_services_containers_v1_containers_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Container); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetContainerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetContainerResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListContainersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListContainersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateContainerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateContainerResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateContainerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateContainerResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteContainerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListContainerMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Container_Runtime); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDesc, - NumEnums: 0, - NumMessages: 14, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_services_containers_v1_containers_proto = out.File - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_rawDesc = nil - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_goTypes = nil - file_github_com_containerd_containerd_api_services_containers_v1_containers_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.proto b/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.proto deleted file mode 100644 index 3de07ffbd6..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.proto +++ /dev/null @@ -1,181 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.services.containers.v1; - -import "google/protobuf/any.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "github.com/containerd/containerd/api/services/containers/v1;containers"; - -// Containers provides metadata storage for containers used in the execution -// service. -// -// The objects here provide an state-independent view of containers for use in -// management and resource pinning. From that perspective, containers do not -// have a "state" but rather this is the set of resources that will be -// considered in use by the container. -// -// From the perspective of the execution service, these objects represent the -// base parameters for creating a container process. -// -// In general, when looking to add fields for this type, first ask yourself -// whether or not the function of the field has to do with runtime execution or -// is invariant of the runtime state of the container. If it has to do with -// runtime, or changes as the "container" is started and stops, it probably -// doesn't belong on this object. -service Containers { - rpc Get(GetContainerRequest) returns (GetContainerResponse); - rpc List(ListContainersRequest) returns (ListContainersResponse); - rpc ListStream(ListContainersRequest) returns (stream ListContainerMessage); - rpc Create(CreateContainerRequest) returns (CreateContainerResponse); - rpc Update(UpdateContainerRequest) returns (UpdateContainerResponse); - rpc Delete(DeleteContainerRequest) returns (google.protobuf.Empty); -} - -message Container { - // ID is the user-specified identifier. - // - // This field may not be updated. - string id = 1; - - // Labels provides an area to include arbitrary data on containers. - // - // The combined size of a key/value pair cannot exceed 4096 bytes. - // - // Note that to add a new value to this field, read the existing set and - // include the entire result in the update call. - map labels = 2; - - // Image contains the reference of the image used to build the - // specification and snapshots for running this container. - // - // If this field is updated, the spec and rootfs needed to updated, as well. - string image = 3; - - message Runtime { - // Name is the name of the runtime. - string name = 1; - // Options specify additional runtime initialization options. - google.protobuf.Any options = 2; - } - // Runtime specifies which runtime to use for executing this container. - Runtime runtime = 4; - - // Spec to be used when creating the container. This is runtime specific. - google.protobuf.Any spec = 5; - - // Snapshotter specifies the snapshotter name used for rootfs - string snapshotter = 6; - - // SnapshotKey specifies the snapshot key to use for the container's root - // filesystem. When starting a task from this container, a caller should - // look up the mounts from the snapshot service and include those on the - // task create request. - // - // Snapshots referenced in this field will not be garbage collected. - // - // This field is set to empty when the rootfs is not a snapshot. - // - // This field may be updated. - string snapshot_key = 7; - - // CreatedAt is the time the container was first created. - google.protobuf.Timestamp created_at = 8; - - // UpdatedAt is the last time the container was mutated. - google.protobuf.Timestamp updated_at = 9; - - // Extensions allow clients to provide zero or more blobs that are directly - // associated with the container. One may provide protobuf, json, or other - // encoding formats. The primary use of this is to further decorate the - // container object with fields that may be specific to a client integration. - // - // The key portion of this map should identify a "name" for the extension - // that should be unique against other extensions. When updating extension - // data, one should only update the specified extension using field paths - // to select a specific map key. - map extensions = 10; - - // Sandbox ID this container belongs to. - string sandbox = 11; -} - -message GetContainerRequest { - string id = 1; -} - -message GetContainerResponse { - Container container = 1; -} - -message ListContainersRequest { - // Filters contains one or more filters using the syntax defined in the - // containerd filter package. - // - // The returned result will be those that match any of the provided - // filters. Expanded, containers that match the following will be - // returned: - // - // filters[0] or filters[1] or ... or filters[n-1] or filters[n] - // - // If filters is zero-length or nil, all items will be returned. - repeated string filters = 1; -} - -message ListContainersResponse { - repeated Container containers = 1; -} - -message CreateContainerRequest { - Container container = 1; -} - -message CreateContainerResponse { - Container container = 1; -} - -// UpdateContainerRequest updates the metadata on one or more container. -// -// The operation should follow semantics described in -// https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/field-mask, -// unless otherwise qualified. -message UpdateContainerRequest { - // Container provides the target values, as declared by the mask, for the update. - // - // The ID field must be set. - Container container = 1; - - // UpdateMask specifies which fields to perform the update on. If empty, - // the operation applies to all fields. - google.protobuf.FieldMask update_mask = 2; -} - -message UpdateContainerResponse { - Container container = 1; -} - -message DeleteContainerRequest { - string id = 1; -} - -message ListContainerMessage { - Container container = 1; -} diff --git a/vendor/github.com/containerd/containerd/api/services/containers/v1/containers_grpc.pb.go b/vendor/github.com/containerd/containerd/api/services/containers/v1/containers_grpc.pb.go deleted file mode 100644 index 93dab77d10..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/containers/v1/containers_grpc.pb.go +++ /dev/null @@ -1,316 +0,0 @@ -//go:build !no_grpc - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/containers/v1/containers.proto - -package containers - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// ContainersClient is the client API for Containers service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type ContainersClient interface { - Get(ctx context.Context, in *GetContainerRequest, opts ...grpc.CallOption) (*GetContainerResponse, error) - List(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (*ListContainersResponse, error) - ListStream(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (Containers_ListStreamClient, error) - Create(ctx context.Context, in *CreateContainerRequest, opts ...grpc.CallOption) (*CreateContainerResponse, error) - Update(ctx context.Context, in *UpdateContainerRequest, opts ...grpc.CallOption) (*UpdateContainerResponse, error) - Delete(ctx context.Context, in *DeleteContainerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type containersClient struct { - cc grpc.ClientConnInterface -} - -func NewContainersClient(cc grpc.ClientConnInterface) ContainersClient { - return &containersClient{cc} -} - -func (c *containersClient) Get(ctx context.Context, in *GetContainerRequest, opts ...grpc.CallOption) (*GetContainerResponse, error) { - out := new(GetContainerResponse) - err := c.cc.Invoke(ctx, "/containerd.services.containers.v1.Containers/Get", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *containersClient) List(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (*ListContainersResponse, error) { - out := new(ListContainersResponse) - err := c.cc.Invoke(ctx, "/containerd.services.containers.v1.Containers/List", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *containersClient) ListStream(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (Containers_ListStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &Containers_ServiceDesc.Streams[0], "/containerd.services.containers.v1.Containers/ListStream", opts...) - if err != nil { - return nil, err - } - x := &containersListStreamClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Containers_ListStreamClient interface { - Recv() (*ListContainerMessage, error) - grpc.ClientStream -} - -type containersListStreamClient struct { - grpc.ClientStream -} - -func (x *containersListStreamClient) Recv() (*ListContainerMessage, error) { - m := new(ListContainerMessage) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *containersClient) Create(ctx context.Context, in *CreateContainerRequest, opts ...grpc.CallOption) (*CreateContainerResponse, error) { - out := new(CreateContainerResponse) - err := c.cc.Invoke(ctx, "/containerd.services.containers.v1.Containers/Create", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *containersClient) Update(ctx context.Context, in *UpdateContainerRequest, opts ...grpc.CallOption) (*UpdateContainerResponse, error) { - out := new(UpdateContainerResponse) - err := c.cc.Invoke(ctx, "/containerd.services.containers.v1.Containers/Update", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *containersClient) Delete(ctx context.Context, in *DeleteContainerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.containers.v1.Containers/Delete", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ContainersServer is the server API for Containers service. -// All implementations must embed UnimplementedContainersServer -// for forward compatibility -type ContainersServer interface { - Get(context.Context, *GetContainerRequest) (*GetContainerResponse, error) - List(context.Context, *ListContainersRequest) (*ListContainersResponse, error) - ListStream(*ListContainersRequest, Containers_ListStreamServer) error - Create(context.Context, *CreateContainerRequest) (*CreateContainerResponse, error) - Update(context.Context, *UpdateContainerRequest) (*UpdateContainerResponse, error) - Delete(context.Context, *DeleteContainerRequest) (*emptypb.Empty, error) - mustEmbedUnimplementedContainersServer() -} - -// UnimplementedContainersServer must be embedded to have forward compatible implementations. -type UnimplementedContainersServer struct { -} - -func (UnimplementedContainersServer) Get(context.Context, *GetContainerRequest) (*GetContainerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") -} -func (UnimplementedContainersServer) List(context.Context, *ListContainersRequest) (*ListContainersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method List not implemented") -} -func (UnimplementedContainersServer) ListStream(*ListContainersRequest, Containers_ListStreamServer) error { - return status.Errorf(codes.Unimplemented, "method ListStream not implemented") -} -func (UnimplementedContainersServer) Create(context.Context, *CreateContainerRequest) (*CreateContainerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") -} -func (UnimplementedContainersServer) Update(context.Context, *UpdateContainerRequest) (*UpdateContainerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") -} -func (UnimplementedContainersServer) Delete(context.Context, *DeleteContainerRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") -} -func (UnimplementedContainersServer) mustEmbedUnimplementedContainersServer() {} - -// UnsafeContainersServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ContainersServer will -// result in compilation errors. -type UnsafeContainersServer interface { - mustEmbedUnimplementedContainersServer() -} - -func RegisterContainersServer(s grpc.ServiceRegistrar, srv ContainersServer) { - s.RegisterService(&Containers_ServiceDesc, srv) -} - -func _Containers_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetContainerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContainersServer).Get(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.containers.v1.Containers/Get", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContainersServer).Get(ctx, req.(*GetContainerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Containers_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListContainersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContainersServer).List(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.containers.v1.Containers/List", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContainersServer).List(ctx, req.(*ListContainersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Containers_ListStream_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ListContainersRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(ContainersServer).ListStream(m, &containersListStreamServer{stream}) -} - -type Containers_ListStreamServer interface { - Send(*ListContainerMessage) error - grpc.ServerStream -} - -type containersListStreamServer struct { - grpc.ServerStream -} - -func (x *containersListStreamServer) Send(m *ListContainerMessage) error { - return x.ServerStream.SendMsg(m) -} - -func _Containers_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateContainerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContainersServer).Create(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.containers.v1.Containers/Create", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContainersServer).Create(ctx, req.(*CreateContainerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Containers_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateContainerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContainersServer).Update(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.containers.v1.Containers/Update", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContainersServer).Update(ctx, req.(*UpdateContainerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Containers_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteContainerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContainersServer).Delete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.containers.v1.Containers/Delete", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContainersServer).Delete(ctx, req.(*DeleteContainerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Containers_ServiceDesc is the grpc.ServiceDesc for Containers service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Containers_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.services.containers.v1.Containers", - HandlerType: (*ContainersServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Get", - Handler: _Containers_Get_Handler, - }, - { - MethodName: "List", - Handler: _Containers_List_Handler, - }, - { - MethodName: "Create", - Handler: _Containers_Create_Handler, - }, - { - MethodName: "Update", - Handler: _Containers_Update_Handler, - }, - { - MethodName: "Delete", - Handler: _Containers_Delete_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "ListStream", - Handler: _Containers_ListStream_Handler, - ServerStreams: true, - }, - }, - Metadata: "github.com/containerd/containerd/api/services/containers/v1/containers.proto", -} diff --git a/vendor/github.com/containerd/containerd/api/services/containers/v1/containers_ttrpc.pb.go b/vendor/github.com/containerd/containerd/api/services/containers/v1/containers_ttrpc.pb.go deleted file mode 100644 index 8090011df3..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/containers/v1/containers_ttrpc.pb.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/containerd/api/services/containers/v1/containers.proto -package containers - -import ( - context "context" - ttrpc "github.com/containerd/ttrpc" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -type TTRPCContainersService interface { - Get(context.Context, *GetContainerRequest) (*GetContainerResponse, error) - List(context.Context, *ListContainersRequest) (*ListContainersResponse, error) - ListStream(context.Context, *ListContainersRequest, TTRPCContainers_ListStreamServer) error - Create(context.Context, *CreateContainerRequest) (*CreateContainerResponse, error) - Update(context.Context, *UpdateContainerRequest) (*UpdateContainerResponse, error) - Delete(context.Context, *DeleteContainerRequest) (*emptypb.Empty, error) -} - -type TTRPCContainers_ListStreamServer interface { - Send(*ListContainerMessage) error - ttrpc.StreamServer -} - -type ttrpccontainersListStreamServer struct { - ttrpc.StreamServer -} - -func (x *ttrpccontainersListStreamServer) Send(m *ListContainerMessage) error { - return x.StreamServer.SendMsg(m) -} - -func RegisterTTRPCContainersService(srv *ttrpc.Server, svc TTRPCContainersService) { - srv.RegisterService("containerd.services.containers.v1.Containers", &ttrpc.ServiceDesc{ - Methods: map[string]ttrpc.Method{ - "Get": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req GetContainerRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Get(ctx, &req) - }, - "List": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ListContainersRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.List(ctx, &req) - }, - "Create": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req CreateContainerRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Create(ctx, &req) - }, - "Update": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req UpdateContainerRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Update(ctx, &req) - }, - "Delete": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req DeleteContainerRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Delete(ctx, &req) - }, - }, - Streams: map[string]ttrpc.Stream{ - "ListStream": { - Handler: func(ctx context.Context, stream ttrpc.StreamServer) (interface{}, error) { - m := new(ListContainersRequest) - if err := stream.RecvMsg(m); err != nil { - return nil, err - } - return nil, svc.ListStream(ctx, m, &ttrpccontainersListStreamServer{stream}) - }, - StreamingClient: false, - StreamingServer: true, - }, - }, - }) -} - -type TTRPCContainersClient interface { - Get(context.Context, *GetContainerRequest) (*GetContainerResponse, error) - List(context.Context, *ListContainersRequest) (*ListContainersResponse, error) - ListStream(context.Context, *ListContainersRequest) (TTRPCContainers_ListStreamClient, error) - Create(context.Context, *CreateContainerRequest) (*CreateContainerResponse, error) - Update(context.Context, *UpdateContainerRequest) (*UpdateContainerResponse, error) - Delete(context.Context, *DeleteContainerRequest) (*emptypb.Empty, error) -} - -type ttrpccontainersClient struct { - client *ttrpc.Client -} - -func NewTTRPCContainersClient(client *ttrpc.Client) TTRPCContainersClient { - return &ttrpccontainersClient{ - client: client, - } -} - -func (c *ttrpccontainersClient) Get(ctx context.Context, req *GetContainerRequest) (*GetContainerResponse, error) { - var resp GetContainerResponse - if err := c.client.Call(ctx, "containerd.services.containers.v1.Containers", "Get", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontainersClient) List(ctx context.Context, req *ListContainersRequest) (*ListContainersResponse, error) { - var resp ListContainersResponse - if err := c.client.Call(ctx, "containerd.services.containers.v1.Containers", "List", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontainersClient) ListStream(ctx context.Context, req *ListContainersRequest) (TTRPCContainers_ListStreamClient, error) { - stream, err := c.client.NewStream(ctx, &ttrpc.StreamDesc{ - StreamingClient: false, - StreamingServer: true, - }, "containerd.services.containers.v1.Containers", "ListStream", req) - if err != nil { - return nil, err - } - x := &ttrpccontainersListStreamClient{stream} - return x, nil -} - -type TTRPCContainers_ListStreamClient interface { - Recv() (*ListContainerMessage, error) - ttrpc.ClientStream -} - -type ttrpccontainersListStreamClient struct { - ttrpc.ClientStream -} - -func (x *ttrpccontainersListStreamClient) Recv() (*ListContainerMessage, error) { - m := new(ListContainerMessage) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *ttrpccontainersClient) Create(ctx context.Context, req *CreateContainerRequest) (*CreateContainerResponse, error) { - var resp CreateContainerResponse - if err := c.client.Call(ctx, "containerd.services.containers.v1.Containers", "Create", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontainersClient) Update(ctx context.Context, req *UpdateContainerRequest) (*UpdateContainerResponse, error) { - var resp UpdateContainerResponse - if err := c.client.Call(ctx, "containerd.services.containers.v1.Containers", "Update", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontainersClient) Delete(ctx context.Context, req *DeleteContainerRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.containers.v1.Containers", "Delete", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/containers/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/containers/v1/doc.go deleted file mode 100644 index a6ef491ce5..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/containers/v1/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package containers diff --git a/vendor/github.com/containerd/containerd/api/services/content/v1/content.pb.go b/vendor/github.com/containerd/containerd/api/services/content/v1/content.pb.go deleted file mode 100644 index 2836646628..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/content/v1/content.pb.go +++ /dev/null @@ -1,1788 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/content/v1/content.proto - -package content - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -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) -) - -// WriteAction defines the behavior of a WriteRequest. -type WriteAction int32 - -const ( - // WriteActionStat instructs the writer to return the current status while - // holding the lock on the write. - WriteAction_STAT WriteAction = 0 - // WriteActionWrite sets the action for the write request to write data. - // - // Any data included will be written at the provided offset. The - // transaction will be left open for further writes. - // - // This is the default. - WriteAction_WRITE WriteAction = 1 - // WriteActionCommit will write any outstanding data in the message and - // commit the write, storing it under the digest. - // - // This can be used in a single message to send the data, verify it and - // commit it. - // - // This action will always terminate the write. - WriteAction_COMMIT WriteAction = 2 -) - -// Enum value maps for WriteAction. -var ( - WriteAction_name = map[int32]string{ - 0: "STAT", - 1: "WRITE", - 2: "COMMIT", - } - WriteAction_value = map[string]int32{ - "STAT": 0, - "WRITE": 1, - "COMMIT": 2, - } -) - -func (x WriteAction) Enum() *WriteAction { - p := new(WriteAction) - *p = x - return p -} - -func (x WriteAction) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (WriteAction) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_enumTypes[0].Descriptor() -} - -func (WriteAction) Type() protoreflect.EnumType { - return &file_github_com_containerd_containerd_api_services_content_v1_content_proto_enumTypes[0] -} - -func (x WriteAction) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use WriteAction.Descriptor instead. -func (WriteAction) EnumDescriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{0} -} - -type Info struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Digest is the hash identity of the blob. - Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` - // Size is the total number of bytes in the blob. - Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` - // CreatedAt provides the time at which the blob was committed. - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - // UpdatedAt provides the time the info was last updated. - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - // Labels are arbitrary data on snapshots. - // - // The combined size of a key/value pair cannot exceed 4096 bytes. - Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *Info) Reset() { - *x = Info{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Info) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Info) ProtoMessage() {} - -func (x *Info) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[0] - 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.ProtoReflect.Descriptor instead. -func (*Info) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{0} -} - -func (x *Info) GetDigest() string { - if x != nil { - return x.Digest - } - return "" -} - -func (x *Info) GetSize() int64 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *Info) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *Info) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -func (x *Info) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -type InfoRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` -} - -func (x *InfoRequest) Reset() { - *x = InfoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InfoRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InfoRequest) ProtoMessage() {} - -func (x *InfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[1] - 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 InfoRequest.ProtoReflect.Descriptor instead. -func (*InfoRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{1} -} - -func (x *InfoRequest) GetDigest() string { - if x != nil { - return x.Digest - } - return "" -} - -type InfoResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Info *Info `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` -} - -func (x *InfoResponse) Reset() { - *x = InfoResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InfoResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InfoResponse) ProtoMessage() {} - -func (x *InfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[2] - 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 InfoResponse.ProtoReflect.Descriptor instead. -func (*InfoResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{2} -} - -func (x *InfoResponse) GetInfo() *Info { - if x != nil { - return x.Info - } - return nil -} - -type UpdateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Info *Info `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` - // UpdateMask specifies which fields to perform the update on. If empty, - // the operation applies to all fields. - // - // In info, Digest, Size, and CreatedAt are immutable, - // other field may be updated using this mask. - // If no mask is provided, all mutable field are updated. - UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` -} - -func (x *UpdateRequest) Reset() { - *x = UpdateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateRequest) ProtoMessage() {} - -func (x *UpdateRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[3] - 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 UpdateRequest.ProtoReflect.Descriptor instead. -func (*UpdateRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{3} -} - -func (x *UpdateRequest) GetInfo() *Info { - if x != nil { - return x.Info - } - return nil -} - -func (x *UpdateRequest) GetUpdateMask() *fieldmaskpb.FieldMask { - if x != nil { - return x.UpdateMask - } - return nil -} - -type UpdateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Info *Info `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` -} - -func (x *UpdateResponse) Reset() { - *x = UpdateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateResponse) ProtoMessage() {} - -func (x *UpdateResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[4] - 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 UpdateResponse.ProtoReflect.Descriptor instead. -func (*UpdateResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{4} -} - -func (x *UpdateResponse) GetInfo() *Info { - if x != nil { - return x.Info - } - return nil -} - -type ListContentRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Filters contains one or more filters using the syntax defined in the - // containerd filter package. - // - // The returned result will be those that match any of the provided - // filters. Expanded, containers that match the following will be - // returned: - // - // filters[0] or filters[1] or ... or filters[n-1] or filters[n] - // - // If filters is zero-length or nil, all items will be returned. - Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` -} - -func (x *ListContentRequest) Reset() { - *x = ListContentRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListContentRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListContentRequest) ProtoMessage() {} - -func (x *ListContentRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[5] - 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 ListContentRequest.ProtoReflect.Descriptor instead. -func (*ListContentRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{5} -} - -func (x *ListContentRequest) GetFilters() []string { - if x != nil { - return x.Filters - } - return nil -} - -type ListContentResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Info []*Info `protobuf:"bytes,1,rep,name=info,proto3" json:"info,omitempty"` -} - -func (x *ListContentResponse) Reset() { - *x = ListContentResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListContentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListContentResponse) ProtoMessage() {} - -func (x *ListContentResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[6] - 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 ListContentResponse.ProtoReflect.Descriptor instead. -func (*ListContentResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{6} -} - -func (x *ListContentResponse) GetInfo() []*Info { - if x != nil { - return x.Info - } - return nil -} - -type DeleteContentRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Digest specifies which content to delete. - Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` -} - -func (x *DeleteContentRequest) Reset() { - *x = DeleteContentRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteContentRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteContentRequest) ProtoMessage() {} - -func (x *DeleteContentRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[7] - 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 DeleteContentRequest.ProtoReflect.Descriptor instead. -func (*DeleteContentRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{7} -} - -func (x *DeleteContentRequest) GetDigest() string { - if x != nil { - return x.Digest - } - return "" -} - -// ReadContentRequest defines the fields that make up a request to read a portion of -// data from a stored object. -type ReadContentRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Digest is the hash identity to read. - Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` - // Offset specifies the number of bytes from the start at which to begin - // the read. If zero or less, the read will be from the start. This uses - // standard zero-indexed semantics. - Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` - // size is the total size of the read. If zero, the entire blob will be - // returned by the service. - Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` -} - -func (x *ReadContentRequest) Reset() { - *x = ReadContentRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReadContentRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReadContentRequest) ProtoMessage() {} - -func (x *ReadContentRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[8] - 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 ReadContentRequest.ProtoReflect.Descriptor instead. -func (*ReadContentRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{8} -} - -func (x *ReadContentRequest) GetDigest() string { - if x != nil { - return x.Digest - } - return "" -} - -func (x *ReadContentRequest) GetOffset() int64 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *ReadContentRequest) GetSize() int64 { - if x != nil { - return x.Size - } - return 0 -} - -// ReadContentResponse carries byte data for a read request. -type ReadContentResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` // offset of the returned data - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // actual data -} - -func (x *ReadContentResponse) Reset() { - *x = ReadContentResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReadContentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReadContentResponse) ProtoMessage() {} - -func (x *ReadContentResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[9] - 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 ReadContentResponse.ProtoReflect.Descriptor instead. -func (*ReadContentResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{9} -} - -func (x *ReadContentResponse) GetOffset() int64 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *ReadContentResponse) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -type Status struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - StartedAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - Ref string `protobuf:"bytes,3,opt,name=ref,proto3" json:"ref,omitempty"` - Offset int64 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"` - Total int64 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"` - Expected string `protobuf:"bytes,6,opt,name=expected,proto3" json:"expected,omitempty"` -} - -func (x *Status) Reset() { - *x = Status{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Status) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Status) ProtoMessage() {} - -func (x *Status) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[10] - 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 Status.ProtoReflect.Descriptor instead. -func (*Status) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{10} -} - -func (x *Status) GetStartedAt() *timestamppb.Timestamp { - if x != nil { - return x.StartedAt - } - return nil -} - -func (x *Status) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -func (x *Status) GetRef() string { - if x != nil { - return x.Ref - } - return "" -} - -func (x *Status) GetOffset() int64 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *Status) GetTotal() int64 { - if x != nil { - return x.Total - } - return 0 -} - -func (x *Status) GetExpected() string { - if x != nil { - return x.Expected - } - return "" -} - -type StatusRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Ref string `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"` -} - -func (x *StatusRequest) Reset() { - *x = StatusRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StatusRequest) ProtoMessage() {} - -func (x *StatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[11] - 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 StatusRequest.ProtoReflect.Descriptor instead. -func (*StatusRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{11} -} - -func (x *StatusRequest) GetRef() string { - if x != nil { - return x.Ref - } - return "" -} - -type StatusResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` -} - -func (x *StatusResponse) Reset() { - *x = StatusResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StatusResponse) ProtoMessage() {} - -func (x *StatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[12] - 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 StatusResponse.ProtoReflect.Descriptor instead. -func (*StatusResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{12} -} - -func (x *StatusResponse) GetStatus() *Status { - if x != nil { - return x.Status - } - return nil -} - -type ListStatusesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` -} - -func (x *ListStatusesRequest) Reset() { - *x = ListStatusesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListStatusesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListStatusesRequest) ProtoMessage() {} - -func (x *ListStatusesRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[13] - 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 ListStatusesRequest.ProtoReflect.Descriptor instead. -func (*ListStatusesRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{13} -} - -func (x *ListStatusesRequest) GetFilters() []string { - if x != nil { - return x.Filters - } - return nil -} - -type ListStatusesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Statuses []*Status `protobuf:"bytes,1,rep,name=statuses,proto3" json:"statuses,omitempty"` -} - -func (x *ListStatusesResponse) Reset() { - *x = ListStatusesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListStatusesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListStatusesResponse) ProtoMessage() {} - -func (x *ListStatusesResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[14] - 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 ListStatusesResponse.ProtoReflect.Descriptor instead. -func (*ListStatusesResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{14} -} - -func (x *ListStatusesResponse) GetStatuses() []*Status { - if x != nil { - return x.Statuses - } - return nil -} - -// WriteContentRequest writes data to the request ref at offset. -type WriteContentRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Action sets the behavior of the write. - // - // When this is a write and the ref is not yet allocated, the ref will be - // allocated and the data will be written at offset. - // - // If the action is write and the ref is allocated, it will accept data to - // an offset that has not yet been written. - // - // If the action is write and there is no data, the current write status - // will be returned. This works differently from status because the stream - // holds a lock. - Action WriteAction `protobuf:"varint,1,opt,name=action,proto3,enum=containerd.services.content.v1.WriteAction" json:"action,omitempty"` - // Ref identifies the pre-commit object to write to. - Ref string `protobuf:"bytes,2,opt,name=ref,proto3" json:"ref,omitempty"` - // Total can be set to have the service validate the total size of the - // committed content. - // - // The latest value before or with the commit action message will be use to - // validate the content. If the offset overflows total, the service may - // report an error. It is only required on one message for the write. - // - // If the value is zero or less, no validation of the final content will be - // performed. - Total int64 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"` - // Expected can be set to have the service validate the final content against - // the provided digest. - // - // If the digest is already present in the object store, an AlreadyExists - // error will be returned. - // - // Only the latest version will be used to check the content against the - // digest. It is only required to include it on a single message, before or - // with the commit action message. - Expected string `protobuf:"bytes,4,opt,name=expected,proto3" json:"expected,omitempty"` - // Offset specifies the number of bytes from the start at which to begin - // the write. For most implementations, this means from the start of the - // file. This uses standard, zero-indexed semantics. - // - // If the action is write, the remote may remove all previously written - // data after the offset. Implementations may support arbitrary offsets but - // MUST support reseting this value to zero with a write. If an - // implementation does not support a write at a particular offset, an - // OutOfRange error must be returned. - Offset int64 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // Data is the actual bytes to be written. - // - // If this is empty and the message is not a commit, a response will be - // returned with the current write state. - Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` - // Labels are arbitrary data on snapshots. - // - // The combined size of a key/value pair cannot exceed 4096 bytes. - Labels map[string]string `protobuf:"bytes,7,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *WriteContentRequest) Reset() { - *x = WriteContentRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WriteContentRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WriteContentRequest) ProtoMessage() {} - -func (x *WriteContentRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[15] - 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 WriteContentRequest.ProtoReflect.Descriptor instead. -func (*WriteContentRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{15} -} - -func (x *WriteContentRequest) GetAction() WriteAction { - if x != nil { - return x.Action - } - return WriteAction_STAT -} - -func (x *WriteContentRequest) GetRef() string { - if x != nil { - return x.Ref - } - return "" -} - -func (x *WriteContentRequest) GetTotal() int64 { - if x != nil { - return x.Total - } - return 0 -} - -func (x *WriteContentRequest) GetExpected() string { - if x != nil { - return x.Expected - } - return "" -} - -func (x *WriteContentRequest) GetOffset() int64 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *WriteContentRequest) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *WriteContentRequest) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -// WriteContentResponse is returned on the culmination of a write call. -type WriteContentResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Action contains the action for the final message of the stream. A writer - // should confirm that they match the intended result. - Action WriteAction `protobuf:"varint,1,opt,name=action,proto3,enum=containerd.services.content.v1.WriteAction" json:"action,omitempty"` - // StartedAt provides the time at which the write began. - // - // This must be set for stat and commit write actions. All other write - // actions may omit this. - StartedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` - // UpdatedAt provides the last time of a successful write. - // - // This must be set for stat and commit write actions. All other write - // actions may omit this. - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - // Offset is the current committed size for the write. - Offset int64 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"` - // Total provides the current, expected total size of the write. - // - // We include this to provide consistency with the Status structure on the - // client writer. - // - // This is only valid on the Stat and Commit response. - Total int64 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"` - // Digest, if present, includes the digest up to the currently committed - // bytes. If action is commit, this field will be set. It is implementation - // defined if this is set for other actions. - Digest string `protobuf:"bytes,6,opt,name=digest,proto3" json:"digest,omitempty"` -} - -func (x *WriteContentResponse) Reset() { - *x = WriteContentResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WriteContentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WriteContentResponse) ProtoMessage() {} - -func (x *WriteContentResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[16] - 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 WriteContentResponse.ProtoReflect.Descriptor instead. -func (*WriteContentResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{16} -} - -func (x *WriteContentResponse) GetAction() WriteAction { - if x != nil { - return x.Action - } - return WriteAction_STAT -} - -func (x *WriteContentResponse) GetStartedAt() *timestamppb.Timestamp { - if x != nil { - return x.StartedAt - } - return nil -} - -func (x *WriteContentResponse) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -func (x *WriteContentResponse) GetOffset() int64 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *WriteContentResponse) GetTotal() int64 { - if x != nil { - return x.Total - } - return 0 -} - -func (x *WriteContentResponse) GetDigest() string { - if x != nil { - return x.Digest - } - return "" -} - -type AbortRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Ref string `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"` -} - -func (x *AbortRequest) Reset() { - *x = AbortRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AbortRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AbortRequest) ProtoMessage() {} - -func (x *AbortRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[17] - 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 AbortRequest.ProtoReflect.Descriptor instead. -func (*AbortRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP(), []int{17} -} - -func (x *AbortRequest) GetRef() string { - if x != nil { - return x.Ref - } - return "" -} - -var File_github_com_containerd_containerd_api_services_content_v1_content_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDesc = []byte{ - 0x0a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, - 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, - 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x02, 0x0a, 0x04, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x39, 0x0a, - 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x41, 0x74, 0x12, 0x48, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 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, 0x22, 0x25, 0x0a, 0x0b, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, - 0x48, 0x0a, 0x0c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x38, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x86, 0x01, 0x0a, 0x0d, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x69, - 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, - 0x73, 0x6b, 0x22, 0x4a, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x2e, - 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x4f, - 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, - 0x2e, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, - 0x58, 0x0a, 0x12, 0x52, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, - 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x41, 0x0a, 0x13, 0x52, 0x65, 0x61, - 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xda, 0x01, 0x0a, - 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, - 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x10, 0x0a, - 0x03, 0x72, 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, - 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x1a, 0x0a, - 0x08, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x22, 0x21, 0x0a, 0x0d, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, - 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x22, 0x50, 0x0a, 0x0e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x2f, - 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, - 0x5a, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x22, 0xde, 0x02, 0x0a, 0x13, - 0x57, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x57, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x22, 0x97, 0x02, 0x0a, - 0x14, 0x57, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x16, - 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x20, 0x0a, 0x0c, 0x41, 0x62, 0x6f, 0x72, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x2a, 0x2e, 0x0a, 0x0b, 0x57, 0x72, 0x69, 0x74, - 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x54, 0x41, 0x54, 0x10, - 0x00, 0x12, 0x09, 0x0a, 0x05, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, - 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x10, 0x02, 0x32, 0xbe, 0x07, 0x0a, 0x07, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x12, 0x61, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2b, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, - 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, - 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x71, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x30, 0x01, 0x12, 0x56, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x34, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x71, 0x0a, 0x04, 0x52, - 0x65, 0x61, 0x64, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x67, - 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x79, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x76, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x33, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, - 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x76, - 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x4d, 0x0a, 0x05, 0x41, 0x62, - 0x6f, 0x72, 0x74, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x62, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x42, 0x5a, 0x40, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescData = file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_services_content_v1_content_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes = make([]protoimpl.MessageInfo, 20) -var file_github_com_containerd_containerd_api_services_content_v1_content_proto_goTypes = []interface{}{ - (WriteAction)(0), // 0: containerd.services.content.v1.WriteAction - (*Info)(nil), // 1: containerd.services.content.v1.Info - (*InfoRequest)(nil), // 2: containerd.services.content.v1.InfoRequest - (*InfoResponse)(nil), // 3: containerd.services.content.v1.InfoResponse - (*UpdateRequest)(nil), // 4: containerd.services.content.v1.UpdateRequest - (*UpdateResponse)(nil), // 5: containerd.services.content.v1.UpdateResponse - (*ListContentRequest)(nil), // 6: containerd.services.content.v1.ListContentRequest - (*ListContentResponse)(nil), // 7: containerd.services.content.v1.ListContentResponse - (*DeleteContentRequest)(nil), // 8: containerd.services.content.v1.DeleteContentRequest - (*ReadContentRequest)(nil), // 9: containerd.services.content.v1.ReadContentRequest - (*ReadContentResponse)(nil), // 10: containerd.services.content.v1.ReadContentResponse - (*Status)(nil), // 11: containerd.services.content.v1.Status - (*StatusRequest)(nil), // 12: containerd.services.content.v1.StatusRequest - (*StatusResponse)(nil), // 13: containerd.services.content.v1.StatusResponse - (*ListStatusesRequest)(nil), // 14: containerd.services.content.v1.ListStatusesRequest - (*ListStatusesResponse)(nil), // 15: containerd.services.content.v1.ListStatusesResponse - (*WriteContentRequest)(nil), // 16: containerd.services.content.v1.WriteContentRequest - (*WriteContentResponse)(nil), // 17: containerd.services.content.v1.WriteContentResponse - (*AbortRequest)(nil), // 18: containerd.services.content.v1.AbortRequest - nil, // 19: containerd.services.content.v1.Info.LabelsEntry - nil, // 20: containerd.services.content.v1.WriteContentRequest.LabelsEntry - (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp - (*fieldmaskpb.FieldMask)(nil), // 22: google.protobuf.FieldMask - (*emptypb.Empty)(nil), // 23: google.protobuf.Empty -} -var file_github_com_containerd_containerd_api_services_content_v1_content_proto_depIdxs = []int32{ - 21, // 0: containerd.services.content.v1.Info.created_at:type_name -> google.protobuf.Timestamp - 21, // 1: containerd.services.content.v1.Info.updated_at:type_name -> google.protobuf.Timestamp - 19, // 2: containerd.services.content.v1.Info.labels:type_name -> containerd.services.content.v1.Info.LabelsEntry - 1, // 3: containerd.services.content.v1.InfoResponse.info:type_name -> containerd.services.content.v1.Info - 1, // 4: containerd.services.content.v1.UpdateRequest.info:type_name -> containerd.services.content.v1.Info - 22, // 5: containerd.services.content.v1.UpdateRequest.update_mask:type_name -> google.protobuf.FieldMask - 1, // 6: containerd.services.content.v1.UpdateResponse.info:type_name -> containerd.services.content.v1.Info - 1, // 7: containerd.services.content.v1.ListContentResponse.info:type_name -> containerd.services.content.v1.Info - 21, // 8: containerd.services.content.v1.Status.started_at:type_name -> google.protobuf.Timestamp - 21, // 9: containerd.services.content.v1.Status.updated_at:type_name -> google.protobuf.Timestamp - 11, // 10: containerd.services.content.v1.StatusResponse.status:type_name -> containerd.services.content.v1.Status - 11, // 11: containerd.services.content.v1.ListStatusesResponse.statuses:type_name -> containerd.services.content.v1.Status - 0, // 12: containerd.services.content.v1.WriteContentRequest.action:type_name -> containerd.services.content.v1.WriteAction - 20, // 13: containerd.services.content.v1.WriteContentRequest.labels:type_name -> containerd.services.content.v1.WriteContentRequest.LabelsEntry - 0, // 14: containerd.services.content.v1.WriteContentResponse.action:type_name -> containerd.services.content.v1.WriteAction - 21, // 15: containerd.services.content.v1.WriteContentResponse.started_at:type_name -> google.protobuf.Timestamp - 21, // 16: containerd.services.content.v1.WriteContentResponse.updated_at:type_name -> google.protobuf.Timestamp - 2, // 17: containerd.services.content.v1.Content.Info:input_type -> containerd.services.content.v1.InfoRequest - 4, // 18: containerd.services.content.v1.Content.Update:input_type -> containerd.services.content.v1.UpdateRequest - 6, // 19: containerd.services.content.v1.Content.List:input_type -> containerd.services.content.v1.ListContentRequest - 8, // 20: containerd.services.content.v1.Content.Delete:input_type -> containerd.services.content.v1.DeleteContentRequest - 9, // 21: containerd.services.content.v1.Content.Read:input_type -> containerd.services.content.v1.ReadContentRequest - 12, // 22: containerd.services.content.v1.Content.Status:input_type -> containerd.services.content.v1.StatusRequest - 14, // 23: containerd.services.content.v1.Content.ListStatuses:input_type -> containerd.services.content.v1.ListStatusesRequest - 16, // 24: containerd.services.content.v1.Content.Write:input_type -> containerd.services.content.v1.WriteContentRequest - 18, // 25: containerd.services.content.v1.Content.Abort:input_type -> containerd.services.content.v1.AbortRequest - 3, // 26: containerd.services.content.v1.Content.Info:output_type -> containerd.services.content.v1.InfoResponse - 5, // 27: containerd.services.content.v1.Content.Update:output_type -> containerd.services.content.v1.UpdateResponse - 7, // 28: containerd.services.content.v1.Content.List:output_type -> containerd.services.content.v1.ListContentResponse - 23, // 29: containerd.services.content.v1.Content.Delete:output_type -> google.protobuf.Empty - 10, // 30: containerd.services.content.v1.Content.Read:output_type -> containerd.services.content.v1.ReadContentResponse - 13, // 31: containerd.services.content.v1.Content.Status:output_type -> containerd.services.content.v1.StatusResponse - 15, // 32: containerd.services.content.v1.Content.ListStatuses:output_type -> containerd.services.content.v1.ListStatusesResponse - 17, // 33: containerd.services.content.v1.Content.Write:output_type -> containerd.services.content.v1.WriteContentResponse - 23, // 34: containerd.services.content.v1.Content.Abort:output_type -> google.protobuf.Empty - 26, // [26:35] is the sub-list for method output_type - 17, // [17:26] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_services_content_v1_content_proto_init() } -func file_github_com_containerd_containerd_api_services_content_v1_content_proto_init() { - if File_github_com_containerd_containerd_api_services_content_v1_content_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InfoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InfoResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListContentRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListContentResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteContentRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadContentRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadContentResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Status); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatusRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatusResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListStatusesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListStatusesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WriteContentRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WriteContentResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AbortRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDesc, - NumEnums: 1, - NumMessages: 20, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_containerd_containerd_api_services_content_v1_content_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_services_content_v1_content_proto_depIdxs, - EnumInfos: file_github_com_containerd_containerd_api_services_content_v1_content_proto_enumTypes, - MessageInfos: file_github_com_containerd_containerd_api_services_content_v1_content_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_services_content_v1_content_proto = out.File - file_github_com_containerd_containerd_api_services_content_v1_content_proto_rawDesc = nil - file_github_com_containerd_containerd_api_services_content_v1_content_proto_goTypes = nil - file_github_com_containerd_containerd_api_services_content_v1_content_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/content/v1/content.proto b/vendor/github.com/containerd/containerd/api/services/content/v1/content.proto deleted file mode 100644 index 8aea0636b8..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/content/v1/content.proto +++ /dev/null @@ -1,330 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.services.content.v1; - -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/empty.proto"; - -option go_package = "github.com/containerd/containerd/api/services/content/v1;content"; - -// Content provides access to a content addressable storage system. -service Content { - // Info returns information about a committed object. - // - // This call can be used for getting the size of content and checking for - // existence. - rpc Info(InfoRequest) returns (InfoResponse); - - // Update updates content metadata. - // - // This call can be used to manage the mutable content labels. The - // immutable metadata such as digest, size, and committed at cannot - // be updated. - rpc Update(UpdateRequest) returns (UpdateResponse); - - // List streams the entire set of content as Info objects and closes the - // stream. - // - // Typically, this will yield a large response, chunked into messages. - // Clients should make provisions to ensure they can handle the entire data - // set. - rpc List(ListContentRequest) returns (stream ListContentResponse); - - // Delete will delete the referenced object. - rpc Delete(DeleteContentRequest) returns (google.protobuf.Empty); - - // Read allows one to read an object based on the offset into the content. - // - // The requested data may be returned in one or more messages. - rpc Read(ReadContentRequest) returns (stream ReadContentResponse); - - // Status returns the status for a single reference. - rpc Status(StatusRequest) returns (StatusResponse); - - // ListStatuses returns the status of ongoing object ingestions, started via - // Write. - // - // Only those matching the regular expression will be provided in the - // response. If the provided regular expression is empty, all ingestions - // will be provided. - rpc ListStatuses(ListStatusesRequest) returns (ListStatusesResponse); - - // Write begins or resumes writes to a resource identified by a unique ref. - // Only one active stream may exist at a time for each ref. - // - // Once a write stream has started, it may only write to a single ref, thus - // once a stream is started, the ref may be omitted on subsequent writes. - // - // For any write transaction represented by a ref, only a single write may - // be made to a given offset. If overlapping writes occur, it is an error. - // Writes should be sequential and implementations may throw an error if - // this is required. - // - // If expected_digest is set and already part of the content store, the - // write will fail. - // - // When completed, the commit flag should be set to true. If expected size - // or digest is set, the content will be validated against those values. - rpc Write(stream WriteContentRequest) returns (stream WriteContentResponse); - - // Abort cancels the ongoing write named in the request. Any resources - // associated with the write will be collected. - rpc Abort(AbortRequest) returns (google.protobuf.Empty); -} - -message Info { - // Digest is the hash identity of the blob. - string digest = 1; - - // Size is the total number of bytes in the blob. - int64 size = 2; - - // CreatedAt provides the time at which the blob was committed. - google.protobuf.Timestamp created_at = 3; - - // UpdatedAt provides the time the info was last updated. - google.protobuf.Timestamp updated_at = 4; - - // Labels are arbitrary data on snapshots. - // - // The combined size of a key/value pair cannot exceed 4096 bytes. - map labels = 5; -} - -message InfoRequest { - string digest = 1; -} - -message InfoResponse { - Info info = 1; -} - -message UpdateRequest { - Info info = 1; - - // UpdateMask specifies which fields to perform the update on. If empty, - // the operation applies to all fields. - // - // In info, Digest, Size, and CreatedAt are immutable, - // other field may be updated using this mask. - // If no mask is provided, all mutable field are updated. - google.protobuf.FieldMask update_mask = 2; -} - -message UpdateResponse { - Info info = 1; -} - -message ListContentRequest { - // Filters contains one or more filters using the syntax defined in the - // containerd filter package. - // - // The returned result will be those that match any of the provided - // filters. Expanded, containers that match the following will be - // returned: - // - // filters[0] or filters[1] or ... or filters[n-1] or filters[n] - // - // If filters is zero-length or nil, all items will be returned. - repeated string filters = 1; -} - -message ListContentResponse { - repeated Info info = 1; -} - -message DeleteContentRequest { - // Digest specifies which content to delete. - string digest = 1; -} - -// ReadContentRequest defines the fields that make up a request to read a portion of -// data from a stored object. -message ReadContentRequest { - // Digest is the hash identity to read. - string digest = 1; - - // Offset specifies the number of bytes from the start at which to begin - // the read. If zero or less, the read will be from the start. This uses - // standard zero-indexed semantics. - int64 offset = 2; - - // size is the total size of the read. If zero, the entire blob will be - // returned by the service. - int64 size = 3; -} - -// ReadContentResponse carries byte data for a read request. -message ReadContentResponse { - int64 offset = 1; // offset of the returned data - bytes data = 2; // actual data -} - -message Status { - google.protobuf.Timestamp started_at = 1; - google.protobuf.Timestamp updated_at = 2; - string ref = 3; - int64 offset = 4; - int64 total = 5; - string expected = 6; -} - - -message StatusRequest { - string ref = 1; -} - -message StatusResponse { - Status status = 1; -} - -message ListStatusesRequest { - repeated string filters = 1; -} - -message ListStatusesResponse { - repeated Status statuses = 1; -} - -// WriteAction defines the behavior of a WriteRequest. -enum WriteAction { - // WriteActionStat instructs the writer to return the current status while - // holding the lock on the write. - STAT = 0; - - // WriteActionWrite sets the action for the write request to write data. - // - // Any data included will be written at the provided offset. The - // transaction will be left open for further writes. - // - // This is the default. - WRITE = 1; - - // WriteActionCommit will write any outstanding data in the message and - // commit the write, storing it under the digest. - // - // This can be used in a single message to send the data, verify it and - // commit it. - // - // This action will always terminate the write. - COMMIT = 2; -} - -// WriteContentRequest writes data to the request ref at offset. -message WriteContentRequest { - // Action sets the behavior of the write. - // - // When this is a write and the ref is not yet allocated, the ref will be - // allocated and the data will be written at offset. - // - // If the action is write and the ref is allocated, it will accept data to - // an offset that has not yet been written. - // - // If the action is write and there is no data, the current write status - // will be returned. This works differently from status because the stream - // holds a lock. - WriteAction action = 1; - - // Ref identifies the pre-commit object to write to. - string ref = 2; - - // Total can be set to have the service validate the total size of the - // committed content. - // - // The latest value before or with the commit action message will be use to - // validate the content. If the offset overflows total, the service may - // report an error. It is only required on one message for the write. - // - // If the value is zero or less, no validation of the final content will be - // performed. - int64 total = 3; - - // Expected can be set to have the service validate the final content against - // the provided digest. - // - // If the digest is already present in the object store, an AlreadyExists - // error will be returned. - // - // Only the latest version will be used to check the content against the - // digest. It is only required to include it on a single message, before or - // with the commit action message. - string expected = 4; - - // Offset specifies the number of bytes from the start at which to begin - // the write. For most implementations, this means from the start of the - // file. This uses standard, zero-indexed semantics. - // - // If the action is write, the remote may remove all previously written - // data after the offset. Implementations may support arbitrary offsets but - // MUST support reseting this value to zero with a write. If an - // implementation does not support a write at a particular offset, an - // OutOfRange error must be returned. - int64 offset = 5; - - // Data is the actual bytes to be written. - // - // If this is empty and the message is not a commit, a response will be - // returned with the current write state. - bytes data = 6; - - // Labels are arbitrary data on snapshots. - // - // The combined size of a key/value pair cannot exceed 4096 bytes. - map labels = 7; -} - -// WriteContentResponse is returned on the culmination of a write call. -message WriteContentResponse { - // Action contains the action for the final message of the stream. A writer - // should confirm that they match the intended result. - WriteAction action = 1; - - // StartedAt provides the time at which the write began. - // - // This must be set for stat and commit write actions. All other write - // actions may omit this. - google.protobuf.Timestamp started_at = 2; - - // UpdatedAt provides the last time of a successful write. - // - // This must be set for stat and commit write actions. All other write - // actions may omit this. - google.protobuf.Timestamp updated_at = 3; - - // Offset is the current committed size for the write. - int64 offset = 4; - - // Total provides the current, expected total size of the write. - // - // We include this to provide consistency with the Status structure on the - // client writer. - // - // This is only valid on the Stat and Commit response. - int64 total = 5; - - // Digest, if present, includes the digest up to the currently committed - // bytes. If action is commit, this field will be set. It is implementation - // defined if this is set for other actions. - string digest = 6; -} - -message AbortRequest { - string ref = 1; -} diff --git a/vendor/github.com/containerd/containerd/api/services/content/v1/content_grpc.pb.go b/vendor/github.com/containerd/containerd/api/services/content/v1/content_grpc.pb.go deleted file mode 100644 index 68efff90e1..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/content/v1/content_grpc.pb.go +++ /dev/null @@ -1,571 +0,0 @@ -//go:build !no_grpc - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/content/v1/content.proto - -package content - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// ContentClient is the client API for Content service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type ContentClient interface { - // Info returns information about a committed object. - // - // This call can be used for getting the size of content and checking for - // existence. - Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) - // Update updates content metadata. - // - // This call can be used to manage the mutable content labels. The - // immutable metadata such as digest, size, and committed at cannot - // be updated. - Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) - // List streams the entire set of content as Info objects and closes the - // stream. - // - // Typically, this will yield a large response, chunked into messages. - // Clients should make provisions to ensure they can handle the entire data - // set. - List(ctx context.Context, in *ListContentRequest, opts ...grpc.CallOption) (Content_ListClient, error) - // Delete will delete the referenced object. - Delete(ctx context.Context, in *DeleteContentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Read allows one to read an object based on the offset into the content. - // - // The requested data may be returned in one or more messages. - Read(ctx context.Context, in *ReadContentRequest, opts ...grpc.CallOption) (Content_ReadClient, error) - // Status returns the status for a single reference. - Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) - // ListStatuses returns the status of ongoing object ingestions, started via - // Write. - // - // Only those matching the regular expression will be provided in the - // response. If the provided regular expression is empty, all ingestions - // will be provided. - ListStatuses(ctx context.Context, in *ListStatusesRequest, opts ...grpc.CallOption) (*ListStatusesResponse, error) - // Write begins or resumes writes to a resource identified by a unique ref. - // Only one active stream may exist at a time for each ref. - // - // Once a write stream has started, it may only write to a single ref, thus - // once a stream is started, the ref may be omitted on subsequent writes. - // - // For any write transaction represented by a ref, only a single write may - // be made to a given offset. If overlapping writes occur, it is an error. - // Writes should be sequential and implementations may throw an error if - // this is required. - // - // If expected_digest is set and already part of the content store, the - // write will fail. - // - // When completed, the commit flag should be set to true. If expected size - // or digest is set, the content will be validated against those values. - Write(ctx context.Context, opts ...grpc.CallOption) (Content_WriteClient, error) - // Abort cancels the ongoing write named in the request. Any resources - // associated with the write will be collected. - Abort(ctx context.Context, in *AbortRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type contentClient struct { - cc grpc.ClientConnInterface -} - -func NewContentClient(cc grpc.ClientConnInterface) ContentClient { - return &contentClient{cc} -} - -func (c *contentClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) { - out := new(InfoResponse) - err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/Info", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *contentClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) { - out := new(UpdateResponse) - err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/Update", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *contentClient) List(ctx context.Context, in *ListContentRequest, opts ...grpc.CallOption) (Content_ListClient, error) { - stream, err := c.cc.NewStream(ctx, &Content_ServiceDesc.Streams[0], "/containerd.services.content.v1.Content/List", opts...) - if err != nil { - return nil, err - } - x := &contentListClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Content_ListClient interface { - Recv() (*ListContentResponse, error) - grpc.ClientStream -} - -type contentListClient struct { - grpc.ClientStream -} - -func (x *contentListClient) Recv() (*ListContentResponse, error) { - m := new(ListContentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *contentClient) Delete(ctx context.Context, in *DeleteContentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/Delete", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *contentClient) Read(ctx context.Context, in *ReadContentRequest, opts ...grpc.CallOption) (Content_ReadClient, error) { - stream, err := c.cc.NewStream(ctx, &Content_ServiceDesc.Streams[1], "/containerd.services.content.v1.Content/Read", opts...) - if err != nil { - return nil, err - } - x := &contentReadClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Content_ReadClient interface { - Recv() (*ReadContentResponse, error) - grpc.ClientStream -} - -type contentReadClient struct { - grpc.ClientStream -} - -func (x *contentReadClient) Recv() (*ReadContentResponse, error) { - m := new(ReadContentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *contentClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { - out := new(StatusResponse) - err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/Status", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *contentClient) ListStatuses(ctx context.Context, in *ListStatusesRequest, opts ...grpc.CallOption) (*ListStatusesResponse, error) { - out := new(ListStatusesResponse) - err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/ListStatuses", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *contentClient) Write(ctx context.Context, opts ...grpc.CallOption) (Content_WriteClient, error) { - stream, err := c.cc.NewStream(ctx, &Content_ServiceDesc.Streams[2], "/containerd.services.content.v1.Content/Write", opts...) - if err != nil { - return nil, err - } - x := &contentWriteClient{stream} - return x, nil -} - -type Content_WriteClient interface { - Send(*WriteContentRequest) error - Recv() (*WriteContentResponse, error) - grpc.ClientStream -} - -type contentWriteClient struct { - grpc.ClientStream -} - -func (x *contentWriteClient) Send(m *WriteContentRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *contentWriteClient) Recv() (*WriteContentResponse, error) { - m := new(WriteContentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *contentClient) Abort(ctx context.Context, in *AbortRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/Abort", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ContentServer is the server API for Content service. -// All implementations must embed UnimplementedContentServer -// for forward compatibility -type ContentServer interface { - // Info returns information about a committed object. - // - // This call can be used for getting the size of content and checking for - // existence. - Info(context.Context, *InfoRequest) (*InfoResponse, error) - // Update updates content metadata. - // - // This call can be used to manage the mutable content labels. The - // immutable metadata such as digest, size, and committed at cannot - // be updated. - Update(context.Context, *UpdateRequest) (*UpdateResponse, error) - // List streams the entire set of content as Info objects and closes the - // stream. - // - // Typically, this will yield a large response, chunked into messages. - // Clients should make provisions to ensure they can handle the entire data - // set. - List(*ListContentRequest, Content_ListServer) error - // Delete will delete the referenced object. - Delete(context.Context, *DeleteContentRequest) (*emptypb.Empty, error) - // Read allows one to read an object based on the offset into the content. - // - // The requested data may be returned in one or more messages. - Read(*ReadContentRequest, Content_ReadServer) error - // Status returns the status for a single reference. - Status(context.Context, *StatusRequest) (*StatusResponse, error) - // ListStatuses returns the status of ongoing object ingestions, started via - // Write. - // - // Only those matching the regular expression will be provided in the - // response. If the provided regular expression is empty, all ingestions - // will be provided. - ListStatuses(context.Context, *ListStatusesRequest) (*ListStatusesResponse, error) - // Write begins or resumes writes to a resource identified by a unique ref. - // Only one active stream may exist at a time for each ref. - // - // Once a write stream has started, it may only write to a single ref, thus - // once a stream is started, the ref may be omitted on subsequent writes. - // - // For any write transaction represented by a ref, only a single write may - // be made to a given offset. If overlapping writes occur, it is an error. - // Writes should be sequential and implementations may throw an error if - // this is required. - // - // If expected_digest is set and already part of the content store, the - // write will fail. - // - // When completed, the commit flag should be set to true. If expected size - // or digest is set, the content will be validated against those values. - Write(Content_WriteServer) error - // Abort cancels the ongoing write named in the request. Any resources - // associated with the write will be collected. - Abort(context.Context, *AbortRequest) (*emptypb.Empty, error) - mustEmbedUnimplementedContentServer() -} - -// UnimplementedContentServer must be embedded to have forward compatible implementations. -type UnimplementedContentServer struct { -} - -func (UnimplementedContentServer) Info(context.Context, *InfoRequest) (*InfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") -} -func (UnimplementedContentServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") -} -func (UnimplementedContentServer) List(*ListContentRequest, Content_ListServer) error { - return status.Errorf(codes.Unimplemented, "method List not implemented") -} -func (UnimplementedContentServer) Delete(context.Context, *DeleteContentRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") -} -func (UnimplementedContentServer) Read(*ReadContentRequest, Content_ReadServer) error { - return status.Errorf(codes.Unimplemented, "method Read not implemented") -} -func (UnimplementedContentServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") -} -func (UnimplementedContentServer) ListStatuses(context.Context, *ListStatusesRequest) (*ListStatusesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListStatuses not implemented") -} -func (UnimplementedContentServer) Write(Content_WriteServer) error { - return status.Errorf(codes.Unimplemented, "method Write not implemented") -} -func (UnimplementedContentServer) Abort(context.Context, *AbortRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Abort not implemented") -} -func (UnimplementedContentServer) mustEmbedUnimplementedContentServer() {} - -// UnsafeContentServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ContentServer will -// result in compilation errors. -type UnsafeContentServer interface { - mustEmbedUnimplementedContentServer() -} - -func RegisterContentServer(s grpc.ServiceRegistrar, srv ContentServer) { - s.RegisterService(&Content_ServiceDesc, srv) -} - -func _Content_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContentServer).Info(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.content.v1.Content/Info", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContentServer).Info(ctx, req.(*InfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Content_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContentServer).Update(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.content.v1.Content/Update", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContentServer).Update(ctx, req.(*UpdateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Content_List_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ListContentRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(ContentServer).List(m, &contentListServer{stream}) -} - -type Content_ListServer interface { - Send(*ListContentResponse) error - grpc.ServerStream -} - -type contentListServer struct { - grpc.ServerStream -} - -func (x *contentListServer) Send(m *ListContentResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Content_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteContentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContentServer).Delete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.content.v1.Content/Delete", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContentServer).Delete(ctx, req.(*DeleteContentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Content_Read_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ReadContentRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(ContentServer).Read(m, &contentReadServer{stream}) -} - -type Content_ReadServer interface { - Send(*ReadContentResponse) error - grpc.ServerStream -} - -type contentReadServer struct { - grpc.ServerStream -} - -func (x *contentReadServer) Send(m *ReadContentResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Content_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContentServer).Status(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.content.v1.Content/Status", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContentServer).Status(ctx, req.(*StatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Content_ListStatuses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListStatusesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContentServer).ListStatuses(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.content.v1.Content/ListStatuses", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContentServer).ListStatuses(ctx, req.(*ListStatusesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Content_Write_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ContentServer).Write(&contentWriteServer{stream}) -} - -type Content_WriteServer interface { - Send(*WriteContentResponse) error - Recv() (*WriteContentRequest, error) - grpc.ServerStream -} - -type contentWriteServer struct { - grpc.ServerStream -} - -func (x *contentWriteServer) Send(m *WriteContentResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *contentWriteServer) Recv() (*WriteContentRequest, error) { - m := new(WriteContentRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Content_Abort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AbortRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContentServer).Abort(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.content.v1.Content/Abort", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContentServer).Abort(ctx, req.(*AbortRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Content_ServiceDesc is the grpc.ServiceDesc for Content service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Content_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.services.content.v1.Content", - HandlerType: (*ContentServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Info", - Handler: _Content_Info_Handler, - }, - { - MethodName: "Update", - Handler: _Content_Update_Handler, - }, - { - MethodName: "Delete", - Handler: _Content_Delete_Handler, - }, - { - MethodName: "Status", - Handler: _Content_Status_Handler, - }, - { - MethodName: "ListStatuses", - Handler: _Content_ListStatuses_Handler, - }, - { - MethodName: "Abort", - Handler: _Content_Abort_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "List", - Handler: _Content_List_Handler, - ServerStreams: true, - }, - { - StreamName: "Read", - Handler: _Content_Read_Handler, - ServerStreams: true, - }, - { - StreamName: "Write", - Handler: _Content_Write_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "github.com/containerd/containerd/api/services/content/v1/content.proto", -} diff --git a/vendor/github.com/containerd/containerd/api/services/content/v1/content_ttrpc.pb.go b/vendor/github.com/containerd/containerd/api/services/content/v1/content_ttrpc.pb.go deleted file mode 100644 index efa241a2b2..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/content/v1/content_ttrpc.pb.go +++ /dev/null @@ -1,311 +0,0 @@ -// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/containerd/api/services/content/v1/content.proto -package content - -import ( - context "context" - ttrpc "github.com/containerd/ttrpc" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -type TTRPCContentService interface { - Info(context.Context, *InfoRequest) (*InfoResponse, error) - Update(context.Context, *UpdateRequest) (*UpdateResponse, error) - List(context.Context, *ListContentRequest, TTRPCContent_ListServer) error - Delete(context.Context, *DeleteContentRequest) (*emptypb.Empty, error) - Read(context.Context, *ReadContentRequest, TTRPCContent_ReadServer) error - Status(context.Context, *StatusRequest) (*StatusResponse, error) - ListStatuses(context.Context, *ListStatusesRequest) (*ListStatusesResponse, error) - Write(context.Context, TTRPCContent_WriteServer) error - Abort(context.Context, *AbortRequest) (*emptypb.Empty, error) -} - -type TTRPCContent_ListServer interface { - Send(*ListContentResponse) error - ttrpc.StreamServer -} - -type ttrpccontentListServer struct { - ttrpc.StreamServer -} - -func (x *ttrpccontentListServer) Send(m *ListContentResponse) error { - return x.StreamServer.SendMsg(m) -} - -type TTRPCContent_ReadServer interface { - Send(*ReadContentResponse) error - ttrpc.StreamServer -} - -type ttrpccontentReadServer struct { - ttrpc.StreamServer -} - -func (x *ttrpccontentReadServer) Send(m *ReadContentResponse) error { - return x.StreamServer.SendMsg(m) -} - -type TTRPCContent_WriteServer interface { - Send(*WriteContentResponse) error - Recv() (*WriteContentRequest, error) - ttrpc.StreamServer -} - -type ttrpccontentWriteServer struct { - ttrpc.StreamServer -} - -func (x *ttrpccontentWriteServer) Send(m *WriteContentResponse) error { - return x.StreamServer.SendMsg(m) -} - -func (x *ttrpccontentWriteServer) Recv() (*WriteContentRequest, error) { - m := new(WriteContentRequest) - if err := x.StreamServer.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func RegisterTTRPCContentService(srv *ttrpc.Server, svc TTRPCContentService) { - srv.RegisterService("containerd.services.content.v1.Content", &ttrpc.ServiceDesc{ - Methods: map[string]ttrpc.Method{ - "Info": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req InfoRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Info(ctx, &req) - }, - "Update": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req UpdateRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Update(ctx, &req) - }, - "Delete": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req DeleteContentRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Delete(ctx, &req) - }, - "Status": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req StatusRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Status(ctx, &req) - }, - "ListStatuses": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ListStatusesRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.ListStatuses(ctx, &req) - }, - "Abort": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req AbortRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Abort(ctx, &req) - }, - }, - Streams: map[string]ttrpc.Stream{ - "List": { - Handler: func(ctx context.Context, stream ttrpc.StreamServer) (interface{}, error) { - m := new(ListContentRequest) - if err := stream.RecvMsg(m); err != nil { - return nil, err - } - return nil, svc.List(ctx, m, &ttrpccontentListServer{stream}) - }, - StreamingClient: false, - StreamingServer: true, - }, - "Read": { - Handler: func(ctx context.Context, stream ttrpc.StreamServer) (interface{}, error) { - m := new(ReadContentRequest) - if err := stream.RecvMsg(m); err != nil { - return nil, err - } - return nil, svc.Read(ctx, m, &ttrpccontentReadServer{stream}) - }, - StreamingClient: false, - StreamingServer: true, - }, - "Write": { - Handler: func(ctx context.Context, stream ttrpc.StreamServer) (interface{}, error) { - return nil, svc.Write(ctx, &ttrpccontentWriteServer{stream}) - }, - StreamingClient: true, - StreamingServer: true, - }, - }, - }) -} - -type TTRPCContentClient interface { - Info(context.Context, *InfoRequest) (*InfoResponse, error) - Update(context.Context, *UpdateRequest) (*UpdateResponse, error) - List(context.Context, *ListContentRequest) (TTRPCContent_ListClient, error) - Delete(context.Context, *DeleteContentRequest) (*emptypb.Empty, error) - Read(context.Context, *ReadContentRequest) (TTRPCContent_ReadClient, error) - Status(context.Context, *StatusRequest) (*StatusResponse, error) - ListStatuses(context.Context, *ListStatusesRequest) (*ListStatusesResponse, error) - Write(context.Context) (TTRPCContent_WriteClient, error) - Abort(context.Context, *AbortRequest) (*emptypb.Empty, error) -} - -type ttrpccontentClient struct { - client *ttrpc.Client -} - -func NewTTRPCContentClient(client *ttrpc.Client) TTRPCContentClient { - return &ttrpccontentClient{ - client: client, - } -} - -func (c *ttrpccontentClient) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error) { - var resp InfoResponse - if err := c.client.Call(ctx, "containerd.services.content.v1.Content", "Info", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontentClient) Update(ctx context.Context, req *UpdateRequest) (*UpdateResponse, error) { - var resp UpdateResponse - if err := c.client.Call(ctx, "containerd.services.content.v1.Content", "Update", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontentClient) List(ctx context.Context, req *ListContentRequest) (TTRPCContent_ListClient, error) { - stream, err := c.client.NewStream(ctx, &ttrpc.StreamDesc{ - StreamingClient: false, - StreamingServer: true, - }, "containerd.services.content.v1.Content", "List", req) - if err != nil { - return nil, err - } - x := &ttrpccontentListClient{stream} - return x, nil -} - -type TTRPCContent_ListClient interface { - Recv() (*ListContentResponse, error) - ttrpc.ClientStream -} - -type ttrpccontentListClient struct { - ttrpc.ClientStream -} - -func (x *ttrpccontentListClient) Recv() (*ListContentResponse, error) { - m := new(ListContentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *ttrpccontentClient) Delete(ctx context.Context, req *DeleteContentRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.content.v1.Content", "Delete", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontentClient) Read(ctx context.Context, req *ReadContentRequest) (TTRPCContent_ReadClient, error) { - stream, err := c.client.NewStream(ctx, &ttrpc.StreamDesc{ - StreamingClient: false, - StreamingServer: true, - }, "containerd.services.content.v1.Content", "Read", req) - if err != nil { - return nil, err - } - x := &ttrpccontentReadClient{stream} - return x, nil -} - -type TTRPCContent_ReadClient interface { - Recv() (*ReadContentResponse, error) - ttrpc.ClientStream -} - -type ttrpccontentReadClient struct { - ttrpc.ClientStream -} - -func (x *ttrpccontentReadClient) Recv() (*ReadContentResponse, error) { - m := new(ReadContentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *ttrpccontentClient) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) { - var resp StatusResponse - if err := c.client.Call(ctx, "containerd.services.content.v1.Content", "Status", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontentClient) ListStatuses(ctx context.Context, req *ListStatusesRequest) (*ListStatusesResponse, error) { - var resp ListStatusesResponse - if err := c.client.Call(ctx, "containerd.services.content.v1.Content", "ListStatuses", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontentClient) Write(ctx context.Context) (TTRPCContent_WriteClient, error) { - stream, err := c.client.NewStream(ctx, &ttrpc.StreamDesc{ - StreamingClient: true, - StreamingServer: true, - }, "containerd.services.content.v1.Content", "Write", nil) - if err != nil { - return nil, err - } - x := &ttrpccontentWriteClient{stream} - return x, nil -} - -type TTRPCContent_WriteClient interface { - Send(*WriteContentRequest) error - Recv() (*WriteContentResponse, error) - ttrpc.ClientStream -} - -type ttrpccontentWriteClient struct { - ttrpc.ClientStream -} - -func (x *ttrpccontentWriteClient) Send(m *WriteContentRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *ttrpccontentWriteClient) Recv() (*WriteContentResponse, error) { - m := new(WriteContentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *ttrpccontentClient) Abort(ctx context.Context, req *AbortRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.content.v1.Content", "Abort", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/content/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/content/v1/doc.go deleted file mode 100644 index 3bf106c89b..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/content/v1/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package content diff --git a/vendor/github.com/containerd/containerd/api/services/diff/v1/diff.pb.go b/vendor/github.com/containerd/containerd/api/services/diff/v1/diff.pb.go deleted file mode 100644 index 1c8db0b021..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/diff/v1/diff.pb.go +++ /dev/null @@ -1,524 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/diff/v1/diff.proto - -package diff - -import ( - types "github.com/containerd/containerd/api/types" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -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) -) - -type ApplyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Diff is the descriptor of the diff to be extracted - Diff *types.Descriptor `protobuf:"bytes,1,opt,name=diff,proto3" json:"diff,omitempty"` - Mounts []*types.Mount `protobuf:"bytes,2,rep,name=mounts,proto3" json:"mounts,omitempty"` - Payloads map[string]*anypb.Any `protobuf:"bytes,3,rep,name=payloads,proto3" json:"payloads,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // SyncFs is to synchronize the underlying filesystem containing files. - SyncFs bool `protobuf:"varint,4,opt,name=sync_fs,json=syncFs,proto3" json:"sync_fs,omitempty"` -} - -func (x *ApplyRequest) Reset() { - *x = ApplyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ApplyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ApplyRequest) ProtoMessage() {} - -func (x *ApplyRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_msgTypes[0] - 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 ApplyRequest.ProtoReflect.Descriptor instead. -func (*ApplyRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDescGZIP(), []int{0} -} - -func (x *ApplyRequest) GetDiff() *types.Descriptor { - if x != nil { - return x.Diff - } - return nil -} - -func (x *ApplyRequest) GetMounts() []*types.Mount { - if x != nil { - return x.Mounts - } - return nil -} - -func (x *ApplyRequest) GetPayloads() map[string]*anypb.Any { - if x != nil { - return x.Payloads - } - return nil -} - -func (x *ApplyRequest) GetSyncFs() bool { - if x != nil { - return x.SyncFs - } - return false -} - -type ApplyResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Applied is the descriptor for the object which was applied. - // If the input was a compressed blob then the result will be - // the descriptor for the uncompressed blob. - Applied *types.Descriptor `protobuf:"bytes,1,opt,name=applied,proto3" json:"applied,omitempty"` -} - -func (x *ApplyResponse) Reset() { - *x = ApplyResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ApplyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ApplyResponse) ProtoMessage() {} - -func (x *ApplyResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_msgTypes[1] - 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 ApplyResponse.ProtoReflect.Descriptor instead. -func (*ApplyResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDescGZIP(), []int{1} -} - -func (x *ApplyResponse) GetApplied() *types.Descriptor { - if x != nil { - return x.Applied - } - return nil -} - -type DiffRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Left are the mounts which represent the older copy - // in which is the base of the computed changes. - Left []*types.Mount `protobuf:"bytes,1,rep,name=left,proto3" json:"left,omitempty"` - // Right are the mounts which represents the newer copy - // in which changes from the left were made into. - Right []*types.Mount `protobuf:"bytes,2,rep,name=right,proto3" json:"right,omitempty"` - // MediaType is the media type descriptor for the created diff - // object - MediaType string `protobuf:"bytes,3,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"` - // Ref identifies the pre-commit content store object. This - // reference can be used to get the status from the content store. - Ref string `protobuf:"bytes,4,opt,name=ref,proto3" json:"ref,omitempty"` - // Labels are the labels to apply to the generated content - // on content store commit. - Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // SourceDateEpoch specifies the timestamp used to provide control for reproducibility. - // See also https://reproducible-builds.org/docs/source-date-epoch/ . - // - // Since containerd v2.0, the whiteout timestamps are set to zero (1970-01-01), - // not to the source date epoch. - SourceDateEpoch *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=source_date_epoch,json=sourceDateEpoch,proto3" json:"source_date_epoch,omitempty"` -} - -func (x *DiffRequest) Reset() { - *x = DiffRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DiffRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DiffRequest) ProtoMessage() {} - -func (x *DiffRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_msgTypes[2] - 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 DiffRequest.ProtoReflect.Descriptor instead. -func (*DiffRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDescGZIP(), []int{2} -} - -func (x *DiffRequest) GetLeft() []*types.Mount { - if x != nil { - return x.Left - } - return nil -} - -func (x *DiffRequest) GetRight() []*types.Mount { - if x != nil { - return x.Right - } - return nil -} - -func (x *DiffRequest) GetMediaType() string { - if x != nil { - return x.MediaType - } - return "" -} - -func (x *DiffRequest) GetRef() string { - if x != nil { - return x.Ref - } - return "" -} - -func (x *DiffRequest) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -func (x *DiffRequest) GetSourceDateEpoch() *timestamppb.Timestamp { - if x != nil { - return x.SourceDateEpoch - } - return nil -} - -type DiffResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Diff is the descriptor of the diff which can be applied - Diff *types.Descriptor `protobuf:"bytes,3,opt,name=diff,proto3" json:"diff,omitempty"` -} - -func (x *DiffResponse) Reset() { - *x = DiffResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DiffResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DiffResponse) ProtoMessage() {} - -func (x *DiffResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_msgTypes[3] - 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 DiffResponse.ProtoReflect.Descriptor instead. -func (*DiffResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDescGZIP(), []int{3} -} - -func (x *DiffResponse) GetDiff() *types.Descriptor { - if x != nil { - return x.Diff - } - return nil -} - -var File_github_com_containerd_containerd_api_services_diff_v1_diff_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDesc = []byte{ - 0x0a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x64, 0x69, 0x66, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x69, 0x66, 0x66, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x1b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x64, 0x69, 0x66, 0x66, 0x2e, 0x76, 0x31, 0x1a, - 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x36, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xb2, 0x02, 0x0a, 0x0c, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x30, 0x0a, 0x04, 0x64, 0x69, 0x66, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x04, 0x64, - 0x69, 0x66, 0x66, 0x12, 0x2f, 0x0a, 0x06, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x64, 0x69, 0x66, - 0x66, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x08, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x79, 0x6e, - 0x63, 0x5f, 0x66, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x79, 0x6e, 0x63, - 0x46, 0x73, 0x1a, 0x51, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 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, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x47, 0x0a, 0x0d, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x07, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x22, 0xeb, - 0x02, 0x0a, 0x0b, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, - 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x2d, 0x0a, 0x05, 0x72, - 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x6f, - 0x75, 0x6e, 0x74, 0x52, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, - 0x64, 0x69, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, 0x4c, 0x0a, 0x06, 0x6c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x64, 0x69, 0x66, 0x66, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x46, 0x0a, 0x11, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x61, 0x74, 0x65, 0x45, 0x70, 0x6f, 0x63, - 0x68, 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, 0x22, 0x40, 0x0a, 0x0c, - 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x04, - 0x64, 0x69, 0x66, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x04, 0x64, 0x69, 0x66, 0x66, 0x32, 0xc3, - 0x01, 0x0a, 0x04, 0x44, 0x69, 0x66, 0x66, 0x12, 0x5e, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x6c, 0x79, - 0x12, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x64, 0x69, 0x66, 0x66, 0x2e, 0x76, 0x31, 0x2e, 0x41, - 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x64, 0x69, 0x66, 0x66, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x04, 0x44, 0x69, 0x66, 0x66, 0x12, - 0x28, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x64, 0x69, 0x66, 0x66, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, - 0x66, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x64, 0x69, 0x66, 0x66, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x64, 0x69, 0x66, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, - 0x66, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDescData = file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_goTypes = []interface{}{ - (*ApplyRequest)(nil), // 0: containerd.services.diff.v1.ApplyRequest - (*ApplyResponse)(nil), // 1: containerd.services.diff.v1.ApplyResponse - (*DiffRequest)(nil), // 2: containerd.services.diff.v1.DiffRequest - (*DiffResponse)(nil), // 3: containerd.services.diff.v1.DiffResponse - nil, // 4: containerd.services.diff.v1.ApplyRequest.PayloadsEntry - nil, // 5: containerd.services.diff.v1.DiffRequest.LabelsEntry - (*types.Descriptor)(nil), // 6: containerd.types.Descriptor - (*types.Mount)(nil), // 7: containerd.types.Mount - (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp - (*anypb.Any)(nil), // 9: google.protobuf.Any -} -var file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_depIdxs = []int32{ - 6, // 0: containerd.services.diff.v1.ApplyRequest.diff:type_name -> containerd.types.Descriptor - 7, // 1: containerd.services.diff.v1.ApplyRequest.mounts:type_name -> containerd.types.Mount - 4, // 2: containerd.services.diff.v1.ApplyRequest.payloads:type_name -> containerd.services.diff.v1.ApplyRequest.PayloadsEntry - 6, // 3: containerd.services.diff.v1.ApplyResponse.applied:type_name -> containerd.types.Descriptor - 7, // 4: containerd.services.diff.v1.DiffRequest.left:type_name -> containerd.types.Mount - 7, // 5: containerd.services.diff.v1.DiffRequest.right:type_name -> containerd.types.Mount - 5, // 6: containerd.services.diff.v1.DiffRequest.labels:type_name -> containerd.services.diff.v1.DiffRequest.LabelsEntry - 8, // 7: containerd.services.diff.v1.DiffRequest.source_date_epoch:type_name -> google.protobuf.Timestamp - 6, // 8: containerd.services.diff.v1.DiffResponse.diff:type_name -> containerd.types.Descriptor - 9, // 9: containerd.services.diff.v1.ApplyRequest.PayloadsEntry.value:type_name -> google.protobuf.Any - 0, // 10: containerd.services.diff.v1.Diff.Apply:input_type -> containerd.services.diff.v1.ApplyRequest - 2, // 11: containerd.services.diff.v1.Diff.Diff:input_type -> containerd.services.diff.v1.DiffRequest - 1, // 12: containerd.services.diff.v1.Diff.Apply:output_type -> containerd.services.diff.v1.ApplyResponse - 3, // 13: containerd.services.diff.v1.Diff.Diff:output_type -> containerd.services.diff.v1.DiffResponse - 12, // [12:14] is the sub-list for method output_type - 10, // [10:12] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_init() } -func file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_init() { - if File_github_com_containerd_containerd_api_services_diff_v1_diff_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ApplyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ApplyResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DiffRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DiffResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDesc, - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_services_diff_v1_diff_proto = out.File - file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_rawDesc = nil - file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_goTypes = nil - file_github_com_containerd_containerd_api_services_diff_v1_diff_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/diff/v1/diff.proto b/vendor/github.com/containerd/containerd/api/services/diff/v1/diff.proto deleted file mode 100644 index 2aa5ad8a11..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/diff/v1/diff.proto +++ /dev/null @@ -1,90 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.services.diff.v1; - -import "google/protobuf/any.proto"; -import "google/protobuf/timestamp.proto"; -import "github.com/containerd/containerd/api/types/mount.proto"; -import "github.com/containerd/containerd/api/types/descriptor.proto"; - -option go_package = "github.com/containerd/containerd/api/services/diff/v1;diff"; - -// Diff service creates and applies diffs -service Diff { - // Apply applies the content associated with the provided digests onto - // the provided mounts. Archive content will be extracted and - // decompressed if necessary. - rpc Apply(ApplyRequest) returns (ApplyResponse); - - // Diff creates a diff between the given mounts and uploads the result - // to the content store. - rpc Diff(DiffRequest) returns (DiffResponse); -} - -message ApplyRequest { - // Diff is the descriptor of the diff to be extracted - containerd.types.Descriptor diff = 1; - - repeated containerd.types.Mount mounts = 2; - - map payloads = 3; - // SyncFs is to synchronize the underlying filesystem containing files. - bool sync_fs = 4; -} - -message ApplyResponse { - // Applied is the descriptor for the object which was applied. - // If the input was a compressed blob then the result will be - // the descriptor for the uncompressed blob. - containerd.types.Descriptor applied = 1; -} - -message DiffRequest { - // Left are the mounts which represent the older copy - // in which is the base of the computed changes. - repeated containerd.types.Mount left = 1; - - // Right are the mounts which represents the newer copy - // in which changes from the left were made into. - repeated containerd.types.Mount right = 2; - - // MediaType is the media type descriptor for the created diff - // object - string media_type = 3; - - // Ref identifies the pre-commit content store object. This - // reference can be used to get the status from the content store. - string ref = 4; - - // Labels are the labels to apply to the generated content - // on content store commit. - map labels = 5; - - // SourceDateEpoch specifies the timestamp used to provide control for reproducibility. - // See also https://reproducible-builds.org/docs/source-date-epoch/ . - // - // Since containerd v2.0, the whiteout timestamps are set to zero (1970-01-01), - // not to the source date epoch. - google.protobuf.Timestamp source_date_epoch = 6; -} - -message DiffResponse { - // Diff is the descriptor of the diff which can be applied - containerd.types.Descriptor diff = 3; -} diff --git a/vendor/github.com/containerd/containerd/api/services/diff/v1/diff_grpc.pb.go b/vendor/github.com/containerd/containerd/api/services/diff/v1/diff_grpc.pb.go deleted file mode 100644 index 9a932b79ee..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/diff/v1/diff_grpc.pb.go +++ /dev/null @@ -1,153 +0,0 @@ -//go:build !no_grpc - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/diff/v1/diff.proto - -package diff - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// DiffClient is the client API for Diff service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type DiffClient interface { - // Apply applies the content associated with the provided digests onto - // the provided mounts. Archive content will be extracted and - // decompressed if necessary. - Apply(ctx context.Context, in *ApplyRequest, opts ...grpc.CallOption) (*ApplyResponse, error) - // Diff creates a diff between the given mounts and uploads the result - // to the content store. - Diff(ctx context.Context, in *DiffRequest, opts ...grpc.CallOption) (*DiffResponse, error) -} - -type diffClient struct { - cc grpc.ClientConnInterface -} - -func NewDiffClient(cc grpc.ClientConnInterface) DiffClient { - return &diffClient{cc} -} - -func (c *diffClient) Apply(ctx context.Context, in *ApplyRequest, opts ...grpc.CallOption) (*ApplyResponse, error) { - out := new(ApplyResponse) - err := c.cc.Invoke(ctx, "/containerd.services.diff.v1.Diff/Apply", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *diffClient) Diff(ctx context.Context, in *DiffRequest, opts ...grpc.CallOption) (*DiffResponse, error) { - out := new(DiffResponse) - err := c.cc.Invoke(ctx, "/containerd.services.diff.v1.Diff/Diff", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// DiffServer is the server API for Diff service. -// All implementations must embed UnimplementedDiffServer -// for forward compatibility -type DiffServer interface { - // Apply applies the content associated with the provided digests onto - // the provided mounts. Archive content will be extracted and - // decompressed if necessary. - Apply(context.Context, *ApplyRequest) (*ApplyResponse, error) - // Diff creates a diff between the given mounts and uploads the result - // to the content store. - Diff(context.Context, *DiffRequest) (*DiffResponse, error) - mustEmbedUnimplementedDiffServer() -} - -// UnimplementedDiffServer must be embedded to have forward compatible implementations. -type UnimplementedDiffServer struct { -} - -func (UnimplementedDiffServer) Apply(context.Context, *ApplyRequest) (*ApplyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Apply not implemented") -} -func (UnimplementedDiffServer) Diff(context.Context, *DiffRequest) (*DiffResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Diff not implemented") -} -func (UnimplementedDiffServer) mustEmbedUnimplementedDiffServer() {} - -// UnsafeDiffServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to DiffServer will -// result in compilation errors. -type UnsafeDiffServer interface { - mustEmbedUnimplementedDiffServer() -} - -func RegisterDiffServer(s grpc.ServiceRegistrar, srv DiffServer) { - s.RegisterService(&Diff_ServiceDesc, srv) -} - -func _Diff_Apply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ApplyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiffServer).Apply(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.diff.v1.Diff/Apply", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiffServer).Apply(ctx, req.(*ApplyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Diff_Diff_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DiffRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiffServer).Diff(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.diff.v1.Diff/Diff", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiffServer).Diff(ctx, req.(*DiffRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Diff_ServiceDesc is the grpc.ServiceDesc for Diff service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Diff_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.services.diff.v1.Diff", - HandlerType: (*DiffServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Apply", - Handler: _Diff_Apply_Handler, - }, - { - MethodName: "Diff", - Handler: _Diff_Diff_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/containerd/containerd/api/services/diff/v1/diff.proto", -} diff --git a/vendor/github.com/containerd/containerd/api/services/diff/v1/diff_ttrpc.pb.go b/vendor/github.com/containerd/containerd/api/services/diff/v1/diff_ttrpc.pb.go deleted file mode 100644 index 0aa063fb3d..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/diff/v1/diff_ttrpc.pb.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/containerd/api/services/diff/v1/diff.proto -package diff - -import ( - context "context" - ttrpc "github.com/containerd/ttrpc" -) - -type TTRPCDiffService interface { - Apply(context.Context, *ApplyRequest) (*ApplyResponse, error) - Diff(context.Context, *DiffRequest) (*DiffResponse, error) -} - -func RegisterTTRPCDiffService(srv *ttrpc.Server, svc TTRPCDiffService) { - srv.RegisterService("containerd.services.diff.v1.Diff", &ttrpc.ServiceDesc{ - Methods: map[string]ttrpc.Method{ - "Apply": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ApplyRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Apply(ctx, &req) - }, - "Diff": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req DiffRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Diff(ctx, &req) - }, - }, - }) -} - -type ttrpcdiffClient struct { - client *ttrpc.Client -} - -func NewTTRPCDiffClient(client *ttrpc.Client) TTRPCDiffService { - return &ttrpcdiffClient{ - client: client, - } -} - -func (c *ttrpcdiffClient) Apply(ctx context.Context, req *ApplyRequest) (*ApplyResponse, error) { - var resp ApplyResponse - if err := c.client.Call(ctx, "containerd.services.diff.v1.Diff", "Apply", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcdiffClient) Diff(ctx context.Context, req *DiffRequest) (*DiffResponse, error) { - var resp DiffResponse - if err := c.client.Call(ctx, "containerd.services.diff.v1.Diff", "Diff", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/diff/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/diff/v1/doc.go deleted file mode 100644 index 37d16deae3..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/diff/v1/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package diff diff --git a/vendor/github.com/containerd/containerd/api/services/events/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/events/v1/doc.go deleted file mode 100644 index 4470a663e8..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/events/v1/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Package events defines the event pushing and subscription service. -package events - -import types "github.com/containerd/containerd/api/types" - -// Deprecated: Use [types.Envelope]. -type Envelope = types.Envelope diff --git a/vendor/github.com/containerd/containerd/api/services/events/v1/events.pb.go b/vendor/github.com/containerd/containerd/api/services/events/v1/events.pb.go deleted file mode 100644 index 9a4f09328a..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/events/v1/events.pb.go +++ /dev/null @@ -1,341 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/events/v1/events.proto - -package events - -import ( - types "github.com/containerd/containerd/api/types" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" -) - -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) -) - -type PublishRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` - Event *anypb.Any `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"` -} - -func (x *PublishRequest) Reset() { - *x = PublishRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_events_v1_events_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PublishRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PublishRequest) ProtoMessage() {} - -func (x *PublishRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_events_v1_events_proto_msgTypes[0] - 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 PublishRequest.ProtoReflect.Descriptor instead. -func (*PublishRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_events_v1_events_proto_rawDescGZIP(), []int{0} -} - -func (x *PublishRequest) GetTopic() string { - if x != nil { - return x.Topic - } - return "" -} - -func (x *PublishRequest) GetEvent() *anypb.Any { - if x != nil { - return x.Event - } - return nil -} - -type ForwardRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Envelope *types.Envelope `protobuf:"bytes,1,opt,name=envelope,proto3" json:"envelope,omitempty"` -} - -func (x *ForwardRequest) Reset() { - *x = ForwardRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_events_v1_events_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ForwardRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ForwardRequest) ProtoMessage() {} - -func (x *ForwardRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_events_v1_events_proto_msgTypes[1] - 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 ForwardRequest.ProtoReflect.Descriptor instead. -func (*ForwardRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_events_v1_events_proto_rawDescGZIP(), []int{1} -} - -func (x *ForwardRequest) GetEnvelope() *types.Envelope { - if x != nil { - return x.Envelope - } - return nil -} - -type SubscribeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` -} - -func (x *SubscribeRequest) Reset() { - *x = SubscribeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_events_v1_events_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SubscribeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeRequest) ProtoMessage() {} - -func (x *SubscribeRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_events_v1_events_proto_msgTypes[2] - 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 SubscribeRequest.ProtoReflect.Descriptor instead. -func (*SubscribeRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_events_v1_events_proto_rawDescGZIP(), []int{2} -} - -func (x *SubscribeRequest) GetFilters() []string { - if x != nil { - return x.Filters - } - return nil -} - -var File_github_com_containerd_containerd_api_services_events_v1_events_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_services_events_v1_events_proto_rawDesc = []byte{ - 0x0a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, - 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x52, 0x0a, 0x0e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x2a, 0x0a, - 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, - 0x6e, 0x79, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x48, 0x0a, 0x0e, 0x46, 0x6f, 0x72, - 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x08, 0x65, - 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x08, 0x65, 0x6e, 0x76, 0x65, 0x6c, - 0x6f, 0x70, 0x65, 0x22, 0x2c, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x73, 0x32, 0x88, 0x02, 0x0a, 0x06, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x50, 0x0a, 0x07, - 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x50, - 0x0a, 0x07, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x12, 0x5a, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x2f, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x30, 0x01, 0x42, 0x40, 0x5a, 0x3e, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_services_events_v1_events_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_services_events_v1_events_proto_rawDescData = file_github_com_containerd_containerd_api_services_events_v1_events_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_services_events_v1_events_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_services_events_v1_events_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_services_events_v1_events_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_services_events_v1_events_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_services_events_v1_events_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_services_events_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_github_com_containerd_containerd_api_services_events_v1_events_proto_goTypes = []interface{}{ - (*PublishRequest)(nil), // 0: containerd.services.events.v1.PublishRequest - (*ForwardRequest)(nil), // 1: containerd.services.events.v1.ForwardRequest - (*SubscribeRequest)(nil), // 2: containerd.services.events.v1.SubscribeRequest - (*anypb.Any)(nil), // 3: google.protobuf.Any - (*types.Envelope)(nil), // 4: containerd.types.Envelope - (*emptypb.Empty)(nil), // 5: google.protobuf.Empty -} -var file_github_com_containerd_containerd_api_services_events_v1_events_proto_depIdxs = []int32{ - 3, // 0: containerd.services.events.v1.PublishRequest.event:type_name -> google.protobuf.Any - 4, // 1: containerd.services.events.v1.ForwardRequest.envelope:type_name -> containerd.types.Envelope - 0, // 2: containerd.services.events.v1.Events.Publish:input_type -> containerd.services.events.v1.PublishRequest - 1, // 3: containerd.services.events.v1.Events.Forward:input_type -> containerd.services.events.v1.ForwardRequest - 2, // 4: containerd.services.events.v1.Events.Subscribe:input_type -> containerd.services.events.v1.SubscribeRequest - 5, // 5: containerd.services.events.v1.Events.Publish:output_type -> google.protobuf.Empty - 5, // 6: containerd.services.events.v1.Events.Forward:output_type -> google.protobuf.Empty - 4, // 7: containerd.services.events.v1.Events.Subscribe:output_type -> containerd.types.Envelope - 5, // [5:8] is the sub-list for method output_type - 2, // [2:5] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_services_events_v1_events_proto_init() } -func file_github_com_containerd_containerd_api_services_events_v1_events_proto_init() { - if File_github_com_containerd_containerd_api_services_events_v1_events_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_services_events_v1_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PublishRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_events_v1_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ForwardRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_events_v1_events_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubscribeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_services_events_v1_events_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_containerd_containerd_api_services_events_v1_events_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_services_events_v1_events_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_services_events_v1_events_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_services_events_v1_events_proto = out.File - file_github_com_containerd_containerd_api_services_events_v1_events_proto_rawDesc = nil - file_github_com_containerd_containerd_api_services_events_v1_events_proto_goTypes = nil - file_github_com_containerd_containerd_api_services_events_v1_events_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/events/v1/events.proto b/vendor/github.com/containerd/containerd/api/services/events/v1/events.proto deleted file mode 100644 index 3ea43e38ac..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/events/v1/events.proto +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.services.events.v1; - -import "github.com/containerd/containerd/api/types/event.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/empty.proto"; - -option go_package = "github.com/containerd/containerd/api/services/events/v1;events"; - -service Events { - // Publish an event to a topic. - // - // The event will be packed into a timestamp envelope with the namespace - // introspected from the context. The envelope will then be dispatched. - rpc Publish(PublishRequest) returns (google.protobuf.Empty); - - // Forward sends an event that has already been packaged into an envelope - // with a timestamp and namespace. - // - // This is useful if earlier timestamping is required or when forwarding on - // behalf of another component, namespace or publisher. - rpc Forward(ForwardRequest) returns (google.protobuf.Empty); - - // Subscribe to a stream of events, possibly returning only that match any - // of the provided filters. - // - // Unlike many other methods in containerd, subscribers will get messages - // from all namespaces unless otherwise specified. If this is not desired, - // a filter can be provided in the format 'namespace==' to - // restrict the received events. - rpc Subscribe(SubscribeRequest) returns (stream containerd.types.Envelope); -} - -message PublishRequest { - string topic = 1; - google.protobuf.Any event = 2; -} - -message ForwardRequest { - containerd.types.Envelope envelope = 1; -} - -message SubscribeRequest { - repeated string filters = 1; -} diff --git a/vendor/github.com/containerd/containerd/api/services/events/v1/events_grpc.pb.go b/vendor/github.com/containerd/containerd/api/services/events/v1/events_grpc.pb.go deleted file mode 100644 index a91362a1e0..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/events/v1/events_grpc.pb.go +++ /dev/null @@ -1,241 +0,0 @@ -//go:build !no_grpc - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/events/v1/events.proto - -package events - -import ( - context "context" - types "github.com/containerd/containerd/api/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// EventsClient is the client API for Events service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type EventsClient interface { - // Publish an event to a topic. - // - // The event will be packed into a timestamp envelope with the namespace - // introspected from the context. The envelope will then be dispatched. - Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Forward sends an event that has already been packaged into an envelope - // with a timestamp and namespace. - // - // This is useful if earlier timestamping is required or when forwarding on - // behalf of another component, namespace or publisher. - Forward(ctx context.Context, in *ForwardRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Subscribe to a stream of events, possibly returning only that match any - // of the provided filters. - // - // Unlike many other methods in containerd, subscribers will get messages - // from all namespaces unless otherwise specified. If this is not desired, - // a filter can be provided in the format 'namespace==' to - // restrict the received events. - Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (Events_SubscribeClient, error) -} - -type eventsClient struct { - cc grpc.ClientConnInterface -} - -func NewEventsClient(cc grpc.ClientConnInterface) EventsClient { - return &eventsClient{cc} -} - -func (c *eventsClient) Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.events.v1.Events/Publish", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *eventsClient) Forward(ctx context.Context, in *ForwardRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.events.v1.Events/Forward", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *eventsClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (Events_SubscribeClient, error) { - stream, err := c.cc.NewStream(ctx, &Events_ServiceDesc.Streams[0], "/containerd.services.events.v1.Events/Subscribe", opts...) - if err != nil { - return nil, err - } - x := &eventsSubscribeClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Events_SubscribeClient interface { - Recv() (*types.Envelope, error) - grpc.ClientStream -} - -type eventsSubscribeClient struct { - grpc.ClientStream -} - -func (x *eventsSubscribeClient) Recv() (*types.Envelope, error) { - m := new(types.Envelope) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// EventsServer is the server API for Events service. -// All implementations must embed UnimplementedEventsServer -// for forward compatibility -type EventsServer interface { - // Publish an event to a topic. - // - // The event will be packed into a timestamp envelope with the namespace - // introspected from the context. The envelope will then be dispatched. - Publish(context.Context, *PublishRequest) (*emptypb.Empty, error) - // Forward sends an event that has already been packaged into an envelope - // with a timestamp and namespace. - // - // This is useful if earlier timestamping is required or when forwarding on - // behalf of another component, namespace or publisher. - Forward(context.Context, *ForwardRequest) (*emptypb.Empty, error) - // Subscribe to a stream of events, possibly returning only that match any - // of the provided filters. - // - // Unlike many other methods in containerd, subscribers will get messages - // from all namespaces unless otherwise specified. If this is not desired, - // a filter can be provided in the format 'namespace==' to - // restrict the received events. - Subscribe(*SubscribeRequest, Events_SubscribeServer) error - mustEmbedUnimplementedEventsServer() -} - -// UnimplementedEventsServer must be embedded to have forward compatible implementations. -type UnimplementedEventsServer struct { -} - -func (UnimplementedEventsServer) Publish(context.Context, *PublishRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Publish not implemented") -} -func (UnimplementedEventsServer) Forward(context.Context, *ForwardRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Forward not implemented") -} -func (UnimplementedEventsServer) Subscribe(*SubscribeRequest, Events_SubscribeServer) error { - return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") -} -func (UnimplementedEventsServer) mustEmbedUnimplementedEventsServer() {} - -// UnsafeEventsServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to EventsServer will -// result in compilation errors. -type UnsafeEventsServer interface { - mustEmbedUnimplementedEventsServer() -} - -func RegisterEventsServer(s grpc.ServiceRegistrar, srv EventsServer) { - s.RegisterService(&Events_ServiceDesc, srv) -} - -func _Events_Publish_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PublishRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EventsServer).Publish(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.events.v1.Events/Publish", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EventsServer).Publish(ctx, req.(*PublishRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Events_Forward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ForwardRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EventsServer).Forward(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.events.v1.Events/Forward", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EventsServer).Forward(ctx, req.(*ForwardRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Events_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SubscribeRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(EventsServer).Subscribe(m, &eventsSubscribeServer{stream}) -} - -type Events_SubscribeServer interface { - Send(*types.Envelope) error - grpc.ServerStream -} - -type eventsSubscribeServer struct { - grpc.ServerStream -} - -func (x *eventsSubscribeServer) Send(m *types.Envelope) error { - return x.ServerStream.SendMsg(m) -} - -// Events_ServiceDesc is the grpc.ServiceDesc for Events service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Events_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.services.events.v1.Events", - HandlerType: (*EventsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Publish", - Handler: _Events_Publish_Handler, - }, - { - MethodName: "Forward", - Handler: _Events_Forward_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Subscribe", - Handler: _Events_Subscribe_Handler, - ServerStreams: true, - }, - }, - Metadata: "github.com/containerd/containerd/api/services/events/v1/events.proto", -} diff --git a/vendor/github.com/containerd/containerd/api/services/events/v1/events_ttrpc.pb.go b/vendor/github.com/containerd/containerd/api/services/events/v1/events_ttrpc.pb.go deleted file mode 100644 index ad8e3fecb9..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/events/v1/events_ttrpc.pb.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/containerd/api/services/events/v1/events.proto -package events - -import ( - context "context" - types "github.com/containerd/containerd/api/types" - ttrpc "github.com/containerd/ttrpc" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -type TTRPCEventsService interface { - Publish(context.Context, *PublishRequest) (*emptypb.Empty, error) - Forward(context.Context, *ForwardRequest) (*emptypb.Empty, error) - Subscribe(context.Context, *SubscribeRequest, TTRPCEvents_SubscribeServer) error -} - -type TTRPCEvents_SubscribeServer interface { - Send(*types.Envelope) error - ttrpc.StreamServer -} - -type ttrpceventsSubscribeServer struct { - ttrpc.StreamServer -} - -func (x *ttrpceventsSubscribeServer) Send(m *types.Envelope) error { - return x.StreamServer.SendMsg(m) -} - -func RegisterTTRPCEventsService(srv *ttrpc.Server, svc TTRPCEventsService) { - srv.RegisterService("containerd.services.events.v1.Events", &ttrpc.ServiceDesc{ - Methods: map[string]ttrpc.Method{ - "Publish": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req PublishRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Publish(ctx, &req) - }, - "Forward": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ForwardRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Forward(ctx, &req) - }, - }, - Streams: map[string]ttrpc.Stream{ - "Subscribe": { - Handler: func(ctx context.Context, stream ttrpc.StreamServer) (interface{}, error) { - m := new(SubscribeRequest) - if err := stream.RecvMsg(m); err != nil { - return nil, err - } - return nil, svc.Subscribe(ctx, m, &ttrpceventsSubscribeServer{stream}) - }, - StreamingClient: false, - StreamingServer: true, - }, - }, - }) -} - -type TTRPCEventsClient interface { - Publish(context.Context, *PublishRequest) (*emptypb.Empty, error) - Forward(context.Context, *ForwardRequest) (*emptypb.Empty, error) - Subscribe(context.Context, *SubscribeRequest) (TTRPCEvents_SubscribeClient, error) -} - -type ttrpceventsClient struct { - client *ttrpc.Client -} - -func NewTTRPCEventsClient(client *ttrpc.Client) TTRPCEventsClient { - return &ttrpceventsClient{ - client: client, - } -} - -func (c *ttrpceventsClient) Publish(ctx context.Context, req *PublishRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.events.v1.Events", "Publish", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpceventsClient) Forward(ctx context.Context, req *ForwardRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.events.v1.Events", "Forward", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpceventsClient) Subscribe(ctx context.Context, req *SubscribeRequest) (TTRPCEvents_SubscribeClient, error) { - stream, err := c.client.NewStream(ctx, &ttrpc.StreamDesc{ - StreamingClient: false, - StreamingServer: true, - }, "containerd.services.events.v1.Events", "Subscribe", req) - if err != nil { - return nil, err - } - x := &ttrpceventsSubscribeClient{stream} - return x, nil -} - -type TTRPCEvents_SubscribeClient interface { - Recv() (*types.Envelope, error) - ttrpc.ClientStream -} - -type ttrpceventsSubscribeClient struct { - ttrpc.ClientStream -} - -func (x *ttrpceventsSubscribeClient) Recv() (*types.Envelope, error) { - m := new(types.Envelope) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/images/v1/docs.go b/vendor/github.com/containerd/containerd/api/services/images/v1/docs.go deleted file mode 100644 index 4170f38aff..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/images/v1/docs.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package images diff --git a/vendor/github.com/containerd/containerd/api/services/images/v1/images.pb.go b/vendor/github.com/containerd/containerd/api/services/images/v1/images.pb.go deleted file mode 100644 index ef5b7faa2c..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/images/v1/images.pb.go +++ /dev/null @@ -1,964 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/images/v1/images.proto - -package images - -import ( - types "github.com/containerd/containerd/api/types" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -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) -) - -type Image struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name provides a unique name for the image. - // - // Containerd treats this as the primary identifier. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Labels provides free form labels for the image. These are runtime only - // and do not get inherited into the package image in any way. - // - // Labels may be updated using the field mask. - // The combined size of a key/value pair cannot exceed 4096 bytes. - Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Target describes the content entry point of the image. - Target *types.Descriptor `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"` - // CreatedAt is the time the image was first created. - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - // UpdatedAt is the last time the image was mutated. - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` -} - -func (x *Image) Reset() { - *x = Image{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Image) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Image) ProtoMessage() {} - -func (x *Image) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[0] - 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 Image.ProtoReflect.Descriptor instead. -func (*Image) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescGZIP(), []int{0} -} - -func (x *Image) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Image) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -func (x *Image) GetTarget() *types.Descriptor { - if x != nil { - return x.Target - } - return nil -} - -func (x *Image) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *Image) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -type GetImageRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetImageRequest) Reset() { - *x = GetImageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetImageRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetImageRequest) ProtoMessage() {} - -func (x *GetImageRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[1] - 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 GetImageRequest.ProtoReflect.Descriptor instead. -func (*GetImageRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescGZIP(), []int{1} -} - -func (x *GetImageRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type GetImageResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Image *Image `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` -} - -func (x *GetImageResponse) Reset() { - *x = GetImageResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetImageResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetImageResponse) ProtoMessage() {} - -func (x *GetImageResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[2] - 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 GetImageResponse.ProtoReflect.Descriptor instead. -func (*GetImageResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescGZIP(), []int{2} -} - -func (x *GetImageResponse) GetImage() *Image { - if x != nil { - return x.Image - } - return nil -} - -type CreateImageRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Image *Image `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` - SourceDateEpoch *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=source_date_epoch,json=sourceDateEpoch,proto3" json:"source_date_epoch,omitempty"` -} - -func (x *CreateImageRequest) Reset() { - *x = CreateImageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateImageRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateImageRequest) ProtoMessage() {} - -func (x *CreateImageRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[3] - 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 CreateImageRequest.ProtoReflect.Descriptor instead. -func (*CreateImageRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescGZIP(), []int{3} -} - -func (x *CreateImageRequest) GetImage() *Image { - if x != nil { - return x.Image - } - return nil -} - -func (x *CreateImageRequest) GetSourceDateEpoch() *timestamppb.Timestamp { - if x != nil { - return x.SourceDateEpoch - } - return nil -} - -type CreateImageResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Image *Image `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` -} - -func (x *CreateImageResponse) Reset() { - *x = CreateImageResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateImageResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateImageResponse) ProtoMessage() {} - -func (x *CreateImageResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[4] - 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 CreateImageResponse.ProtoReflect.Descriptor instead. -func (*CreateImageResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescGZIP(), []int{4} -} - -func (x *CreateImageResponse) GetImage() *Image { - if x != nil { - return x.Image - } - return nil -} - -type UpdateImageRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Image provides a full or partial image for update. - // - // The name field must be set or an error will be returned. - Image *Image `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` - // UpdateMask specifies which fields to perform the update on. If empty, - // the operation applies to all fields. - UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` - SourceDateEpoch *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=source_date_epoch,json=sourceDateEpoch,proto3" json:"source_date_epoch,omitempty"` -} - -func (x *UpdateImageRequest) Reset() { - *x = UpdateImageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateImageRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateImageRequest) ProtoMessage() {} - -func (x *UpdateImageRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[5] - 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 UpdateImageRequest.ProtoReflect.Descriptor instead. -func (*UpdateImageRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescGZIP(), []int{5} -} - -func (x *UpdateImageRequest) GetImage() *Image { - if x != nil { - return x.Image - } - return nil -} - -func (x *UpdateImageRequest) GetUpdateMask() *fieldmaskpb.FieldMask { - if x != nil { - return x.UpdateMask - } - return nil -} - -func (x *UpdateImageRequest) GetSourceDateEpoch() *timestamppb.Timestamp { - if x != nil { - return x.SourceDateEpoch - } - return nil -} - -type UpdateImageResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Image *Image `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` -} - -func (x *UpdateImageResponse) Reset() { - *x = UpdateImageResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateImageResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateImageResponse) ProtoMessage() {} - -func (x *UpdateImageResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[6] - 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 UpdateImageResponse.ProtoReflect.Descriptor instead. -func (*UpdateImageResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescGZIP(), []int{6} -} - -func (x *UpdateImageResponse) GetImage() *Image { - if x != nil { - return x.Image - } - return nil -} - -type ListImagesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Filters contains one or more filters using the syntax defined in the - // containerd filter package. - // - // The returned result will be those that match any of the provided - // filters. Expanded, images that match the following will be - // returned: - // - // filters[0] or filters[1] or ... or filters[n-1] or filters[n] - // - // If filters is zero-length or nil, all items will be returned. - Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` -} - -func (x *ListImagesRequest) Reset() { - *x = ListImagesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListImagesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListImagesRequest) ProtoMessage() {} - -func (x *ListImagesRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[7] - 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 ListImagesRequest.ProtoReflect.Descriptor instead. -func (*ListImagesRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescGZIP(), []int{7} -} - -func (x *ListImagesRequest) GetFilters() []string { - if x != nil { - return x.Filters - } - return nil -} - -type ListImagesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Images []*Image `protobuf:"bytes,1,rep,name=images,proto3" json:"images,omitempty"` -} - -func (x *ListImagesResponse) Reset() { - *x = ListImagesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListImagesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListImagesResponse) ProtoMessage() {} - -func (x *ListImagesResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[8] - 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 ListImagesResponse.ProtoReflect.Descriptor instead. -func (*ListImagesResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescGZIP(), []int{8} -} - -func (x *ListImagesResponse) GetImages() []*Image { - if x != nil { - return x.Images - } - return nil -} - -type DeleteImageRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Sync indicates that the delete and cleanup should be done - // synchronously before returning to the caller - // - // Default is false - Sync bool `protobuf:"varint,2,opt,name=sync,proto3" json:"sync,omitempty"` - // Target value for image to be deleted - // - // If image descriptor does not match the same digest, - // the delete operation will return "not found" error. - Target *types.Descriptor `protobuf:"bytes,3,opt,name=target,proto3,oneof" json:"target,omitempty"` -} - -func (x *DeleteImageRequest) Reset() { - *x = DeleteImageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteImageRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteImageRequest) ProtoMessage() {} - -func (x *DeleteImageRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[9] - 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 DeleteImageRequest.ProtoReflect.Descriptor instead. -func (*DeleteImageRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescGZIP(), []int{9} -} - -func (x *DeleteImageRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *DeleteImageRequest) GetSync() bool { - if x != nil { - return x.Sync - } - return false -} - -func (x *DeleteImageRequest) GetTarget() *types.Descriptor { - if x != nil { - return x.Target - } - return nil -} - -var File_github_com_containerd_containerd_api_services_images_v1_images_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDesc = []byte{ - 0x0a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xcc, 0x02, 0x0a, 0x05, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x48, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x34, 0x0a, 0x06, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 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, 0x22, 0x25, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4e, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x49, - 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x05, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, - 0x65, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x22, 0x98, 0x01, 0x0a, 0x12, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x3a, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, - 0x6d, 0x61, 0x67, 0x65, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x46, 0x0a, 0x11, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x61, 0x74, 0x65, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x22, 0x51, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x05, 0x69, 0x6d, - 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, - 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x22, 0xd5, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, - 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, - 0x67, 0x65, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x46, 0x0a, 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x5f, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0f, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x61, 0x74, 0x65, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x51, - 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x22, 0x2d, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, - 0x22, 0x52, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6d, 0x61, - 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x06, 0x69, 0x6d, - 0x61, 0x67, 0x65, 0x73, 0x22, 0x82, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, - 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 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, 0x73, 0x79, 0x6e, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x73, - 0x79, 0x6e, 0x63, 0x12, 0x39, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x48, 0x00, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x88, 0x01, 0x01, 0x42, 0x09, - 0x0a, 0x07, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x32, 0x94, 0x04, 0x0a, 0x06, 0x49, 0x6d, - 0x61, 0x67, 0x65, 0x73, 0x12, 0x66, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x2e, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, - 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, - 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x04, - 0x4c, 0x69, 0x73, 0x74, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6d, 0x61, - 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x06, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6d, 0x61, - 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x06, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6d, - 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6d, - 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x06, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescData = file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes = make([]protoimpl.MessageInfo, 11) -var file_github_com_containerd_containerd_api_services_images_v1_images_proto_goTypes = []interface{}{ - (*Image)(nil), // 0: containerd.services.images.v1.Image - (*GetImageRequest)(nil), // 1: containerd.services.images.v1.GetImageRequest - (*GetImageResponse)(nil), // 2: containerd.services.images.v1.GetImageResponse - (*CreateImageRequest)(nil), // 3: containerd.services.images.v1.CreateImageRequest - (*CreateImageResponse)(nil), // 4: containerd.services.images.v1.CreateImageResponse - (*UpdateImageRequest)(nil), // 5: containerd.services.images.v1.UpdateImageRequest - (*UpdateImageResponse)(nil), // 6: containerd.services.images.v1.UpdateImageResponse - (*ListImagesRequest)(nil), // 7: containerd.services.images.v1.ListImagesRequest - (*ListImagesResponse)(nil), // 8: containerd.services.images.v1.ListImagesResponse - (*DeleteImageRequest)(nil), // 9: containerd.services.images.v1.DeleteImageRequest - nil, // 10: containerd.services.images.v1.Image.LabelsEntry - (*types.Descriptor)(nil), // 11: containerd.types.Descriptor - (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp - (*fieldmaskpb.FieldMask)(nil), // 13: google.protobuf.FieldMask - (*emptypb.Empty)(nil), // 14: google.protobuf.Empty -} -var file_github_com_containerd_containerd_api_services_images_v1_images_proto_depIdxs = []int32{ - 10, // 0: containerd.services.images.v1.Image.labels:type_name -> containerd.services.images.v1.Image.LabelsEntry - 11, // 1: containerd.services.images.v1.Image.target:type_name -> containerd.types.Descriptor - 12, // 2: containerd.services.images.v1.Image.created_at:type_name -> google.protobuf.Timestamp - 12, // 3: containerd.services.images.v1.Image.updated_at:type_name -> google.protobuf.Timestamp - 0, // 4: containerd.services.images.v1.GetImageResponse.image:type_name -> containerd.services.images.v1.Image - 0, // 5: containerd.services.images.v1.CreateImageRequest.image:type_name -> containerd.services.images.v1.Image - 12, // 6: containerd.services.images.v1.CreateImageRequest.source_date_epoch:type_name -> google.protobuf.Timestamp - 0, // 7: containerd.services.images.v1.CreateImageResponse.image:type_name -> containerd.services.images.v1.Image - 0, // 8: containerd.services.images.v1.UpdateImageRequest.image:type_name -> containerd.services.images.v1.Image - 13, // 9: containerd.services.images.v1.UpdateImageRequest.update_mask:type_name -> google.protobuf.FieldMask - 12, // 10: containerd.services.images.v1.UpdateImageRequest.source_date_epoch:type_name -> google.protobuf.Timestamp - 0, // 11: containerd.services.images.v1.UpdateImageResponse.image:type_name -> containerd.services.images.v1.Image - 0, // 12: containerd.services.images.v1.ListImagesResponse.images:type_name -> containerd.services.images.v1.Image - 11, // 13: containerd.services.images.v1.DeleteImageRequest.target:type_name -> containerd.types.Descriptor - 1, // 14: containerd.services.images.v1.Images.Get:input_type -> containerd.services.images.v1.GetImageRequest - 7, // 15: containerd.services.images.v1.Images.List:input_type -> containerd.services.images.v1.ListImagesRequest - 3, // 16: containerd.services.images.v1.Images.Create:input_type -> containerd.services.images.v1.CreateImageRequest - 5, // 17: containerd.services.images.v1.Images.Update:input_type -> containerd.services.images.v1.UpdateImageRequest - 9, // 18: containerd.services.images.v1.Images.Delete:input_type -> containerd.services.images.v1.DeleteImageRequest - 2, // 19: containerd.services.images.v1.Images.Get:output_type -> containerd.services.images.v1.GetImageResponse - 8, // 20: containerd.services.images.v1.Images.List:output_type -> containerd.services.images.v1.ListImagesResponse - 4, // 21: containerd.services.images.v1.Images.Create:output_type -> containerd.services.images.v1.CreateImageResponse - 6, // 22: containerd.services.images.v1.Images.Update:output_type -> containerd.services.images.v1.UpdateImageResponse - 14, // 23: containerd.services.images.v1.Images.Delete:output_type -> google.protobuf.Empty - 19, // [19:24] is the sub-list for method output_type - 14, // [14:19] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_services_images_v1_images_proto_init() } -func file_github_com_containerd_containerd_api_services_images_v1_images_proto_init() { - if File_github_com_containerd_containerd_api_services_images_v1_images_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Image); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetImageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetImageResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateImageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateImageResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateImageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateImageResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListImagesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListImagesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteImageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes[9].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDesc, - NumEnums: 0, - NumMessages: 11, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_containerd_containerd_api_services_images_v1_images_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_services_images_v1_images_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_services_images_v1_images_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_services_images_v1_images_proto = out.File - file_github_com_containerd_containerd_api_services_images_v1_images_proto_rawDesc = nil - file_github_com_containerd_containerd_api_services_images_v1_images_proto_goTypes = nil - file_github_com_containerd_containerd_api_services_images_v1_images_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/images/v1/images.proto b/vendor/github.com/containerd/containerd/api/services/images/v1/images.proto deleted file mode 100644 index 2f47ab284d..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/images/v1/images.proto +++ /dev/null @@ -1,149 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.services.images.v1; - -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "github.com/containerd/containerd/api/types/descriptor.proto"; - -option go_package = "github.com/containerd/containerd/api/services/images/v1;images"; - -// Images is a service that allows one to register images with containerd. -// -// In containerd, an image is merely the mapping of a name to a content root, -// described by a descriptor. The behavior and state of image is purely -// dictated by the type of the descriptor. -// -// From the perspective of this service, these references are mostly shallow, -// in that the existence of the required content won't be validated until -// required by consuming services. -// -// As such, this can really be considered a "metadata service". -service Images { - // Get returns an image by name. - rpc Get(GetImageRequest) returns (GetImageResponse); - - // List returns a list of all images known to containerd. - rpc List(ListImagesRequest) returns (ListImagesResponse); - - // Create an image record in the metadata store. - // - // The name of the image must be unique. - rpc Create(CreateImageRequest) returns (CreateImageResponse); - - // Update assigns the name to a given target image based on the provided - // image. - rpc Update(UpdateImageRequest) returns (UpdateImageResponse); - - // Delete deletes the image by name. - rpc Delete(DeleteImageRequest) returns (google.protobuf.Empty); -} - -message Image { - // Name provides a unique name for the image. - // - // Containerd treats this as the primary identifier. - string name = 1; - - // Labels provides free form labels for the image. These are runtime only - // and do not get inherited into the package image in any way. - // - // Labels may be updated using the field mask. - // The combined size of a key/value pair cannot exceed 4096 bytes. - map labels = 2; - - // Target describes the content entry point of the image. - containerd.types.Descriptor target = 3; - - // CreatedAt is the time the image was first created. - google.protobuf.Timestamp created_at = 7; - - // UpdatedAt is the last time the image was mutated. - google.protobuf.Timestamp updated_at = 8; -} - -message GetImageRequest { - string name = 1; -} - -message GetImageResponse { - Image image = 1; -} - -message CreateImageRequest { - Image image = 1; - - google.protobuf.Timestamp source_date_epoch = 2; -} - -message CreateImageResponse { - Image image = 1; -} - -message UpdateImageRequest { - // Image provides a full or partial image for update. - // - // The name field must be set or an error will be returned. - Image image = 1; - - // UpdateMask specifies which fields to perform the update on. If empty, - // the operation applies to all fields. - google.protobuf.FieldMask update_mask = 2; - - google.protobuf.Timestamp source_date_epoch = 3; -} - -message UpdateImageResponse { - Image image = 1; -} - -message ListImagesRequest { - // Filters contains one or more filters using the syntax defined in the - // containerd filter package. - // - // The returned result will be those that match any of the provided - // filters. Expanded, images that match the following will be - // returned: - // - // filters[0] or filters[1] or ... or filters[n-1] or filters[n] - // - // If filters is zero-length or nil, all items will be returned. - repeated string filters = 1; -} - -message ListImagesResponse { - repeated Image images = 1; -} - -message DeleteImageRequest { - string name = 1; - - // Sync indicates that the delete and cleanup should be done - // synchronously before returning to the caller - // - // Default is false - bool sync = 2; - - // Target value for image to be deleted - // - // If image descriptor does not match the same digest, - // the delete operation will return "not found" error. - optional containerd.types.Descriptor target = 3; -} diff --git a/vendor/github.com/containerd/containerd/api/services/images/v1/images_grpc.pb.go b/vendor/github.com/containerd/containerd/api/services/images/v1/images_grpc.pb.go deleted file mode 100644 index 39c488af0b..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/images/v1/images_grpc.pb.go +++ /dev/null @@ -1,268 +0,0 @@ -//go:build !no_grpc - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/images/v1/images.proto - -package images - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// ImagesClient is the client API for Images service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type ImagesClient interface { - // Get returns an image by name. - Get(ctx context.Context, in *GetImageRequest, opts ...grpc.CallOption) (*GetImageResponse, error) - // List returns a list of all images known to containerd. - List(ctx context.Context, in *ListImagesRequest, opts ...grpc.CallOption) (*ListImagesResponse, error) - // Create an image record in the metadata store. - // - // The name of the image must be unique. - Create(ctx context.Context, in *CreateImageRequest, opts ...grpc.CallOption) (*CreateImageResponse, error) - // Update assigns the name to a given target image based on the provided - // image. - Update(ctx context.Context, in *UpdateImageRequest, opts ...grpc.CallOption) (*UpdateImageResponse, error) - // Delete deletes the image by name. - Delete(ctx context.Context, in *DeleteImageRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type imagesClient struct { - cc grpc.ClientConnInterface -} - -func NewImagesClient(cc grpc.ClientConnInterface) ImagesClient { - return &imagesClient{cc} -} - -func (c *imagesClient) Get(ctx context.Context, in *GetImageRequest, opts ...grpc.CallOption) (*GetImageResponse, error) { - out := new(GetImageResponse) - err := c.cc.Invoke(ctx, "/containerd.services.images.v1.Images/Get", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *imagesClient) List(ctx context.Context, in *ListImagesRequest, opts ...grpc.CallOption) (*ListImagesResponse, error) { - out := new(ListImagesResponse) - err := c.cc.Invoke(ctx, "/containerd.services.images.v1.Images/List", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *imagesClient) Create(ctx context.Context, in *CreateImageRequest, opts ...grpc.CallOption) (*CreateImageResponse, error) { - out := new(CreateImageResponse) - err := c.cc.Invoke(ctx, "/containerd.services.images.v1.Images/Create", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *imagesClient) Update(ctx context.Context, in *UpdateImageRequest, opts ...grpc.CallOption) (*UpdateImageResponse, error) { - out := new(UpdateImageResponse) - err := c.cc.Invoke(ctx, "/containerd.services.images.v1.Images/Update", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *imagesClient) Delete(ctx context.Context, in *DeleteImageRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.images.v1.Images/Delete", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ImagesServer is the server API for Images service. -// All implementations must embed UnimplementedImagesServer -// for forward compatibility -type ImagesServer interface { - // Get returns an image by name. - Get(context.Context, *GetImageRequest) (*GetImageResponse, error) - // List returns a list of all images known to containerd. - List(context.Context, *ListImagesRequest) (*ListImagesResponse, error) - // Create an image record in the metadata store. - // - // The name of the image must be unique. - Create(context.Context, *CreateImageRequest) (*CreateImageResponse, error) - // Update assigns the name to a given target image based on the provided - // image. - Update(context.Context, *UpdateImageRequest) (*UpdateImageResponse, error) - // Delete deletes the image by name. - Delete(context.Context, *DeleteImageRequest) (*emptypb.Empty, error) - mustEmbedUnimplementedImagesServer() -} - -// UnimplementedImagesServer must be embedded to have forward compatible implementations. -type UnimplementedImagesServer struct { -} - -func (UnimplementedImagesServer) Get(context.Context, *GetImageRequest) (*GetImageResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") -} -func (UnimplementedImagesServer) List(context.Context, *ListImagesRequest) (*ListImagesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method List not implemented") -} -func (UnimplementedImagesServer) Create(context.Context, *CreateImageRequest) (*CreateImageResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") -} -func (UnimplementedImagesServer) Update(context.Context, *UpdateImageRequest) (*UpdateImageResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") -} -func (UnimplementedImagesServer) Delete(context.Context, *DeleteImageRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") -} -func (UnimplementedImagesServer) mustEmbedUnimplementedImagesServer() {} - -// UnsafeImagesServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ImagesServer will -// result in compilation errors. -type UnsafeImagesServer interface { - mustEmbedUnimplementedImagesServer() -} - -func RegisterImagesServer(s grpc.ServiceRegistrar, srv ImagesServer) { - s.RegisterService(&Images_ServiceDesc, srv) -} - -func _Images_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetImageRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ImagesServer).Get(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.images.v1.Images/Get", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ImagesServer).Get(ctx, req.(*GetImageRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Images_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListImagesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ImagesServer).List(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.images.v1.Images/List", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ImagesServer).List(ctx, req.(*ListImagesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Images_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateImageRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ImagesServer).Create(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.images.v1.Images/Create", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ImagesServer).Create(ctx, req.(*CreateImageRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Images_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateImageRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ImagesServer).Update(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.images.v1.Images/Update", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ImagesServer).Update(ctx, req.(*UpdateImageRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Images_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteImageRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ImagesServer).Delete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.images.v1.Images/Delete", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ImagesServer).Delete(ctx, req.(*DeleteImageRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Images_ServiceDesc is the grpc.ServiceDesc for Images service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Images_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.services.images.v1.Images", - HandlerType: (*ImagesServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Get", - Handler: _Images_Get_Handler, - }, - { - MethodName: "List", - Handler: _Images_List_Handler, - }, - { - MethodName: "Create", - Handler: _Images_Create_Handler, - }, - { - MethodName: "Update", - Handler: _Images_Update_Handler, - }, - { - MethodName: "Delete", - Handler: _Images_Delete_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/containerd/containerd/api/services/images/v1/images.proto", -} diff --git a/vendor/github.com/containerd/containerd/api/services/images/v1/images_ttrpc.pb.go b/vendor/github.com/containerd/containerd/api/services/images/v1/images_ttrpc.pb.go deleted file mode 100644 index 442e1ac5c1..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/images/v1/images_ttrpc.pb.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/containerd/api/services/images/v1/images.proto -package images - -import ( - context "context" - ttrpc "github.com/containerd/ttrpc" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -type TTRPCImagesService interface { - Get(context.Context, *GetImageRequest) (*GetImageResponse, error) - List(context.Context, *ListImagesRequest) (*ListImagesResponse, error) - Create(context.Context, *CreateImageRequest) (*CreateImageResponse, error) - Update(context.Context, *UpdateImageRequest) (*UpdateImageResponse, error) - Delete(context.Context, *DeleteImageRequest) (*emptypb.Empty, error) -} - -func RegisterTTRPCImagesService(srv *ttrpc.Server, svc TTRPCImagesService) { - srv.RegisterService("containerd.services.images.v1.Images", &ttrpc.ServiceDesc{ - Methods: map[string]ttrpc.Method{ - "Get": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req GetImageRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Get(ctx, &req) - }, - "List": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ListImagesRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.List(ctx, &req) - }, - "Create": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req CreateImageRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Create(ctx, &req) - }, - "Update": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req UpdateImageRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Update(ctx, &req) - }, - "Delete": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req DeleteImageRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Delete(ctx, &req) - }, - }, - }) -} - -type ttrpcimagesClient struct { - client *ttrpc.Client -} - -func NewTTRPCImagesClient(client *ttrpc.Client) TTRPCImagesService { - return &ttrpcimagesClient{ - client: client, - } -} - -func (c *ttrpcimagesClient) Get(ctx context.Context, req *GetImageRequest) (*GetImageResponse, error) { - var resp GetImageResponse - if err := c.client.Call(ctx, "containerd.services.images.v1.Images", "Get", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcimagesClient) List(ctx context.Context, req *ListImagesRequest) (*ListImagesResponse, error) { - var resp ListImagesResponse - if err := c.client.Call(ctx, "containerd.services.images.v1.Images", "List", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcimagesClient) Create(ctx context.Context, req *CreateImageRequest) (*CreateImageResponse, error) { - var resp CreateImageResponse - if err := c.client.Call(ctx, "containerd.services.images.v1.Images", "Create", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcimagesClient) Update(ctx context.Context, req *UpdateImageRequest) (*UpdateImageResponse, error) { - var resp UpdateImageResponse - if err := c.client.Call(ctx, "containerd.services.images.v1.Images", "Update", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcimagesClient) Delete(ctx context.Context, req *DeleteImageRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.images.v1.Images", "Delete", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/introspection/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/introspection/v1/doc.go deleted file mode 100644 index f6f65eadfd..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/introspection/v1/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package introspection diff --git a/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection.pb.go b/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection.pb.go deleted file mode 100644 index 0d2f8c6232..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection.pb.go +++ /dev/null @@ -1,811 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/introspection/v1/introspection.proto - -package introspection - -import ( - types "github.com/containerd/containerd/api/types" - status "google.golang.org/genproto/googleapis/rpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - emptypb "google.golang.org/protobuf/types/known/emptypb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -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) -) - -type Plugin struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Type defines the type of plugin. - // - // See package plugin for a list of possible values. Non core plugins may - // define their own values during registration. - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - // ID identifies the plugin uniquely in the system. - ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - // Requires lists the plugin types required by this plugin. - Requires []string `protobuf:"bytes,3,rep,name=requires,proto3" json:"requires,omitempty"` - // Platforms enumerates the platforms this plugin will support. - // - // If values are provided here, the plugin will only be operable under the - // provided platforms. - // - // If this is empty, the plugin will work across all platforms. - // - // If the plugin prefers certain platforms over others, they should be - // listed from most to least preferred. - Platforms []*types.Platform `protobuf:"bytes,4,rep,name=platforms,proto3" json:"platforms,omitempty"` - // Exports allows plugins to provide values about state or configuration to - // interested parties. - // - // One example is exposing the configured path of a snapshotter plugin. - Exports map[string]string `protobuf:"bytes,5,rep,name=exports,proto3" json:"exports,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Capabilities allows plugins to communicate feature switches to allow - // clients to detect features that may not be on be default or may be - // different from version to version. - // - // Use this sparingly. - Capabilities []string `protobuf:"bytes,6,rep,name=capabilities,proto3" json:"capabilities,omitempty"` - // InitErr will be set if the plugin fails initialization. - // - // This means the plugin may have been registered but a non-terminal error - // was encountered during initialization. - // - // Plugins that have this value set cannot be used. - InitErr *status.Status `protobuf:"bytes,7,opt,name=init_err,json=initErr,proto3" json:"init_err,omitempty"` -} - -func (x *Plugin) Reset() { - *x = Plugin{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Plugin) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Plugin) ProtoMessage() {} - -func (x *Plugin) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[0] - 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 Plugin.ProtoReflect.Descriptor instead. -func (*Plugin) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDescGZIP(), []int{0} -} - -func (x *Plugin) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Plugin) GetID() string { - if x != nil { - return x.ID - } - return "" -} - -func (x *Plugin) GetRequires() []string { - if x != nil { - return x.Requires - } - return nil -} - -func (x *Plugin) GetPlatforms() []*types.Platform { - if x != nil { - return x.Platforms - } - return nil -} - -func (x *Plugin) GetExports() map[string]string { - if x != nil { - return x.Exports - } - return nil -} - -func (x *Plugin) GetCapabilities() []string { - if x != nil { - return x.Capabilities - } - return nil -} - -func (x *Plugin) GetInitErr() *status.Status { - if x != nil { - return x.InitErr - } - return nil -} - -type PluginsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Filters contains one or more filters using the syntax defined in the - // containerd filter package. - // - // The returned result will be those that match any of the provided - // filters. Expanded, plugins that match the following will be - // returned: - // - // filters[0] or filters[1] or ... or filters[n-1] or filters[n] - // - // If filters is zero-length or nil, all items will be returned. - Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` -} - -func (x *PluginsRequest) Reset() { - *x = PluginsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PluginsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PluginsRequest) ProtoMessage() {} - -func (x *PluginsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[1] - 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 PluginsRequest.ProtoReflect.Descriptor instead. -func (*PluginsRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDescGZIP(), []int{1} -} - -func (x *PluginsRequest) GetFilters() []string { - if x != nil { - return x.Filters - } - return nil -} - -type PluginsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Plugins []*Plugin `protobuf:"bytes,1,rep,name=plugins,proto3" json:"plugins,omitempty"` -} - -func (x *PluginsResponse) Reset() { - *x = PluginsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PluginsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PluginsResponse) ProtoMessage() {} - -func (x *PluginsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[2] - 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 PluginsResponse.ProtoReflect.Descriptor instead. -func (*PluginsResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDescGZIP(), []int{2} -} - -func (x *PluginsResponse) GetPlugins() []*Plugin { - if x != nil { - return x.Plugins - } - return nil -} - -type ServerResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UUID string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` - Pid uint64 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"` - Pidns uint64 `protobuf:"varint,3,opt,name=pidns,proto3" json:"pidns,omitempty"` // PID namespace, such as 4026531836 - Deprecations []*DeprecationWarning `protobuf:"bytes,4,rep,name=deprecations,proto3" json:"deprecations,omitempty"` -} - -func (x *ServerResponse) Reset() { - *x = ServerResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerResponse) ProtoMessage() {} - -func (x *ServerResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[3] - 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 ServerResponse.ProtoReflect.Descriptor instead. -func (*ServerResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDescGZIP(), []int{3} -} - -func (x *ServerResponse) GetUUID() string { - if x != nil { - return x.UUID - } - return "" -} - -func (x *ServerResponse) GetPid() uint64 { - if x != nil { - return x.Pid - } - return 0 -} - -func (x *ServerResponse) GetPidns() uint64 { - if x != nil { - return x.Pidns - } - return 0 -} - -func (x *ServerResponse) GetDeprecations() []*DeprecationWarning { - if x != nil { - return x.Deprecations - } - return nil -} - -type DeprecationWarning struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - LastOccurrence *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=last_occurrence,json=lastOccurrence,proto3" json:"last_occurrence,omitempty"` -} - -func (x *DeprecationWarning) Reset() { - *x = DeprecationWarning{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeprecationWarning) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeprecationWarning) ProtoMessage() {} - -func (x *DeprecationWarning) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[4] - 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 DeprecationWarning.ProtoReflect.Descriptor instead. -func (*DeprecationWarning) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDescGZIP(), []int{4} -} - -func (x *DeprecationWarning) GetID() string { - if x != nil { - return x.ID - } - return "" -} - -func (x *DeprecationWarning) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *DeprecationWarning) GetLastOccurrence() *timestamppb.Timestamp { - if x != nil { - return x.LastOccurrence - } - return nil -} - -type PluginInfoRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - // Options may be used to request extra dynamic information from - // a plugin. - // This object is determined by the plugin and the plugin may return - // NotImplemented or InvalidArgument if it is not supported - Options *anypb.Any `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"` -} - -func (x *PluginInfoRequest) Reset() { - *x = PluginInfoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PluginInfoRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PluginInfoRequest) ProtoMessage() {} - -func (x *PluginInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[5] - 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 PluginInfoRequest.ProtoReflect.Descriptor instead. -func (*PluginInfoRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDescGZIP(), []int{5} -} - -func (x *PluginInfoRequest) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *PluginInfoRequest) GetID() string { - if x != nil { - return x.ID - } - return "" -} - -func (x *PluginInfoRequest) GetOptions() *anypb.Any { - if x != nil { - return x.Options - } - return nil -} - -type PluginInfoResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Plugin *Plugin `protobuf:"bytes,1,opt,name=plugin,proto3" json:"plugin,omitempty"` - Extra *anypb.Any `protobuf:"bytes,2,opt,name=extra,proto3" json:"extra,omitempty"` -} - -func (x *PluginInfoResponse) Reset() { - *x = PluginInfoResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PluginInfoResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PluginInfoResponse) ProtoMessage() {} - -func (x *PluginInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[6] - 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 PluginInfoResponse.ProtoReflect.Descriptor instead. -func (*PluginInfoResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDescGZIP(), []int{6} -} - -func (x *PluginInfoResponse) GetPlugin() *Plugin { - if x != nil { - return x.Plugin - } - return nil -} - -func (x *PluginInfoResponse) GetExtra() *anypb.Any { - if x != nil { - return x.Extra - } - return nil -} - -var File_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDesc = []byte{ - 0x0a, 0x52, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, - 0x2f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x24, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73, - 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe6, 0x02, 0x0a, 0x06, 0x50, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, - 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, - 0x65, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x52, 0x09, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x12, 0x53, 0x0a, 0x07, - 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x45, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, - 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, - 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x08, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x65, 0x72, - 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x07, 0x69, 0x6e, 0x69, - 0x74, 0x45, 0x72, 0x72, 0x1a, 0x3a, 0x0a, 0x0c, 0x45, 0x78, 0x70, 0x6f, 0x72, 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, 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, - 0x22, 0x2a, 0x0a, 0x0e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x59, 0x0a, 0x0f, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x46, 0x0a, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x07, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x22, 0xaa, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x10, - 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x70, 0x69, 0x64, - 0x12, 0x14, 0x0a, 0x05, 0x70, 0x69, 0x64, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x05, 0x70, 0x69, 0x64, 0x6e, 0x73, 0x12, 0x5c, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, - 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x83, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x43, 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6f, 0x63, - 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x6c, 0x61, 0x73, 0x74, - 0x4f, 0x63, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x67, 0x0a, 0x11, 0x50, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x22, 0x86, 0x01, 0x0a, 0x12, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x06, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x32, 0xe0, 0x02, 0x0a, - 0x0d, 0x49, 0x6e, 0x74, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x76, - 0x0a, 0x07, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x34, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x35, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, - 0x6e, 0x74, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7f, - 0x0a, 0x0a, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x37, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x72, - 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x4e, 0x5a, 0x4c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, - 0x31, 0x3b, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDescData = file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_goTypes = []interface{}{ - (*Plugin)(nil), // 0: containerd.services.introspection.v1.Plugin - (*PluginsRequest)(nil), // 1: containerd.services.introspection.v1.PluginsRequest - (*PluginsResponse)(nil), // 2: containerd.services.introspection.v1.PluginsResponse - (*ServerResponse)(nil), // 3: containerd.services.introspection.v1.ServerResponse - (*DeprecationWarning)(nil), // 4: containerd.services.introspection.v1.DeprecationWarning - (*PluginInfoRequest)(nil), // 5: containerd.services.introspection.v1.PluginInfoRequest - (*PluginInfoResponse)(nil), // 6: containerd.services.introspection.v1.PluginInfoResponse - nil, // 7: containerd.services.introspection.v1.Plugin.ExportsEntry - (*types.Platform)(nil), // 8: containerd.types.Platform - (*status.Status)(nil), // 9: google.rpc.Status - (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp - (*anypb.Any)(nil), // 11: google.protobuf.Any - (*emptypb.Empty)(nil), // 12: google.protobuf.Empty -} -var file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_depIdxs = []int32{ - 8, // 0: containerd.services.introspection.v1.Plugin.platforms:type_name -> containerd.types.Platform - 7, // 1: containerd.services.introspection.v1.Plugin.exports:type_name -> containerd.services.introspection.v1.Plugin.ExportsEntry - 9, // 2: containerd.services.introspection.v1.Plugin.init_err:type_name -> google.rpc.Status - 0, // 3: containerd.services.introspection.v1.PluginsResponse.plugins:type_name -> containerd.services.introspection.v1.Plugin - 4, // 4: containerd.services.introspection.v1.ServerResponse.deprecations:type_name -> containerd.services.introspection.v1.DeprecationWarning - 10, // 5: containerd.services.introspection.v1.DeprecationWarning.last_occurrence:type_name -> google.protobuf.Timestamp - 11, // 6: containerd.services.introspection.v1.PluginInfoRequest.options:type_name -> google.protobuf.Any - 0, // 7: containerd.services.introspection.v1.PluginInfoResponse.plugin:type_name -> containerd.services.introspection.v1.Plugin - 11, // 8: containerd.services.introspection.v1.PluginInfoResponse.extra:type_name -> google.protobuf.Any - 1, // 9: containerd.services.introspection.v1.Introspection.Plugins:input_type -> containerd.services.introspection.v1.PluginsRequest - 12, // 10: containerd.services.introspection.v1.Introspection.Server:input_type -> google.protobuf.Empty - 5, // 11: containerd.services.introspection.v1.Introspection.PluginInfo:input_type -> containerd.services.introspection.v1.PluginInfoRequest - 2, // 12: containerd.services.introspection.v1.Introspection.Plugins:output_type -> containerd.services.introspection.v1.PluginsResponse - 3, // 13: containerd.services.introspection.v1.Introspection.Server:output_type -> containerd.services.introspection.v1.ServerResponse - 6, // 14: containerd.services.introspection.v1.Introspection.PluginInfo:output_type -> containerd.services.introspection.v1.PluginInfoResponse - 12, // [12:15] is the sub-list for method output_type - 9, // [9:12] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name -} - -func init() { - file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_init() -} -func file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_init() { - if File_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Plugin); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PluginsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PluginsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeprecationWarning); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PluginInfoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PluginInfoResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDesc, - NumEnums: 0, - NumMessages: 8, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto = out.File - file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_rawDesc = nil - file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_goTypes = nil - file_github_com_containerd_containerd_api_services_introspection_v1_introspection_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection.proto b/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection.proto deleted file mode 100644 index 12fbcf5b96..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection.proto +++ /dev/null @@ -1,133 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.services.introspection.v1; - -import "google/protobuf/any.proto"; -import "github.com/containerd/containerd/api/types/introspection.proto"; -import "github.com/containerd/containerd/api/types/platform.proto"; -import "google/rpc/status.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "github.com/containerd/containerd/api/services/introspection/v1;introspection"; - -service Introspection { - // Plugins returns a list of plugins in containerd. - // - // Clients can use this to detect features and capabilities when using - // containerd. - rpc Plugins(PluginsRequest) returns (PluginsResponse); - // Server returns information about the containerd server - rpc Server(google.protobuf.Empty) returns (ServerResponse); - // PluginInfo returns information directly from a plugin if the plugin supports it - rpc PluginInfo(PluginInfoRequest) returns (PluginInfoResponse); -} - -message Plugin { - // Type defines the type of plugin. - // - // See package plugin for a list of possible values. Non core plugins may - // define their own values during registration. - string type = 1; - - // ID identifies the plugin uniquely in the system. - string id = 2; - - // Requires lists the plugin types required by this plugin. - repeated string requires = 3; - - // Platforms enumerates the platforms this plugin will support. - // - // If values are provided here, the plugin will only be operable under the - // provided platforms. - // - // If this is empty, the plugin will work across all platforms. - // - // If the plugin prefers certain platforms over others, they should be - // listed from most to least preferred. - repeated types.Platform platforms = 4; - - // Exports allows plugins to provide values about state or configuration to - // interested parties. - // - // One example is exposing the configured path of a snapshotter plugin. - map exports = 5; - - // Capabilities allows plugins to communicate feature switches to allow - // clients to detect features that may not be on be default or may be - // different from version to version. - // - // Use this sparingly. - repeated string capabilities = 6; - - // InitErr will be set if the plugin fails initialization. - // - // This means the plugin may have been registered but a non-terminal error - // was encountered during initialization. - // - // Plugins that have this value set cannot be used. - google.rpc.Status init_err = 7; -} - -message PluginsRequest { - // Filters contains one or more filters using the syntax defined in the - // containerd filter package. - // - // The returned result will be those that match any of the provided - // filters. Expanded, plugins that match the following will be - // returned: - // - // filters[0] or filters[1] or ... or filters[n-1] or filters[n] - // - // If filters is zero-length or nil, all items will be returned. - repeated string filters = 1; -} - -message PluginsResponse { - repeated Plugin plugins = 1; -} - -message ServerResponse { - string uuid = 1; - uint64 pid = 2; - uint64 pidns = 3; // PID namespace, such as 4026531836 - repeated DeprecationWarning deprecations = 4; -} - -message DeprecationWarning { - string id = 1; - string message = 2; - google.protobuf.Timestamp last_occurrence = 3; -} - -message PluginInfoRequest { - string type = 1; - string id = 2; - - // Options may be used to request extra dynamic information from - // a plugin. - // This object is determined by the plugin and the plugin may return - // NotImplemented or InvalidArgument if it is not supported - google.protobuf.Any options = 3; -} - -message PluginInfoResponse { - Plugin plugin = 1; - google.protobuf.Any extra = 2; -} diff --git a/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection_grpc.pb.go b/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection_grpc.pb.go deleted file mode 100644 index 135028ee9b..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection_grpc.pb.go +++ /dev/null @@ -1,192 +0,0 @@ -//go:build !no_grpc - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/introspection/v1/introspection.proto - -package introspection - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// IntrospectionClient is the client API for Introspection service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type IntrospectionClient interface { - // Plugins returns a list of plugins in containerd. - // - // Clients can use this to detect features and capabilities when using - // containerd. - Plugins(ctx context.Context, in *PluginsRequest, opts ...grpc.CallOption) (*PluginsResponse, error) - // Server returns information about the containerd server - Server(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ServerResponse, error) - // PluginInfo returns information directly from a plugin if the plugin supports it - PluginInfo(ctx context.Context, in *PluginInfoRequest, opts ...grpc.CallOption) (*PluginInfoResponse, error) -} - -type introspectionClient struct { - cc grpc.ClientConnInterface -} - -func NewIntrospectionClient(cc grpc.ClientConnInterface) IntrospectionClient { - return &introspectionClient{cc} -} - -func (c *introspectionClient) Plugins(ctx context.Context, in *PluginsRequest, opts ...grpc.CallOption) (*PluginsResponse, error) { - out := new(PluginsResponse) - err := c.cc.Invoke(ctx, "/containerd.services.introspection.v1.Introspection/Plugins", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *introspectionClient) Server(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ServerResponse, error) { - out := new(ServerResponse) - err := c.cc.Invoke(ctx, "/containerd.services.introspection.v1.Introspection/Server", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *introspectionClient) PluginInfo(ctx context.Context, in *PluginInfoRequest, opts ...grpc.CallOption) (*PluginInfoResponse, error) { - out := new(PluginInfoResponse) - err := c.cc.Invoke(ctx, "/containerd.services.introspection.v1.Introspection/PluginInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// IntrospectionServer is the server API for Introspection service. -// All implementations must embed UnimplementedIntrospectionServer -// for forward compatibility -type IntrospectionServer interface { - // Plugins returns a list of plugins in containerd. - // - // Clients can use this to detect features and capabilities when using - // containerd. - Plugins(context.Context, *PluginsRequest) (*PluginsResponse, error) - // Server returns information about the containerd server - Server(context.Context, *emptypb.Empty) (*ServerResponse, error) - // PluginInfo returns information directly from a plugin if the plugin supports it - PluginInfo(context.Context, *PluginInfoRequest) (*PluginInfoResponse, error) - mustEmbedUnimplementedIntrospectionServer() -} - -// UnimplementedIntrospectionServer must be embedded to have forward compatible implementations. -type UnimplementedIntrospectionServer struct { -} - -func (UnimplementedIntrospectionServer) Plugins(context.Context, *PluginsRequest) (*PluginsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Plugins not implemented") -} -func (UnimplementedIntrospectionServer) Server(context.Context, *emptypb.Empty) (*ServerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Server not implemented") -} -func (UnimplementedIntrospectionServer) PluginInfo(context.Context, *PluginInfoRequest) (*PluginInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PluginInfo not implemented") -} -func (UnimplementedIntrospectionServer) mustEmbedUnimplementedIntrospectionServer() {} - -// UnsafeIntrospectionServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to IntrospectionServer will -// result in compilation errors. -type UnsafeIntrospectionServer interface { - mustEmbedUnimplementedIntrospectionServer() -} - -func RegisterIntrospectionServer(s grpc.ServiceRegistrar, srv IntrospectionServer) { - s.RegisterService(&Introspection_ServiceDesc, srv) -} - -func _Introspection_Plugins_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PluginsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(IntrospectionServer).Plugins(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.introspection.v1.Introspection/Plugins", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IntrospectionServer).Plugins(ctx, req.(*PluginsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Introspection_Server_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(emptypb.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(IntrospectionServer).Server(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.introspection.v1.Introspection/Server", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IntrospectionServer).Server(ctx, req.(*emptypb.Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _Introspection_PluginInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PluginInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(IntrospectionServer).PluginInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.introspection.v1.Introspection/PluginInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IntrospectionServer).PluginInfo(ctx, req.(*PluginInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Introspection_ServiceDesc is the grpc.ServiceDesc for Introspection service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Introspection_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.services.introspection.v1.Introspection", - HandlerType: (*IntrospectionServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Plugins", - Handler: _Introspection_Plugins_Handler, - }, - { - MethodName: "Server", - Handler: _Introspection_Server_Handler, - }, - { - MethodName: "PluginInfo", - Handler: _Introspection_PluginInfo_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/containerd/containerd/api/services/introspection/v1/introspection.proto", -} diff --git a/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection_ttrpc.pb.go b/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection_ttrpc.pb.go deleted file mode 100644 index d8027d5f94..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection_ttrpc.pb.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/containerd/api/services/introspection/v1/introspection.proto -package introspection - -import ( - context "context" - ttrpc "github.com/containerd/ttrpc" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -type TTRPCIntrospectionService interface { - Plugins(context.Context, *PluginsRequest) (*PluginsResponse, error) - Server(context.Context, *emptypb.Empty) (*ServerResponse, error) - PluginInfo(context.Context, *PluginInfoRequest) (*PluginInfoResponse, error) -} - -func RegisterTTRPCIntrospectionService(srv *ttrpc.Server, svc TTRPCIntrospectionService) { - srv.RegisterService("containerd.services.introspection.v1.Introspection", &ttrpc.ServiceDesc{ - Methods: map[string]ttrpc.Method{ - "Plugins": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req PluginsRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Plugins(ctx, &req) - }, - "Server": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req emptypb.Empty - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Server(ctx, &req) - }, - "PluginInfo": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req PluginInfoRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.PluginInfo(ctx, &req) - }, - }, - }) -} - -type ttrpcintrospectionClient struct { - client *ttrpc.Client -} - -func NewTTRPCIntrospectionClient(client *ttrpc.Client) TTRPCIntrospectionService { - return &ttrpcintrospectionClient{ - client: client, - } -} - -func (c *ttrpcintrospectionClient) Plugins(ctx context.Context, req *PluginsRequest) (*PluginsResponse, error) { - var resp PluginsResponse - if err := c.client.Call(ctx, "containerd.services.introspection.v1.Introspection", "Plugins", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcintrospectionClient) Server(ctx context.Context, req *emptypb.Empty) (*ServerResponse, error) { - var resp ServerResponse - if err := c.client.Call(ctx, "containerd.services.introspection.v1.Introspection", "Server", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcintrospectionClient) PluginInfo(ctx context.Context, req *PluginInfoRequest) (*PluginInfoResponse, error) { - var resp PluginInfoResponse - if err := c.client.Call(ctx, "containerd.services.introspection.v1.Introspection", "PluginInfo", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/leases/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/leases/v1/doc.go deleted file mode 100644 index db2422a8bb..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/leases/v1/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package leases diff --git a/vendor/github.com/containerd/containerd/api/services/leases/v1/leases.pb.go b/vendor/github.com/containerd/containerd/api/services/leases/v1/leases.pb.go deleted file mode 100644 index 2a66f0f8b8..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/leases/v1/leases.pb.go +++ /dev/null @@ -1,961 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/leases/v1/leases.proto - -package leases - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -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) -) - -// Lease is an object which retains resources while it exists. -type Lease struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *Lease) Reset() { - *x = Lease{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Lease) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Lease) ProtoMessage() {} - -func (x *Lease) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[0] - 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 Lease.ProtoReflect.Descriptor instead. -func (*Lease) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescGZIP(), []int{0} -} - -func (x *Lease) GetID() string { - if x != nil { - return x.ID - } - return "" -} - -func (x *Lease) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *Lease) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -type CreateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // ID is used to identity the lease, when the id is not set the service - // generates a random identifier for the lease. - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *CreateRequest) Reset() { - *x = CreateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRequest) ProtoMessage() {} - -func (x *CreateRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[1] - 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 CreateRequest.ProtoReflect.Descriptor instead. -func (*CreateRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateRequest) GetID() string { - if x != nil { - return x.ID - } - return "" -} - -func (x *CreateRequest) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -type CreateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Lease *Lease `protobuf:"bytes,1,opt,name=lease,proto3" json:"lease,omitempty"` -} - -func (x *CreateResponse) Reset() { - *x = CreateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateResponse) ProtoMessage() {} - -func (x *CreateResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[2] - 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 CreateResponse.ProtoReflect.Descriptor instead. -func (*CreateResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescGZIP(), []int{2} -} - -func (x *CreateResponse) GetLease() *Lease { - if x != nil { - return x.Lease - } - return nil -} - -type DeleteRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Sync indicates that the delete and cleanup should be done - // synchronously before returning to the caller - // - // Default is false - Sync bool `protobuf:"varint,2,opt,name=sync,proto3" json:"sync,omitempty"` -} - -func (x *DeleteRequest) Reset() { - *x = DeleteRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRequest) ProtoMessage() {} - -func (x *DeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[3] - 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 DeleteRequest.ProtoReflect.Descriptor instead. -func (*DeleteRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescGZIP(), []int{3} -} - -func (x *DeleteRequest) GetID() string { - if x != nil { - return x.ID - } - return "" -} - -func (x *DeleteRequest) GetSync() bool { - if x != nil { - return x.Sync - } - return false -} - -type ListRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` -} - -func (x *ListRequest) Reset() { - *x = ListRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRequest) ProtoMessage() {} - -func (x *ListRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[4] - 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 ListRequest.ProtoReflect.Descriptor instead. -func (*ListRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescGZIP(), []int{4} -} - -func (x *ListRequest) GetFilters() []string { - if x != nil { - return x.Filters - } - return nil -} - -type ListResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Leases []*Lease `protobuf:"bytes,1,rep,name=leases,proto3" json:"leases,omitempty"` -} - -func (x *ListResponse) Reset() { - *x = ListResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListResponse) ProtoMessage() {} - -func (x *ListResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[5] - 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 ListResponse.ProtoReflect.Descriptor instead. -func (*ListResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescGZIP(), []int{5} -} - -func (x *ListResponse) GetLeases() []*Lease { - if x != nil { - return x.Leases - } - return nil -} - -type Resource struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // For snapshotter resource, there are many snapshotter types here, like - // overlayfs, devmapper etc. The type will be formatted with type, - // like "snapshotter/overlayfs". - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` -} - -func (x *Resource) Reset() { - *x = Resource{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Resource) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Resource) ProtoMessage() {} - -func (x *Resource) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[6] - 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 Resource.ProtoReflect.Descriptor instead. -func (*Resource) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescGZIP(), []int{6} -} - -func (x *Resource) GetID() string { - if x != nil { - return x.ID - } - return "" -} - -func (x *Resource) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -type AddResourceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Resource *Resource `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` -} - -func (x *AddResourceRequest) Reset() { - *x = AddResourceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddResourceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddResourceRequest) ProtoMessage() {} - -func (x *AddResourceRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[7] - 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 AddResourceRequest.ProtoReflect.Descriptor instead. -func (*AddResourceRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescGZIP(), []int{7} -} - -func (x *AddResourceRequest) GetID() string { - if x != nil { - return x.ID - } - return "" -} - -func (x *AddResourceRequest) GetResource() *Resource { - if x != nil { - return x.Resource - } - return nil -} - -type DeleteResourceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Resource *Resource `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` -} - -func (x *DeleteResourceRequest) Reset() { - *x = DeleteResourceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteResourceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteResourceRequest) ProtoMessage() {} - -func (x *DeleteResourceRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[8] - 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 DeleteResourceRequest.ProtoReflect.Descriptor instead. -func (*DeleteResourceRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescGZIP(), []int{8} -} - -func (x *DeleteResourceRequest) GetID() string { - if x != nil { - return x.ID - } - return "" -} - -func (x *DeleteResourceRequest) GetResource() *Resource { - if x != nil { - return x.Resource - } - return nil -} - -type ListResourcesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *ListResourcesRequest) Reset() { - *x = ListResourcesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListResourcesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListResourcesRequest) ProtoMessage() {} - -func (x *ListResourcesRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[9] - 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 ListResourcesRequest.ProtoReflect.Descriptor instead. -func (*ListResourcesRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescGZIP(), []int{9} -} - -func (x *ListResourcesRequest) GetID() string { - if x != nil { - return x.ID - } - return "" -} - -type ListResourcesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Resources []*Resource `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` -} - -func (x *ListResourcesResponse) Reset() { - *x = ListResourcesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListResourcesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListResourcesResponse) ProtoMessage() {} - -func (x *ListResourcesResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[10] - 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 ListResourcesResponse.ProtoReflect.Descriptor instead. -func (*ListResourcesResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescGZIP(), []int{10} -} - -func (x *ListResourcesResponse) GetResources() []*Resource { - if x != nil { - return x.Resources - } - return nil -} - -var File_github_com_containerd_containerd_api_services_leases_v1_leases_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDesc = []byte{ - 0x0a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xd7, 0x01, 0x0a, 0x05, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, - 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x48, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x65, 0x61, 0x73, 0x65, 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, 0x22, 0xac, 0x01, - 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x50, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x38, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x22, 0x4c, 0x0a, 0x0e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, - 0x0a, 0x05, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x65, - 0x61, 0x73, 0x65, 0x52, 0x05, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x33, 0x0a, 0x0d, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, - 0x79, 0x6e, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x73, 0x79, 0x6e, 0x63, 0x22, - 0x27, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x4c, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x06, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x22, 0x2e, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x69, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x08, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x22, 0x6c, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, - 0x26, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x5e, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x45, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x32, 0xd6, 0x04, 0x0a, 0x06, 0x4c, 0x65, 0x61, 0x73, - 0x65, 0x73, 0x12, 0x65, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x06, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x5f, 0x0a, 0x04, 0x4c, 0x69, 0x73, - 0x74, 0x12, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0b, 0x41, 0x64, - 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x12, 0x5e, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x34, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x12, 0x7a, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2f, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescData = file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_goTypes = []interface{}{ - (*Lease)(nil), // 0: containerd.services.leases.v1.Lease - (*CreateRequest)(nil), // 1: containerd.services.leases.v1.CreateRequest - (*CreateResponse)(nil), // 2: containerd.services.leases.v1.CreateResponse - (*DeleteRequest)(nil), // 3: containerd.services.leases.v1.DeleteRequest - (*ListRequest)(nil), // 4: containerd.services.leases.v1.ListRequest - (*ListResponse)(nil), // 5: containerd.services.leases.v1.ListResponse - (*Resource)(nil), // 6: containerd.services.leases.v1.Resource - (*AddResourceRequest)(nil), // 7: containerd.services.leases.v1.AddResourceRequest - (*DeleteResourceRequest)(nil), // 8: containerd.services.leases.v1.DeleteResourceRequest - (*ListResourcesRequest)(nil), // 9: containerd.services.leases.v1.ListResourcesRequest - (*ListResourcesResponse)(nil), // 10: containerd.services.leases.v1.ListResourcesResponse - nil, // 11: containerd.services.leases.v1.Lease.LabelsEntry - nil, // 12: containerd.services.leases.v1.CreateRequest.LabelsEntry - (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp - (*emptypb.Empty)(nil), // 14: google.protobuf.Empty -} -var file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_depIdxs = []int32{ - 13, // 0: containerd.services.leases.v1.Lease.created_at:type_name -> google.protobuf.Timestamp - 11, // 1: containerd.services.leases.v1.Lease.labels:type_name -> containerd.services.leases.v1.Lease.LabelsEntry - 12, // 2: containerd.services.leases.v1.CreateRequest.labels:type_name -> containerd.services.leases.v1.CreateRequest.LabelsEntry - 0, // 3: containerd.services.leases.v1.CreateResponse.lease:type_name -> containerd.services.leases.v1.Lease - 0, // 4: containerd.services.leases.v1.ListResponse.leases:type_name -> containerd.services.leases.v1.Lease - 6, // 5: containerd.services.leases.v1.AddResourceRequest.resource:type_name -> containerd.services.leases.v1.Resource - 6, // 6: containerd.services.leases.v1.DeleteResourceRequest.resource:type_name -> containerd.services.leases.v1.Resource - 6, // 7: containerd.services.leases.v1.ListResourcesResponse.resources:type_name -> containerd.services.leases.v1.Resource - 1, // 8: containerd.services.leases.v1.Leases.Create:input_type -> containerd.services.leases.v1.CreateRequest - 3, // 9: containerd.services.leases.v1.Leases.Delete:input_type -> containerd.services.leases.v1.DeleteRequest - 4, // 10: containerd.services.leases.v1.Leases.List:input_type -> containerd.services.leases.v1.ListRequest - 7, // 11: containerd.services.leases.v1.Leases.AddResource:input_type -> containerd.services.leases.v1.AddResourceRequest - 8, // 12: containerd.services.leases.v1.Leases.DeleteResource:input_type -> containerd.services.leases.v1.DeleteResourceRequest - 9, // 13: containerd.services.leases.v1.Leases.ListResources:input_type -> containerd.services.leases.v1.ListResourcesRequest - 2, // 14: containerd.services.leases.v1.Leases.Create:output_type -> containerd.services.leases.v1.CreateResponse - 14, // 15: containerd.services.leases.v1.Leases.Delete:output_type -> google.protobuf.Empty - 5, // 16: containerd.services.leases.v1.Leases.List:output_type -> containerd.services.leases.v1.ListResponse - 14, // 17: containerd.services.leases.v1.Leases.AddResource:output_type -> google.protobuf.Empty - 14, // 18: containerd.services.leases.v1.Leases.DeleteResource:output_type -> google.protobuf.Empty - 10, // 19: containerd.services.leases.v1.Leases.ListResources:output_type -> containerd.services.leases.v1.ListResourcesResponse - 14, // [14:20] is the sub-list for method output_type - 8, // [8:14] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_init() } -func file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_init() { - if File_github_com_containerd_containerd_api_services_leases_v1_leases_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Lease); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Resource); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddResourceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteResourceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListResourcesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListResourcesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDesc, - NumEnums: 0, - NumMessages: 13, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_services_leases_v1_leases_proto = out.File - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_rawDesc = nil - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_goTypes = nil - file_github_com_containerd_containerd_api_services_leases_v1_leases_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/leases/v1/leases.proto b/vendor/github.com/containerd/containerd/api/services/leases/v1/leases.proto deleted file mode 100644 index 8551fcea7f..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/leases/v1/leases.proto +++ /dev/null @@ -1,116 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -syntax = "proto3"; - -package containerd.services.leases.v1; - -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "github.com/containerd/containerd/api/services/leases/v1;leases"; - -// Leases service manages resources leases within the metadata store. -service Leases { - // Create creates a new lease for managing changes to metadata. A lease - // can be used to protect objects from being removed. - rpc Create(CreateRequest) returns (CreateResponse); - - // Delete deletes the lease and makes any unreferenced objects created - // during the lease eligible for garbage collection if not referenced - // or retained by other resources during the lease. - rpc Delete(DeleteRequest) returns (google.protobuf.Empty); - - // List lists all active leases, returning the full list of - // leases and optionally including the referenced resources. - rpc List(ListRequest) returns (ListResponse); - - // AddResource references the resource by the provided lease. - rpc AddResource(AddResourceRequest) returns (google.protobuf.Empty); - - // DeleteResource dereferences the resource by the provided lease. - rpc DeleteResource(DeleteResourceRequest) returns (google.protobuf.Empty); - - // ListResources lists all the resources referenced by the lease. - rpc ListResources(ListResourcesRequest) returns (ListResourcesResponse); -} - -// Lease is an object which retains resources while it exists. -message Lease { - string id = 1; - - google.protobuf.Timestamp created_at = 2; - - map labels = 3; -} - -message CreateRequest { - // ID is used to identity the lease, when the id is not set the service - // generates a random identifier for the lease. - string id = 1; - - map labels = 3; -} - -message CreateResponse { - Lease lease = 1; -} - -message DeleteRequest { - string id = 1; - - // Sync indicates that the delete and cleanup should be done - // synchronously before returning to the caller - // - // Default is false - bool sync = 2; -} - -message ListRequest { - repeated string filters = 1; -} - -message ListResponse { - repeated Lease leases = 1; -} - -message Resource { - string id = 1; - - // For snapshotter resource, there are many snapshotter types here, like - // overlayfs, devmapper etc. The type will be formatted with type, - // like "snapshotter/overlayfs". - string type = 2; -} - -message AddResourceRequest { - string id = 1; - - Resource resource = 2; -} - -message DeleteResourceRequest { - string id = 1; - - Resource resource = 2; -} - -message ListResourcesRequest { - string id = 1; -} - -message ListResourcesResponse { - repeated Resource resources = 1 ; -} diff --git a/vendor/github.com/containerd/containerd/api/services/leases/v1/leases_grpc.pb.go b/vendor/github.com/containerd/containerd/api/services/leases/v1/leases_grpc.pb.go deleted file mode 100644 index 7f5f5531ff..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/leases/v1/leases_grpc.pb.go +++ /dev/null @@ -1,308 +0,0 @@ -//go:build !no_grpc - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/leases/v1/leases.proto - -package leases - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// LeasesClient is the client API for Leases service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type LeasesClient interface { - // Create creates a new lease for managing changes to metadata. A lease - // can be used to protect objects from being removed. - Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) - // Delete deletes the lease and makes any unreferenced objects created - // during the lease eligible for garbage collection if not referenced - // or retained by other resources during the lease. - Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // List lists all active leases, returning the full list of - // leases and optionally including the referenced resources. - List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) - // AddResource references the resource by the provided lease. - AddResource(ctx context.Context, in *AddResourceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // DeleteResource dereferences the resource by the provided lease. - DeleteResource(ctx context.Context, in *DeleteResourceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // ListResources lists all the resources referenced by the lease. - ListResources(ctx context.Context, in *ListResourcesRequest, opts ...grpc.CallOption) (*ListResourcesResponse, error) -} - -type leasesClient struct { - cc grpc.ClientConnInterface -} - -func NewLeasesClient(cc grpc.ClientConnInterface) LeasesClient { - return &leasesClient{cc} -} - -func (c *leasesClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) { - out := new(CreateResponse) - err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/Create", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *leasesClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/Delete", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *leasesClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { - out := new(ListResponse) - err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/List", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *leasesClient) AddResource(ctx context.Context, in *AddResourceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/AddResource", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *leasesClient) DeleteResource(ctx context.Context, in *DeleteResourceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/DeleteResource", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *leasesClient) ListResources(ctx context.Context, in *ListResourcesRequest, opts ...grpc.CallOption) (*ListResourcesResponse, error) { - out := new(ListResourcesResponse) - err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/ListResources", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// LeasesServer is the server API for Leases service. -// All implementations must embed UnimplementedLeasesServer -// for forward compatibility -type LeasesServer interface { - // Create creates a new lease for managing changes to metadata. A lease - // can be used to protect objects from being removed. - Create(context.Context, *CreateRequest) (*CreateResponse, error) - // Delete deletes the lease and makes any unreferenced objects created - // during the lease eligible for garbage collection if not referenced - // or retained by other resources during the lease. - Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error) - // List lists all active leases, returning the full list of - // leases and optionally including the referenced resources. - List(context.Context, *ListRequest) (*ListResponse, error) - // AddResource references the resource by the provided lease. - AddResource(context.Context, *AddResourceRequest) (*emptypb.Empty, error) - // DeleteResource dereferences the resource by the provided lease. - DeleteResource(context.Context, *DeleteResourceRequest) (*emptypb.Empty, error) - // ListResources lists all the resources referenced by the lease. - ListResources(context.Context, *ListResourcesRequest) (*ListResourcesResponse, error) - mustEmbedUnimplementedLeasesServer() -} - -// UnimplementedLeasesServer must be embedded to have forward compatible implementations. -type UnimplementedLeasesServer struct { -} - -func (UnimplementedLeasesServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") -} -func (UnimplementedLeasesServer) Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") -} -func (UnimplementedLeasesServer) List(context.Context, *ListRequest) (*ListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method List not implemented") -} -func (UnimplementedLeasesServer) AddResource(context.Context, *AddResourceRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddResource not implemented") -} -func (UnimplementedLeasesServer) DeleteResource(context.Context, *DeleteResourceRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteResource not implemented") -} -func (UnimplementedLeasesServer) ListResources(context.Context, *ListResourcesRequest) (*ListResourcesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListResources not implemented") -} -func (UnimplementedLeasesServer) mustEmbedUnimplementedLeasesServer() {} - -// UnsafeLeasesServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to LeasesServer will -// result in compilation errors. -type UnsafeLeasesServer interface { - mustEmbedUnimplementedLeasesServer() -} - -func RegisterLeasesServer(s grpc.ServiceRegistrar, srv LeasesServer) { - s.RegisterService(&Leases_ServiceDesc, srv) -} - -func _Leases_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LeasesServer).Create(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.leases.v1.Leases/Create", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LeasesServer).Create(ctx, req.(*CreateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Leases_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LeasesServer).Delete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.leases.v1.Leases/Delete", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LeasesServer).Delete(ctx, req.(*DeleteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Leases_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LeasesServer).List(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.leases.v1.Leases/List", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LeasesServer).List(ctx, req.(*ListRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Leases_AddResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddResourceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LeasesServer).AddResource(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.leases.v1.Leases/AddResource", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LeasesServer).AddResource(ctx, req.(*AddResourceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Leases_DeleteResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteResourceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LeasesServer).DeleteResource(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.leases.v1.Leases/DeleteResource", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LeasesServer).DeleteResource(ctx, req.(*DeleteResourceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Leases_ListResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListResourcesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LeasesServer).ListResources(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.leases.v1.Leases/ListResources", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LeasesServer).ListResources(ctx, req.(*ListResourcesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Leases_ServiceDesc is the grpc.ServiceDesc for Leases service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Leases_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.services.leases.v1.Leases", - HandlerType: (*LeasesServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Create", - Handler: _Leases_Create_Handler, - }, - { - MethodName: "Delete", - Handler: _Leases_Delete_Handler, - }, - { - MethodName: "List", - Handler: _Leases_List_Handler, - }, - { - MethodName: "AddResource", - Handler: _Leases_AddResource_Handler, - }, - { - MethodName: "DeleteResource", - Handler: _Leases_DeleteResource_Handler, - }, - { - MethodName: "ListResources", - Handler: _Leases_ListResources_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/containerd/containerd/api/services/leases/v1/leases.proto", -} diff --git a/vendor/github.com/containerd/containerd/api/services/leases/v1/leases_ttrpc.pb.go b/vendor/github.com/containerd/containerd/api/services/leases/v1/leases_ttrpc.pb.go deleted file mode 100644 index af63dc0907..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/leases/v1/leases_ttrpc.pb.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/containerd/api/services/leases/v1/leases.proto -package leases - -import ( - context "context" - ttrpc "github.com/containerd/ttrpc" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -type TTRPCLeasesService interface { - Create(context.Context, *CreateRequest) (*CreateResponse, error) - Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error) - List(context.Context, *ListRequest) (*ListResponse, error) - AddResource(context.Context, *AddResourceRequest) (*emptypb.Empty, error) - DeleteResource(context.Context, *DeleteResourceRequest) (*emptypb.Empty, error) - ListResources(context.Context, *ListResourcesRequest) (*ListResourcesResponse, error) -} - -func RegisterTTRPCLeasesService(srv *ttrpc.Server, svc TTRPCLeasesService) { - srv.RegisterService("containerd.services.leases.v1.Leases", &ttrpc.ServiceDesc{ - Methods: map[string]ttrpc.Method{ - "Create": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req CreateRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Create(ctx, &req) - }, - "Delete": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req DeleteRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Delete(ctx, &req) - }, - "List": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ListRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.List(ctx, &req) - }, - "AddResource": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req AddResourceRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.AddResource(ctx, &req) - }, - "DeleteResource": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req DeleteResourceRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.DeleteResource(ctx, &req) - }, - "ListResources": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ListResourcesRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.ListResources(ctx, &req) - }, - }, - }) -} - -type ttrpcleasesClient struct { - client *ttrpc.Client -} - -func NewTTRPCLeasesClient(client *ttrpc.Client) TTRPCLeasesService { - return &ttrpcleasesClient{ - client: client, - } -} - -func (c *ttrpcleasesClient) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error) { - var resp CreateResponse - if err := c.client.Call(ctx, "containerd.services.leases.v1.Leases", "Create", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcleasesClient) Delete(ctx context.Context, req *DeleteRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.leases.v1.Leases", "Delete", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcleasesClient) List(ctx context.Context, req *ListRequest) (*ListResponse, error) { - var resp ListResponse - if err := c.client.Call(ctx, "containerd.services.leases.v1.Leases", "List", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcleasesClient) AddResource(ctx context.Context, req *AddResourceRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.leases.v1.Leases", "AddResource", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcleasesClient) DeleteResource(ctx context.Context, req *DeleteResourceRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.leases.v1.Leases", "DeleteResource", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcleasesClient) ListResources(ctx context.Context, req *ListResourcesRequest) (*ListResourcesResponse, error) { - var resp ListResourcesResponse - if err := c.client.Call(ctx, "containerd.services.leases.v1.Leases", "ListResources", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/namespaces/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/namespaces/v1/doc.go deleted file mode 100644 index 4315f94072..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/namespaces/v1/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package namespaces diff --git a/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace.pb.go b/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace.pb.go deleted file mode 100644 index a75a315c43..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace.pb.go +++ /dev/null @@ -1,867 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/namespaces/v1/namespace.proto - -package namespaces - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" - reflect "reflect" - sync "sync" -) - -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) -) - -type Namespace struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Labels provides an area to include arbitrary data on namespaces. - // - // The combined size of a key/value pair cannot exceed 4096 bytes. - // - // Note that to add a new value to this field, read the existing set and - // include the entire result in the update call. - Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *Namespace) Reset() { - *x = Namespace{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Namespace) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Namespace) ProtoMessage() {} - -func (x *Namespace) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[0] - 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 Namespace.ProtoReflect.Descriptor instead. -func (*Namespace) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescGZIP(), []int{0} -} - -func (x *Namespace) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Namespace) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -type GetNamespaceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetNamespaceRequest) Reset() { - *x = GetNamespaceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetNamespaceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetNamespaceRequest) ProtoMessage() {} - -func (x *GetNamespaceRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[1] - 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 GetNamespaceRequest.ProtoReflect.Descriptor instead. -func (*GetNamespaceRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescGZIP(), []int{1} -} - -func (x *GetNamespaceRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type GetNamespaceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespace *Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` -} - -func (x *GetNamespaceResponse) Reset() { - *x = GetNamespaceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetNamespaceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetNamespaceResponse) ProtoMessage() {} - -func (x *GetNamespaceResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[2] - 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 GetNamespaceResponse.ProtoReflect.Descriptor instead. -func (*GetNamespaceResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescGZIP(), []int{2} -} - -func (x *GetNamespaceResponse) GetNamespace() *Namespace { - if x != nil { - return x.Namespace - } - return nil -} - -type ListNamespacesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` -} - -func (x *ListNamespacesRequest) Reset() { - *x = ListNamespacesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListNamespacesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListNamespacesRequest) ProtoMessage() {} - -func (x *ListNamespacesRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[3] - 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 ListNamespacesRequest.ProtoReflect.Descriptor instead. -func (*ListNamespacesRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescGZIP(), []int{3} -} - -func (x *ListNamespacesRequest) GetFilter() string { - if x != nil { - return x.Filter - } - return "" -} - -type ListNamespacesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespaces []*Namespace `protobuf:"bytes,1,rep,name=namespaces,proto3" json:"namespaces,omitempty"` -} - -func (x *ListNamespacesResponse) Reset() { - *x = ListNamespacesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListNamespacesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListNamespacesResponse) ProtoMessage() {} - -func (x *ListNamespacesResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[4] - 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 ListNamespacesResponse.ProtoReflect.Descriptor instead. -func (*ListNamespacesResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescGZIP(), []int{4} -} - -func (x *ListNamespacesResponse) GetNamespaces() []*Namespace { - if x != nil { - return x.Namespaces - } - return nil -} - -type CreateNamespaceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespace *Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` -} - -func (x *CreateNamespaceRequest) Reset() { - *x = CreateNamespaceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateNamespaceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateNamespaceRequest) ProtoMessage() {} - -func (x *CreateNamespaceRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[5] - 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 CreateNamespaceRequest.ProtoReflect.Descriptor instead. -func (*CreateNamespaceRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescGZIP(), []int{5} -} - -func (x *CreateNamespaceRequest) GetNamespace() *Namespace { - if x != nil { - return x.Namespace - } - return nil -} - -type CreateNamespaceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespace *Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` -} - -func (x *CreateNamespaceResponse) Reset() { - *x = CreateNamespaceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateNamespaceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateNamespaceResponse) ProtoMessage() {} - -func (x *CreateNamespaceResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[6] - 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 CreateNamespaceResponse.ProtoReflect.Descriptor instead. -func (*CreateNamespaceResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescGZIP(), []int{6} -} - -func (x *CreateNamespaceResponse) GetNamespace() *Namespace { - if x != nil { - return x.Namespace - } - return nil -} - -// UpdateNamespaceRequest updates the metadata for a namespace. -// -// The operation should follow semantics described in -// https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/field-mask, -// unless otherwise qualified. -type UpdateNamespaceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Namespace provides the target value, as declared by the mask, for the update. - // - // The namespace field must be set. - Namespace *Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - // UpdateMask specifies which fields to perform the update on. If empty, - // the operation applies to all fields. - // - // For the most part, this applies only to selectively updating labels on - // the namespace. While field masks are typically limited to ascii alphas - // and digits, we just take everything after the "labels." as the map key. - UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` -} - -func (x *UpdateNamespaceRequest) Reset() { - *x = UpdateNamespaceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateNamespaceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNamespaceRequest) ProtoMessage() {} - -func (x *UpdateNamespaceRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[7] - 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 UpdateNamespaceRequest.ProtoReflect.Descriptor instead. -func (*UpdateNamespaceRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescGZIP(), []int{7} -} - -func (x *UpdateNamespaceRequest) GetNamespace() *Namespace { - if x != nil { - return x.Namespace - } - return nil -} - -func (x *UpdateNamespaceRequest) GetUpdateMask() *fieldmaskpb.FieldMask { - if x != nil { - return x.UpdateMask - } - return nil -} - -type UpdateNamespaceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespace *Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` -} - -func (x *UpdateNamespaceResponse) Reset() { - *x = UpdateNamespaceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateNamespaceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNamespaceResponse) ProtoMessage() {} - -func (x *UpdateNamespaceResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[8] - 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 UpdateNamespaceResponse.ProtoReflect.Descriptor instead. -func (*UpdateNamespaceResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescGZIP(), []int{8} -} - -func (x *UpdateNamespaceResponse) GetNamespace() *Namespace { - if x != nil { - return x.Namespace - } - return nil -} - -type DeleteNamespaceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *DeleteNamespaceRequest) Reset() { - *x = DeleteNamespaceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteNamespaceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteNamespaceRequest) ProtoMessage() {} - -func (x *DeleteNamespaceRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[9] - 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 DeleteNamespaceRequest.ProtoReflect.Descriptor instead. -func (*DeleteNamespaceRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescGZIP(), []int{9} -} - -func (x *DeleteNamespaceRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -var File_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDesc = []byte{ - 0x0a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, - 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xac, 0x01, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x50, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x38, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 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, 0x22, 0x29, - 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x62, 0x0a, 0x14, 0x47, 0x65, 0x74, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x4a, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x2f, 0x0a, - 0x15, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x66, - 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x22, 0x64, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x4a, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x65, 0x0a, 0x17, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x22, 0xa1, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4a, - 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, - 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x65, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x2c, - 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x32, 0xe0, 0x04, 0x0a, - 0x0a, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x76, 0x0a, 0x03, 0x47, - 0x65, 0x74, 0x12, 0x36, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x38, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x7f, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x39, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x7f, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x39, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x39, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, - 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescData = file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes = make([]protoimpl.MessageInfo, 11) -var file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_goTypes = []interface{}{ - (*Namespace)(nil), // 0: containerd.services.namespaces.v1.Namespace - (*GetNamespaceRequest)(nil), // 1: containerd.services.namespaces.v1.GetNamespaceRequest - (*GetNamespaceResponse)(nil), // 2: containerd.services.namespaces.v1.GetNamespaceResponse - (*ListNamespacesRequest)(nil), // 3: containerd.services.namespaces.v1.ListNamespacesRequest - (*ListNamespacesResponse)(nil), // 4: containerd.services.namespaces.v1.ListNamespacesResponse - (*CreateNamespaceRequest)(nil), // 5: containerd.services.namespaces.v1.CreateNamespaceRequest - (*CreateNamespaceResponse)(nil), // 6: containerd.services.namespaces.v1.CreateNamespaceResponse - (*UpdateNamespaceRequest)(nil), // 7: containerd.services.namespaces.v1.UpdateNamespaceRequest - (*UpdateNamespaceResponse)(nil), // 8: containerd.services.namespaces.v1.UpdateNamespaceResponse - (*DeleteNamespaceRequest)(nil), // 9: containerd.services.namespaces.v1.DeleteNamespaceRequest - nil, // 10: containerd.services.namespaces.v1.Namespace.LabelsEntry - (*fieldmaskpb.FieldMask)(nil), // 11: google.protobuf.FieldMask - (*emptypb.Empty)(nil), // 12: google.protobuf.Empty -} -var file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_depIdxs = []int32{ - 10, // 0: containerd.services.namespaces.v1.Namespace.labels:type_name -> containerd.services.namespaces.v1.Namespace.LabelsEntry - 0, // 1: containerd.services.namespaces.v1.GetNamespaceResponse.namespace:type_name -> containerd.services.namespaces.v1.Namespace - 0, // 2: containerd.services.namespaces.v1.ListNamespacesResponse.namespaces:type_name -> containerd.services.namespaces.v1.Namespace - 0, // 3: containerd.services.namespaces.v1.CreateNamespaceRequest.namespace:type_name -> containerd.services.namespaces.v1.Namespace - 0, // 4: containerd.services.namespaces.v1.CreateNamespaceResponse.namespace:type_name -> containerd.services.namespaces.v1.Namespace - 0, // 5: containerd.services.namespaces.v1.UpdateNamespaceRequest.namespace:type_name -> containerd.services.namespaces.v1.Namespace - 11, // 6: containerd.services.namespaces.v1.UpdateNamespaceRequest.update_mask:type_name -> google.protobuf.FieldMask - 0, // 7: containerd.services.namespaces.v1.UpdateNamespaceResponse.namespace:type_name -> containerd.services.namespaces.v1.Namespace - 1, // 8: containerd.services.namespaces.v1.Namespaces.Get:input_type -> containerd.services.namespaces.v1.GetNamespaceRequest - 3, // 9: containerd.services.namespaces.v1.Namespaces.List:input_type -> containerd.services.namespaces.v1.ListNamespacesRequest - 5, // 10: containerd.services.namespaces.v1.Namespaces.Create:input_type -> containerd.services.namespaces.v1.CreateNamespaceRequest - 7, // 11: containerd.services.namespaces.v1.Namespaces.Update:input_type -> containerd.services.namespaces.v1.UpdateNamespaceRequest - 9, // 12: containerd.services.namespaces.v1.Namespaces.Delete:input_type -> containerd.services.namespaces.v1.DeleteNamespaceRequest - 2, // 13: containerd.services.namespaces.v1.Namespaces.Get:output_type -> containerd.services.namespaces.v1.GetNamespaceResponse - 4, // 14: containerd.services.namespaces.v1.Namespaces.List:output_type -> containerd.services.namespaces.v1.ListNamespacesResponse - 6, // 15: containerd.services.namespaces.v1.Namespaces.Create:output_type -> containerd.services.namespaces.v1.CreateNamespaceResponse - 8, // 16: containerd.services.namespaces.v1.Namespaces.Update:output_type -> containerd.services.namespaces.v1.UpdateNamespaceResponse - 12, // 17: containerd.services.namespaces.v1.Namespaces.Delete:output_type -> google.protobuf.Empty - 13, // [13:18] is the sub-list for method output_type - 8, // [8:13] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_init() } -func file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_init() { - if File_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Namespace); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetNamespaceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetNamespaceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListNamespacesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListNamespacesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateNamespaceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateNamespaceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateNamespaceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateNamespaceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteNamespaceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDesc, - NumEnums: 0, - NumMessages: 11, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto = out.File - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_rawDesc = nil - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_goTypes = nil - file_github_com_containerd_containerd_api_services_namespaces_v1_namespace_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace.proto b/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace.proto deleted file mode 100644 index 910bcd6c72..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace.proto +++ /dev/null @@ -1,107 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.services.namespaces.v1; - -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option go_package = "github.com/containerd/containerd/api/services/namespaces/v1;namespaces"; - -// Namespaces provides the ability to manipulate containerd namespaces. -// -// All objects in the system are required to be a member of a namespace. If a -// namespace is deleted, all objects, including containers, images and -// snapshots, will be deleted, as well. -// -// Unless otherwise noted, operations in containerd apply only to the namespace -// supplied per request. -// -// I hope this goes without saying, but namespaces are themselves NOT -// namespaced. -service Namespaces { - rpc Get(GetNamespaceRequest) returns (GetNamespaceResponse); - rpc List(ListNamespacesRequest) returns (ListNamespacesResponse); - rpc Create(CreateNamespaceRequest) returns (CreateNamespaceResponse); - rpc Update(UpdateNamespaceRequest) returns (UpdateNamespaceResponse); - rpc Delete(DeleteNamespaceRequest) returns (google.protobuf.Empty); -} - -message Namespace { - string name = 1; - - // Labels provides an area to include arbitrary data on namespaces. - // - // The combined size of a key/value pair cannot exceed 4096 bytes. - // - // Note that to add a new value to this field, read the existing set and - // include the entire result in the update call. - map labels = 2; -} - -message GetNamespaceRequest { - string name = 1; -} - -message GetNamespaceResponse { - Namespace namespace = 1; -} - -message ListNamespacesRequest { - string filter = 1; -} - -message ListNamespacesResponse { - repeated Namespace namespaces = 1; -} - -message CreateNamespaceRequest { - Namespace namespace = 1; -} - -message CreateNamespaceResponse { - Namespace namespace = 1; -} - -// UpdateNamespaceRequest updates the metadata for a namespace. -// -// The operation should follow semantics described in -// https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/field-mask, -// unless otherwise qualified. -message UpdateNamespaceRequest { - // Namespace provides the target value, as declared by the mask, for the update. - // - // The namespace field must be set. - Namespace namespace = 1; - - // UpdateMask specifies which fields to perform the update on. If empty, - // the operation applies to all fields. - // - // For the most part, this applies only to selectively updating labels on - // the namespace. While field masks are typically limited to ascii alphas - // and digits, we just take everything after the "labels." as the map key. - google.protobuf.FieldMask update_mask = 2; -} - -message UpdateNamespaceResponse { - Namespace namespace = 1; -} - -message DeleteNamespaceRequest { - string name = 1; -} diff --git a/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace_grpc.pb.go b/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace_grpc.pb.go deleted file mode 100644 index d35d71d7bc..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace_grpc.pb.go +++ /dev/null @@ -1,252 +0,0 @@ -//go:build !no_grpc - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/namespaces/v1/namespace.proto - -package namespaces - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// NamespacesClient is the client API for Namespaces service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type NamespacesClient interface { - Get(ctx context.Context, in *GetNamespaceRequest, opts ...grpc.CallOption) (*GetNamespaceResponse, error) - List(ctx context.Context, in *ListNamespacesRequest, opts ...grpc.CallOption) (*ListNamespacesResponse, error) - Create(ctx context.Context, in *CreateNamespaceRequest, opts ...grpc.CallOption) (*CreateNamespaceResponse, error) - Update(ctx context.Context, in *UpdateNamespaceRequest, opts ...grpc.CallOption) (*UpdateNamespaceResponse, error) - Delete(ctx context.Context, in *DeleteNamespaceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type namespacesClient struct { - cc grpc.ClientConnInterface -} - -func NewNamespacesClient(cc grpc.ClientConnInterface) NamespacesClient { - return &namespacesClient{cc} -} - -func (c *namespacesClient) Get(ctx context.Context, in *GetNamespaceRequest, opts ...grpc.CallOption) (*GetNamespaceResponse, error) { - out := new(GetNamespaceResponse) - err := c.cc.Invoke(ctx, "/containerd.services.namespaces.v1.Namespaces/Get", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *namespacesClient) List(ctx context.Context, in *ListNamespacesRequest, opts ...grpc.CallOption) (*ListNamespacesResponse, error) { - out := new(ListNamespacesResponse) - err := c.cc.Invoke(ctx, "/containerd.services.namespaces.v1.Namespaces/List", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *namespacesClient) Create(ctx context.Context, in *CreateNamespaceRequest, opts ...grpc.CallOption) (*CreateNamespaceResponse, error) { - out := new(CreateNamespaceResponse) - err := c.cc.Invoke(ctx, "/containerd.services.namespaces.v1.Namespaces/Create", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *namespacesClient) Update(ctx context.Context, in *UpdateNamespaceRequest, opts ...grpc.CallOption) (*UpdateNamespaceResponse, error) { - out := new(UpdateNamespaceResponse) - err := c.cc.Invoke(ctx, "/containerd.services.namespaces.v1.Namespaces/Update", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *namespacesClient) Delete(ctx context.Context, in *DeleteNamespaceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.namespaces.v1.Namespaces/Delete", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// NamespacesServer is the server API for Namespaces service. -// All implementations must embed UnimplementedNamespacesServer -// for forward compatibility -type NamespacesServer interface { - Get(context.Context, *GetNamespaceRequest) (*GetNamespaceResponse, error) - List(context.Context, *ListNamespacesRequest) (*ListNamespacesResponse, error) - Create(context.Context, *CreateNamespaceRequest) (*CreateNamespaceResponse, error) - Update(context.Context, *UpdateNamespaceRequest) (*UpdateNamespaceResponse, error) - Delete(context.Context, *DeleteNamespaceRequest) (*emptypb.Empty, error) - mustEmbedUnimplementedNamespacesServer() -} - -// UnimplementedNamespacesServer must be embedded to have forward compatible implementations. -type UnimplementedNamespacesServer struct { -} - -func (UnimplementedNamespacesServer) Get(context.Context, *GetNamespaceRequest) (*GetNamespaceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") -} -func (UnimplementedNamespacesServer) List(context.Context, *ListNamespacesRequest) (*ListNamespacesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method List not implemented") -} -func (UnimplementedNamespacesServer) Create(context.Context, *CreateNamespaceRequest) (*CreateNamespaceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") -} -func (UnimplementedNamespacesServer) Update(context.Context, *UpdateNamespaceRequest) (*UpdateNamespaceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") -} -func (UnimplementedNamespacesServer) Delete(context.Context, *DeleteNamespaceRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") -} -func (UnimplementedNamespacesServer) mustEmbedUnimplementedNamespacesServer() {} - -// UnsafeNamespacesServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to NamespacesServer will -// result in compilation errors. -type UnsafeNamespacesServer interface { - mustEmbedUnimplementedNamespacesServer() -} - -func RegisterNamespacesServer(s grpc.ServiceRegistrar, srv NamespacesServer) { - s.RegisterService(&Namespaces_ServiceDesc, srv) -} - -func _Namespaces_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetNamespaceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NamespacesServer).Get(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.namespaces.v1.Namespaces/Get", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NamespacesServer).Get(ctx, req.(*GetNamespaceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Namespaces_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListNamespacesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NamespacesServer).List(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.namespaces.v1.Namespaces/List", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NamespacesServer).List(ctx, req.(*ListNamespacesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Namespaces_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateNamespaceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NamespacesServer).Create(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.namespaces.v1.Namespaces/Create", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NamespacesServer).Create(ctx, req.(*CreateNamespaceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Namespaces_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateNamespaceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NamespacesServer).Update(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.namespaces.v1.Namespaces/Update", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NamespacesServer).Update(ctx, req.(*UpdateNamespaceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Namespaces_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteNamespaceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NamespacesServer).Delete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.namespaces.v1.Namespaces/Delete", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NamespacesServer).Delete(ctx, req.(*DeleteNamespaceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Namespaces_ServiceDesc is the grpc.ServiceDesc for Namespaces service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Namespaces_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.services.namespaces.v1.Namespaces", - HandlerType: (*NamespacesServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Get", - Handler: _Namespaces_Get_Handler, - }, - { - MethodName: "List", - Handler: _Namespaces_List_Handler, - }, - { - MethodName: "Create", - Handler: _Namespaces_Create_Handler, - }, - { - MethodName: "Update", - Handler: _Namespaces_Update_Handler, - }, - { - MethodName: "Delete", - Handler: _Namespaces_Delete_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/containerd/containerd/api/services/namespaces/v1/namespace.proto", -} diff --git a/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace_ttrpc.pb.go b/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace_ttrpc.pb.go deleted file mode 100644 index 09f94c1d1f..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace_ttrpc.pb.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/containerd/api/services/namespaces/v1/namespace.proto -package namespaces - -import ( - context "context" - ttrpc "github.com/containerd/ttrpc" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -type TTRPCNamespacesService interface { - Get(context.Context, *GetNamespaceRequest) (*GetNamespaceResponse, error) - List(context.Context, *ListNamespacesRequest) (*ListNamespacesResponse, error) - Create(context.Context, *CreateNamespaceRequest) (*CreateNamespaceResponse, error) - Update(context.Context, *UpdateNamespaceRequest) (*UpdateNamespaceResponse, error) - Delete(context.Context, *DeleteNamespaceRequest) (*emptypb.Empty, error) -} - -func RegisterTTRPCNamespacesService(srv *ttrpc.Server, svc TTRPCNamespacesService) { - srv.RegisterService("containerd.services.namespaces.v1.Namespaces", &ttrpc.ServiceDesc{ - Methods: map[string]ttrpc.Method{ - "Get": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req GetNamespaceRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Get(ctx, &req) - }, - "List": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ListNamespacesRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.List(ctx, &req) - }, - "Create": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req CreateNamespaceRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Create(ctx, &req) - }, - "Update": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req UpdateNamespaceRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Update(ctx, &req) - }, - "Delete": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req DeleteNamespaceRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Delete(ctx, &req) - }, - }, - }) -} - -type ttrpcnamespacesClient struct { - client *ttrpc.Client -} - -func NewTTRPCNamespacesClient(client *ttrpc.Client) TTRPCNamespacesService { - return &ttrpcnamespacesClient{ - client: client, - } -} - -func (c *ttrpcnamespacesClient) Get(ctx context.Context, req *GetNamespaceRequest) (*GetNamespaceResponse, error) { - var resp GetNamespaceResponse - if err := c.client.Call(ctx, "containerd.services.namespaces.v1.Namespaces", "Get", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcnamespacesClient) List(ctx context.Context, req *ListNamespacesRequest) (*ListNamespacesResponse, error) { - var resp ListNamespacesResponse - if err := c.client.Call(ctx, "containerd.services.namespaces.v1.Namespaces", "List", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcnamespacesClient) Create(ctx context.Context, req *CreateNamespaceRequest) (*CreateNamespaceResponse, error) { - var resp CreateNamespaceResponse - if err := c.client.Call(ctx, "containerd.services.namespaces.v1.Namespaces", "Create", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcnamespacesClient) Update(ctx context.Context, req *UpdateNamespaceRequest) (*UpdateNamespaceResponse, error) { - var resp UpdateNamespaceResponse - if err := c.client.Call(ctx, "containerd.services.namespaces.v1.Namespaces", "Update", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcnamespacesClient) Delete(ctx context.Context, req *DeleteNamespaceRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.namespaces.v1.Namespaces", "Delete", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/sandbox/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/sandbox/v1/doc.go deleted file mode 100644 index f960350c16..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/sandbox/v1/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package sandbox diff --git a/vendor/github.com/containerd/containerd/api/services/sandbox/v1/sandbox.pb.go b/vendor/github.com/containerd/containerd/api/services/sandbox/v1/sandbox.pb.go deleted file mode 100644 index 235081b7a8..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/sandbox/v1/sandbox.pb.go +++ /dev/null @@ -1,2407 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/sandbox/v1/sandbox.proto - -// Sandbox is a v2 runtime extension that allows more complex execution environments for containers. -// This adds a notion of groups of containers that share same lifecycle and/or resources. -// A few good fits for sandbox can be: -// - A "pause" container in k8s, that acts as a parent process for child containers to hold network namespace. -// - (micro)VMs that launch a VM process and executes containers inside guest OS. -// containerd in this case remains implementation agnostic and delegates sandbox handling to runtimes. -// See proposal and discussion here: https://github.com/containerd/containerd/issues/4131 - -package sandbox - -import ( - types "github.com/containerd/containerd/api/types" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -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) -) - -type StoreCreateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sandbox *types.Sandbox `protobuf:"bytes,1,opt,name=sandbox,proto3" json:"sandbox,omitempty"` -} - -func (x *StoreCreateRequest) Reset() { - *x = StoreCreateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StoreCreateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StoreCreateRequest) ProtoMessage() {} - -func (x *StoreCreateRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[0] - 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 StoreCreateRequest.ProtoReflect.Descriptor instead. -func (*StoreCreateRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{0} -} - -func (x *StoreCreateRequest) GetSandbox() *types.Sandbox { - if x != nil { - return x.Sandbox - } - return nil -} - -type StoreCreateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sandbox *types.Sandbox `protobuf:"bytes,1,opt,name=sandbox,proto3" json:"sandbox,omitempty"` -} - -func (x *StoreCreateResponse) Reset() { - *x = StoreCreateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StoreCreateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StoreCreateResponse) ProtoMessage() {} - -func (x *StoreCreateResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[1] - 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 StoreCreateResponse.ProtoReflect.Descriptor instead. -func (*StoreCreateResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{1} -} - -func (x *StoreCreateResponse) GetSandbox() *types.Sandbox { - if x != nil { - return x.Sandbox - } - return nil -} - -type StoreUpdateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sandbox *types.Sandbox `protobuf:"bytes,1,opt,name=sandbox,proto3" json:"sandbox,omitempty"` - Fields []string `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"` -} - -func (x *StoreUpdateRequest) Reset() { - *x = StoreUpdateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StoreUpdateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StoreUpdateRequest) ProtoMessage() {} - -func (x *StoreUpdateRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[2] - 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 StoreUpdateRequest.ProtoReflect.Descriptor instead. -func (*StoreUpdateRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{2} -} - -func (x *StoreUpdateRequest) GetSandbox() *types.Sandbox { - if x != nil { - return x.Sandbox - } - return nil -} - -func (x *StoreUpdateRequest) GetFields() []string { - if x != nil { - return x.Fields - } - return nil -} - -type StoreUpdateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sandbox *types.Sandbox `protobuf:"bytes,1,opt,name=sandbox,proto3" json:"sandbox,omitempty"` -} - -func (x *StoreUpdateResponse) Reset() { - *x = StoreUpdateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StoreUpdateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StoreUpdateResponse) ProtoMessage() {} - -func (x *StoreUpdateResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[3] - 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 StoreUpdateResponse.ProtoReflect.Descriptor instead. -func (*StoreUpdateResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{3} -} - -func (x *StoreUpdateResponse) GetSandbox() *types.Sandbox { - if x != nil { - return x.Sandbox - } - return nil -} - -type StoreDeleteRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` -} - -func (x *StoreDeleteRequest) Reset() { - *x = StoreDeleteRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StoreDeleteRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StoreDeleteRequest) ProtoMessage() {} - -func (x *StoreDeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[4] - 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 StoreDeleteRequest.ProtoReflect.Descriptor instead. -func (*StoreDeleteRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{4} -} - -func (x *StoreDeleteRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -type StoreDeleteResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *StoreDeleteResponse) Reset() { - *x = StoreDeleteResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StoreDeleteResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StoreDeleteResponse) ProtoMessage() {} - -func (x *StoreDeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[5] - 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 StoreDeleteResponse.ProtoReflect.Descriptor instead. -func (*StoreDeleteResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{5} -} - -type StoreListRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` -} - -func (x *StoreListRequest) Reset() { - *x = StoreListRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StoreListRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StoreListRequest) ProtoMessage() {} - -func (x *StoreListRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[6] - 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 StoreListRequest.ProtoReflect.Descriptor instead. -func (*StoreListRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{6} -} - -func (x *StoreListRequest) GetFilters() []string { - if x != nil { - return x.Filters - } - return nil -} - -type StoreListResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - List []*types.Sandbox `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` -} - -func (x *StoreListResponse) Reset() { - *x = StoreListResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StoreListResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StoreListResponse) ProtoMessage() {} - -func (x *StoreListResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[7] - 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 StoreListResponse.ProtoReflect.Descriptor instead. -func (*StoreListResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{7} -} - -func (x *StoreListResponse) GetList() []*types.Sandbox { - if x != nil { - return x.List - } - return nil -} - -type StoreGetRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` -} - -func (x *StoreGetRequest) Reset() { - *x = StoreGetRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StoreGetRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StoreGetRequest) ProtoMessage() {} - -func (x *StoreGetRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[8] - 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 StoreGetRequest.ProtoReflect.Descriptor instead. -func (*StoreGetRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{8} -} - -func (x *StoreGetRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -type StoreGetResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sandbox *types.Sandbox `protobuf:"bytes,1,opt,name=sandbox,proto3" json:"sandbox,omitempty"` -} - -func (x *StoreGetResponse) Reset() { - *x = StoreGetResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StoreGetResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StoreGetResponse) ProtoMessage() {} - -func (x *StoreGetResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[9] - 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 StoreGetResponse.ProtoReflect.Descriptor instead. -func (*StoreGetResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{9} -} - -func (x *StoreGetResponse) GetSandbox() *types.Sandbox { - if x != nil { - return x.Sandbox - } - return nil -} - -type ControllerCreateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - Rootfs []*types.Mount `protobuf:"bytes,2,rep,name=rootfs,proto3" json:"rootfs,omitempty"` - Options *anypb.Any `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"` - NetnsPath string `protobuf:"bytes,4,opt,name=netns_path,json=netnsPath,proto3" json:"netns_path,omitempty"` - Annotations map[string]string `protobuf:"bytes,5,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Sandbox *types.Sandbox `protobuf:"bytes,6,opt,name=sandbox,proto3" json:"sandbox,omitempty"` - Sandboxer string `protobuf:"bytes,10,opt,name=sandboxer,proto3" json:"sandboxer,omitempty"` -} - -func (x *ControllerCreateRequest) Reset() { - *x = ControllerCreateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerCreateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerCreateRequest) ProtoMessage() {} - -func (x *ControllerCreateRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[10] - 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 ControllerCreateRequest.ProtoReflect.Descriptor instead. -func (*ControllerCreateRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{10} -} - -func (x *ControllerCreateRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *ControllerCreateRequest) GetRootfs() []*types.Mount { - if x != nil { - return x.Rootfs - } - return nil -} - -func (x *ControllerCreateRequest) GetOptions() *anypb.Any { - if x != nil { - return x.Options - } - return nil -} - -func (x *ControllerCreateRequest) GetNetnsPath() string { - if x != nil { - return x.NetnsPath - } - return "" -} - -func (x *ControllerCreateRequest) GetAnnotations() map[string]string { - if x != nil { - return x.Annotations - } - return nil -} - -func (x *ControllerCreateRequest) GetSandbox() *types.Sandbox { - if x != nil { - return x.Sandbox - } - return nil -} - -func (x *ControllerCreateRequest) GetSandboxer() string { - if x != nil { - return x.Sandboxer - } - return "" -} - -type ControllerCreateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` -} - -func (x *ControllerCreateResponse) Reset() { - *x = ControllerCreateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerCreateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerCreateResponse) ProtoMessage() {} - -func (x *ControllerCreateResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[11] - 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 ControllerCreateResponse.ProtoReflect.Descriptor instead. -func (*ControllerCreateResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{11} -} - -func (x *ControllerCreateResponse) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -type ControllerStartRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - Sandboxer string `protobuf:"bytes,10,opt,name=sandboxer,proto3" json:"sandboxer,omitempty"` -} - -func (x *ControllerStartRequest) Reset() { - *x = ControllerStartRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerStartRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerStartRequest) ProtoMessage() {} - -func (x *ControllerStartRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[12] - 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 ControllerStartRequest.ProtoReflect.Descriptor instead. -func (*ControllerStartRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{12} -} - -func (x *ControllerStartRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *ControllerStartRequest) GetSandboxer() string { - if x != nil { - return x.Sandboxer - } - return "" -} - -type ControllerStartResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - Pid uint32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Address of the sandbox for containerd to connect, - // for calling Task or other APIs serving in the sandbox. - // it is in the form of ttrpc+unix://path/to/uds or grpc+vsock://:. - Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` - Version uint32 `protobuf:"varint,6,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *ControllerStartResponse) Reset() { - *x = ControllerStartResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerStartResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerStartResponse) ProtoMessage() {} - -func (x *ControllerStartResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[13] - 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 ControllerStartResponse.ProtoReflect.Descriptor instead. -func (*ControllerStartResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{13} -} - -func (x *ControllerStartResponse) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *ControllerStartResponse) GetPid() uint32 { - if x != nil { - return x.Pid - } - return 0 -} - -func (x *ControllerStartResponse) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *ControllerStartResponse) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -func (x *ControllerStartResponse) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *ControllerStartResponse) GetVersion() uint32 { - if x != nil { - return x.Version - } - return 0 -} - -type ControllerPlatformRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - Sandboxer string `protobuf:"bytes,10,opt,name=sandboxer,proto3" json:"sandboxer,omitempty"` -} - -func (x *ControllerPlatformRequest) Reset() { - *x = ControllerPlatformRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerPlatformRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerPlatformRequest) ProtoMessage() {} - -func (x *ControllerPlatformRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[14] - 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 ControllerPlatformRequest.ProtoReflect.Descriptor instead. -func (*ControllerPlatformRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{14} -} - -func (x *ControllerPlatformRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *ControllerPlatformRequest) GetSandboxer() string { - if x != nil { - return x.Sandboxer - } - return "" -} - -type ControllerPlatformResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Platform *types.Platform `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` -} - -func (x *ControllerPlatformResponse) Reset() { - *x = ControllerPlatformResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerPlatformResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerPlatformResponse) ProtoMessage() {} - -func (x *ControllerPlatformResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[15] - 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 ControllerPlatformResponse.ProtoReflect.Descriptor instead. -func (*ControllerPlatformResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{15} -} - -func (x *ControllerPlatformResponse) GetPlatform() *types.Platform { - if x != nil { - return x.Platform - } - return nil -} - -type ControllerStopRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - TimeoutSecs uint32 `protobuf:"varint,2,opt,name=timeout_secs,json=timeoutSecs,proto3" json:"timeout_secs,omitempty"` - Sandboxer string `protobuf:"bytes,10,opt,name=sandboxer,proto3" json:"sandboxer,omitempty"` -} - -func (x *ControllerStopRequest) Reset() { - *x = ControllerStopRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerStopRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerStopRequest) ProtoMessage() {} - -func (x *ControllerStopRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[16] - 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 ControllerStopRequest.ProtoReflect.Descriptor instead. -func (*ControllerStopRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{16} -} - -func (x *ControllerStopRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *ControllerStopRequest) GetTimeoutSecs() uint32 { - if x != nil { - return x.TimeoutSecs - } - return 0 -} - -func (x *ControllerStopRequest) GetSandboxer() string { - if x != nil { - return x.Sandboxer - } - return "" -} - -type ControllerStopResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ControllerStopResponse) Reset() { - *x = ControllerStopResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerStopResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerStopResponse) ProtoMessage() {} - -func (x *ControllerStopResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[17] - 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 ControllerStopResponse.ProtoReflect.Descriptor instead. -func (*ControllerStopResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{17} -} - -type ControllerWaitRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - Sandboxer string `protobuf:"bytes,10,opt,name=sandboxer,proto3" json:"sandboxer,omitempty"` -} - -func (x *ControllerWaitRequest) Reset() { - *x = ControllerWaitRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerWaitRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerWaitRequest) ProtoMessage() {} - -func (x *ControllerWaitRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[18] - 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 ControllerWaitRequest.ProtoReflect.Descriptor instead. -func (*ControllerWaitRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{18} -} - -func (x *ControllerWaitRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *ControllerWaitRequest) GetSandboxer() string { - if x != nil { - return x.Sandboxer - } - return "" -} - -type ControllerWaitResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ExitStatus uint32 `protobuf:"varint,1,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` - ExitedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=exited_at,json=exitedAt,proto3" json:"exited_at,omitempty"` -} - -func (x *ControllerWaitResponse) Reset() { - *x = ControllerWaitResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerWaitResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerWaitResponse) ProtoMessage() {} - -func (x *ControllerWaitResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[19] - 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 ControllerWaitResponse.ProtoReflect.Descriptor instead. -func (*ControllerWaitResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{19} -} - -func (x *ControllerWaitResponse) GetExitStatus() uint32 { - if x != nil { - return x.ExitStatus - } - return 0 -} - -func (x *ControllerWaitResponse) GetExitedAt() *timestamppb.Timestamp { - if x != nil { - return x.ExitedAt - } - return nil -} - -type ControllerStatusRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - Verbose bool `protobuf:"varint,2,opt,name=verbose,proto3" json:"verbose,omitempty"` - Sandboxer string `protobuf:"bytes,10,opt,name=sandboxer,proto3" json:"sandboxer,omitempty"` -} - -func (x *ControllerStatusRequest) Reset() { - *x = ControllerStatusRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerStatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerStatusRequest) ProtoMessage() {} - -func (x *ControllerStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[20] - 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 ControllerStatusRequest.ProtoReflect.Descriptor instead. -func (*ControllerStatusRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{20} -} - -func (x *ControllerStatusRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *ControllerStatusRequest) GetVerbose() bool { - if x != nil { - return x.Verbose - } - return false -} - -func (x *ControllerStatusRequest) GetSandboxer() string { - if x != nil { - return x.Sandboxer - } - return "" -} - -type ControllerStatusResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - Pid uint32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"` - State string `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"` - Info map[string]string `protobuf:"bytes,4,rep,name=info,proto3" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - ExitedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=exited_at,json=exitedAt,proto3" json:"exited_at,omitempty"` - Extra *anypb.Any `protobuf:"bytes,7,opt,name=extra,proto3" json:"extra,omitempty"` - // Address of the sandbox for containerd to connect, - // for calling Task or other APIs serving in the sandbox. - // it is in the form of ttrpc+unix://path/to/uds or grpc+vsock://:. - Address string `protobuf:"bytes,8,opt,name=address,proto3" json:"address,omitempty"` - Version uint32 `protobuf:"varint,9,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *ControllerStatusResponse) Reset() { - *x = ControllerStatusResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerStatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerStatusResponse) ProtoMessage() {} - -func (x *ControllerStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[21] - 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 ControllerStatusResponse.ProtoReflect.Descriptor instead. -func (*ControllerStatusResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{21} -} - -func (x *ControllerStatusResponse) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *ControllerStatusResponse) GetPid() uint32 { - if x != nil { - return x.Pid - } - return 0 -} - -func (x *ControllerStatusResponse) GetState() string { - if x != nil { - return x.State - } - return "" -} - -func (x *ControllerStatusResponse) GetInfo() map[string]string { - if x != nil { - return x.Info - } - return nil -} - -func (x *ControllerStatusResponse) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *ControllerStatusResponse) GetExitedAt() *timestamppb.Timestamp { - if x != nil { - return x.ExitedAt - } - return nil -} - -func (x *ControllerStatusResponse) GetExtra() *anypb.Any { - if x != nil { - return x.Extra - } - return nil -} - -func (x *ControllerStatusResponse) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *ControllerStatusResponse) GetVersion() uint32 { - if x != nil { - return x.Version - } - return 0 -} - -type ControllerShutdownRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - Sandboxer string `protobuf:"bytes,10,opt,name=sandboxer,proto3" json:"sandboxer,omitempty"` -} - -func (x *ControllerShutdownRequest) Reset() { - *x = ControllerShutdownRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerShutdownRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerShutdownRequest) ProtoMessage() {} - -func (x *ControllerShutdownRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[22] - 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 ControllerShutdownRequest.ProtoReflect.Descriptor instead. -func (*ControllerShutdownRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{22} -} - -func (x *ControllerShutdownRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *ControllerShutdownRequest) GetSandboxer() string { - if x != nil { - return x.Sandboxer - } - return "" -} - -type ControllerShutdownResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ControllerShutdownResponse) Reset() { - *x = ControllerShutdownResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerShutdownResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerShutdownResponse) ProtoMessage() {} - -func (x *ControllerShutdownResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[23] - 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 ControllerShutdownResponse.ProtoReflect.Descriptor instead. -func (*ControllerShutdownResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{23} -} - -type ControllerMetricsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - Sandboxer string `protobuf:"bytes,10,opt,name=sandboxer,proto3" json:"sandboxer,omitempty"` -} - -func (x *ControllerMetricsRequest) Reset() { - *x = ControllerMetricsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerMetricsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerMetricsRequest) ProtoMessage() {} - -func (x *ControllerMetricsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[24] - 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 ControllerMetricsRequest.ProtoReflect.Descriptor instead. -func (*ControllerMetricsRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{24} -} - -func (x *ControllerMetricsRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *ControllerMetricsRequest) GetSandboxer() string { - if x != nil { - return x.Sandboxer - } - return "" -} - -type ControllerMetricsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Metrics *types.Metric `protobuf:"bytes,1,opt,name=metrics,proto3" json:"metrics,omitempty"` -} - -func (x *ControllerMetricsResponse) Reset() { - *x = ControllerMetricsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerMetricsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerMetricsResponse) ProtoMessage() {} - -func (x *ControllerMetricsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[25] - 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 ControllerMetricsResponse.ProtoReflect.Descriptor instead. -func (*ControllerMetricsResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{25} -} - -func (x *ControllerMetricsResponse) GetMetrics() *types.Metric { - if x != nil { - return x.Metrics - } - return nil -} - -type ControllerUpdateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - Sandboxer string `protobuf:"bytes,2,opt,name=sandboxer,proto3" json:"sandboxer,omitempty"` - Sandbox *types.Sandbox `protobuf:"bytes,3,opt,name=sandbox,proto3" json:"sandbox,omitempty"` - Fields []string `protobuf:"bytes,4,rep,name=fields,proto3" json:"fields,omitempty"` -} - -func (x *ControllerUpdateRequest) Reset() { - *x = ControllerUpdateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerUpdateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerUpdateRequest) ProtoMessage() {} - -func (x *ControllerUpdateRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[26] - 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 ControllerUpdateRequest.ProtoReflect.Descriptor instead. -func (*ControllerUpdateRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{26} -} - -func (x *ControllerUpdateRequest) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *ControllerUpdateRequest) GetSandboxer() string { - if x != nil { - return x.Sandboxer - } - return "" -} - -func (x *ControllerUpdateRequest) GetSandbox() *types.Sandbox { - if x != nil { - return x.Sandbox - } - return nil -} - -func (x *ControllerUpdateRequest) GetFields() []string { - if x != nil { - return x.Fields - } - return nil -} - -type ControllerUpdateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ControllerUpdateResponse) Reset() { - *x = ControllerUpdateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ControllerUpdateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ControllerUpdateResponse) ProtoMessage() {} - -func (x *ControllerUpdateResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[27] - 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 ControllerUpdateResponse.ProtoReflect.Descriptor instead. -func (*ControllerUpdateResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{27} -} - -var File_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDesc = []byte{ - 0x0a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x61, 0x6e, 0x64, 0x62, - 0x6f, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, - 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x36, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x49, 0x0a, 0x12, 0x53, - 0x74, 0x6f, 0x72, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x33, 0x0a, 0x07, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x07, 0x73, - 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x22, 0x4a, 0x0a, 0x13, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, - 0x07, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x07, 0x73, 0x61, 0x6e, 0x64, 0x62, - 0x6f, 0x78, 0x22, 0x61, 0x0a, 0x12, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x07, 0x73, 0x61, 0x6e, 0x64, - 0x62, 0x6f, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x61, 0x6e, - 0x64, 0x62, 0x6f, 0x78, 0x52, 0x07, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, 0x16, 0x0a, - 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0x4a, 0x0a, 0x13, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, - 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x07, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x22, 0x33, 0x0a, 0x12, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, - 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, - 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x0a, - 0x10, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x42, 0x0a, 0x11, 0x53, - 0x74, 0x6f, 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2d, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, - 0x30, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, - 0x64, 0x22, 0x47, 0x0a, 0x10, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x52, 0x07, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x22, 0xb7, 0x03, 0x0a, 0x17, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, - 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x72, 0x6f, 0x6f, 0x74, 0x66, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, - 0x72, 0x6f, 0x6f, 0x74, 0x66, 0x73, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x6e, 0x73, 0x5f, - 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x6e, - 0x73, 0x50, 0x61, 0x74, 0x68, 0x12, 0x6a, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x48, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 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, 0x12, 0x33, 0x0a, 0x07, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x07, 0x73, - 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, - 0x6f, 0x78, 0x65, 0x72, 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, 0x22, 0x39, 0x0a, 0x18, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x22, - 0x55, 0x0a, 0x16, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, - 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, - 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x61, 0x6e, 0x64, - 0x62, 0x6f, 0x78, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, - 0x64, 0x62, 0x6f, 0x78, 0x65, 0x72, 0x22, 0xd1, 0x02, 0x0a, 0x17, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, - 0x64, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, - 0x70, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x5b, - 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x43, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 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, 0x22, 0x58, 0x0a, 0x19, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, - 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, - 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, - 0x6f, 0x78, 0x65, 0x72, 0x22, 0x54, 0x0a, 0x1a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x77, 0x0a, 0x15, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, - 0x63, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, - 0x74, 0x53, 0x65, 0x63, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x65, 0x72, 0x22, 0x18, 0x0a, 0x16, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x54, 0x0a, - 0x15, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x57, 0x61, 0x69, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, - 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x65, 0x72, 0x22, 0x72, 0x0a, 0x16, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, - 0x0b, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x0a, 0x65, 0x78, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x37, - 0x0a, 0x09, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x65, - 0x78, 0x69, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x70, 0x0a, 0x17, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, - 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, - 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x65, 0x72, 0x22, 0xc6, 0x03, 0x0a, 0x18, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, - 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x56, 0x0a, - 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, - 0x12, 0x37, 0x0a, 0x09, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x08, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x78, 0x74, - 0x72, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, - 0x65, 0x78, 0x74, 0x72, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x37, 0x0a, 0x09, 0x49, 0x6e, 0x66, - 0x6f, 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, 0x22, 0x58, 0x0a, 0x19, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x1c, - 0x0a, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x65, 0x72, 0x22, 0x1c, 0x0a, 0x1a, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, - 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x57, 0x0a, 0x18, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, - 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x65, 0x72, 0x22, 0x4f, 0x0a, 0x19, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x07, 0x6d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x73, 0x22, 0xa3, 0x01, 0x0a, 0x17, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, - 0x1c, 0x0a, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x65, 0x72, 0x12, 0x33, 0x0a, - 0x07, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x07, 0x73, 0x61, 0x6e, 0x64, 0x62, - 0x6f, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb7, 0x04, 0x0a, 0x05, 0x53, 0x74, 0x6f, 0x72, 0x65, - 0x12, 0x71, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x72, - 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x71, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x32, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x74, 0x6f, 0x72, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x71, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, - 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x04, 0x4c, 0x69, 0x73, - 0x74, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x2f, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x74, 0x6f, 0x72, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x74, 0x6f, 0x72, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x32, 0xf3, 0x08, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, - 0x7b, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x78, 0x0a, 0x05, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x36, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, - 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x12, 0x39, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x50, - 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75, 0x0a, 0x04, 0x53, 0x74, - 0x6f, 0x70, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x74, - 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x75, 0x0a, 0x04, 0x57, 0x61, 0x69, 0x74, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x36, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x57, 0x61, 0x69, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x08, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, - 0x77, 0x6e, 0x12, 0x39, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x68, - 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7e, 0x0a, 0x07, 0x4d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x73, 0x12, 0x38, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, - 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x06, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x42, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2f, - 0x76, 0x31, 0x3b, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescData = file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes = make([]protoimpl.MessageInfo, 31) -var file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_goTypes = []interface{}{ - (*StoreCreateRequest)(nil), // 0: containerd.services.sandbox.v1.StoreCreateRequest - (*StoreCreateResponse)(nil), // 1: containerd.services.sandbox.v1.StoreCreateResponse - (*StoreUpdateRequest)(nil), // 2: containerd.services.sandbox.v1.StoreUpdateRequest - (*StoreUpdateResponse)(nil), // 3: containerd.services.sandbox.v1.StoreUpdateResponse - (*StoreDeleteRequest)(nil), // 4: containerd.services.sandbox.v1.StoreDeleteRequest - (*StoreDeleteResponse)(nil), // 5: containerd.services.sandbox.v1.StoreDeleteResponse - (*StoreListRequest)(nil), // 6: containerd.services.sandbox.v1.StoreListRequest - (*StoreListResponse)(nil), // 7: containerd.services.sandbox.v1.StoreListResponse - (*StoreGetRequest)(nil), // 8: containerd.services.sandbox.v1.StoreGetRequest - (*StoreGetResponse)(nil), // 9: containerd.services.sandbox.v1.StoreGetResponse - (*ControllerCreateRequest)(nil), // 10: containerd.services.sandbox.v1.ControllerCreateRequest - (*ControllerCreateResponse)(nil), // 11: containerd.services.sandbox.v1.ControllerCreateResponse - (*ControllerStartRequest)(nil), // 12: containerd.services.sandbox.v1.ControllerStartRequest - (*ControllerStartResponse)(nil), // 13: containerd.services.sandbox.v1.ControllerStartResponse - (*ControllerPlatformRequest)(nil), // 14: containerd.services.sandbox.v1.ControllerPlatformRequest - (*ControllerPlatformResponse)(nil), // 15: containerd.services.sandbox.v1.ControllerPlatformResponse - (*ControllerStopRequest)(nil), // 16: containerd.services.sandbox.v1.ControllerStopRequest - (*ControllerStopResponse)(nil), // 17: containerd.services.sandbox.v1.ControllerStopResponse - (*ControllerWaitRequest)(nil), // 18: containerd.services.sandbox.v1.ControllerWaitRequest - (*ControllerWaitResponse)(nil), // 19: containerd.services.sandbox.v1.ControllerWaitResponse - (*ControllerStatusRequest)(nil), // 20: containerd.services.sandbox.v1.ControllerStatusRequest - (*ControllerStatusResponse)(nil), // 21: containerd.services.sandbox.v1.ControllerStatusResponse - (*ControllerShutdownRequest)(nil), // 22: containerd.services.sandbox.v1.ControllerShutdownRequest - (*ControllerShutdownResponse)(nil), // 23: containerd.services.sandbox.v1.ControllerShutdownResponse - (*ControllerMetricsRequest)(nil), // 24: containerd.services.sandbox.v1.ControllerMetricsRequest - (*ControllerMetricsResponse)(nil), // 25: containerd.services.sandbox.v1.ControllerMetricsResponse - (*ControllerUpdateRequest)(nil), // 26: containerd.services.sandbox.v1.ControllerUpdateRequest - (*ControllerUpdateResponse)(nil), // 27: containerd.services.sandbox.v1.ControllerUpdateResponse - nil, // 28: containerd.services.sandbox.v1.ControllerCreateRequest.AnnotationsEntry - nil, // 29: containerd.services.sandbox.v1.ControllerStartResponse.LabelsEntry - nil, // 30: containerd.services.sandbox.v1.ControllerStatusResponse.InfoEntry - (*types.Sandbox)(nil), // 31: containerd.types.Sandbox - (*types.Mount)(nil), // 32: containerd.types.Mount - (*anypb.Any)(nil), // 33: google.protobuf.Any - (*timestamppb.Timestamp)(nil), // 34: google.protobuf.Timestamp - (*types.Platform)(nil), // 35: containerd.types.Platform - (*types.Metric)(nil), // 36: containerd.types.Metric -} -var file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_depIdxs = []int32{ - 31, // 0: containerd.services.sandbox.v1.StoreCreateRequest.sandbox:type_name -> containerd.types.Sandbox - 31, // 1: containerd.services.sandbox.v1.StoreCreateResponse.sandbox:type_name -> containerd.types.Sandbox - 31, // 2: containerd.services.sandbox.v1.StoreUpdateRequest.sandbox:type_name -> containerd.types.Sandbox - 31, // 3: containerd.services.sandbox.v1.StoreUpdateResponse.sandbox:type_name -> containerd.types.Sandbox - 31, // 4: containerd.services.sandbox.v1.StoreListResponse.list:type_name -> containerd.types.Sandbox - 31, // 5: containerd.services.sandbox.v1.StoreGetResponse.sandbox:type_name -> containerd.types.Sandbox - 32, // 6: containerd.services.sandbox.v1.ControllerCreateRequest.rootfs:type_name -> containerd.types.Mount - 33, // 7: containerd.services.sandbox.v1.ControllerCreateRequest.options:type_name -> google.protobuf.Any - 28, // 8: containerd.services.sandbox.v1.ControllerCreateRequest.annotations:type_name -> containerd.services.sandbox.v1.ControllerCreateRequest.AnnotationsEntry - 31, // 9: containerd.services.sandbox.v1.ControllerCreateRequest.sandbox:type_name -> containerd.types.Sandbox - 34, // 10: containerd.services.sandbox.v1.ControllerStartResponse.created_at:type_name -> google.protobuf.Timestamp - 29, // 11: containerd.services.sandbox.v1.ControllerStartResponse.labels:type_name -> containerd.services.sandbox.v1.ControllerStartResponse.LabelsEntry - 35, // 12: containerd.services.sandbox.v1.ControllerPlatformResponse.platform:type_name -> containerd.types.Platform - 34, // 13: containerd.services.sandbox.v1.ControllerWaitResponse.exited_at:type_name -> google.protobuf.Timestamp - 30, // 14: containerd.services.sandbox.v1.ControllerStatusResponse.info:type_name -> containerd.services.sandbox.v1.ControllerStatusResponse.InfoEntry - 34, // 15: containerd.services.sandbox.v1.ControllerStatusResponse.created_at:type_name -> google.protobuf.Timestamp - 34, // 16: containerd.services.sandbox.v1.ControllerStatusResponse.exited_at:type_name -> google.protobuf.Timestamp - 33, // 17: containerd.services.sandbox.v1.ControllerStatusResponse.extra:type_name -> google.protobuf.Any - 36, // 18: containerd.services.sandbox.v1.ControllerMetricsResponse.metrics:type_name -> containerd.types.Metric - 31, // 19: containerd.services.sandbox.v1.ControllerUpdateRequest.sandbox:type_name -> containerd.types.Sandbox - 0, // 20: containerd.services.sandbox.v1.Store.Create:input_type -> containerd.services.sandbox.v1.StoreCreateRequest - 2, // 21: containerd.services.sandbox.v1.Store.Update:input_type -> containerd.services.sandbox.v1.StoreUpdateRequest - 4, // 22: containerd.services.sandbox.v1.Store.Delete:input_type -> containerd.services.sandbox.v1.StoreDeleteRequest - 6, // 23: containerd.services.sandbox.v1.Store.List:input_type -> containerd.services.sandbox.v1.StoreListRequest - 8, // 24: containerd.services.sandbox.v1.Store.Get:input_type -> containerd.services.sandbox.v1.StoreGetRequest - 10, // 25: containerd.services.sandbox.v1.Controller.Create:input_type -> containerd.services.sandbox.v1.ControllerCreateRequest - 12, // 26: containerd.services.sandbox.v1.Controller.Start:input_type -> containerd.services.sandbox.v1.ControllerStartRequest - 14, // 27: containerd.services.sandbox.v1.Controller.Platform:input_type -> containerd.services.sandbox.v1.ControllerPlatformRequest - 16, // 28: containerd.services.sandbox.v1.Controller.Stop:input_type -> containerd.services.sandbox.v1.ControllerStopRequest - 18, // 29: containerd.services.sandbox.v1.Controller.Wait:input_type -> containerd.services.sandbox.v1.ControllerWaitRequest - 20, // 30: containerd.services.sandbox.v1.Controller.Status:input_type -> containerd.services.sandbox.v1.ControllerStatusRequest - 22, // 31: containerd.services.sandbox.v1.Controller.Shutdown:input_type -> containerd.services.sandbox.v1.ControllerShutdownRequest - 24, // 32: containerd.services.sandbox.v1.Controller.Metrics:input_type -> containerd.services.sandbox.v1.ControllerMetricsRequest - 26, // 33: containerd.services.sandbox.v1.Controller.Update:input_type -> containerd.services.sandbox.v1.ControllerUpdateRequest - 1, // 34: containerd.services.sandbox.v1.Store.Create:output_type -> containerd.services.sandbox.v1.StoreCreateResponse - 3, // 35: containerd.services.sandbox.v1.Store.Update:output_type -> containerd.services.sandbox.v1.StoreUpdateResponse - 5, // 36: containerd.services.sandbox.v1.Store.Delete:output_type -> containerd.services.sandbox.v1.StoreDeleteResponse - 7, // 37: containerd.services.sandbox.v1.Store.List:output_type -> containerd.services.sandbox.v1.StoreListResponse - 9, // 38: containerd.services.sandbox.v1.Store.Get:output_type -> containerd.services.sandbox.v1.StoreGetResponse - 11, // 39: containerd.services.sandbox.v1.Controller.Create:output_type -> containerd.services.sandbox.v1.ControllerCreateResponse - 13, // 40: containerd.services.sandbox.v1.Controller.Start:output_type -> containerd.services.sandbox.v1.ControllerStartResponse - 15, // 41: containerd.services.sandbox.v1.Controller.Platform:output_type -> containerd.services.sandbox.v1.ControllerPlatformResponse - 17, // 42: containerd.services.sandbox.v1.Controller.Stop:output_type -> containerd.services.sandbox.v1.ControllerStopResponse - 19, // 43: containerd.services.sandbox.v1.Controller.Wait:output_type -> containerd.services.sandbox.v1.ControllerWaitResponse - 21, // 44: containerd.services.sandbox.v1.Controller.Status:output_type -> containerd.services.sandbox.v1.ControllerStatusResponse - 23, // 45: containerd.services.sandbox.v1.Controller.Shutdown:output_type -> containerd.services.sandbox.v1.ControllerShutdownResponse - 25, // 46: containerd.services.sandbox.v1.Controller.Metrics:output_type -> containerd.services.sandbox.v1.ControllerMetricsResponse - 27, // 47: containerd.services.sandbox.v1.Controller.Update:output_type -> containerd.services.sandbox.v1.ControllerUpdateResponse - 34, // [34:48] is the sub-list for method output_type - 20, // [20:34] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_init() } -func file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_init() { - if File_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StoreCreateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StoreCreateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StoreUpdateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StoreUpdateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StoreDeleteRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StoreDeleteResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StoreListRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StoreListResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StoreGetRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StoreGetResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerCreateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerCreateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerStartRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerStartResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerPlatformRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerPlatformResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerStopRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerStopResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerWaitRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerWaitResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerStatusRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerStatusResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerShutdownRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerShutdownResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerMetricsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerMetricsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerUpdateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ControllerUpdateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDesc, - NumEnums: 0, - NumMessages: 31, - NumExtensions: 0, - NumServices: 2, - }, - GoTypes: file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto = out.File - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_rawDesc = nil - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_goTypes = nil - file_github_com_containerd_containerd_api_services_sandbox_v1_sandbox_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/sandbox/v1/sandbox.proto b/vendor/github.com/containerd/containerd/api/services/sandbox/v1/sandbox.proto deleted file mode 100644 index 87e6ec3a34..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/sandbox/v1/sandbox.proto +++ /dev/null @@ -1,204 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -// Sandbox is a v2 runtime extension that allows more complex execution environments for containers. -// This adds a notion of groups of containers that share same lifecycle and/or resources. -// A few good fits for sandbox can be: -// - A "pause" container in k8s, that acts as a parent process for child containers to hold network namespace. -// - (micro)VMs that launch a VM process and executes containers inside guest OS. -// containerd in this case remains implementation agnostic and delegates sandbox handling to runtimes. -// See proposal and discussion here: https://github.com/containerd/containerd/issues/4131 -package containerd.services.sandbox.v1; - -import "google/protobuf/any.proto"; -import "google/protobuf/timestamp.proto"; - -import "github.com/containerd/containerd/api/types/sandbox.proto"; -import "github.com/containerd/containerd/api/types/mount.proto"; -import "github.com/containerd/containerd/api/types/platform.proto"; -import "github.com/containerd/containerd/api/types/metrics.proto"; - -option go_package = "github.com/containerd/containerd/api/services/sandbox/v1;sandbox"; - -// Store provides a metadata storage interface for sandboxes. Similarly to `Containers`, -// sandbox object includes info required to start a new instance, but no runtime state. -// When running a new sandbox instance, store objects are used as base type to create from. -service Store { - rpc Create(StoreCreateRequest) returns (StoreCreateResponse); - rpc Update(StoreUpdateRequest) returns (StoreUpdateResponse); - rpc Delete(StoreDeleteRequest) returns (StoreDeleteResponse); - rpc List(StoreListRequest) returns (StoreListResponse); - rpc Get(StoreGetRequest) returns (StoreGetResponse); -} - -message StoreCreateRequest { - containerd.types.Sandbox sandbox = 1; -} - -message StoreCreateResponse { - containerd.types.Sandbox sandbox = 1; -} - -message StoreUpdateRequest { - containerd.types.Sandbox sandbox = 1; - repeated string fields = 2; -} - -message StoreUpdateResponse { - containerd.types.Sandbox sandbox = 1; -} - -message StoreDeleteRequest { - string sandbox_id = 1; -} - -message StoreDeleteResponse {} - -message StoreListRequest { - repeated string filters = 1; -} - -message StoreListResponse { - repeated containerd.types.Sandbox list = 1; -} - -message StoreGetRequest { - string sandbox_id = 1; -} - -message StoreGetResponse { - containerd.types.Sandbox sandbox = 1; -} - -// Controller is an interface to manage runtime sandbox instances. -service Controller { - rpc Create(ControllerCreateRequest) returns (ControllerCreateResponse); - rpc Start(ControllerStartRequest) returns (ControllerStartResponse); - rpc Platform(ControllerPlatformRequest) returns (ControllerPlatformResponse); - rpc Stop(ControllerStopRequest) returns (ControllerStopResponse); - rpc Wait(ControllerWaitRequest) returns (ControllerWaitResponse); - rpc Status(ControllerStatusRequest) returns (ControllerStatusResponse); - rpc Shutdown(ControllerShutdownRequest) returns (ControllerShutdownResponse); - rpc Metrics(ControllerMetricsRequest) returns (ControllerMetricsResponse); - rpc Update(ControllerUpdateRequest) returns (ControllerUpdateResponse); -} - -message ControllerCreateRequest { - string sandbox_id = 1; - repeated containerd.types.Mount rootfs = 2; - google.protobuf.Any options = 3; - string netns_path = 4; - map annotations = 5; - containerd.types.Sandbox sandbox = 6; - string sandboxer = 10; -} - -message ControllerCreateResponse { - string sandbox_id = 1; -} - -message ControllerStartRequest { - string sandbox_id = 1; - string sandboxer = 10; -} - -message ControllerStartResponse { - string sandbox_id = 1; - uint32 pid = 2; - google.protobuf.Timestamp created_at = 3; - map labels = 4; - // Address of the sandbox for containerd to connect, - // for calling Task or other APIs serving in the sandbox. - // it is in the form of ttrpc+unix://path/to/uds or grpc+vsock://:. - string address = 5; - uint32 version = 6; -} - -message ControllerPlatformRequest { - string sandbox_id = 1; - string sandboxer = 10; -} - -message ControllerPlatformResponse { - containerd.types.Platform platform = 1; -} - -message ControllerStopRequest { - string sandbox_id = 1; - uint32 timeout_secs = 2; - string sandboxer = 10; -} - -message ControllerStopResponse {} - -message ControllerWaitRequest { - string sandbox_id = 1; - string sandboxer = 10; -} - -message ControllerWaitResponse { - uint32 exit_status = 1; - google.protobuf.Timestamp exited_at = 2; -} - -message ControllerStatusRequest { - string sandbox_id = 1; - bool verbose = 2; - string sandboxer = 10; -} - -message ControllerStatusResponse { - string sandbox_id = 1; - uint32 pid = 2; - string state = 3; - map info = 4; - google.protobuf.Timestamp created_at = 5; - google.protobuf.Timestamp exited_at = 6; - google.protobuf.Any extra = 7; - // Address of the sandbox for containerd to connect, - // for calling Task or other APIs serving in the sandbox. - // it is in the form of ttrpc+unix://path/to/uds or grpc+vsock://:. - string address = 8; - uint32 version = 9; -} - -message ControllerShutdownRequest { - string sandbox_id = 1; - string sandboxer = 10; -} - -message ControllerShutdownResponse {} - -message ControllerMetricsRequest { - string sandbox_id = 1; - string sandboxer = 10; -} - -message ControllerMetricsResponse { - types.Metric metrics = 1; -} - -message ControllerUpdateRequest { - string sandbox_id = 1; - string sandboxer = 2; - containerd.types.Sandbox sandbox = 3; - repeated string fields = 4; -} - -message ControllerUpdateResponse { -} diff --git a/vendor/github.com/containerd/containerd/api/services/sandbox/v1/sandbox_grpc.pb.go b/vendor/github.com/containerd/containerd/api/services/sandbox/v1/sandbox_grpc.pb.go deleted file mode 100644 index 6a5ec28045..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/sandbox/v1/sandbox_grpc.pb.go +++ /dev/null @@ -1,625 +0,0 @@ -//go:build !no_grpc - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/sandbox/v1/sandbox.proto - -package sandbox - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// StoreClient is the client API for Store service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type StoreClient interface { - Create(ctx context.Context, in *StoreCreateRequest, opts ...grpc.CallOption) (*StoreCreateResponse, error) - Update(ctx context.Context, in *StoreUpdateRequest, opts ...grpc.CallOption) (*StoreUpdateResponse, error) - Delete(ctx context.Context, in *StoreDeleteRequest, opts ...grpc.CallOption) (*StoreDeleteResponse, error) - List(ctx context.Context, in *StoreListRequest, opts ...grpc.CallOption) (*StoreListResponse, error) - Get(ctx context.Context, in *StoreGetRequest, opts ...grpc.CallOption) (*StoreGetResponse, error) -} - -type storeClient struct { - cc grpc.ClientConnInterface -} - -func NewStoreClient(cc grpc.ClientConnInterface) StoreClient { - return &storeClient{cc} -} - -func (c *storeClient) Create(ctx context.Context, in *StoreCreateRequest, opts ...grpc.CallOption) (*StoreCreateResponse, error) { - out := new(StoreCreateResponse) - err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Store/Create", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storeClient) Update(ctx context.Context, in *StoreUpdateRequest, opts ...grpc.CallOption) (*StoreUpdateResponse, error) { - out := new(StoreUpdateResponse) - err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Store/Update", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storeClient) Delete(ctx context.Context, in *StoreDeleteRequest, opts ...grpc.CallOption) (*StoreDeleteResponse, error) { - out := new(StoreDeleteResponse) - err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Store/Delete", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storeClient) List(ctx context.Context, in *StoreListRequest, opts ...grpc.CallOption) (*StoreListResponse, error) { - out := new(StoreListResponse) - err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Store/List", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storeClient) Get(ctx context.Context, in *StoreGetRequest, opts ...grpc.CallOption) (*StoreGetResponse, error) { - out := new(StoreGetResponse) - err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Store/Get", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// StoreServer is the server API for Store service. -// All implementations must embed UnimplementedStoreServer -// for forward compatibility -type StoreServer interface { - Create(context.Context, *StoreCreateRequest) (*StoreCreateResponse, error) - Update(context.Context, *StoreUpdateRequest) (*StoreUpdateResponse, error) - Delete(context.Context, *StoreDeleteRequest) (*StoreDeleteResponse, error) - List(context.Context, *StoreListRequest) (*StoreListResponse, error) - Get(context.Context, *StoreGetRequest) (*StoreGetResponse, error) - mustEmbedUnimplementedStoreServer() -} - -// UnimplementedStoreServer must be embedded to have forward compatible implementations. -type UnimplementedStoreServer struct { -} - -func (UnimplementedStoreServer) Create(context.Context, *StoreCreateRequest) (*StoreCreateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") -} -func (UnimplementedStoreServer) Update(context.Context, *StoreUpdateRequest) (*StoreUpdateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") -} -func (UnimplementedStoreServer) Delete(context.Context, *StoreDeleteRequest) (*StoreDeleteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") -} -func (UnimplementedStoreServer) List(context.Context, *StoreListRequest) (*StoreListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method List not implemented") -} -func (UnimplementedStoreServer) Get(context.Context, *StoreGetRequest) (*StoreGetResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") -} -func (UnimplementedStoreServer) mustEmbedUnimplementedStoreServer() {} - -// UnsafeStoreServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to StoreServer will -// result in compilation errors. -type UnsafeStoreServer interface { - mustEmbedUnimplementedStoreServer() -} - -func RegisterStoreServer(s grpc.ServiceRegistrar, srv StoreServer) { - s.RegisterService(&Store_ServiceDesc, srv) -} - -func _Store_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StoreCreateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).Create(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.sandbox.v1.Store/Create", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).Create(ctx, req.(*StoreCreateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Store_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StoreUpdateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).Update(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.sandbox.v1.Store/Update", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).Update(ctx, req.(*StoreUpdateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Store_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StoreDeleteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).Delete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.sandbox.v1.Store/Delete", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).Delete(ctx, req.(*StoreDeleteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Store_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StoreListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).List(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.sandbox.v1.Store/List", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).List(ctx, req.(*StoreListRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Store_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StoreGetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).Get(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.sandbox.v1.Store/Get", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).Get(ctx, req.(*StoreGetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Store_ServiceDesc is the grpc.ServiceDesc for Store service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Store_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.services.sandbox.v1.Store", - HandlerType: (*StoreServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Create", - Handler: _Store_Create_Handler, - }, - { - MethodName: "Update", - Handler: _Store_Update_Handler, - }, - { - MethodName: "Delete", - Handler: _Store_Delete_Handler, - }, - { - MethodName: "List", - Handler: _Store_List_Handler, - }, - { - MethodName: "Get", - Handler: _Store_Get_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/containerd/containerd/api/services/sandbox/v1/sandbox.proto", -} - -// ControllerClient is the client API for Controller service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type ControllerClient interface { - Create(ctx context.Context, in *ControllerCreateRequest, opts ...grpc.CallOption) (*ControllerCreateResponse, error) - Start(ctx context.Context, in *ControllerStartRequest, opts ...grpc.CallOption) (*ControllerStartResponse, error) - Platform(ctx context.Context, in *ControllerPlatformRequest, opts ...grpc.CallOption) (*ControllerPlatformResponse, error) - Stop(ctx context.Context, in *ControllerStopRequest, opts ...grpc.CallOption) (*ControllerStopResponse, error) - Wait(ctx context.Context, in *ControllerWaitRequest, opts ...grpc.CallOption) (*ControllerWaitResponse, error) - Status(ctx context.Context, in *ControllerStatusRequest, opts ...grpc.CallOption) (*ControllerStatusResponse, error) - Shutdown(ctx context.Context, in *ControllerShutdownRequest, opts ...grpc.CallOption) (*ControllerShutdownResponse, error) - Metrics(ctx context.Context, in *ControllerMetricsRequest, opts ...grpc.CallOption) (*ControllerMetricsResponse, error) - Update(ctx context.Context, in *ControllerUpdateRequest, opts ...grpc.CallOption) (*ControllerUpdateResponse, error) -} - -type controllerClient struct { - cc grpc.ClientConnInterface -} - -func NewControllerClient(cc grpc.ClientConnInterface) ControllerClient { - return &controllerClient{cc} -} - -func (c *controllerClient) Create(ctx context.Context, in *ControllerCreateRequest, opts ...grpc.CallOption) (*ControllerCreateResponse, error) { - out := new(ControllerCreateResponse) - err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Controller/Create", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controllerClient) Start(ctx context.Context, in *ControllerStartRequest, opts ...grpc.CallOption) (*ControllerStartResponse, error) { - out := new(ControllerStartResponse) - err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Controller/Start", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controllerClient) Platform(ctx context.Context, in *ControllerPlatformRequest, opts ...grpc.CallOption) (*ControllerPlatformResponse, error) { - out := new(ControllerPlatformResponse) - err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Controller/Platform", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controllerClient) Stop(ctx context.Context, in *ControllerStopRequest, opts ...grpc.CallOption) (*ControllerStopResponse, error) { - out := new(ControllerStopResponse) - err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Controller/Stop", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controllerClient) Wait(ctx context.Context, in *ControllerWaitRequest, opts ...grpc.CallOption) (*ControllerWaitResponse, error) { - out := new(ControllerWaitResponse) - err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Controller/Wait", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controllerClient) Status(ctx context.Context, in *ControllerStatusRequest, opts ...grpc.CallOption) (*ControllerStatusResponse, error) { - out := new(ControllerStatusResponse) - err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Controller/Status", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controllerClient) Shutdown(ctx context.Context, in *ControllerShutdownRequest, opts ...grpc.CallOption) (*ControllerShutdownResponse, error) { - out := new(ControllerShutdownResponse) - err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Controller/Shutdown", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controllerClient) Metrics(ctx context.Context, in *ControllerMetricsRequest, opts ...grpc.CallOption) (*ControllerMetricsResponse, error) { - out := new(ControllerMetricsResponse) - err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Controller/Metrics", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controllerClient) Update(ctx context.Context, in *ControllerUpdateRequest, opts ...grpc.CallOption) (*ControllerUpdateResponse, error) { - out := new(ControllerUpdateResponse) - err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Controller/Update", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ControllerServer is the server API for Controller service. -// All implementations must embed UnimplementedControllerServer -// for forward compatibility -type ControllerServer interface { - Create(context.Context, *ControllerCreateRequest) (*ControllerCreateResponse, error) - Start(context.Context, *ControllerStartRequest) (*ControllerStartResponse, error) - Platform(context.Context, *ControllerPlatformRequest) (*ControllerPlatformResponse, error) - Stop(context.Context, *ControllerStopRequest) (*ControllerStopResponse, error) - Wait(context.Context, *ControllerWaitRequest) (*ControllerWaitResponse, error) - Status(context.Context, *ControllerStatusRequest) (*ControllerStatusResponse, error) - Shutdown(context.Context, *ControllerShutdownRequest) (*ControllerShutdownResponse, error) - Metrics(context.Context, *ControllerMetricsRequest) (*ControllerMetricsResponse, error) - Update(context.Context, *ControllerUpdateRequest) (*ControllerUpdateResponse, error) - mustEmbedUnimplementedControllerServer() -} - -// UnimplementedControllerServer must be embedded to have forward compatible implementations. -type UnimplementedControllerServer struct { -} - -func (UnimplementedControllerServer) Create(context.Context, *ControllerCreateRequest) (*ControllerCreateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") -} -func (UnimplementedControllerServer) Start(context.Context, *ControllerStartRequest) (*ControllerStartResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") -} -func (UnimplementedControllerServer) Platform(context.Context, *ControllerPlatformRequest) (*ControllerPlatformResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Platform not implemented") -} -func (UnimplementedControllerServer) Stop(context.Context, *ControllerStopRequest) (*ControllerStopResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") -} -func (UnimplementedControllerServer) Wait(context.Context, *ControllerWaitRequest) (*ControllerWaitResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Wait not implemented") -} -func (UnimplementedControllerServer) Status(context.Context, *ControllerStatusRequest) (*ControllerStatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") -} -func (UnimplementedControllerServer) Shutdown(context.Context, *ControllerShutdownRequest) (*ControllerShutdownResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Shutdown not implemented") -} -func (UnimplementedControllerServer) Metrics(context.Context, *ControllerMetricsRequest) (*ControllerMetricsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Metrics not implemented") -} -func (UnimplementedControllerServer) Update(context.Context, *ControllerUpdateRequest) (*ControllerUpdateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") -} -func (UnimplementedControllerServer) mustEmbedUnimplementedControllerServer() {} - -// UnsafeControllerServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ControllerServer will -// result in compilation errors. -type UnsafeControllerServer interface { - mustEmbedUnimplementedControllerServer() -} - -func RegisterControllerServer(s grpc.ServiceRegistrar, srv ControllerServer) { - s.RegisterService(&Controller_ServiceDesc, srv) -} - -func _Controller_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ControllerCreateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControllerServer).Create(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.sandbox.v1.Controller/Create", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControllerServer).Create(ctx, req.(*ControllerCreateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Controller_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ControllerStartRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControllerServer).Start(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.sandbox.v1.Controller/Start", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControllerServer).Start(ctx, req.(*ControllerStartRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Controller_Platform_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ControllerPlatformRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControllerServer).Platform(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.sandbox.v1.Controller/Platform", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControllerServer).Platform(ctx, req.(*ControllerPlatformRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Controller_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ControllerStopRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControllerServer).Stop(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.sandbox.v1.Controller/Stop", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControllerServer).Stop(ctx, req.(*ControllerStopRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Controller_Wait_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ControllerWaitRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControllerServer).Wait(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.sandbox.v1.Controller/Wait", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControllerServer).Wait(ctx, req.(*ControllerWaitRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Controller_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ControllerStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControllerServer).Status(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.sandbox.v1.Controller/Status", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControllerServer).Status(ctx, req.(*ControllerStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Controller_Shutdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ControllerShutdownRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControllerServer).Shutdown(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.sandbox.v1.Controller/Shutdown", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControllerServer).Shutdown(ctx, req.(*ControllerShutdownRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Controller_Metrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ControllerMetricsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControllerServer).Metrics(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.sandbox.v1.Controller/Metrics", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControllerServer).Metrics(ctx, req.(*ControllerMetricsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Controller_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ControllerUpdateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControllerServer).Update(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.sandbox.v1.Controller/Update", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControllerServer).Update(ctx, req.(*ControllerUpdateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Controller_ServiceDesc is the grpc.ServiceDesc for Controller service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Controller_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.services.sandbox.v1.Controller", - HandlerType: (*ControllerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Create", - Handler: _Controller_Create_Handler, - }, - { - MethodName: "Start", - Handler: _Controller_Start_Handler, - }, - { - MethodName: "Platform", - Handler: _Controller_Platform_Handler, - }, - { - MethodName: "Stop", - Handler: _Controller_Stop_Handler, - }, - { - MethodName: "Wait", - Handler: _Controller_Wait_Handler, - }, - { - MethodName: "Status", - Handler: _Controller_Status_Handler, - }, - { - MethodName: "Shutdown", - Handler: _Controller_Shutdown_Handler, - }, - { - MethodName: "Metrics", - Handler: _Controller_Metrics_Handler, - }, - { - MethodName: "Update", - Handler: _Controller_Update_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/containerd/containerd/api/services/sandbox/v1/sandbox.proto", -} diff --git a/vendor/github.com/containerd/containerd/api/services/sandbox/v1/sandbox_ttrpc.pb.go b/vendor/github.com/containerd/containerd/api/services/sandbox/v1/sandbox_ttrpc.pb.go deleted file mode 100644 index 924a54f6e7..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/sandbox/v1/sandbox_ttrpc.pb.go +++ /dev/null @@ -1,272 +0,0 @@ -// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/containerd/api/services/sandbox/v1/sandbox.proto -package sandbox - -import ( - context "context" - ttrpc "github.com/containerd/ttrpc" -) - -type TTRPCStoreService interface { - Create(context.Context, *StoreCreateRequest) (*StoreCreateResponse, error) - Update(context.Context, *StoreUpdateRequest) (*StoreUpdateResponse, error) - Delete(context.Context, *StoreDeleteRequest) (*StoreDeleteResponse, error) - List(context.Context, *StoreListRequest) (*StoreListResponse, error) - Get(context.Context, *StoreGetRequest) (*StoreGetResponse, error) -} - -func RegisterTTRPCStoreService(srv *ttrpc.Server, svc TTRPCStoreService) { - srv.RegisterService("containerd.services.sandbox.v1.Store", &ttrpc.ServiceDesc{ - Methods: map[string]ttrpc.Method{ - "Create": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req StoreCreateRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Create(ctx, &req) - }, - "Update": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req StoreUpdateRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Update(ctx, &req) - }, - "Delete": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req StoreDeleteRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Delete(ctx, &req) - }, - "List": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req StoreListRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.List(ctx, &req) - }, - "Get": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req StoreGetRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Get(ctx, &req) - }, - }, - }) -} - -type ttrpcstoreClient struct { - client *ttrpc.Client -} - -func NewTTRPCStoreClient(client *ttrpc.Client) TTRPCStoreService { - return &ttrpcstoreClient{ - client: client, - } -} - -func (c *ttrpcstoreClient) Create(ctx context.Context, req *StoreCreateRequest) (*StoreCreateResponse, error) { - var resp StoreCreateResponse - if err := c.client.Call(ctx, "containerd.services.sandbox.v1.Store", "Create", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcstoreClient) Update(ctx context.Context, req *StoreUpdateRequest) (*StoreUpdateResponse, error) { - var resp StoreUpdateResponse - if err := c.client.Call(ctx, "containerd.services.sandbox.v1.Store", "Update", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcstoreClient) Delete(ctx context.Context, req *StoreDeleteRequest) (*StoreDeleteResponse, error) { - var resp StoreDeleteResponse - if err := c.client.Call(ctx, "containerd.services.sandbox.v1.Store", "Delete", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcstoreClient) List(ctx context.Context, req *StoreListRequest) (*StoreListResponse, error) { - var resp StoreListResponse - if err := c.client.Call(ctx, "containerd.services.sandbox.v1.Store", "List", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcstoreClient) Get(ctx context.Context, req *StoreGetRequest) (*StoreGetResponse, error) { - var resp StoreGetResponse - if err := c.client.Call(ctx, "containerd.services.sandbox.v1.Store", "Get", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -type TTRPCControllerService interface { - Create(context.Context, *ControllerCreateRequest) (*ControllerCreateResponse, error) - Start(context.Context, *ControllerStartRequest) (*ControllerStartResponse, error) - Platform(context.Context, *ControllerPlatformRequest) (*ControllerPlatformResponse, error) - Stop(context.Context, *ControllerStopRequest) (*ControllerStopResponse, error) - Wait(context.Context, *ControllerWaitRequest) (*ControllerWaitResponse, error) - Status(context.Context, *ControllerStatusRequest) (*ControllerStatusResponse, error) - Shutdown(context.Context, *ControllerShutdownRequest) (*ControllerShutdownResponse, error) - Metrics(context.Context, *ControllerMetricsRequest) (*ControllerMetricsResponse, error) - Update(context.Context, *ControllerUpdateRequest) (*ControllerUpdateResponse, error) -} - -func RegisterTTRPCControllerService(srv *ttrpc.Server, svc TTRPCControllerService) { - srv.RegisterService("containerd.services.sandbox.v1.Controller", &ttrpc.ServiceDesc{ - Methods: map[string]ttrpc.Method{ - "Create": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ControllerCreateRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Create(ctx, &req) - }, - "Start": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ControllerStartRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Start(ctx, &req) - }, - "Platform": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ControllerPlatformRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Platform(ctx, &req) - }, - "Stop": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ControllerStopRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Stop(ctx, &req) - }, - "Wait": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ControllerWaitRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Wait(ctx, &req) - }, - "Status": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ControllerStatusRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Status(ctx, &req) - }, - "Shutdown": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ControllerShutdownRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Shutdown(ctx, &req) - }, - "Metrics": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ControllerMetricsRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Metrics(ctx, &req) - }, - "Update": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ControllerUpdateRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Update(ctx, &req) - }, - }, - }) -} - -type ttrpccontrollerClient struct { - client *ttrpc.Client -} - -func NewTTRPCControllerClient(client *ttrpc.Client) TTRPCControllerService { - return &ttrpccontrollerClient{ - client: client, - } -} - -func (c *ttrpccontrollerClient) Create(ctx context.Context, req *ControllerCreateRequest) (*ControllerCreateResponse, error) { - var resp ControllerCreateResponse - if err := c.client.Call(ctx, "containerd.services.sandbox.v1.Controller", "Create", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontrollerClient) Start(ctx context.Context, req *ControllerStartRequest) (*ControllerStartResponse, error) { - var resp ControllerStartResponse - if err := c.client.Call(ctx, "containerd.services.sandbox.v1.Controller", "Start", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontrollerClient) Platform(ctx context.Context, req *ControllerPlatformRequest) (*ControllerPlatformResponse, error) { - var resp ControllerPlatformResponse - if err := c.client.Call(ctx, "containerd.services.sandbox.v1.Controller", "Platform", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontrollerClient) Stop(ctx context.Context, req *ControllerStopRequest) (*ControllerStopResponse, error) { - var resp ControllerStopResponse - if err := c.client.Call(ctx, "containerd.services.sandbox.v1.Controller", "Stop", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontrollerClient) Wait(ctx context.Context, req *ControllerWaitRequest) (*ControllerWaitResponse, error) { - var resp ControllerWaitResponse - if err := c.client.Call(ctx, "containerd.services.sandbox.v1.Controller", "Wait", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontrollerClient) Status(ctx context.Context, req *ControllerStatusRequest) (*ControllerStatusResponse, error) { - var resp ControllerStatusResponse - if err := c.client.Call(ctx, "containerd.services.sandbox.v1.Controller", "Status", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontrollerClient) Shutdown(ctx context.Context, req *ControllerShutdownRequest) (*ControllerShutdownResponse, error) { - var resp ControllerShutdownResponse - if err := c.client.Call(ctx, "containerd.services.sandbox.v1.Controller", "Shutdown", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontrollerClient) Metrics(ctx context.Context, req *ControllerMetricsRequest) (*ControllerMetricsResponse, error) { - var resp ControllerMetricsResponse - if err := c.client.Call(ctx, "containerd.services.sandbox.v1.Controller", "Metrics", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpccontrollerClient) Update(ctx context.Context, req *ControllerUpdateRequest) (*ControllerUpdateResponse, error) { - var resp ControllerUpdateResponse - if err := c.client.Call(ctx, "containerd.services.sandbox.v1.Controller", "Update", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/snapshots/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/snapshots/v1/doc.go deleted file mode 100644 index 00b3cd9625..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/snapshots/v1/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package snapshots diff --git a/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots.pb.go b/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots.pb.go deleted file mode 100644 index b7cec8048b..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots.pb.go +++ /dev/null @@ -1,1715 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto - -package snapshots - -import ( - types "github.com/containerd/containerd/api/types" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -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) -) - -type Kind int32 - -const ( - Kind_UNKNOWN Kind = 0 - Kind_VIEW Kind = 1 - Kind_ACTIVE Kind = 2 - Kind_COMMITTED Kind = 3 -) - -// Enum value maps for Kind. -var ( - Kind_name = map[int32]string{ - 0: "UNKNOWN", - 1: "VIEW", - 2: "ACTIVE", - 3: "COMMITTED", - } - Kind_value = map[string]int32{ - "UNKNOWN": 0, - "VIEW": 1, - "ACTIVE": 2, - "COMMITTED": 3, - } -) - -func (x Kind) Enum() *Kind { - p := new(Kind) - *p = x - return p -} - -func (x Kind) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Kind) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_enumTypes[0].Descriptor() -} - -func (Kind) Type() protoreflect.EnumType { - return &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_enumTypes[0] -} - -func (x Kind) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Kind.Descriptor instead. -func (Kind) EnumDescriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{0} -} - -type PrepareSnapshotRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Parent string `protobuf:"bytes,3,opt,name=parent,proto3" json:"parent,omitempty"` - // Labels are arbitrary data on snapshots. - // - // The combined size of a key/value pair cannot exceed 4096 bytes. - Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *PrepareSnapshotRequest) Reset() { - *x = PrepareSnapshotRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PrepareSnapshotRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PrepareSnapshotRequest) ProtoMessage() {} - -func (x *PrepareSnapshotRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[0] - 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 PrepareSnapshotRequest.ProtoReflect.Descriptor instead. -func (*PrepareSnapshotRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{0} -} - -func (x *PrepareSnapshotRequest) GetSnapshotter() string { - if x != nil { - return x.Snapshotter - } - return "" -} - -func (x *PrepareSnapshotRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *PrepareSnapshotRequest) GetParent() string { - if x != nil { - return x.Parent - } - return "" -} - -func (x *PrepareSnapshotRequest) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -type PrepareSnapshotResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Mounts []*types.Mount `protobuf:"bytes,1,rep,name=mounts,proto3" json:"mounts,omitempty"` -} - -func (x *PrepareSnapshotResponse) Reset() { - *x = PrepareSnapshotResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PrepareSnapshotResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PrepareSnapshotResponse) ProtoMessage() {} - -func (x *PrepareSnapshotResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[1] - 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 PrepareSnapshotResponse.ProtoReflect.Descriptor instead. -func (*PrepareSnapshotResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{1} -} - -func (x *PrepareSnapshotResponse) GetMounts() []*types.Mount { - if x != nil { - return x.Mounts - } - return nil -} - -type ViewSnapshotRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Parent string `protobuf:"bytes,3,opt,name=parent,proto3" json:"parent,omitempty"` - // Labels are arbitrary data on snapshots. - // - // The combined size of a key/value pair cannot exceed 4096 bytes. - Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *ViewSnapshotRequest) Reset() { - *x = ViewSnapshotRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ViewSnapshotRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ViewSnapshotRequest) ProtoMessage() {} - -func (x *ViewSnapshotRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[2] - 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 ViewSnapshotRequest.ProtoReflect.Descriptor instead. -func (*ViewSnapshotRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{2} -} - -func (x *ViewSnapshotRequest) GetSnapshotter() string { - if x != nil { - return x.Snapshotter - } - return "" -} - -func (x *ViewSnapshotRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *ViewSnapshotRequest) GetParent() string { - if x != nil { - return x.Parent - } - return "" -} - -func (x *ViewSnapshotRequest) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -type ViewSnapshotResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Mounts []*types.Mount `protobuf:"bytes,1,rep,name=mounts,proto3" json:"mounts,omitempty"` -} - -func (x *ViewSnapshotResponse) Reset() { - *x = ViewSnapshotResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ViewSnapshotResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ViewSnapshotResponse) ProtoMessage() {} - -func (x *ViewSnapshotResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[3] - 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 ViewSnapshotResponse.ProtoReflect.Descriptor instead. -func (*ViewSnapshotResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{3} -} - -func (x *ViewSnapshotResponse) GetMounts() []*types.Mount { - if x != nil { - return x.Mounts - } - return nil -} - -type MountsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` -} - -func (x *MountsRequest) Reset() { - *x = MountsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MountsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MountsRequest) ProtoMessage() {} - -func (x *MountsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[4] - 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 MountsRequest.ProtoReflect.Descriptor instead. -func (*MountsRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{4} -} - -func (x *MountsRequest) GetSnapshotter() string { - if x != nil { - return x.Snapshotter - } - return "" -} - -func (x *MountsRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -type MountsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Mounts []*types.Mount `protobuf:"bytes,1,rep,name=mounts,proto3" json:"mounts,omitempty"` -} - -func (x *MountsResponse) Reset() { - *x = MountsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MountsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MountsResponse) ProtoMessage() {} - -func (x *MountsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[5] - 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 MountsResponse.ProtoReflect.Descriptor instead. -func (*MountsResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{5} -} - -func (x *MountsResponse) GetMounts() []*types.Mount { - if x != nil { - return x.Mounts - } - return nil -} - -type RemoveSnapshotRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` -} - -func (x *RemoveSnapshotRequest) Reset() { - *x = RemoveSnapshotRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveSnapshotRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveSnapshotRequest) ProtoMessage() {} - -func (x *RemoveSnapshotRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[6] - 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 RemoveSnapshotRequest.ProtoReflect.Descriptor instead. -func (*RemoveSnapshotRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{6} -} - -func (x *RemoveSnapshotRequest) GetSnapshotter() string { - if x != nil { - return x.Snapshotter - } - return "" -} - -func (x *RemoveSnapshotRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -type CommitSnapshotRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - // Labels are arbitrary data on snapshots. - // - // The combined size of a key/value pair cannot exceed 4096 bytes. - Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *CommitSnapshotRequest) Reset() { - *x = CommitSnapshotRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommitSnapshotRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommitSnapshotRequest) ProtoMessage() {} - -func (x *CommitSnapshotRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[7] - 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 CommitSnapshotRequest.ProtoReflect.Descriptor instead. -func (*CommitSnapshotRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{7} -} - -func (x *CommitSnapshotRequest) GetSnapshotter() string { - if x != nil { - return x.Snapshotter - } - return "" -} - -func (x *CommitSnapshotRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CommitSnapshotRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *CommitSnapshotRequest) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -type StatSnapshotRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` -} - -func (x *StatSnapshotRequest) Reset() { - *x = StatSnapshotRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StatSnapshotRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StatSnapshotRequest) ProtoMessage() {} - -func (x *StatSnapshotRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[8] - 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 StatSnapshotRequest.ProtoReflect.Descriptor instead. -func (*StatSnapshotRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{8} -} - -func (x *StatSnapshotRequest) GetSnapshotter() string { - if x != nil { - return x.Snapshotter - } - return "" -} - -func (x *StatSnapshotRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -type Info struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Parent string `protobuf:"bytes,2,opt,name=parent,proto3" json:"parent,omitempty"` - Kind Kind `protobuf:"varint,3,opt,name=kind,proto3,enum=containerd.services.snapshots.v1.Kind" json:"kind,omitempty"` - // CreatedAt provides the time at which the snapshot was created. - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - // UpdatedAt provides the time the info was last updated. - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - // Labels are arbitrary data on snapshots. - // - // The combined size of a key/value pair cannot exceed 4096 bytes. - Labels map[string]string `protobuf:"bytes,6,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *Info) Reset() { - *x = Info{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Info) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Info) ProtoMessage() {} - -func (x *Info) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[9] - 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.ProtoReflect.Descriptor instead. -func (*Info) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{9} -} - -func (x *Info) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Info) GetParent() string { - if x != nil { - return x.Parent - } - return "" -} - -func (x *Info) GetKind() Kind { - if x != nil { - return x.Kind - } - return Kind_UNKNOWN -} - -func (x *Info) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *Info) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -func (x *Info) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -type StatSnapshotResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Info *Info `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` -} - -func (x *StatSnapshotResponse) Reset() { - *x = StatSnapshotResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StatSnapshotResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StatSnapshotResponse) ProtoMessage() {} - -func (x *StatSnapshotResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[10] - 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 StatSnapshotResponse.ProtoReflect.Descriptor instead. -func (*StatSnapshotResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{10} -} - -func (x *StatSnapshotResponse) GetInfo() *Info { - if x != nil { - return x.Info - } - return nil -} - -type UpdateSnapshotRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` - Info *Info `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` - // UpdateMask specifies which fields to perform the update on. If empty, - // the operation applies to all fields. - // - // In info, Name, Parent, Kind, Created are immutable, - // other field may be updated using this mask. - // If no mask is provided, all mutable field are updated. - UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` -} - -func (x *UpdateSnapshotRequest) Reset() { - *x = UpdateSnapshotRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateSnapshotRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateSnapshotRequest) ProtoMessage() {} - -func (x *UpdateSnapshotRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[11] - 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 UpdateSnapshotRequest.ProtoReflect.Descriptor instead. -func (*UpdateSnapshotRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{11} -} - -func (x *UpdateSnapshotRequest) GetSnapshotter() string { - if x != nil { - return x.Snapshotter - } - return "" -} - -func (x *UpdateSnapshotRequest) GetInfo() *Info { - if x != nil { - return x.Info - } - return nil -} - -func (x *UpdateSnapshotRequest) GetUpdateMask() *fieldmaskpb.FieldMask { - if x != nil { - return x.UpdateMask - } - return nil -} - -type UpdateSnapshotResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Info *Info `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` -} - -func (x *UpdateSnapshotResponse) Reset() { - *x = UpdateSnapshotResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateSnapshotResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateSnapshotResponse) ProtoMessage() {} - -func (x *UpdateSnapshotResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[12] - 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 UpdateSnapshotResponse.ProtoReflect.Descriptor instead. -func (*UpdateSnapshotResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{12} -} - -func (x *UpdateSnapshotResponse) GetInfo() *Info { - if x != nil { - return x.Info - } - return nil -} - -type ListSnapshotsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` - // Filters contains one or more filters using the syntax defined in the - // containerd filter package. - // - // The returned result will be those that match any of the provided - // filters. Expanded, images that match the following will be - // returned: - // - // filters[0] or filters[1] or ... or filters[n-1] or filters[n] - // - // If filters is zero-length or nil, all items will be returned. - Filters []string `protobuf:"bytes,2,rep,name=filters,proto3" json:"filters,omitempty"` -} - -func (x *ListSnapshotsRequest) Reset() { - *x = ListSnapshotsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSnapshotsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSnapshotsRequest) ProtoMessage() {} - -func (x *ListSnapshotsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[13] - 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 ListSnapshotsRequest.ProtoReflect.Descriptor instead. -func (*ListSnapshotsRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{13} -} - -func (x *ListSnapshotsRequest) GetSnapshotter() string { - if x != nil { - return x.Snapshotter - } - return "" -} - -func (x *ListSnapshotsRequest) GetFilters() []string { - if x != nil { - return x.Filters - } - return nil -} - -type ListSnapshotsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Info []*Info `protobuf:"bytes,1,rep,name=info,proto3" json:"info,omitempty"` -} - -func (x *ListSnapshotsResponse) Reset() { - *x = ListSnapshotsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSnapshotsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSnapshotsResponse) ProtoMessage() {} - -func (x *ListSnapshotsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[14] - 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 ListSnapshotsResponse.ProtoReflect.Descriptor instead. -func (*ListSnapshotsResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{14} -} - -func (x *ListSnapshotsResponse) GetInfo() []*Info { - if x != nil { - return x.Info - } - return nil -} - -type UsageRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` -} - -func (x *UsageRequest) Reset() { - *x = UsageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UsageRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UsageRequest) ProtoMessage() {} - -func (x *UsageRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[15] - 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 UsageRequest.ProtoReflect.Descriptor instead. -func (*UsageRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{15} -} - -func (x *UsageRequest) GetSnapshotter() string { - if x != nil { - return x.Snapshotter - } - return "" -} - -func (x *UsageRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -type UsageResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Size int64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` - Inodes int64 `protobuf:"varint,2,opt,name=inodes,proto3" json:"inodes,omitempty"` -} - -func (x *UsageResponse) Reset() { - *x = UsageResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UsageResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UsageResponse) ProtoMessage() {} - -func (x *UsageResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[16] - 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 UsageResponse.ProtoReflect.Descriptor instead. -func (*UsageResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{16} -} - -func (x *UsageResponse) GetSize() int64 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *UsageResponse) GetInodes() int64 { - if x != nil { - return x.Inodes - } - return 0 -} - -type CleanupRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` -} - -func (x *CleanupRequest) Reset() { - *x = CleanupRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CleanupRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CleanupRequest) ProtoMessage() {} - -func (x *CleanupRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[17] - 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 CleanupRequest.ProtoReflect.Descriptor instead. -func (*CleanupRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP(), []int{17} -} - -func (x *CleanupRequest) GetSnapshotter() string { - if x != nil { - return x.Snapshotter - } - return "" -} - -var File_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDesc = []byte{ - 0x0a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x6e, 0x61, - 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x20, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1b, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x36, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfd, 0x01, 0x0a, 0x16, 0x50, 0x72, 0x65, 0x70, 0x61, - 0x72, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x5c, 0x0a, - 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x44, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x22, 0x4a, 0x0a, 0x17, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, - 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x22, 0xf7, 0x01, 0x0a, 0x13, 0x56, 0x69, 0x65, 0x77, 0x53, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x16, - 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x59, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, - 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x53, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x22, 0x47, 0x0a, 0x14, - 0x56, 0x69, 0x65, 0x77, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x43, 0x0a, 0x0d, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6e, 0x61, - 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x41, 0x0a, 0x0e, 0x4d, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x06, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x4b, 0x0a, - 0x15, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6e, 0x61, - 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0xf7, 0x01, 0x0a, 0x15, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x5b, 0x0a, 0x06, - 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x22, 0x49, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x74, 0x53, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x73, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, - 0xeb, 0x02, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x12, 0x3a, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, - 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, - 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x4a, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, - 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 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, 0x22, 0x52, 0x0a, - 0x14, 0x53, 0x74, 0x61, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, - 0x6f, 0x22, 0xb2, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x73, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x12, 0x3a, 0x0a, - 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x54, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x3a, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x52, 0x0a, 0x14, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, - 0x22, 0x53, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x04, 0x69, 0x6e, 0x66, - 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x42, 0x0a, 0x0c, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, - 0x74, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x3b, 0x0a, 0x0d, 0x55, 0x73, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x69, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x69, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x32, 0x0a, 0x0e, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, - 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x2a, 0x38, 0x0a, 0x04, 0x4b, 0x69, - 0x6e, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, - 0x08, 0x0a, 0x04, 0x56, 0x49, 0x45, 0x57, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, - 0x49, 0x56, 0x45, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x54, - 0x45, 0x44, 0x10, 0x03, 0x32, 0xd3, 0x08, 0x0a, 0x09, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, - 0x74, 0x73, 0x12, 0x7e, 0x0a, 0x07, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, 0x38, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, - 0x72, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x75, 0x0a, 0x04, 0x56, 0x69, 0x65, 0x77, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, - 0x65, 0x77, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x36, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x06, 0x4d, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x12, 0x59, 0x0a, 0x06, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x12, 0x37, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x75, 0x0a, 0x04, - 0x53, 0x74, 0x61, 0x74, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x53, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x37, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, - 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x79, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x36, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x37, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x68, 0x0a, 0x05, 0x55, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x07, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, - 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x46, 0x5a, 0x44, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, - 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescData = file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes = make([]protoimpl.MessageInfo, 22) -var file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_goTypes = []interface{}{ - (Kind)(0), // 0: containerd.services.snapshots.v1.Kind - (*PrepareSnapshotRequest)(nil), // 1: containerd.services.snapshots.v1.PrepareSnapshotRequest - (*PrepareSnapshotResponse)(nil), // 2: containerd.services.snapshots.v1.PrepareSnapshotResponse - (*ViewSnapshotRequest)(nil), // 3: containerd.services.snapshots.v1.ViewSnapshotRequest - (*ViewSnapshotResponse)(nil), // 4: containerd.services.snapshots.v1.ViewSnapshotResponse - (*MountsRequest)(nil), // 5: containerd.services.snapshots.v1.MountsRequest - (*MountsResponse)(nil), // 6: containerd.services.snapshots.v1.MountsResponse - (*RemoveSnapshotRequest)(nil), // 7: containerd.services.snapshots.v1.RemoveSnapshotRequest - (*CommitSnapshotRequest)(nil), // 8: containerd.services.snapshots.v1.CommitSnapshotRequest - (*StatSnapshotRequest)(nil), // 9: containerd.services.snapshots.v1.StatSnapshotRequest - (*Info)(nil), // 10: containerd.services.snapshots.v1.Info - (*StatSnapshotResponse)(nil), // 11: containerd.services.snapshots.v1.StatSnapshotResponse - (*UpdateSnapshotRequest)(nil), // 12: containerd.services.snapshots.v1.UpdateSnapshotRequest - (*UpdateSnapshotResponse)(nil), // 13: containerd.services.snapshots.v1.UpdateSnapshotResponse - (*ListSnapshotsRequest)(nil), // 14: containerd.services.snapshots.v1.ListSnapshotsRequest - (*ListSnapshotsResponse)(nil), // 15: containerd.services.snapshots.v1.ListSnapshotsResponse - (*UsageRequest)(nil), // 16: containerd.services.snapshots.v1.UsageRequest - (*UsageResponse)(nil), // 17: containerd.services.snapshots.v1.UsageResponse - (*CleanupRequest)(nil), // 18: containerd.services.snapshots.v1.CleanupRequest - nil, // 19: containerd.services.snapshots.v1.PrepareSnapshotRequest.LabelsEntry - nil, // 20: containerd.services.snapshots.v1.ViewSnapshotRequest.LabelsEntry - nil, // 21: containerd.services.snapshots.v1.CommitSnapshotRequest.LabelsEntry - nil, // 22: containerd.services.snapshots.v1.Info.LabelsEntry - (*types.Mount)(nil), // 23: containerd.types.Mount - (*timestamppb.Timestamp)(nil), // 24: google.protobuf.Timestamp - (*fieldmaskpb.FieldMask)(nil), // 25: google.protobuf.FieldMask - (*emptypb.Empty)(nil), // 26: google.protobuf.Empty -} -var file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_depIdxs = []int32{ - 19, // 0: containerd.services.snapshots.v1.PrepareSnapshotRequest.labels:type_name -> containerd.services.snapshots.v1.PrepareSnapshotRequest.LabelsEntry - 23, // 1: containerd.services.snapshots.v1.PrepareSnapshotResponse.mounts:type_name -> containerd.types.Mount - 20, // 2: containerd.services.snapshots.v1.ViewSnapshotRequest.labels:type_name -> containerd.services.snapshots.v1.ViewSnapshotRequest.LabelsEntry - 23, // 3: containerd.services.snapshots.v1.ViewSnapshotResponse.mounts:type_name -> containerd.types.Mount - 23, // 4: containerd.services.snapshots.v1.MountsResponse.mounts:type_name -> containerd.types.Mount - 21, // 5: containerd.services.snapshots.v1.CommitSnapshotRequest.labels:type_name -> containerd.services.snapshots.v1.CommitSnapshotRequest.LabelsEntry - 0, // 6: containerd.services.snapshots.v1.Info.kind:type_name -> containerd.services.snapshots.v1.Kind - 24, // 7: containerd.services.snapshots.v1.Info.created_at:type_name -> google.protobuf.Timestamp - 24, // 8: containerd.services.snapshots.v1.Info.updated_at:type_name -> google.protobuf.Timestamp - 22, // 9: containerd.services.snapshots.v1.Info.labels:type_name -> containerd.services.snapshots.v1.Info.LabelsEntry - 10, // 10: containerd.services.snapshots.v1.StatSnapshotResponse.info:type_name -> containerd.services.snapshots.v1.Info - 10, // 11: containerd.services.snapshots.v1.UpdateSnapshotRequest.info:type_name -> containerd.services.snapshots.v1.Info - 25, // 12: containerd.services.snapshots.v1.UpdateSnapshotRequest.update_mask:type_name -> google.protobuf.FieldMask - 10, // 13: containerd.services.snapshots.v1.UpdateSnapshotResponse.info:type_name -> containerd.services.snapshots.v1.Info - 10, // 14: containerd.services.snapshots.v1.ListSnapshotsResponse.info:type_name -> containerd.services.snapshots.v1.Info - 1, // 15: containerd.services.snapshots.v1.Snapshots.Prepare:input_type -> containerd.services.snapshots.v1.PrepareSnapshotRequest - 3, // 16: containerd.services.snapshots.v1.Snapshots.View:input_type -> containerd.services.snapshots.v1.ViewSnapshotRequest - 5, // 17: containerd.services.snapshots.v1.Snapshots.Mounts:input_type -> containerd.services.snapshots.v1.MountsRequest - 8, // 18: containerd.services.snapshots.v1.Snapshots.Commit:input_type -> containerd.services.snapshots.v1.CommitSnapshotRequest - 7, // 19: containerd.services.snapshots.v1.Snapshots.Remove:input_type -> containerd.services.snapshots.v1.RemoveSnapshotRequest - 9, // 20: containerd.services.snapshots.v1.Snapshots.Stat:input_type -> containerd.services.snapshots.v1.StatSnapshotRequest - 12, // 21: containerd.services.snapshots.v1.Snapshots.Update:input_type -> containerd.services.snapshots.v1.UpdateSnapshotRequest - 14, // 22: containerd.services.snapshots.v1.Snapshots.List:input_type -> containerd.services.snapshots.v1.ListSnapshotsRequest - 16, // 23: containerd.services.snapshots.v1.Snapshots.Usage:input_type -> containerd.services.snapshots.v1.UsageRequest - 18, // 24: containerd.services.snapshots.v1.Snapshots.Cleanup:input_type -> containerd.services.snapshots.v1.CleanupRequest - 2, // 25: containerd.services.snapshots.v1.Snapshots.Prepare:output_type -> containerd.services.snapshots.v1.PrepareSnapshotResponse - 4, // 26: containerd.services.snapshots.v1.Snapshots.View:output_type -> containerd.services.snapshots.v1.ViewSnapshotResponse - 6, // 27: containerd.services.snapshots.v1.Snapshots.Mounts:output_type -> containerd.services.snapshots.v1.MountsResponse - 26, // 28: containerd.services.snapshots.v1.Snapshots.Commit:output_type -> google.protobuf.Empty - 26, // 29: containerd.services.snapshots.v1.Snapshots.Remove:output_type -> google.protobuf.Empty - 11, // 30: containerd.services.snapshots.v1.Snapshots.Stat:output_type -> containerd.services.snapshots.v1.StatSnapshotResponse - 13, // 31: containerd.services.snapshots.v1.Snapshots.Update:output_type -> containerd.services.snapshots.v1.UpdateSnapshotResponse - 15, // 32: containerd.services.snapshots.v1.Snapshots.List:output_type -> containerd.services.snapshots.v1.ListSnapshotsResponse - 17, // 33: containerd.services.snapshots.v1.Snapshots.Usage:output_type -> containerd.services.snapshots.v1.UsageResponse - 26, // 34: containerd.services.snapshots.v1.Snapshots.Cleanup:output_type -> google.protobuf.Empty - 25, // [25:35] is the sub-list for method output_type - 15, // [15:25] is the sub-list for method input_type - 15, // [15:15] is the sub-list for extension type_name - 15, // [15:15] is the sub-list for extension extendee - 0, // [0:15] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_init() } -func file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_init() { - if File_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrepareSnapshotRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrepareSnapshotResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewSnapshotRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewSnapshotResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MountsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MountsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveSnapshotRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommitSnapshotRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatSnapshotRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatSnapshotResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateSnapshotRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateSnapshotResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSnapshotsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSnapshotsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UsageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UsageResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CleanupRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDesc, - NumEnums: 1, - NumMessages: 22, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_depIdxs, - EnumInfos: file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_enumTypes, - MessageInfos: file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto = out.File - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_rawDesc = nil - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_goTypes = nil - file_github_com_containerd_containerd_api_services_snapshots_v1_snapshots_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto b/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto deleted file mode 100644 index 170ff473e2..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto +++ /dev/null @@ -1,179 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.services.snapshots.v1; - -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "github.com/containerd/containerd/api/types/mount.proto"; - -option go_package = "github.com/containerd/containerd/api/services/snapshots/v1;snapshots"; - -// Snapshot service manages snapshots -service Snapshots { - rpc Prepare(PrepareSnapshotRequest) returns (PrepareSnapshotResponse); - rpc View(ViewSnapshotRequest) returns (ViewSnapshotResponse); - rpc Mounts(MountsRequest) returns (MountsResponse); - rpc Commit(CommitSnapshotRequest) returns (google.protobuf.Empty); - rpc Remove(RemoveSnapshotRequest) returns (google.protobuf.Empty); - rpc Stat(StatSnapshotRequest) returns (StatSnapshotResponse); - rpc Update(UpdateSnapshotRequest) returns (UpdateSnapshotResponse); - rpc List(ListSnapshotsRequest) returns (stream ListSnapshotsResponse); - rpc Usage(UsageRequest) returns (UsageResponse); - rpc Cleanup(CleanupRequest) returns (google.protobuf.Empty); -} - -message PrepareSnapshotRequest { - string snapshotter = 1; - string key = 2; - string parent = 3; - - // Labels are arbitrary data on snapshots. - // - // The combined size of a key/value pair cannot exceed 4096 bytes. - map labels = 4; -} - -message PrepareSnapshotResponse { - repeated containerd.types.Mount mounts = 1; -} - -message ViewSnapshotRequest { - string snapshotter = 1; - string key = 2; - string parent = 3; - - // Labels are arbitrary data on snapshots. - // - // The combined size of a key/value pair cannot exceed 4096 bytes. - map labels = 4; -} - -message ViewSnapshotResponse { - repeated containerd.types.Mount mounts = 1; -} - -message MountsRequest { - string snapshotter = 1; - string key = 2; -} - -message MountsResponse { - repeated containerd.types.Mount mounts = 1; -} - -message RemoveSnapshotRequest { - string snapshotter = 1; - string key = 2; -} - -message CommitSnapshotRequest { - string snapshotter = 1; - string name = 2; - string key = 3; - - // Labels are arbitrary data on snapshots. - // - // The combined size of a key/value pair cannot exceed 4096 bytes. - map labels = 4; -} - -message StatSnapshotRequest { - string snapshotter = 1; - string key = 2; -} - -enum Kind { - UNKNOWN = 0; - VIEW = 1; - ACTIVE = 2; - COMMITTED = 3; -} - -message Info { - string name = 1; - string parent = 2; - Kind kind = 3; - - // CreatedAt provides the time at which the snapshot was created. - google.protobuf.Timestamp created_at = 4; - - // UpdatedAt provides the time the info was last updated. - google.protobuf.Timestamp updated_at = 5; - - // Labels are arbitrary data on snapshots. - // - // The combined size of a key/value pair cannot exceed 4096 bytes. - map labels = 6; -} - -message StatSnapshotResponse { - Info info = 1; -} - -message UpdateSnapshotRequest { - string snapshotter = 1; - Info info = 2; - - // UpdateMask specifies which fields to perform the update on. If empty, - // the operation applies to all fields. - // - // In info, Name, Parent, Kind, Created are immutable, - // other field may be updated using this mask. - // If no mask is provided, all mutable field are updated. - google.protobuf.FieldMask update_mask = 3; -} - -message UpdateSnapshotResponse { - Info info = 1; -} - -message ListSnapshotsRequest{ - string snapshotter = 1; - - // Filters contains one or more filters using the syntax defined in the - // containerd filter package. - // - // The returned result will be those that match any of the provided - // filters. Expanded, images that match the following will be - // returned: - // - // filters[0] or filters[1] or ... or filters[n-1] or filters[n] - // - // If filters is zero-length or nil, all items will be returned. - repeated string filters = 2; -} - -message ListSnapshotsResponse { - repeated Info info = 1; -} - -message UsageRequest { - string snapshotter = 1; - string key = 2; -} - -message UsageResponse { - int64 size = 1; - int64 inodes = 2; -} - -message CleanupRequest { - string snapshotter = 1; -} diff --git a/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots_grpc.pb.go b/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots_grpc.pb.go deleted file mode 100644 index ac50d0066b..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots_grpc.pb.go +++ /dev/null @@ -1,460 +0,0 @@ -//go:build !no_grpc - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto - -package snapshots - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// SnapshotsClient is the client API for Snapshots service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type SnapshotsClient interface { - Prepare(ctx context.Context, in *PrepareSnapshotRequest, opts ...grpc.CallOption) (*PrepareSnapshotResponse, error) - View(ctx context.Context, in *ViewSnapshotRequest, opts ...grpc.CallOption) (*ViewSnapshotResponse, error) - Mounts(ctx context.Context, in *MountsRequest, opts ...grpc.CallOption) (*MountsResponse, error) - Commit(ctx context.Context, in *CommitSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - Remove(ctx context.Context, in *RemoveSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - Stat(ctx context.Context, in *StatSnapshotRequest, opts ...grpc.CallOption) (*StatSnapshotResponse, error) - Update(ctx context.Context, in *UpdateSnapshotRequest, opts ...grpc.CallOption) (*UpdateSnapshotResponse, error) - List(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (Snapshots_ListClient, error) - Usage(ctx context.Context, in *UsageRequest, opts ...grpc.CallOption) (*UsageResponse, error) - Cleanup(ctx context.Context, in *CleanupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type snapshotsClient struct { - cc grpc.ClientConnInterface -} - -func NewSnapshotsClient(cc grpc.ClientConnInterface) SnapshotsClient { - return &snapshotsClient{cc} -} - -func (c *snapshotsClient) Prepare(ctx context.Context, in *PrepareSnapshotRequest, opts ...grpc.CallOption) (*PrepareSnapshotResponse, error) { - out := new(PrepareSnapshotResponse) - err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Prepare", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *snapshotsClient) View(ctx context.Context, in *ViewSnapshotRequest, opts ...grpc.CallOption) (*ViewSnapshotResponse, error) { - out := new(ViewSnapshotResponse) - err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/View", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *snapshotsClient) Mounts(ctx context.Context, in *MountsRequest, opts ...grpc.CallOption) (*MountsResponse, error) { - out := new(MountsResponse) - err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Mounts", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *snapshotsClient) Commit(ctx context.Context, in *CommitSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Commit", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *snapshotsClient) Remove(ctx context.Context, in *RemoveSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Remove", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *snapshotsClient) Stat(ctx context.Context, in *StatSnapshotRequest, opts ...grpc.CallOption) (*StatSnapshotResponse, error) { - out := new(StatSnapshotResponse) - err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Stat", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *snapshotsClient) Update(ctx context.Context, in *UpdateSnapshotRequest, opts ...grpc.CallOption) (*UpdateSnapshotResponse, error) { - out := new(UpdateSnapshotResponse) - err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Update", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *snapshotsClient) List(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (Snapshots_ListClient, error) { - stream, err := c.cc.NewStream(ctx, &Snapshots_ServiceDesc.Streams[0], "/containerd.services.snapshots.v1.Snapshots/List", opts...) - if err != nil { - return nil, err - } - x := &snapshotsListClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Snapshots_ListClient interface { - Recv() (*ListSnapshotsResponse, error) - grpc.ClientStream -} - -type snapshotsListClient struct { - grpc.ClientStream -} - -func (x *snapshotsListClient) Recv() (*ListSnapshotsResponse, error) { - m := new(ListSnapshotsResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *snapshotsClient) Usage(ctx context.Context, in *UsageRequest, opts ...grpc.CallOption) (*UsageResponse, error) { - out := new(UsageResponse) - err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Usage", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *snapshotsClient) Cleanup(ctx context.Context, in *CleanupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Cleanup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// SnapshotsServer is the server API for Snapshots service. -// All implementations must embed UnimplementedSnapshotsServer -// for forward compatibility -type SnapshotsServer interface { - Prepare(context.Context, *PrepareSnapshotRequest) (*PrepareSnapshotResponse, error) - View(context.Context, *ViewSnapshotRequest) (*ViewSnapshotResponse, error) - Mounts(context.Context, *MountsRequest) (*MountsResponse, error) - Commit(context.Context, *CommitSnapshotRequest) (*emptypb.Empty, error) - Remove(context.Context, *RemoveSnapshotRequest) (*emptypb.Empty, error) - Stat(context.Context, *StatSnapshotRequest) (*StatSnapshotResponse, error) - Update(context.Context, *UpdateSnapshotRequest) (*UpdateSnapshotResponse, error) - List(*ListSnapshotsRequest, Snapshots_ListServer) error - Usage(context.Context, *UsageRequest) (*UsageResponse, error) - Cleanup(context.Context, *CleanupRequest) (*emptypb.Empty, error) - mustEmbedUnimplementedSnapshotsServer() -} - -// UnimplementedSnapshotsServer must be embedded to have forward compatible implementations. -type UnimplementedSnapshotsServer struct { -} - -func (UnimplementedSnapshotsServer) Prepare(context.Context, *PrepareSnapshotRequest) (*PrepareSnapshotResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Prepare not implemented") -} -func (UnimplementedSnapshotsServer) View(context.Context, *ViewSnapshotRequest) (*ViewSnapshotResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method View not implemented") -} -func (UnimplementedSnapshotsServer) Mounts(context.Context, *MountsRequest) (*MountsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Mounts not implemented") -} -func (UnimplementedSnapshotsServer) Commit(context.Context, *CommitSnapshotRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Commit not implemented") -} -func (UnimplementedSnapshotsServer) Remove(context.Context, *RemoveSnapshotRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Remove not implemented") -} -func (UnimplementedSnapshotsServer) Stat(context.Context, *StatSnapshotRequest) (*StatSnapshotResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Stat not implemented") -} -func (UnimplementedSnapshotsServer) Update(context.Context, *UpdateSnapshotRequest) (*UpdateSnapshotResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") -} -func (UnimplementedSnapshotsServer) List(*ListSnapshotsRequest, Snapshots_ListServer) error { - return status.Errorf(codes.Unimplemented, "method List not implemented") -} -func (UnimplementedSnapshotsServer) Usage(context.Context, *UsageRequest) (*UsageResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Usage not implemented") -} -func (UnimplementedSnapshotsServer) Cleanup(context.Context, *CleanupRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Cleanup not implemented") -} -func (UnimplementedSnapshotsServer) mustEmbedUnimplementedSnapshotsServer() {} - -// UnsafeSnapshotsServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to SnapshotsServer will -// result in compilation errors. -type UnsafeSnapshotsServer interface { - mustEmbedUnimplementedSnapshotsServer() -} - -func RegisterSnapshotsServer(s grpc.ServiceRegistrar, srv SnapshotsServer) { - s.RegisterService(&Snapshots_ServiceDesc, srv) -} - -func _Snapshots_Prepare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PrepareSnapshotRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnapshotsServer).Prepare(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.snapshots.v1.Snapshots/Prepare", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnapshotsServer).Prepare(ctx, req.(*PrepareSnapshotRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Snapshots_View_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ViewSnapshotRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnapshotsServer).View(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.snapshots.v1.Snapshots/View", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnapshotsServer).View(ctx, req.(*ViewSnapshotRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Snapshots_Mounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MountsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnapshotsServer).Mounts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.snapshots.v1.Snapshots/Mounts", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnapshotsServer).Mounts(ctx, req.(*MountsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Snapshots_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CommitSnapshotRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnapshotsServer).Commit(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.snapshots.v1.Snapshots/Commit", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnapshotsServer).Commit(ctx, req.(*CommitSnapshotRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Snapshots_Remove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveSnapshotRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnapshotsServer).Remove(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.snapshots.v1.Snapshots/Remove", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnapshotsServer).Remove(ctx, req.(*RemoveSnapshotRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Snapshots_Stat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StatSnapshotRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnapshotsServer).Stat(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.snapshots.v1.Snapshots/Stat", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnapshotsServer).Stat(ctx, req.(*StatSnapshotRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Snapshots_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateSnapshotRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnapshotsServer).Update(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.snapshots.v1.Snapshots/Update", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnapshotsServer).Update(ctx, req.(*UpdateSnapshotRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Snapshots_List_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ListSnapshotsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(SnapshotsServer).List(m, &snapshotsListServer{stream}) -} - -type Snapshots_ListServer interface { - Send(*ListSnapshotsResponse) error - grpc.ServerStream -} - -type snapshotsListServer struct { - grpc.ServerStream -} - -func (x *snapshotsListServer) Send(m *ListSnapshotsResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Snapshots_Usage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UsageRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnapshotsServer).Usage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.snapshots.v1.Snapshots/Usage", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnapshotsServer).Usage(ctx, req.(*UsageRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Snapshots_Cleanup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CleanupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnapshotsServer).Cleanup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.snapshots.v1.Snapshots/Cleanup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnapshotsServer).Cleanup(ctx, req.(*CleanupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Snapshots_ServiceDesc is the grpc.ServiceDesc for Snapshots service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Snapshots_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.services.snapshots.v1.Snapshots", - HandlerType: (*SnapshotsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Prepare", - Handler: _Snapshots_Prepare_Handler, - }, - { - MethodName: "View", - Handler: _Snapshots_View_Handler, - }, - { - MethodName: "Mounts", - Handler: _Snapshots_Mounts_Handler, - }, - { - MethodName: "Commit", - Handler: _Snapshots_Commit_Handler, - }, - { - MethodName: "Remove", - Handler: _Snapshots_Remove_Handler, - }, - { - MethodName: "Stat", - Handler: _Snapshots_Stat_Handler, - }, - { - MethodName: "Update", - Handler: _Snapshots_Update_Handler, - }, - { - MethodName: "Usage", - Handler: _Snapshots_Usage_Handler, - }, - { - MethodName: "Cleanup", - Handler: _Snapshots_Cleanup_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "List", - Handler: _Snapshots_List_Handler, - ServerStreams: true, - }, - }, - Metadata: "github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto", -} diff --git a/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots_ttrpc.pb.go b/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots_ttrpc.pb.go deleted file mode 100644 index 8ab278cb4e..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots_ttrpc.pb.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto -package snapshots - -import ( - context "context" - ttrpc "github.com/containerd/ttrpc" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -type TTRPCSnapshotsService interface { - Prepare(context.Context, *PrepareSnapshotRequest) (*PrepareSnapshotResponse, error) - View(context.Context, *ViewSnapshotRequest) (*ViewSnapshotResponse, error) - Mounts(context.Context, *MountsRequest) (*MountsResponse, error) - Commit(context.Context, *CommitSnapshotRequest) (*emptypb.Empty, error) - Remove(context.Context, *RemoveSnapshotRequest) (*emptypb.Empty, error) - Stat(context.Context, *StatSnapshotRequest) (*StatSnapshotResponse, error) - Update(context.Context, *UpdateSnapshotRequest) (*UpdateSnapshotResponse, error) - List(context.Context, *ListSnapshotsRequest, TTRPCSnapshots_ListServer) error - Usage(context.Context, *UsageRequest) (*UsageResponse, error) - Cleanup(context.Context, *CleanupRequest) (*emptypb.Empty, error) -} - -type TTRPCSnapshots_ListServer interface { - Send(*ListSnapshotsResponse) error - ttrpc.StreamServer -} - -type ttrpcsnapshotsListServer struct { - ttrpc.StreamServer -} - -func (x *ttrpcsnapshotsListServer) Send(m *ListSnapshotsResponse) error { - return x.StreamServer.SendMsg(m) -} - -func RegisterTTRPCSnapshotsService(srv *ttrpc.Server, svc TTRPCSnapshotsService) { - srv.RegisterService("containerd.services.snapshots.v1.Snapshots", &ttrpc.ServiceDesc{ - Methods: map[string]ttrpc.Method{ - "Prepare": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req PrepareSnapshotRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Prepare(ctx, &req) - }, - "View": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ViewSnapshotRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.View(ctx, &req) - }, - "Mounts": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req MountsRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Mounts(ctx, &req) - }, - "Commit": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req CommitSnapshotRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Commit(ctx, &req) - }, - "Remove": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req RemoveSnapshotRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Remove(ctx, &req) - }, - "Stat": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req StatSnapshotRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Stat(ctx, &req) - }, - "Update": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req UpdateSnapshotRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Update(ctx, &req) - }, - "Usage": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req UsageRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Usage(ctx, &req) - }, - "Cleanup": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req CleanupRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Cleanup(ctx, &req) - }, - }, - Streams: map[string]ttrpc.Stream{ - "List": { - Handler: func(ctx context.Context, stream ttrpc.StreamServer) (interface{}, error) { - m := new(ListSnapshotsRequest) - if err := stream.RecvMsg(m); err != nil { - return nil, err - } - return nil, svc.List(ctx, m, &ttrpcsnapshotsListServer{stream}) - }, - StreamingClient: false, - StreamingServer: true, - }, - }, - }) -} - -type TTRPCSnapshotsClient interface { - Prepare(context.Context, *PrepareSnapshotRequest) (*PrepareSnapshotResponse, error) - View(context.Context, *ViewSnapshotRequest) (*ViewSnapshotResponse, error) - Mounts(context.Context, *MountsRequest) (*MountsResponse, error) - Commit(context.Context, *CommitSnapshotRequest) (*emptypb.Empty, error) - Remove(context.Context, *RemoveSnapshotRequest) (*emptypb.Empty, error) - Stat(context.Context, *StatSnapshotRequest) (*StatSnapshotResponse, error) - Update(context.Context, *UpdateSnapshotRequest) (*UpdateSnapshotResponse, error) - List(context.Context, *ListSnapshotsRequest) (TTRPCSnapshots_ListClient, error) - Usage(context.Context, *UsageRequest) (*UsageResponse, error) - Cleanup(context.Context, *CleanupRequest) (*emptypb.Empty, error) -} - -type ttrpcsnapshotsClient struct { - client *ttrpc.Client -} - -func NewTTRPCSnapshotsClient(client *ttrpc.Client) TTRPCSnapshotsClient { - return &ttrpcsnapshotsClient{ - client: client, - } -} - -func (c *ttrpcsnapshotsClient) Prepare(ctx context.Context, req *PrepareSnapshotRequest) (*PrepareSnapshotResponse, error) { - var resp PrepareSnapshotResponse - if err := c.client.Call(ctx, "containerd.services.snapshots.v1.Snapshots", "Prepare", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcsnapshotsClient) View(ctx context.Context, req *ViewSnapshotRequest) (*ViewSnapshotResponse, error) { - var resp ViewSnapshotResponse - if err := c.client.Call(ctx, "containerd.services.snapshots.v1.Snapshots", "View", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcsnapshotsClient) Mounts(ctx context.Context, req *MountsRequest) (*MountsResponse, error) { - var resp MountsResponse - if err := c.client.Call(ctx, "containerd.services.snapshots.v1.Snapshots", "Mounts", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcsnapshotsClient) Commit(ctx context.Context, req *CommitSnapshotRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.snapshots.v1.Snapshots", "Commit", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcsnapshotsClient) Remove(ctx context.Context, req *RemoveSnapshotRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.snapshots.v1.Snapshots", "Remove", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcsnapshotsClient) Stat(ctx context.Context, req *StatSnapshotRequest) (*StatSnapshotResponse, error) { - var resp StatSnapshotResponse - if err := c.client.Call(ctx, "containerd.services.snapshots.v1.Snapshots", "Stat", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcsnapshotsClient) Update(ctx context.Context, req *UpdateSnapshotRequest) (*UpdateSnapshotResponse, error) { - var resp UpdateSnapshotResponse - if err := c.client.Call(ctx, "containerd.services.snapshots.v1.Snapshots", "Update", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcsnapshotsClient) List(ctx context.Context, req *ListSnapshotsRequest) (TTRPCSnapshots_ListClient, error) { - stream, err := c.client.NewStream(ctx, &ttrpc.StreamDesc{ - StreamingClient: false, - StreamingServer: true, - }, "containerd.services.snapshots.v1.Snapshots", "List", req) - if err != nil { - return nil, err - } - x := &ttrpcsnapshotsListClient{stream} - return x, nil -} - -type TTRPCSnapshots_ListClient interface { - Recv() (*ListSnapshotsResponse, error) - ttrpc.ClientStream -} - -type ttrpcsnapshotsListClient struct { - ttrpc.ClientStream -} - -func (x *ttrpcsnapshotsListClient) Recv() (*ListSnapshotsResponse, error) { - m := new(ListSnapshotsResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *ttrpcsnapshotsClient) Usage(ctx context.Context, req *UsageRequest) (*UsageResponse, error) { - var resp UsageResponse - if err := c.client.Call(ctx, "containerd.services.snapshots.v1.Snapshots", "Usage", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpcsnapshotsClient) Cleanup(ctx context.Context, req *CleanupRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.snapshots.v1.Snapshots", "Cleanup", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/streaming/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/streaming/v1/doc.go deleted file mode 100644 index 04c4362d83..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/streaming/v1/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package streaming diff --git a/vendor/github.com/containerd/containerd/api/services/streaming/v1/streaming.pb.go b/vendor/github.com/containerd/containerd/api/services/streaming/v1/streaming.pb.go deleted file mode 100644 index 08fb6392ec..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/streaming/v1/streaming.pb.go +++ /dev/null @@ -1,175 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/streaming/v1/streaming.proto - -package streaming - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - reflect "reflect" - sync "sync" -) - -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) -) - -type StreamInit struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *StreamInit) Reset() { - *x = StreamInit{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StreamInit) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StreamInit) ProtoMessage() {} - -func (x *StreamInit) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_msgTypes[0] - 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 StreamInit.ProtoReflect.Descriptor instead. -func (*StreamInit) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_rawDescGZIP(), []int{0} -} - -func (x *StreamInit) GetID() string { - if x != nil { - return x.ID - } - return "" -} - -var File_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_rawDesc = []byte{ - 0x0a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x20, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x19, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1c, 0x0a, 0x0a, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x32, 0x45, 0x0a, 0x09, 0x53, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x38, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x14, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x41, 0x6e, 0x79, 0x1a, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x28, 0x01, 0x30, 0x01, 0x42, 0x46, - 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_rawDescData = file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_goTypes = []interface{}{ - (*StreamInit)(nil), // 0: containerd.services.streaming.v1.StreamInit - (*anypb.Any)(nil), // 1: google.protobuf.Any -} -var file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_depIdxs = []int32{ - 1, // 0: containerd.services.streaming.v1.Streaming.Stream:input_type -> google.protobuf.Any - 1, // 1: containerd.services.streaming.v1.Streaming.Stream:output_type -> google.protobuf.Any - 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_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_init() } -func file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_init() { - if File_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamInit); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto = out.File - file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_rawDesc = nil - file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_goTypes = nil - file_github_com_containerd_containerd_api_services_streaming_v1_streaming_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/streaming/v1/streaming.proto b/vendor/github.com/containerd/containerd/api/services/streaming/v1/streaming.proto deleted file mode 100644 index 4c14f2ecfa..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/streaming/v1/streaming.proto +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.services.streaming.v1; - -import "google/protobuf/any.proto"; - -option go_package = "github.com/containerd/containerd/api/services/streaming/v1;streaming"; - -service Streaming { - rpc Stream(stream google.protobuf.Any) returns (stream google.protobuf.Any); -} - -message StreamInit { - string id = 1; -} diff --git a/vendor/github.com/containerd/containerd/api/services/streaming/v1/streaming_grpc.pb.go b/vendor/github.com/containerd/containerd/api/services/streaming/v1/streaming_grpc.pb.go deleted file mode 100644 index 2a2971df48..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/streaming/v1/streaming_grpc.pb.go +++ /dev/null @@ -1,140 +0,0 @@ -//go:build !no_grpc - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/streaming/v1/streaming.proto - -package streaming - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - anypb "google.golang.org/protobuf/types/known/anypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// StreamingClient is the client API for Streaming service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type StreamingClient interface { - Stream(ctx context.Context, opts ...grpc.CallOption) (Streaming_StreamClient, error) -} - -type streamingClient struct { - cc grpc.ClientConnInterface -} - -func NewStreamingClient(cc grpc.ClientConnInterface) StreamingClient { - return &streamingClient{cc} -} - -func (c *streamingClient) Stream(ctx context.Context, opts ...grpc.CallOption) (Streaming_StreamClient, error) { - stream, err := c.cc.NewStream(ctx, &Streaming_ServiceDesc.Streams[0], "/containerd.services.streaming.v1.Streaming/Stream", opts...) - if err != nil { - return nil, err - } - x := &streamingStreamClient{stream} - return x, nil -} - -type Streaming_StreamClient interface { - Send(*anypb.Any) error - Recv() (*anypb.Any, error) - grpc.ClientStream -} - -type streamingStreamClient struct { - grpc.ClientStream -} - -func (x *streamingStreamClient) Send(m *anypb.Any) error { - return x.ClientStream.SendMsg(m) -} - -func (x *streamingStreamClient) Recv() (*anypb.Any, error) { - m := new(anypb.Any) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// StreamingServer is the server API for Streaming service. -// All implementations must embed UnimplementedStreamingServer -// for forward compatibility -type StreamingServer interface { - Stream(Streaming_StreamServer) error - mustEmbedUnimplementedStreamingServer() -} - -// UnimplementedStreamingServer must be embedded to have forward compatible implementations. -type UnimplementedStreamingServer struct { -} - -func (UnimplementedStreamingServer) Stream(Streaming_StreamServer) error { - return status.Errorf(codes.Unimplemented, "method Stream not implemented") -} -func (UnimplementedStreamingServer) mustEmbedUnimplementedStreamingServer() {} - -// UnsafeStreamingServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to StreamingServer will -// result in compilation errors. -type UnsafeStreamingServer interface { - mustEmbedUnimplementedStreamingServer() -} - -func RegisterStreamingServer(s grpc.ServiceRegistrar, srv StreamingServer) { - s.RegisterService(&Streaming_ServiceDesc, srv) -} - -func _Streaming_Stream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(StreamingServer).Stream(&streamingStreamServer{stream}) -} - -type Streaming_StreamServer interface { - Send(*anypb.Any) error - Recv() (*anypb.Any, error) - grpc.ServerStream -} - -type streamingStreamServer struct { - grpc.ServerStream -} - -func (x *streamingStreamServer) Send(m *anypb.Any) error { - return x.ServerStream.SendMsg(m) -} - -func (x *streamingStreamServer) Recv() (*anypb.Any, error) { - m := new(anypb.Any) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// Streaming_ServiceDesc is the grpc.ServiceDesc for Streaming service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Streaming_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.services.streaming.v1.Streaming", - HandlerType: (*StreamingServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Stream", - Handler: _Streaming_Stream_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "github.com/containerd/containerd/api/services/streaming/v1/streaming.proto", -} diff --git a/vendor/github.com/containerd/containerd/api/services/streaming/v1/streaming_ttrpc.pb.go b/vendor/github.com/containerd/containerd/api/services/streaming/v1/streaming_ttrpc.pb.go deleted file mode 100644 index 9e30233d43..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/streaming/v1/streaming_ttrpc.pb.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/containerd/api/services/streaming/v1/streaming.proto -package streaming - -import ( - context "context" - ttrpc "github.com/containerd/ttrpc" - anypb "google.golang.org/protobuf/types/known/anypb" -) - -type TTRPCStreamingService interface { - Stream(context.Context, TTRPCStreaming_StreamServer) error -} - -type TTRPCStreaming_StreamServer interface { - Send(*anypb.Any) error - Recv() (*anypb.Any, error) - ttrpc.StreamServer -} - -type ttrpcstreamingStreamServer struct { - ttrpc.StreamServer -} - -func (x *ttrpcstreamingStreamServer) Send(m *anypb.Any) error { - return x.StreamServer.SendMsg(m) -} - -func (x *ttrpcstreamingStreamServer) Recv() (*anypb.Any, error) { - m := new(anypb.Any) - if err := x.StreamServer.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func RegisterTTRPCStreamingService(srv *ttrpc.Server, svc TTRPCStreamingService) { - srv.RegisterService("containerd.services.streaming.v1.Streaming", &ttrpc.ServiceDesc{ - Streams: map[string]ttrpc.Stream{ - "Stream": { - Handler: func(ctx context.Context, stream ttrpc.StreamServer) (interface{}, error) { - return nil, svc.Stream(ctx, &ttrpcstreamingStreamServer{stream}) - }, - StreamingClient: true, - StreamingServer: true, - }, - }, - }) -} - -type TTRPCStreamingClient interface { - Stream(context.Context) (TTRPCStreaming_StreamClient, error) -} - -type ttrpcstreamingClient struct { - client *ttrpc.Client -} - -func NewTTRPCStreamingClient(client *ttrpc.Client) TTRPCStreamingClient { - return &ttrpcstreamingClient{ - client: client, - } -} - -func (c *ttrpcstreamingClient) Stream(ctx context.Context) (TTRPCStreaming_StreamClient, error) { - stream, err := c.client.NewStream(ctx, &ttrpc.StreamDesc{ - StreamingClient: true, - StreamingServer: true, - }, "containerd.services.streaming.v1.Streaming", "Stream", nil) - if err != nil { - return nil, err - } - x := &ttrpcstreamingStreamClient{stream} - return x, nil -} - -type TTRPCStreaming_StreamClient interface { - Send(*anypb.Any) error - Recv() (*anypb.Any, error) - ttrpc.ClientStream -} - -type ttrpcstreamingStreamClient struct { - ttrpc.ClientStream -} - -func (x *ttrpcstreamingStreamClient) Send(m *anypb.Any) error { - return x.ClientStream.SendMsg(m) -} - -func (x *ttrpcstreamingStreamClient) Recv() (*anypb.Any, error) { - m := new(anypb.Any) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/tasks/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/tasks/v1/doc.go deleted file mode 100644 index 0888ba8a85..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/tasks/v1/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package tasks diff --git a/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.pb.go b/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.pb.go deleted file mode 100644 index 1a55d696dd..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.pb.go +++ /dev/null @@ -1,2359 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/tasks/v1/tasks.proto - -package tasks - -import ( - types "github.com/containerd/containerd/api/types" - task "github.com/containerd/containerd/api/types/task" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - emptypb "google.golang.org/protobuf/types/known/emptypb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -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) -) - -type CreateTaskRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - // RootFS provides the pre-chroot mounts to perform in the shim before - // executing the container task. - // - // These are for mounts that cannot be performed in the user namespace. - // Typically, these mounts should be resolved from snapshots specified on - // the container object. - Rootfs []*types.Mount `protobuf:"bytes,3,rep,name=rootfs,proto3" json:"rootfs,omitempty"` - Stdin string `protobuf:"bytes,4,opt,name=stdin,proto3" json:"stdin,omitempty"` - Stdout string `protobuf:"bytes,5,opt,name=stdout,proto3" json:"stdout,omitempty"` - Stderr string `protobuf:"bytes,6,opt,name=stderr,proto3" json:"stderr,omitempty"` - Terminal bool `protobuf:"varint,7,opt,name=terminal,proto3" json:"terminal,omitempty"` - Checkpoint *types.Descriptor `protobuf:"bytes,8,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"` - Options *anypb.Any `protobuf:"bytes,9,opt,name=options,proto3" json:"options,omitempty"` - RuntimePath string `protobuf:"bytes,10,opt,name=runtime_path,json=runtimePath,proto3" json:"runtime_path,omitempty"` -} - -func (x *CreateTaskRequest) Reset() { - *x = CreateTaskRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateTaskRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateTaskRequest) ProtoMessage() {} - -func (x *CreateTaskRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[0] - 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 CreateTaskRequest.ProtoReflect.Descriptor instead. -func (*CreateTaskRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateTaskRequest) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -func (x *CreateTaskRequest) GetRootfs() []*types.Mount { - if x != nil { - return x.Rootfs - } - return nil -} - -func (x *CreateTaskRequest) GetStdin() string { - if x != nil { - return x.Stdin - } - return "" -} - -func (x *CreateTaskRequest) GetStdout() string { - if x != nil { - return x.Stdout - } - return "" -} - -func (x *CreateTaskRequest) GetStderr() string { - if x != nil { - return x.Stderr - } - return "" -} - -func (x *CreateTaskRequest) GetTerminal() bool { - if x != nil { - return x.Terminal - } - return false -} - -func (x *CreateTaskRequest) GetCheckpoint() *types.Descriptor { - if x != nil { - return x.Checkpoint - } - return nil -} - -func (x *CreateTaskRequest) GetOptions() *anypb.Any { - if x != nil { - return x.Options - } - return nil -} - -func (x *CreateTaskRequest) GetRuntimePath() string { - if x != nil { - return x.RuntimePath - } - return "" -} - -type CreateTaskResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - Pid uint32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"` -} - -func (x *CreateTaskResponse) Reset() { - *x = CreateTaskResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateTaskResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateTaskResponse) ProtoMessage() {} - -func (x *CreateTaskResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[1] - 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 CreateTaskResponse.ProtoReflect.Descriptor instead. -func (*CreateTaskResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateTaskResponse) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -func (x *CreateTaskResponse) GetPid() uint32 { - if x != nil { - return x.Pid - } - return 0 -} - -type StartRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` -} - -func (x *StartRequest) Reset() { - *x = StartRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StartRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartRequest) ProtoMessage() {} - -func (x *StartRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[2] - 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 StartRequest.ProtoReflect.Descriptor instead. -func (*StartRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{2} -} - -func (x *StartRequest) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -func (x *StartRequest) GetExecID() string { - if x != nil { - return x.ExecID - } - return "" -} - -type StartResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Pid uint32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` -} - -func (x *StartResponse) Reset() { - *x = StartResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StartResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartResponse) ProtoMessage() {} - -func (x *StartResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[3] - 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 StartResponse.ProtoReflect.Descriptor instead. -func (*StartResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{3} -} - -func (x *StartResponse) GetPid() uint32 { - if x != nil { - return x.Pid - } - return 0 -} - -type DeleteTaskRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` -} - -func (x *DeleteTaskRequest) Reset() { - *x = DeleteTaskRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteTaskRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteTaskRequest) ProtoMessage() {} - -func (x *DeleteTaskRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[4] - 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 DeleteTaskRequest.ProtoReflect.Descriptor instead. -func (*DeleteTaskRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{4} -} - -func (x *DeleteTaskRequest) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -type DeleteResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Pid uint32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"` - ExitStatus uint32 `protobuf:"varint,3,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` - ExitedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=exited_at,json=exitedAt,proto3" json:"exited_at,omitempty"` -} - -func (x *DeleteResponse) Reset() { - *x = DeleteResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteResponse) ProtoMessage() {} - -func (x *DeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[5] - 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 DeleteResponse.ProtoReflect.Descriptor instead. -func (*DeleteResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{5} -} - -func (x *DeleteResponse) GetID() string { - if x != nil { - return x.ID - } - return "" -} - -func (x *DeleteResponse) GetPid() uint32 { - if x != nil { - return x.Pid - } - return 0 -} - -func (x *DeleteResponse) GetExitStatus() uint32 { - if x != nil { - return x.ExitStatus - } - return 0 -} - -func (x *DeleteResponse) GetExitedAt() *timestamppb.Timestamp { - if x != nil { - return x.ExitedAt - } - return nil -} - -type DeleteProcessRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` -} - -func (x *DeleteProcessRequest) Reset() { - *x = DeleteProcessRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteProcessRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteProcessRequest) ProtoMessage() {} - -func (x *DeleteProcessRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[6] - 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 DeleteProcessRequest.ProtoReflect.Descriptor instead. -func (*DeleteProcessRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{6} -} - -func (x *DeleteProcessRequest) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -func (x *DeleteProcessRequest) GetExecID() string { - if x != nil { - return x.ExecID - } - return "" -} - -type GetRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` -} - -func (x *GetRequest) Reset() { - *x = GetRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRequest) ProtoMessage() {} - -func (x *GetRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[7] - 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 GetRequest.ProtoReflect.Descriptor instead. -func (*GetRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{7} -} - -func (x *GetRequest) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -func (x *GetRequest) GetExecID() string { - if x != nil { - return x.ExecID - } - return "" -} - -type GetResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Process *task.Process `protobuf:"bytes,1,opt,name=process,proto3" json:"process,omitempty"` -} - -func (x *GetResponse) Reset() { - *x = GetResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResponse) ProtoMessage() {} - -func (x *GetResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[8] - 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 GetResponse.ProtoReflect.Descriptor instead. -func (*GetResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{8} -} - -func (x *GetResponse) GetProcess() *task.Process { - if x != nil { - return x.Process - } - return nil -} - -type ListTasksRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` -} - -func (x *ListTasksRequest) Reset() { - *x = ListTasksRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListTasksRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTasksRequest) ProtoMessage() {} - -func (x *ListTasksRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[9] - 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 ListTasksRequest.ProtoReflect.Descriptor instead. -func (*ListTasksRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{9} -} - -func (x *ListTasksRequest) GetFilter() string { - if x != nil { - return x.Filter - } - return "" -} - -type ListTasksResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tasks []*task.Process `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks,omitempty"` -} - -func (x *ListTasksResponse) Reset() { - *x = ListTasksResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListTasksResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTasksResponse) ProtoMessage() {} - -func (x *ListTasksResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[10] - 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 ListTasksResponse.ProtoReflect.Descriptor instead. -func (*ListTasksResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{10} -} - -func (x *ListTasksResponse) GetTasks() []*task.Process { - if x != nil { - return x.Tasks - } - return nil -} - -type KillRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` - Signal uint32 `protobuf:"varint,3,opt,name=signal,proto3" json:"signal,omitempty"` - All bool `protobuf:"varint,4,opt,name=all,proto3" json:"all,omitempty"` -} - -func (x *KillRequest) Reset() { - *x = KillRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *KillRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KillRequest) ProtoMessage() {} - -func (x *KillRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[11] - 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 KillRequest.ProtoReflect.Descriptor instead. -func (*KillRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{11} -} - -func (x *KillRequest) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -func (x *KillRequest) GetExecID() string { - if x != nil { - return x.ExecID - } - return "" -} - -func (x *KillRequest) GetSignal() uint32 { - if x != nil { - return x.Signal - } - return 0 -} - -func (x *KillRequest) GetAll() bool { - if x != nil { - return x.All - } - return false -} - -type ExecProcessRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - Stdin string `protobuf:"bytes,2,opt,name=stdin,proto3" json:"stdin,omitempty"` - Stdout string `protobuf:"bytes,3,opt,name=stdout,proto3" json:"stdout,omitempty"` - Stderr string `protobuf:"bytes,4,opt,name=stderr,proto3" json:"stderr,omitempty"` - Terminal bool `protobuf:"varint,5,opt,name=terminal,proto3" json:"terminal,omitempty"` - // Spec for starting a process in the target container. - // - // For runc, this is a process spec, for example. - Spec *anypb.Any `protobuf:"bytes,6,opt,name=spec,proto3" json:"spec,omitempty"` - // id of the exec process - ExecID string `protobuf:"bytes,7,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` -} - -func (x *ExecProcessRequest) Reset() { - *x = ExecProcessRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExecProcessRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExecProcessRequest) ProtoMessage() {} - -func (x *ExecProcessRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[12] - 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 ExecProcessRequest.ProtoReflect.Descriptor instead. -func (*ExecProcessRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{12} -} - -func (x *ExecProcessRequest) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -func (x *ExecProcessRequest) GetStdin() string { - if x != nil { - return x.Stdin - } - return "" -} - -func (x *ExecProcessRequest) GetStdout() string { - if x != nil { - return x.Stdout - } - return "" -} - -func (x *ExecProcessRequest) GetStderr() string { - if x != nil { - return x.Stderr - } - return "" -} - -func (x *ExecProcessRequest) GetTerminal() bool { - if x != nil { - return x.Terminal - } - return false -} - -func (x *ExecProcessRequest) GetSpec() *anypb.Any { - if x != nil { - return x.Spec - } - return nil -} - -func (x *ExecProcessRequest) GetExecID() string { - if x != nil { - return x.ExecID - } - return "" -} - -type ExecProcessResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ExecProcessResponse) Reset() { - *x = ExecProcessResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExecProcessResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExecProcessResponse) ProtoMessage() {} - -func (x *ExecProcessResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[13] - 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 ExecProcessResponse.ProtoReflect.Descriptor instead. -func (*ExecProcessResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{13} -} - -type ResizePtyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` - Width uint32 `protobuf:"varint,3,opt,name=width,proto3" json:"width,omitempty"` - Height uint32 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"` -} - -func (x *ResizePtyRequest) Reset() { - *x = ResizePtyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResizePtyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResizePtyRequest) ProtoMessage() {} - -func (x *ResizePtyRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[14] - 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 ResizePtyRequest.ProtoReflect.Descriptor instead. -func (*ResizePtyRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{14} -} - -func (x *ResizePtyRequest) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -func (x *ResizePtyRequest) GetExecID() string { - if x != nil { - return x.ExecID - } - return "" -} - -func (x *ResizePtyRequest) GetWidth() uint32 { - if x != nil { - return x.Width - } - return 0 -} - -func (x *ResizePtyRequest) GetHeight() uint32 { - if x != nil { - return x.Height - } - return 0 -} - -type CloseIORequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` - Stdin bool `protobuf:"varint,3,opt,name=stdin,proto3" json:"stdin,omitempty"` -} - -func (x *CloseIORequest) Reset() { - *x = CloseIORequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CloseIORequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CloseIORequest) ProtoMessage() {} - -func (x *CloseIORequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[15] - 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 CloseIORequest.ProtoReflect.Descriptor instead. -func (*CloseIORequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{15} -} - -func (x *CloseIORequest) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -func (x *CloseIORequest) GetExecID() string { - if x != nil { - return x.ExecID - } - return "" -} - -func (x *CloseIORequest) GetStdin() bool { - if x != nil { - return x.Stdin - } - return false -} - -type PauseTaskRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` -} - -func (x *PauseTaskRequest) Reset() { - *x = PauseTaskRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PauseTaskRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PauseTaskRequest) ProtoMessage() {} - -func (x *PauseTaskRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[16] - 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 PauseTaskRequest.ProtoReflect.Descriptor instead. -func (*PauseTaskRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{16} -} - -func (x *PauseTaskRequest) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -type ResumeTaskRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` -} - -func (x *ResumeTaskRequest) Reset() { - *x = ResumeTaskRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResumeTaskRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResumeTaskRequest) ProtoMessage() {} - -func (x *ResumeTaskRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[17] - 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 ResumeTaskRequest.ProtoReflect.Descriptor instead. -func (*ResumeTaskRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{17} -} - -func (x *ResumeTaskRequest) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -type ListPidsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` -} - -func (x *ListPidsRequest) Reset() { - *x = ListPidsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListPidsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPidsRequest) ProtoMessage() {} - -func (x *ListPidsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[18] - 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 ListPidsRequest.ProtoReflect.Descriptor instead. -func (*ListPidsRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{18} -} - -func (x *ListPidsRequest) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -type ListPidsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Processes includes the process ID and additional process information - Processes []*task.ProcessInfo `protobuf:"bytes,1,rep,name=processes,proto3" json:"processes,omitempty"` -} - -func (x *ListPidsResponse) Reset() { - *x = ListPidsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListPidsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPidsResponse) ProtoMessage() {} - -func (x *ListPidsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[19] - 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 ListPidsResponse.ProtoReflect.Descriptor instead. -func (*ListPidsResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{19} -} - -func (x *ListPidsResponse) GetProcesses() []*task.ProcessInfo { - if x != nil { - return x.Processes - } - return nil -} - -type CheckpointTaskRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - ParentCheckpoint string `protobuf:"bytes,2,opt,name=parent_checkpoint,json=parentCheckpoint,proto3" json:"parent_checkpoint,omitempty"` - Options *anypb.Any `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"` -} - -func (x *CheckpointTaskRequest) Reset() { - *x = CheckpointTaskRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CheckpointTaskRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckpointTaskRequest) ProtoMessage() {} - -func (x *CheckpointTaskRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[20] - 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 CheckpointTaskRequest.ProtoReflect.Descriptor instead. -func (*CheckpointTaskRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{20} -} - -func (x *CheckpointTaskRequest) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -func (x *CheckpointTaskRequest) GetParentCheckpoint() string { - if x != nil { - return x.ParentCheckpoint - } - return "" -} - -func (x *CheckpointTaskRequest) GetOptions() *anypb.Any { - if x != nil { - return x.Options - } - return nil -} - -type CheckpointTaskResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Descriptors []*types.Descriptor `protobuf:"bytes,1,rep,name=descriptors,proto3" json:"descriptors,omitempty"` -} - -func (x *CheckpointTaskResponse) Reset() { - *x = CheckpointTaskResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CheckpointTaskResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckpointTaskResponse) ProtoMessage() {} - -func (x *CheckpointTaskResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[21] - 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 CheckpointTaskResponse.ProtoReflect.Descriptor instead. -func (*CheckpointTaskResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{21} -} - -func (x *CheckpointTaskResponse) GetDescriptors() []*types.Descriptor { - if x != nil { - return x.Descriptors - } - return nil -} - -type UpdateTaskRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - Resources *anypb.Any `protobuf:"bytes,2,opt,name=resources,proto3" json:"resources,omitempty"` - Annotations map[string]string `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *UpdateTaskRequest) Reset() { - *x = UpdateTaskRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateTaskRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateTaskRequest) ProtoMessage() {} - -func (x *UpdateTaskRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[22] - 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 UpdateTaskRequest.ProtoReflect.Descriptor instead. -func (*UpdateTaskRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{22} -} - -func (x *UpdateTaskRequest) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -func (x *UpdateTaskRequest) GetResources() *anypb.Any { - if x != nil { - return x.Resources - } - return nil -} - -func (x *UpdateTaskRequest) GetAnnotations() map[string]string { - if x != nil { - return x.Annotations - } - return nil -} - -type MetricsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` -} - -func (x *MetricsRequest) Reset() { - *x = MetricsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MetricsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MetricsRequest) ProtoMessage() {} - -func (x *MetricsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[23] - 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 MetricsRequest.ProtoReflect.Descriptor instead. -func (*MetricsRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{23} -} - -func (x *MetricsRequest) GetFilters() []string { - if x != nil { - return x.Filters - } - return nil -} - -type MetricsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Metrics []*types.Metric `protobuf:"bytes,1,rep,name=metrics,proto3" json:"metrics,omitempty"` -} - -func (x *MetricsResponse) Reset() { - *x = MetricsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MetricsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MetricsResponse) ProtoMessage() {} - -func (x *MetricsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[24] - 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 MetricsResponse.ProtoReflect.Descriptor instead. -func (*MetricsResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{24} -} - -func (x *MetricsResponse) GetMetrics() []*types.Metric { - if x != nil { - return x.Metrics - } - return nil -} - -type WaitRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` -} - -func (x *WaitRequest) Reset() { - *x = WaitRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WaitRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WaitRequest) ProtoMessage() {} - -func (x *WaitRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[25] - 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 WaitRequest.ProtoReflect.Descriptor instead. -func (*WaitRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{25} -} - -func (x *WaitRequest) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -func (x *WaitRequest) GetExecID() string { - if x != nil { - return x.ExecID - } - return "" -} - -type WaitResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ExitStatus uint32 `protobuf:"varint,1,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` - ExitedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=exited_at,json=exitedAt,proto3" json:"exited_at,omitempty"` -} - -func (x *WaitResponse) Reset() { - *x = WaitResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WaitResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WaitResponse) ProtoMessage() {} - -func (x *WaitResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[26] - 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 WaitResponse.ProtoReflect.Descriptor instead. -func (*WaitResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP(), []int{26} -} - -func (x *WaitResponse) GetExitStatus() uint32 { - if x != nil { - return x.ExitStatus - } - return 0 -} - -func (x *WaitResponse) GetExitedAt() *timestamppb.Timestamp { - if x != nil { - return x.ExitedAt - } - return nil -} - -var File_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDesc = []byte{ - 0x0a, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, - 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x36, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x3b, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xda, 0x02, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x2f, 0x0a, 0x06, 0x72, 0x6f, 0x6f, 0x74, 0x66, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x74, 0x66, 0x73, - 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x64, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x73, 0x74, 0x64, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, - 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, - 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x50, - 0x61, 0x74, 0x68, 0x22, 0x49, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, - 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, - 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x4a, - 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, - 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x78, 0x65, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x65, 0x78, 0x65, 0x63, 0x49, 0x64, 0x22, 0x21, 0x0a, 0x0d, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x70, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x36, 0x0a, - 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, 0x8c, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, - 0x69, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x0a, 0x65, 0x78, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x37, 0x0a, 0x09, 0x65, - 0x78, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, - 0x65, 0x64, 0x41, 0x74, 0x22, 0x52, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, - 0x6f, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x17, 0x0a, 0x07, 0x65, 0x78, 0x65, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x65, 0x78, 0x65, 0x63, 0x49, 0x64, 0x22, 0x48, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x78, 0x65, - 0x63, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x78, 0x65, 0x63, - 0x49, 0x64, 0x22, 0x45, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x36, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x52, 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x22, 0x2a, 0x0a, 0x10, 0x4c, 0x69, 0x73, - 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, - 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x47, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, - 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x74, 0x61, - 0x73, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x52, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x22, 0x73, - 0x0a, 0x0b, 0x4b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, - 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x17, 0x0a, 0x07, 0x65, 0x78, 0x65, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x65, 0x78, 0x65, 0x63, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, - 0x61, 0x6c, 0x6c, 0x22, 0xdc, 0x01, 0x0a, 0x12, 0x45, 0x78, 0x65, 0x63, 0x50, 0x72, 0x6f, 0x63, - 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, - 0x05, 0x73, 0x74, 0x64, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, - 0x64, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x74, 0x64, 0x65, 0x72, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x64, - 0x65, 0x72, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x12, - 0x28, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x41, 0x6e, 0x79, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x78, 0x65, - 0x63, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x78, 0x65, 0x63, - 0x49, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x45, 0x78, 0x65, 0x63, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7c, 0x0a, 0x10, 0x52, 0x65, 0x73, - 0x69, 0x7a, 0x65, 0x50, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, - 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x17, 0x0a, 0x07, 0x65, 0x78, 0x65, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x65, 0x78, 0x65, 0x63, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64, - 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, - 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x62, 0x0a, 0x0e, 0x43, 0x6c, 0x6f, 0x73, 0x65, - 0x49, 0x4f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, - 0x65, 0x78, 0x65, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, - 0x78, 0x65, 0x63, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x64, 0x69, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x74, 0x64, 0x69, 0x6e, 0x22, 0x35, 0x0a, 0x10, 0x50, - 0x61, 0x75, 0x73, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x49, 0x64, 0x22, 0x36, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x54, 0x61, 0x73, 0x6b, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, 0x34, 0x0a, 0x0f, 0x4c, 0x69, - 0x73, 0x74, 0x50, 0x69, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, - 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, - 0x22, 0x52, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x69, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x72, - 0x6f, 0x63, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x65, 0x73, 0x22, 0x97, 0x01, 0x0a, 0x15, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, - 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x2b, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x2e, - 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x58, - 0x0a, 0x16, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x54, 0x61, 0x73, 0x6b, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x8e, 0x02, 0x0a, 0x11, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, - 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x32, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x62, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x22, 0x2a, 0x0a, 0x0e, 0x4d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x45, 0x0a, 0x0f, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, - 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0x49, 0x0a, 0x0b, - 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, - 0x0a, 0x07, 0x65, 0x78, 0x65, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x65, 0x78, 0x65, 0x63, 0x49, 0x64, 0x22, 0x68, 0x0a, 0x0c, 0x57, 0x61, 0x69, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x69, 0x74, 0x5f, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x65, 0x78, - 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x37, 0x0a, 0x09, 0x65, 0x78, 0x69, 0x74, - 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x41, - 0x74, 0x32, 0xdc, 0x0c, 0x0a, 0x05, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x6b, 0x0a, 0x06, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, - 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x12, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x06, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x71, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, - 0x63, 0x65, 0x73, 0x73, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, - 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x28, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, - 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x67, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, - 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, - 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x04, 0x4b, - 0x69, 0x6c, 0x6c, 0x12, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x4b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x50, 0x0a, 0x04, 0x45, 0x78, 0x65, 0x63, 0x12, 0x30, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, - 0x65, 0x63, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x53, 0x0a, 0x09, 0x52, 0x65, 0x73, 0x69, - 0x7a, 0x65, 0x50, 0x74, 0x79, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x50, 0x74, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4f, 0x0a, - 0x07, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x49, 0x4f, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, - 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x49, 0x4f, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4f, - 0x0a, 0x05, 0x50, 0x61, 0x75, 0x73, 0x65, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, - 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x75, 0x73, 0x65, 0x54, 0x61, 0x73, 0x6b, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, - 0x51, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x54, - 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x12, 0x69, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x69, 0x64, 0x73, 0x12, 0x2d, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x50, 0x69, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x50, 0x69, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x77, 0x0a, - 0x0a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x33, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x66, 0x0a, 0x07, 0x4d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x5d, 0x0a, 0x04, 0x57, 0x61, 0x69, 0x74, 0x12, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x42, 0x3e, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x61, 0x73, 0x6b, 0x73, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescData = file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes = make([]protoimpl.MessageInfo, 28) -var file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_goTypes = []interface{}{ - (*CreateTaskRequest)(nil), // 0: containerd.services.tasks.v1.CreateTaskRequest - (*CreateTaskResponse)(nil), // 1: containerd.services.tasks.v1.CreateTaskResponse - (*StartRequest)(nil), // 2: containerd.services.tasks.v1.StartRequest - (*StartResponse)(nil), // 3: containerd.services.tasks.v1.StartResponse - (*DeleteTaskRequest)(nil), // 4: containerd.services.tasks.v1.DeleteTaskRequest - (*DeleteResponse)(nil), // 5: containerd.services.tasks.v1.DeleteResponse - (*DeleteProcessRequest)(nil), // 6: containerd.services.tasks.v1.DeleteProcessRequest - (*GetRequest)(nil), // 7: containerd.services.tasks.v1.GetRequest - (*GetResponse)(nil), // 8: containerd.services.tasks.v1.GetResponse - (*ListTasksRequest)(nil), // 9: containerd.services.tasks.v1.ListTasksRequest - (*ListTasksResponse)(nil), // 10: containerd.services.tasks.v1.ListTasksResponse - (*KillRequest)(nil), // 11: containerd.services.tasks.v1.KillRequest - (*ExecProcessRequest)(nil), // 12: containerd.services.tasks.v1.ExecProcessRequest - (*ExecProcessResponse)(nil), // 13: containerd.services.tasks.v1.ExecProcessResponse - (*ResizePtyRequest)(nil), // 14: containerd.services.tasks.v1.ResizePtyRequest - (*CloseIORequest)(nil), // 15: containerd.services.tasks.v1.CloseIORequest - (*PauseTaskRequest)(nil), // 16: containerd.services.tasks.v1.PauseTaskRequest - (*ResumeTaskRequest)(nil), // 17: containerd.services.tasks.v1.ResumeTaskRequest - (*ListPidsRequest)(nil), // 18: containerd.services.tasks.v1.ListPidsRequest - (*ListPidsResponse)(nil), // 19: containerd.services.tasks.v1.ListPidsResponse - (*CheckpointTaskRequest)(nil), // 20: containerd.services.tasks.v1.CheckpointTaskRequest - (*CheckpointTaskResponse)(nil), // 21: containerd.services.tasks.v1.CheckpointTaskResponse - (*UpdateTaskRequest)(nil), // 22: containerd.services.tasks.v1.UpdateTaskRequest - (*MetricsRequest)(nil), // 23: containerd.services.tasks.v1.MetricsRequest - (*MetricsResponse)(nil), // 24: containerd.services.tasks.v1.MetricsResponse - (*WaitRequest)(nil), // 25: containerd.services.tasks.v1.WaitRequest - (*WaitResponse)(nil), // 26: containerd.services.tasks.v1.WaitResponse - nil, // 27: containerd.services.tasks.v1.UpdateTaskRequest.AnnotationsEntry - (*types.Mount)(nil), // 28: containerd.types.Mount - (*types.Descriptor)(nil), // 29: containerd.types.Descriptor - (*anypb.Any)(nil), // 30: google.protobuf.Any - (*timestamppb.Timestamp)(nil), // 31: google.protobuf.Timestamp - (*task.Process)(nil), // 32: containerd.v1.types.Process - (*task.ProcessInfo)(nil), // 33: containerd.v1.types.ProcessInfo - (*types.Metric)(nil), // 34: containerd.types.Metric - (*emptypb.Empty)(nil), // 35: google.protobuf.Empty -} -var file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_depIdxs = []int32{ - 28, // 0: containerd.services.tasks.v1.CreateTaskRequest.rootfs:type_name -> containerd.types.Mount - 29, // 1: containerd.services.tasks.v1.CreateTaskRequest.checkpoint:type_name -> containerd.types.Descriptor - 30, // 2: containerd.services.tasks.v1.CreateTaskRequest.options:type_name -> google.protobuf.Any - 31, // 3: containerd.services.tasks.v1.DeleteResponse.exited_at:type_name -> google.protobuf.Timestamp - 32, // 4: containerd.services.tasks.v1.GetResponse.process:type_name -> containerd.v1.types.Process - 32, // 5: containerd.services.tasks.v1.ListTasksResponse.tasks:type_name -> containerd.v1.types.Process - 30, // 6: containerd.services.tasks.v1.ExecProcessRequest.spec:type_name -> google.protobuf.Any - 33, // 7: containerd.services.tasks.v1.ListPidsResponse.processes:type_name -> containerd.v1.types.ProcessInfo - 30, // 8: containerd.services.tasks.v1.CheckpointTaskRequest.options:type_name -> google.protobuf.Any - 29, // 9: containerd.services.tasks.v1.CheckpointTaskResponse.descriptors:type_name -> containerd.types.Descriptor - 30, // 10: containerd.services.tasks.v1.UpdateTaskRequest.resources:type_name -> google.protobuf.Any - 27, // 11: containerd.services.tasks.v1.UpdateTaskRequest.annotations:type_name -> containerd.services.tasks.v1.UpdateTaskRequest.AnnotationsEntry - 34, // 12: containerd.services.tasks.v1.MetricsResponse.metrics:type_name -> containerd.types.Metric - 31, // 13: containerd.services.tasks.v1.WaitResponse.exited_at:type_name -> google.protobuf.Timestamp - 0, // 14: containerd.services.tasks.v1.Tasks.Create:input_type -> containerd.services.tasks.v1.CreateTaskRequest - 2, // 15: containerd.services.tasks.v1.Tasks.Start:input_type -> containerd.services.tasks.v1.StartRequest - 4, // 16: containerd.services.tasks.v1.Tasks.Delete:input_type -> containerd.services.tasks.v1.DeleteTaskRequest - 6, // 17: containerd.services.tasks.v1.Tasks.DeleteProcess:input_type -> containerd.services.tasks.v1.DeleteProcessRequest - 7, // 18: containerd.services.tasks.v1.Tasks.Get:input_type -> containerd.services.tasks.v1.GetRequest - 9, // 19: containerd.services.tasks.v1.Tasks.List:input_type -> containerd.services.tasks.v1.ListTasksRequest - 11, // 20: containerd.services.tasks.v1.Tasks.Kill:input_type -> containerd.services.tasks.v1.KillRequest - 12, // 21: containerd.services.tasks.v1.Tasks.Exec:input_type -> containerd.services.tasks.v1.ExecProcessRequest - 14, // 22: containerd.services.tasks.v1.Tasks.ResizePty:input_type -> containerd.services.tasks.v1.ResizePtyRequest - 15, // 23: containerd.services.tasks.v1.Tasks.CloseIO:input_type -> containerd.services.tasks.v1.CloseIORequest - 16, // 24: containerd.services.tasks.v1.Tasks.Pause:input_type -> containerd.services.tasks.v1.PauseTaskRequest - 17, // 25: containerd.services.tasks.v1.Tasks.Resume:input_type -> containerd.services.tasks.v1.ResumeTaskRequest - 18, // 26: containerd.services.tasks.v1.Tasks.ListPids:input_type -> containerd.services.tasks.v1.ListPidsRequest - 20, // 27: containerd.services.tasks.v1.Tasks.Checkpoint:input_type -> containerd.services.tasks.v1.CheckpointTaskRequest - 22, // 28: containerd.services.tasks.v1.Tasks.Update:input_type -> containerd.services.tasks.v1.UpdateTaskRequest - 23, // 29: containerd.services.tasks.v1.Tasks.Metrics:input_type -> containerd.services.tasks.v1.MetricsRequest - 25, // 30: containerd.services.tasks.v1.Tasks.Wait:input_type -> containerd.services.tasks.v1.WaitRequest - 1, // 31: containerd.services.tasks.v1.Tasks.Create:output_type -> containerd.services.tasks.v1.CreateTaskResponse - 3, // 32: containerd.services.tasks.v1.Tasks.Start:output_type -> containerd.services.tasks.v1.StartResponse - 5, // 33: containerd.services.tasks.v1.Tasks.Delete:output_type -> containerd.services.tasks.v1.DeleteResponse - 5, // 34: containerd.services.tasks.v1.Tasks.DeleteProcess:output_type -> containerd.services.tasks.v1.DeleteResponse - 8, // 35: containerd.services.tasks.v1.Tasks.Get:output_type -> containerd.services.tasks.v1.GetResponse - 10, // 36: containerd.services.tasks.v1.Tasks.List:output_type -> containerd.services.tasks.v1.ListTasksResponse - 35, // 37: containerd.services.tasks.v1.Tasks.Kill:output_type -> google.protobuf.Empty - 35, // 38: containerd.services.tasks.v1.Tasks.Exec:output_type -> google.protobuf.Empty - 35, // 39: containerd.services.tasks.v1.Tasks.ResizePty:output_type -> google.protobuf.Empty - 35, // 40: containerd.services.tasks.v1.Tasks.CloseIO:output_type -> google.protobuf.Empty - 35, // 41: containerd.services.tasks.v1.Tasks.Pause:output_type -> google.protobuf.Empty - 35, // 42: containerd.services.tasks.v1.Tasks.Resume:output_type -> google.protobuf.Empty - 19, // 43: containerd.services.tasks.v1.Tasks.ListPids:output_type -> containerd.services.tasks.v1.ListPidsResponse - 21, // 44: containerd.services.tasks.v1.Tasks.Checkpoint:output_type -> containerd.services.tasks.v1.CheckpointTaskResponse - 35, // 45: containerd.services.tasks.v1.Tasks.Update:output_type -> google.protobuf.Empty - 24, // 46: containerd.services.tasks.v1.Tasks.Metrics:output_type -> containerd.services.tasks.v1.MetricsResponse - 26, // 47: containerd.services.tasks.v1.Tasks.Wait:output_type -> containerd.services.tasks.v1.WaitResponse - 31, // [31:48] is the sub-list for method output_type - 14, // [14:31] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_init() } -func file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_init() { - if File_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateTaskRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateTaskResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteTaskRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteProcessRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTasksRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTasksResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KillRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecProcessRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecProcessResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResizePtyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CloseIORequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PauseTaskRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResumeTaskRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListPidsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListPidsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckpointTaskRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckpointTaskResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateTaskRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MetricsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MetricsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WaitRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WaitResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDesc, - NumEnums: 0, - NumMessages: 28, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto = out.File - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_rawDesc = nil - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_goTypes = nil - file_github_com_containerd_containerd_api_services_tasks_v1_tasks_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.proto b/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.proto deleted file mode 100644 index 8ddd319260..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.proto +++ /dev/null @@ -1,227 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.services.tasks.v1; - -import "google/protobuf/empty.proto"; -import "google/protobuf/any.proto"; -import "github.com/containerd/containerd/api/types/mount.proto"; -import "github.com/containerd/containerd/api/types/metrics.proto"; -import "github.com/containerd/containerd/api/types/descriptor.proto"; -import "github.com/containerd/containerd/api/types/task/task.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "github.com/containerd/containerd/api/services/tasks/v1;tasks"; - -service Tasks { - // Create a task. - rpc Create(CreateTaskRequest) returns (CreateTaskResponse); - - // Start a process. - rpc Start(StartRequest) returns (StartResponse); - - // Delete a task and on disk state. - rpc Delete(DeleteTaskRequest) returns (DeleteResponse); - - rpc DeleteProcess(DeleteProcessRequest) returns (DeleteResponse); - - rpc Get(GetRequest) returns (GetResponse); - - rpc List(ListTasksRequest) returns (ListTasksResponse); - - // Kill a task or process. - rpc Kill(KillRequest) returns (google.protobuf.Empty); - - rpc Exec(ExecProcessRequest) returns (google.protobuf.Empty); - - rpc ResizePty(ResizePtyRequest) returns (google.protobuf.Empty); - - rpc CloseIO(CloseIORequest) returns (google.protobuf.Empty); - - rpc Pause(PauseTaskRequest) returns (google.protobuf.Empty); - - rpc Resume(ResumeTaskRequest) returns (google.protobuf.Empty); - - rpc ListPids(ListPidsRequest) returns (ListPidsResponse); - - rpc Checkpoint(CheckpointTaskRequest) returns (CheckpointTaskResponse); - - rpc Update(UpdateTaskRequest) returns (google.protobuf.Empty); - - rpc Metrics(MetricsRequest) returns (MetricsResponse); - - rpc Wait(WaitRequest) returns (WaitResponse); -} - -message CreateTaskRequest { - string container_id = 1; - - // RootFS provides the pre-chroot mounts to perform in the shim before - // executing the container task. - // - // These are for mounts that cannot be performed in the user namespace. - // Typically, these mounts should be resolved from snapshots specified on - // the container object. - repeated containerd.types.Mount rootfs = 3; - - string stdin = 4; - string stdout = 5; - string stderr = 6; - bool terminal = 7; - - containerd.types.Descriptor checkpoint = 8; - - google.protobuf.Any options = 9; - - string runtime_path = 10; -} - -message CreateTaskResponse { - string container_id = 1; - uint32 pid = 2; -} - -message StartRequest { - string container_id = 1; - string exec_id = 2; -} - -message StartResponse { - uint32 pid = 1; -} - -message DeleteTaskRequest { - string container_id = 1; -} - -message DeleteResponse { - string id = 1; - uint32 pid = 2; - uint32 exit_status = 3; - google.protobuf.Timestamp exited_at = 4; -} - -message DeleteProcessRequest { - string container_id = 1; - string exec_id = 2; -} - -message GetRequest { - string container_id = 1; - string exec_id = 2; -} - -message GetResponse { - containerd.v1.types.Process process = 1; -} - -message ListTasksRequest { - string filter = 1; -} - -message ListTasksResponse { - repeated containerd.v1.types.Process tasks = 1; -} - -message KillRequest { - string container_id = 1; - string exec_id = 2; - uint32 signal = 3; - bool all = 4; -} - -message ExecProcessRequest { - string container_id = 1; - string stdin = 2; - string stdout = 3; - string stderr = 4; - bool terminal = 5; - // Spec for starting a process in the target container. - // - // For runc, this is a process spec, for example. - google.protobuf.Any spec = 6; - // id of the exec process - string exec_id = 7; -} - -message ExecProcessResponse { -} - -message ResizePtyRequest { - string container_id = 1; - string exec_id = 2; - uint32 width = 3; - uint32 height = 4; -} - -message CloseIORequest { - string container_id = 1; - string exec_id = 2; - bool stdin = 3; -} - -message PauseTaskRequest { - string container_id = 1; -} - -message ResumeTaskRequest { - string container_id = 1; -} - -message ListPidsRequest { - string container_id = 1; -} - -message ListPidsResponse { - // Processes includes the process ID and additional process information - repeated containerd.v1.types.ProcessInfo processes = 1; -} - -message CheckpointTaskRequest { - string container_id = 1; - string parent_checkpoint = 2; - google.protobuf.Any options = 3; -} - -message CheckpointTaskResponse { - repeated containerd.types.Descriptor descriptors = 1; -} - -message UpdateTaskRequest { - string container_id = 1; - google.protobuf.Any resources = 2; - map annotations = 3; -} - -message MetricsRequest { - repeated string filters = 1; -} - -message MetricsResponse { - repeated types.Metric metrics = 1; -} - -message WaitRequest { - string container_id = 1; - string exec_id = 2; -} - -message WaitResponse { - uint32 exit_status = 1; - google.protobuf.Timestamp exited_at = 2; -} diff --git a/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks_grpc.pb.go b/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks_grpc.pb.go deleted file mode 100644 index 1bc23522ab..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks_grpc.pb.go +++ /dev/null @@ -1,692 +0,0 @@ -//go:build !no_grpc - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/tasks/v1/tasks.proto - -package tasks - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// TasksClient is the client API for Tasks service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type TasksClient interface { - // Create a task. - Create(ctx context.Context, in *CreateTaskRequest, opts ...grpc.CallOption) (*CreateTaskResponse, error) - // Start a process. - Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error) - // Delete a task and on disk state. - Delete(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*DeleteResponse, error) - DeleteProcess(ctx context.Context, in *DeleteProcessRequest, opts ...grpc.CallOption) (*DeleteResponse, error) - Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) - List(ctx context.Context, in *ListTasksRequest, opts ...grpc.CallOption) (*ListTasksResponse, error) - // Kill a task or process. - Kill(ctx context.Context, in *KillRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - Exec(ctx context.Context, in *ExecProcessRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - ResizePty(ctx context.Context, in *ResizePtyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - CloseIO(ctx context.Context, in *CloseIORequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - Pause(ctx context.Context, in *PauseTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - Resume(ctx context.Context, in *ResumeTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - ListPids(ctx context.Context, in *ListPidsRequest, opts ...grpc.CallOption) (*ListPidsResponse, error) - Checkpoint(ctx context.Context, in *CheckpointTaskRequest, opts ...grpc.CallOption) (*CheckpointTaskResponse, error) - Update(ctx context.Context, in *UpdateTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - Metrics(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*MetricsResponse, error) - Wait(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (*WaitResponse, error) -} - -type tasksClient struct { - cc grpc.ClientConnInterface -} - -func NewTasksClient(cc grpc.ClientConnInterface) TasksClient { - return &tasksClient{cc} -} - -func (c *tasksClient) Create(ctx context.Context, in *CreateTaskRequest, opts ...grpc.CallOption) (*CreateTaskResponse, error) { - out := new(CreateTaskResponse) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Create", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tasksClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error) { - out := new(StartResponse) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Start", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tasksClient) Delete(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { - out := new(DeleteResponse) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Delete", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tasksClient) DeleteProcess(ctx context.Context, in *DeleteProcessRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { - out := new(DeleteResponse) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/DeleteProcess", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tasksClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { - out := new(GetResponse) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Get", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tasksClient) List(ctx context.Context, in *ListTasksRequest, opts ...grpc.CallOption) (*ListTasksResponse, error) { - out := new(ListTasksResponse) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/List", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tasksClient) Kill(ctx context.Context, in *KillRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Kill", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tasksClient) Exec(ctx context.Context, in *ExecProcessRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Exec", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tasksClient) ResizePty(ctx context.Context, in *ResizePtyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/ResizePty", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tasksClient) CloseIO(ctx context.Context, in *CloseIORequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/CloseIO", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tasksClient) Pause(ctx context.Context, in *PauseTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Pause", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tasksClient) Resume(ctx context.Context, in *ResumeTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Resume", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tasksClient) ListPids(ctx context.Context, in *ListPidsRequest, opts ...grpc.CallOption) (*ListPidsResponse, error) { - out := new(ListPidsResponse) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/ListPids", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tasksClient) Checkpoint(ctx context.Context, in *CheckpointTaskRequest, opts ...grpc.CallOption) (*CheckpointTaskResponse, error) { - out := new(CheckpointTaskResponse) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Checkpoint", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tasksClient) Update(ctx context.Context, in *UpdateTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Update", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tasksClient) Metrics(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*MetricsResponse, error) { - out := new(MetricsResponse) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Metrics", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tasksClient) Wait(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (*WaitResponse, error) { - out := new(WaitResponse) - err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Wait", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// TasksServer is the server API for Tasks service. -// All implementations must embed UnimplementedTasksServer -// for forward compatibility -type TasksServer interface { - // Create a task. - Create(context.Context, *CreateTaskRequest) (*CreateTaskResponse, error) - // Start a process. - Start(context.Context, *StartRequest) (*StartResponse, error) - // Delete a task and on disk state. - Delete(context.Context, *DeleteTaskRequest) (*DeleteResponse, error) - DeleteProcess(context.Context, *DeleteProcessRequest) (*DeleteResponse, error) - Get(context.Context, *GetRequest) (*GetResponse, error) - List(context.Context, *ListTasksRequest) (*ListTasksResponse, error) - // Kill a task or process. - Kill(context.Context, *KillRequest) (*emptypb.Empty, error) - Exec(context.Context, *ExecProcessRequest) (*emptypb.Empty, error) - ResizePty(context.Context, *ResizePtyRequest) (*emptypb.Empty, error) - CloseIO(context.Context, *CloseIORequest) (*emptypb.Empty, error) - Pause(context.Context, *PauseTaskRequest) (*emptypb.Empty, error) - Resume(context.Context, *ResumeTaskRequest) (*emptypb.Empty, error) - ListPids(context.Context, *ListPidsRequest) (*ListPidsResponse, error) - Checkpoint(context.Context, *CheckpointTaskRequest) (*CheckpointTaskResponse, error) - Update(context.Context, *UpdateTaskRequest) (*emptypb.Empty, error) - Metrics(context.Context, *MetricsRequest) (*MetricsResponse, error) - Wait(context.Context, *WaitRequest) (*WaitResponse, error) - mustEmbedUnimplementedTasksServer() -} - -// UnimplementedTasksServer must be embedded to have forward compatible implementations. -type UnimplementedTasksServer struct { -} - -func (UnimplementedTasksServer) Create(context.Context, *CreateTaskRequest) (*CreateTaskResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") -} -func (UnimplementedTasksServer) Start(context.Context, *StartRequest) (*StartResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") -} -func (UnimplementedTasksServer) Delete(context.Context, *DeleteTaskRequest) (*DeleteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") -} -func (UnimplementedTasksServer) DeleteProcess(context.Context, *DeleteProcessRequest) (*DeleteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteProcess not implemented") -} -func (UnimplementedTasksServer) Get(context.Context, *GetRequest) (*GetResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") -} -func (UnimplementedTasksServer) List(context.Context, *ListTasksRequest) (*ListTasksResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method List not implemented") -} -func (UnimplementedTasksServer) Kill(context.Context, *KillRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Kill not implemented") -} -func (UnimplementedTasksServer) Exec(context.Context, *ExecProcessRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Exec not implemented") -} -func (UnimplementedTasksServer) ResizePty(context.Context, *ResizePtyRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ResizePty not implemented") -} -func (UnimplementedTasksServer) CloseIO(context.Context, *CloseIORequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method CloseIO not implemented") -} -func (UnimplementedTasksServer) Pause(context.Context, *PauseTaskRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Pause not implemented") -} -func (UnimplementedTasksServer) Resume(context.Context, *ResumeTaskRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Resume not implemented") -} -func (UnimplementedTasksServer) ListPids(context.Context, *ListPidsRequest) (*ListPidsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListPids not implemented") -} -func (UnimplementedTasksServer) Checkpoint(context.Context, *CheckpointTaskRequest) (*CheckpointTaskResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Checkpoint not implemented") -} -func (UnimplementedTasksServer) Update(context.Context, *UpdateTaskRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") -} -func (UnimplementedTasksServer) Metrics(context.Context, *MetricsRequest) (*MetricsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Metrics not implemented") -} -func (UnimplementedTasksServer) Wait(context.Context, *WaitRequest) (*WaitResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Wait not implemented") -} -func (UnimplementedTasksServer) mustEmbedUnimplementedTasksServer() {} - -// UnsafeTasksServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to TasksServer will -// result in compilation errors. -type UnsafeTasksServer interface { - mustEmbedUnimplementedTasksServer() -} - -func RegisterTasksServer(s grpc.ServiceRegistrar, srv TasksServer) { - s.RegisterService(&Tasks_ServiceDesc, srv) -} - -func _Tasks_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateTaskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).Create(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/Create", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).Create(ctx, req.(*CreateTaskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Tasks_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StartRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).Start(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/Start", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).Start(ctx, req.(*StartRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Tasks_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteTaskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).Delete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/Delete", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).Delete(ctx, req.(*DeleteTaskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Tasks_DeleteProcess_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteProcessRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).DeleteProcess(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/DeleteProcess", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).DeleteProcess(ctx, req.(*DeleteProcessRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Tasks_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).Get(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/Get", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).Get(ctx, req.(*GetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Tasks_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListTasksRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).List(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/List", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).List(ctx, req.(*ListTasksRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Tasks_Kill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(KillRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).Kill(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/Kill", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).Kill(ctx, req.(*KillRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Tasks_Exec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ExecProcessRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).Exec(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/Exec", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).Exec(ctx, req.(*ExecProcessRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Tasks_ResizePty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ResizePtyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).ResizePty(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/ResizePty", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).ResizePty(ctx, req.(*ResizePtyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Tasks_CloseIO_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CloseIORequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).CloseIO(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/CloseIO", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).CloseIO(ctx, req.(*CloseIORequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Tasks_Pause_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PauseTaskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).Pause(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/Pause", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).Pause(ctx, req.(*PauseTaskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Tasks_Resume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ResumeTaskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).Resume(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/Resume", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).Resume(ctx, req.(*ResumeTaskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Tasks_ListPids_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListPidsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).ListPids(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/ListPids", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).ListPids(ctx, req.(*ListPidsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Tasks_Checkpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CheckpointTaskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).Checkpoint(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/Checkpoint", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).Checkpoint(ctx, req.(*CheckpointTaskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Tasks_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateTaskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).Update(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/Update", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).Update(ctx, req.(*UpdateTaskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Tasks_Metrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MetricsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).Metrics(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/Metrics", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).Metrics(ctx, req.(*MetricsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Tasks_Wait_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WaitRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TasksServer).Wait(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.tasks.v1.Tasks/Wait", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TasksServer).Wait(ctx, req.(*WaitRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Tasks_ServiceDesc is the grpc.ServiceDesc for Tasks service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Tasks_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.services.tasks.v1.Tasks", - HandlerType: (*TasksServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Create", - Handler: _Tasks_Create_Handler, - }, - { - MethodName: "Start", - Handler: _Tasks_Start_Handler, - }, - { - MethodName: "Delete", - Handler: _Tasks_Delete_Handler, - }, - { - MethodName: "DeleteProcess", - Handler: _Tasks_DeleteProcess_Handler, - }, - { - MethodName: "Get", - Handler: _Tasks_Get_Handler, - }, - { - MethodName: "List", - Handler: _Tasks_List_Handler, - }, - { - MethodName: "Kill", - Handler: _Tasks_Kill_Handler, - }, - { - MethodName: "Exec", - Handler: _Tasks_Exec_Handler, - }, - { - MethodName: "ResizePty", - Handler: _Tasks_ResizePty_Handler, - }, - { - MethodName: "CloseIO", - Handler: _Tasks_CloseIO_Handler, - }, - { - MethodName: "Pause", - Handler: _Tasks_Pause_Handler, - }, - { - MethodName: "Resume", - Handler: _Tasks_Resume_Handler, - }, - { - MethodName: "ListPids", - Handler: _Tasks_ListPids_Handler, - }, - { - MethodName: "Checkpoint", - Handler: _Tasks_Checkpoint_Handler, - }, - { - MethodName: "Update", - Handler: _Tasks_Update_Handler, - }, - { - MethodName: "Metrics", - Handler: _Tasks_Metrics_Handler, - }, - { - MethodName: "Wait", - Handler: _Tasks_Wait_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/containerd/containerd/api/services/tasks/v1/tasks.proto", -} diff --git a/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks_ttrpc.pb.go b/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks_ttrpc.pb.go deleted file mode 100644 index 859eec58e0..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks_ttrpc.pb.go +++ /dev/null @@ -1,301 +0,0 @@ -// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/containerd/api/services/tasks/v1/tasks.proto -package tasks - -import ( - context "context" - ttrpc "github.com/containerd/ttrpc" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -type TTRPCTasksService interface { - Create(context.Context, *CreateTaskRequest) (*CreateTaskResponse, error) - Start(context.Context, *StartRequest) (*StartResponse, error) - Delete(context.Context, *DeleteTaskRequest) (*DeleteResponse, error) - DeleteProcess(context.Context, *DeleteProcessRequest) (*DeleteResponse, error) - Get(context.Context, *GetRequest) (*GetResponse, error) - List(context.Context, *ListTasksRequest) (*ListTasksResponse, error) - Kill(context.Context, *KillRequest) (*emptypb.Empty, error) - Exec(context.Context, *ExecProcessRequest) (*emptypb.Empty, error) - ResizePty(context.Context, *ResizePtyRequest) (*emptypb.Empty, error) - CloseIO(context.Context, *CloseIORequest) (*emptypb.Empty, error) - Pause(context.Context, *PauseTaskRequest) (*emptypb.Empty, error) - Resume(context.Context, *ResumeTaskRequest) (*emptypb.Empty, error) - ListPids(context.Context, *ListPidsRequest) (*ListPidsResponse, error) - Checkpoint(context.Context, *CheckpointTaskRequest) (*CheckpointTaskResponse, error) - Update(context.Context, *UpdateTaskRequest) (*emptypb.Empty, error) - Metrics(context.Context, *MetricsRequest) (*MetricsResponse, error) - Wait(context.Context, *WaitRequest) (*WaitResponse, error) -} - -func RegisterTTRPCTasksService(srv *ttrpc.Server, svc TTRPCTasksService) { - srv.RegisterService("containerd.services.tasks.v1.Tasks", &ttrpc.ServiceDesc{ - Methods: map[string]ttrpc.Method{ - "Create": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req CreateTaskRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Create(ctx, &req) - }, - "Start": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req StartRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Start(ctx, &req) - }, - "Delete": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req DeleteTaskRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Delete(ctx, &req) - }, - "DeleteProcess": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req DeleteProcessRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.DeleteProcess(ctx, &req) - }, - "Get": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req GetRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Get(ctx, &req) - }, - "List": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ListTasksRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.List(ctx, &req) - }, - "Kill": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req KillRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Kill(ctx, &req) - }, - "Exec": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ExecProcessRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Exec(ctx, &req) - }, - "ResizePty": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ResizePtyRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.ResizePty(ctx, &req) - }, - "CloseIO": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req CloseIORequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.CloseIO(ctx, &req) - }, - "Pause": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req PauseTaskRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Pause(ctx, &req) - }, - "Resume": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ResumeTaskRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Resume(ctx, &req) - }, - "ListPids": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ListPidsRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.ListPids(ctx, &req) - }, - "Checkpoint": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req CheckpointTaskRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Checkpoint(ctx, &req) - }, - "Update": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req UpdateTaskRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Update(ctx, &req) - }, - "Metrics": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req MetricsRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Metrics(ctx, &req) - }, - "Wait": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req WaitRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Wait(ctx, &req) - }, - }, - }) -} - -type ttrpctasksClient struct { - client *ttrpc.Client -} - -func NewTTRPCTasksClient(client *ttrpc.Client) TTRPCTasksService { - return &ttrpctasksClient{ - client: client, - } -} - -func (c *ttrpctasksClient) Create(ctx context.Context, req *CreateTaskRequest) (*CreateTaskResponse, error) { - var resp CreateTaskResponse - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Create", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpctasksClient) Start(ctx context.Context, req *StartRequest) (*StartResponse, error) { - var resp StartResponse - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Start", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpctasksClient) Delete(ctx context.Context, req *DeleteTaskRequest) (*DeleteResponse, error) { - var resp DeleteResponse - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Delete", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpctasksClient) DeleteProcess(ctx context.Context, req *DeleteProcessRequest) (*DeleteResponse, error) { - var resp DeleteResponse - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "DeleteProcess", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpctasksClient) Get(ctx context.Context, req *GetRequest) (*GetResponse, error) { - var resp GetResponse - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Get", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpctasksClient) List(ctx context.Context, req *ListTasksRequest) (*ListTasksResponse, error) { - var resp ListTasksResponse - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "List", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpctasksClient) Kill(ctx context.Context, req *KillRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Kill", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpctasksClient) Exec(ctx context.Context, req *ExecProcessRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Exec", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpctasksClient) ResizePty(ctx context.Context, req *ResizePtyRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "ResizePty", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpctasksClient) CloseIO(ctx context.Context, req *CloseIORequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "CloseIO", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpctasksClient) Pause(ctx context.Context, req *PauseTaskRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Pause", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpctasksClient) Resume(ctx context.Context, req *ResumeTaskRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Resume", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpctasksClient) ListPids(ctx context.Context, req *ListPidsRequest) (*ListPidsResponse, error) { - var resp ListPidsResponse - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "ListPids", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpctasksClient) Checkpoint(ctx context.Context, req *CheckpointTaskRequest) (*CheckpointTaskResponse, error) { - var resp CheckpointTaskResponse - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Checkpoint", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpctasksClient) Update(ctx context.Context, req *UpdateTaskRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Update", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpctasksClient) Metrics(ctx context.Context, req *MetricsRequest) (*MetricsResponse, error) { - var resp MetricsResponse - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Metrics", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *ttrpctasksClient) Wait(ctx context.Context, req *WaitRequest) (*WaitResponse, error) { - var resp WaitResponse - if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Wait", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/transfer/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/transfer/v1/doc.go deleted file mode 100644 index 0882a6e922..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/transfer/v1/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package transfer diff --git a/vendor/github.com/containerd/containerd/api/services/transfer/v1/transfer.pb.go b/vendor/github.com/containerd/containerd/api/services/transfer/v1/transfer.pb.go deleted file mode 100644 index b6e959babd..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/transfer/v1/transfer.pb.go +++ /dev/null @@ -1,274 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/transfer/v1/transfer.proto - -package transfer - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" -) - -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) -) - -type TransferRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Source *anypb.Any `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` - Destination *anypb.Any `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"` - Options *TransferOptions `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"` -} - -func (x *TransferRequest) Reset() { - *x = TransferRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TransferRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TransferRequest) ProtoMessage() {} - -func (x *TransferRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_msgTypes[0] - 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 TransferRequest.ProtoReflect.Descriptor instead. -func (*TransferRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_rawDescGZIP(), []int{0} -} - -func (x *TransferRequest) GetSource() *anypb.Any { - if x != nil { - return x.Source - } - return nil -} - -func (x *TransferRequest) GetDestination() *anypb.Any { - if x != nil { - return x.Destination - } - return nil -} - -func (x *TransferRequest) GetOptions() *TransferOptions { - if x != nil { - return x.Options - } - return nil -} - -type TransferOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProgressStream string `protobuf:"bytes,1,opt,name=progress_stream,json=progressStream,proto3" json:"progress_stream,omitempty"` // Progress min interval -} - -func (x *TransferOptions) Reset() { - *x = TransferOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TransferOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TransferOptions) ProtoMessage() {} - -func (x *TransferOptions) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_msgTypes[1] - 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 TransferOptions.ProtoReflect.Descriptor instead. -func (*TransferOptions) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_rawDescGZIP(), []int{1} -} - -func (x *TransferOptions) GetProgressStream() string { - if x != nil { - return x.ProgressStream - } - return "" -} - -var File_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_rawDesc = []byte{ - 0x0a, 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x66, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1f, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xc3, 0x01, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x06, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, - 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, - 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2e, 0x76, 0x31, - 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x0a, 0x0f, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x27, 0x0a, 0x0f, - 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x53, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x32, 0x60, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, - 0x72, 0x12, 0x54, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x12, 0x30, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x44, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, - 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_rawDescData = file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_goTypes = []interface{}{ - (*TransferRequest)(nil), // 0: containerd.services.transfer.v1.TransferRequest - (*TransferOptions)(nil), // 1: containerd.services.transfer.v1.TransferOptions - (*anypb.Any)(nil), // 2: google.protobuf.Any - (*emptypb.Empty)(nil), // 3: google.protobuf.Empty -} -var file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_depIdxs = []int32{ - 2, // 0: containerd.services.transfer.v1.TransferRequest.source:type_name -> google.protobuf.Any - 2, // 1: containerd.services.transfer.v1.TransferRequest.destination:type_name -> google.protobuf.Any - 1, // 2: containerd.services.transfer.v1.TransferRequest.options:type_name -> containerd.services.transfer.v1.TransferOptions - 0, // 3: containerd.services.transfer.v1.Transfer.Transfer:input_type -> containerd.services.transfer.v1.TransferRequest - 3, // 4: containerd.services.transfer.v1.Transfer.Transfer:output_type -> google.protobuf.Empty - 4, // [4:5] is the sub-list for method output_type - 3, // [3:4] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_init() } -func file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_init() { - if File_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransferRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransferOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto = out.File - file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_rawDesc = nil - file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_goTypes = nil - file_github_com_containerd_containerd_api_services_transfer_v1_transfer_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/transfer/v1/transfer.proto b/vendor/github.com/containerd/containerd/api/services/transfer/v1/transfer.proto deleted file mode 100644 index a8f25ee593..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/transfer/v1/transfer.proto +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.services.transfer.v1; - -import "google/protobuf/any.proto"; -import "google/protobuf/empty.proto"; - -option go_package = "github.com/containerd/containerd/api/services/transfer/v1;transfer"; - -service Transfer { - rpc Transfer(TransferRequest) returns (google.protobuf.Empty); -} - -message TransferRequest { - google.protobuf.Any source = 1; - google.protobuf.Any destination = 2; - TransferOptions options = 3; -} - -message TransferOptions { - string progress_stream = 1; - // Progress min interval -} diff --git a/vendor/github.com/containerd/containerd/api/services/transfer/v1/transfer_grpc.pb.go b/vendor/github.com/containerd/containerd/api/services/transfer/v1/transfer_grpc.pb.go deleted file mode 100644 index 90c71224d3..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/transfer/v1/transfer_grpc.pb.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build !no_grpc - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/transfer/v1/transfer.proto - -package transfer - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// TransferClient is the client API for Transfer service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type TransferClient interface { - Transfer(ctx context.Context, in *TransferRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type transferClient struct { - cc grpc.ClientConnInterface -} - -func NewTransferClient(cc grpc.ClientConnInterface) TransferClient { - return &transferClient{cc} -} - -func (c *transferClient) Transfer(ctx context.Context, in *TransferRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/containerd.services.transfer.v1.Transfer/Transfer", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// TransferServer is the server API for Transfer service. -// All implementations must embed UnimplementedTransferServer -// for forward compatibility -type TransferServer interface { - Transfer(context.Context, *TransferRequest) (*emptypb.Empty, error) - mustEmbedUnimplementedTransferServer() -} - -// UnimplementedTransferServer must be embedded to have forward compatible implementations. -type UnimplementedTransferServer struct { -} - -func (UnimplementedTransferServer) Transfer(context.Context, *TransferRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Transfer not implemented") -} -func (UnimplementedTransferServer) mustEmbedUnimplementedTransferServer() {} - -// UnsafeTransferServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to TransferServer will -// result in compilation errors. -type UnsafeTransferServer interface { - mustEmbedUnimplementedTransferServer() -} - -func RegisterTransferServer(s grpc.ServiceRegistrar, srv TransferServer) { - s.RegisterService(&Transfer_ServiceDesc, srv) -} - -func _Transfer_Transfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TransferRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TransferServer).Transfer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.transfer.v1.Transfer/Transfer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TransferServer).Transfer(ctx, req.(*TransferRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Transfer_ServiceDesc is the grpc.ServiceDesc for Transfer service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Transfer_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.services.transfer.v1.Transfer", - HandlerType: (*TransferServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Transfer", - Handler: _Transfer_Transfer_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/containerd/containerd/api/services/transfer/v1/transfer.proto", -} diff --git a/vendor/github.com/containerd/containerd/api/services/transfer/v1/transfer_ttrpc.pb.go b/vendor/github.com/containerd/containerd/api/services/transfer/v1/transfer_ttrpc.pb.go deleted file mode 100644 index 848eb1933f..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/transfer/v1/transfer_ttrpc.pb.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/containerd/api/services/transfer/v1/transfer.proto -package transfer - -import ( - context "context" - ttrpc "github.com/containerd/ttrpc" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -type TTRPCTransferService interface { - Transfer(context.Context, *TransferRequest) (*emptypb.Empty, error) -} - -func RegisterTTRPCTransferService(srv *ttrpc.Server, svc TTRPCTransferService) { - srv.RegisterService("containerd.services.transfer.v1.Transfer", &ttrpc.ServiceDesc{ - Methods: map[string]ttrpc.Method{ - "Transfer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req TransferRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Transfer(ctx, &req) - }, - }, - }) -} - -type ttrpctransferClient struct { - client *ttrpc.Client -} - -func NewTTRPCTransferClient(client *ttrpc.Client) TTRPCTransferService { - return &ttrpctransferClient{ - client: client, - } -} - -func (c *ttrpctransferClient) Transfer(ctx context.Context, req *TransferRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "containerd.services.transfer.v1.Transfer", "Transfer", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/version/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/version/v1/doc.go deleted file mode 100644 index c5c0b85ddb..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/version/v1/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Package version defines the version service. -package version diff --git a/vendor/github.com/containerd/containerd/api/services/version/v1/version.pb.go b/vendor/github.com/containerd/containerd/api/services/version/v1/version.pb.go deleted file mode 100644 index c087d3e26b..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/version/v1/version.pb.go +++ /dev/null @@ -1,187 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/version/v1/version.proto - -package version - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" -) - -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) -) - -type VersionResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - Revision string `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` -} - -func (x *VersionResponse) Reset() { - *x = VersionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_services_version_v1_version_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *VersionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VersionResponse) ProtoMessage() {} - -func (x *VersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_services_version_v1_version_proto_msgTypes[0] - 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 VersionResponse.ProtoReflect.Descriptor instead. -func (*VersionResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDescGZIP(), []int{0} -} - -func (x *VersionResponse) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *VersionResponse) GetRevision() string { - if x != nil { - return x.Revision - } - return "" -} - -var File_github_com_containerd_containerd_api_services_version_v1_version_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDesc = []byte{ - 0x0a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x47, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x5d, - 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x07, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x2f, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x42, 0x5a, - 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDescData = file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_services_version_v1_version_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_github_com_containerd_containerd_api_services_version_v1_version_proto_goTypes = []interface{}{ - (*VersionResponse)(nil), // 0: containerd.services.version.v1.VersionResponse - (*emptypb.Empty)(nil), // 1: google.protobuf.Empty -} -var file_github_com_containerd_containerd_api_services_version_v1_version_proto_depIdxs = []int32{ - 1, // 0: containerd.services.version.v1.Version.Version:input_type -> google.protobuf.Empty - 0, // 1: containerd.services.version.v1.Version.Version:output_type -> containerd.services.version.v1.VersionResponse - 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_github_com_containerd_containerd_api_services_version_v1_version_proto_init() } -func file_github_com_containerd_containerd_api_services_version_v1_version_proto_init() { - if File_github_com_containerd_containerd_api_services_version_v1_version_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_services_version_v1_version_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VersionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_containerd_containerd_api_services_version_v1_version_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_services_version_v1_version_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_services_version_v1_version_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_services_version_v1_version_proto = out.File - file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDesc = nil - file_github_com_containerd_containerd_api_services_version_v1_version_proto_goTypes = nil - file_github_com_containerd_containerd_api_services_version_v1_version_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/services/version/v1/version.proto b/vendor/github.com/containerd/containerd/api/services/version/v1/version.proto deleted file mode 100644 index bd948ff343..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/version/v1/version.proto +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.services.version.v1; - -import "google/protobuf/empty.proto"; - -// TODO(stevvooe): Should version service actually be versioned? -option go_package = "github.com/containerd/containerd/api/services/version/v1;version"; - -service Version { - rpc Version(google.protobuf.Empty) returns (VersionResponse); -} - -message VersionResponse { - string version = 1; - string revision = 2; -} diff --git a/vendor/github.com/containerd/containerd/api/services/version/v1/version_grpc.pb.go b/vendor/github.com/containerd/containerd/api/services/version/v1/version_grpc.pb.go deleted file mode 100644 index e96eddefb7..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/version/v1/version_grpc.pb.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build !no_grpc - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.20.1 -// source: github.com/containerd/containerd/api/services/version/v1/version.proto - -package version - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// VersionClient is the client API for Version service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type VersionClient interface { - Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*VersionResponse, error) -} - -type versionClient struct { - cc grpc.ClientConnInterface -} - -func NewVersionClient(cc grpc.ClientConnInterface) VersionClient { - return &versionClient{cc} -} - -func (c *versionClient) Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*VersionResponse, error) { - out := new(VersionResponse) - err := c.cc.Invoke(ctx, "/containerd.services.version.v1.Version/Version", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// VersionServer is the server API for Version service. -// All implementations must embed UnimplementedVersionServer -// for forward compatibility -type VersionServer interface { - Version(context.Context, *emptypb.Empty) (*VersionResponse, error) - mustEmbedUnimplementedVersionServer() -} - -// UnimplementedVersionServer must be embedded to have forward compatible implementations. -type UnimplementedVersionServer struct { -} - -func (UnimplementedVersionServer) Version(context.Context, *emptypb.Empty) (*VersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Version not implemented") -} -func (UnimplementedVersionServer) mustEmbedUnimplementedVersionServer() {} - -// UnsafeVersionServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to VersionServer will -// result in compilation errors. -type UnsafeVersionServer interface { - mustEmbedUnimplementedVersionServer() -} - -func RegisterVersionServer(s grpc.ServiceRegistrar, srv VersionServer) { - s.RegisterService(&Version_ServiceDesc, srv) -} - -func _Version_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(emptypb.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VersionServer).Version(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/containerd.services.version.v1.Version/Version", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VersionServer).Version(ctx, req.(*emptypb.Empty)) - } - return interceptor(ctx, in, info, handler) -} - -// Version_ServiceDesc is the grpc.ServiceDesc for Version service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Version_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.services.version.v1.Version", - HandlerType: (*VersionServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Version", - Handler: _Version_Version_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/containerd/containerd/api/services/version/v1/version.proto", -} diff --git a/vendor/github.com/containerd/containerd/api/services/version/v1/version_ttrpc.pb.go b/vendor/github.com/containerd/containerd/api/services/version/v1/version_ttrpc.pb.go deleted file mode 100644 index c284f14e72..0000000000 --- a/vendor/github.com/containerd/containerd/api/services/version/v1/version_ttrpc.pb.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/containerd/api/services/version/v1/version.proto -package version - -import ( - context "context" - ttrpc "github.com/containerd/ttrpc" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -type TTRPCVersionService interface { - Version(context.Context, *emptypb.Empty) (*VersionResponse, error) -} - -func RegisterTTRPCVersionService(srv *ttrpc.Server, svc TTRPCVersionService) { - srv.RegisterService("containerd.services.version.v1.Version", &ttrpc.ServiceDesc{ - Methods: map[string]ttrpc.Method{ - "Version": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req emptypb.Empty - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Version(ctx, &req) - }, - }, - }) -} - -type ttrpcversionClient struct { - client *ttrpc.Client -} - -func NewTTRPCVersionClient(client *ttrpc.Client) TTRPCVersionService { - return &ttrpcversionClient{ - client: client, - } -} - -func (c *ttrpcversionClient) Version(ctx context.Context, req *emptypb.Empty) (*VersionResponse, error) { - var resp VersionResponse - if err := c.client.Call(ctx, "containerd.services.version.v1.Version", "Version", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} diff --git a/vendor/github.com/containerd/containerd/api/types/runc/options/doc.go b/vendor/github.com/containerd/containerd/api/types/runc/options/doc.go deleted file mode 100644 index ffff495cbf..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/runc/options/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package options diff --git a/vendor/github.com/containerd/containerd/api/types/runc/options/next.pb.txt b/vendor/github.com/containerd/containerd/api/types/runc/options/next.pb.txt deleted file mode 100644 index 6b5ce784b4..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/runc/options/next.pb.txt +++ /dev/null @@ -1,175 +0,0 @@ -file { - name: "github.com/containerd/containerd/core/runtime/v2/runc/options/oci.proto" - package: "containerd.runc.v1" - message_type { - name: "Options" - field { - name: "no_pivot_root" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "noPivotRoot" - } - field { - name: "no_new_keyring" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "noNewKeyring" - } - field { - name: "shim_cgroup" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "shimCgroup" - } - field { - name: "io_uid" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_UINT32 - json_name: "ioUid" - } - field { - name: "io_gid" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_UINT32 - json_name: "ioGid" - } - field { - name: "binary_name" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "binaryName" - } - field { - name: "root" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "root" - } - field { - name: "systemd_cgroup" - number: 9 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "systemdCgroup" - } - field { - name: "criu_image_path" - number: 10 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "criuImagePath" - } - field { - name: "criu_work_path" - number: 11 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "criuWorkPath" - } - field { - name: "task_api_address" - number: 12 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "taskApiAddress" - } - field { - name: "task_api_version" - number: 13 - label: LABEL_OPTIONAL - type: TYPE_UINT32 - json_name: "taskApiVersion" - } - reserved_range { - start: 8 - end: 9 - } - } - message_type { - name: "CheckpointOptions" - field { - name: "exit" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "exit" - } - field { - name: "open_tcp" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "openTcp" - } - field { - name: "external_unix_sockets" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "externalUnixSockets" - } - field { - name: "terminal" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "terminal" - } - field { - name: "file_locks" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "fileLocks" - } - field { - name: "empty_namespaces" - number: 6 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "emptyNamespaces" - } - field { - name: "cgroups_mode" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "cgroupsMode" - } - field { - name: "image_path" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "imagePath" - } - field { - name: "work_path" - number: 9 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "workPath" - } - } - message_type { - name: "ProcessDetails" - field { - name: "exec_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "execId" - } - } - options { - go_package: "github.com/containerd/containerd/v2/core/runtime/v2/runc/options;options" - } - syntax: "proto3" -} diff --git a/vendor/github.com/containerd/containerd/api/types/runc/options/oci.pb.go b/vendor/github.com/containerd/containerd/api/types/runc/options/oci.pb.go deleted file mode 100644 index aa55fc46fd..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/runc/options/oci.pb.go +++ /dev/null @@ -1,491 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/types/runc/options/oci.proto - -package options - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -type Options struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // disable pivot root when creating a container - NoPivotRoot bool `protobuf:"varint,1,opt,name=no_pivot_root,json=noPivotRoot,proto3" json:"no_pivot_root,omitempty"` - // create a new keyring for the container - NoNewKeyring bool `protobuf:"varint,2,opt,name=no_new_keyring,json=noNewKeyring,proto3" json:"no_new_keyring,omitempty"` - // place the shim in a cgroup - ShimCgroup string `protobuf:"bytes,3,opt,name=shim_cgroup,json=shimCgroup,proto3" json:"shim_cgroup,omitempty"` - // set the I/O's pipes uid - IoUid uint32 `protobuf:"varint,4,opt,name=io_uid,json=ioUid,proto3" json:"io_uid,omitempty"` - // set the I/O's pipes gid - IoGid uint32 `protobuf:"varint,5,opt,name=io_gid,json=ioGid,proto3" json:"io_gid,omitempty"` - // binary name of the runc binary - BinaryName string `protobuf:"bytes,6,opt,name=binary_name,json=binaryName,proto3" json:"binary_name,omitempty"` - // runc root directory - Root string `protobuf:"bytes,7,opt,name=root,proto3" json:"root,omitempty"` - // enable systemd cgroups - SystemdCgroup bool `protobuf:"varint,9,opt,name=systemd_cgroup,json=systemdCgroup,proto3" json:"systemd_cgroup,omitempty"` - // criu image path - CriuImagePath string `protobuf:"bytes,10,opt,name=criu_image_path,json=criuImagePath,proto3" json:"criu_image_path,omitempty"` - // criu work path - CriuWorkPath string `protobuf:"bytes,11,opt,name=criu_work_path,json=criuWorkPath,proto3" json:"criu_work_path,omitempty"` - // task api address, can be a unix domain socket, or vsock address. - // it is in the form of ttrpc+unix://path/to/uds or grpc+vsock://:. - TaskApiAddress string `protobuf:"bytes,12,opt,name=task_api_address,json=taskApiAddress,proto3" json:"task_api_address,omitempty"` - // task api version, currently supported value is 2 and 3. - TaskApiVersion uint32 `protobuf:"varint,13,opt,name=task_api_version,json=taskApiVersion,proto3" json:"task_api_version,omitempty"` -} - -func (x *Options) Reset() { - *x = Options{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_runc_options_oci_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Options) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Options) ProtoMessage() {} - -func (x *Options) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_runc_options_oci_proto_msgTypes[0] - 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 Options.ProtoReflect.Descriptor instead. -func (*Options) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_runc_options_oci_proto_rawDescGZIP(), []int{0} -} - -func (x *Options) GetNoPivotRoot() bool { - if x != nil { - return x.NoPivotRoot - } - return false -} - -func (x *Options) GetNoNewKeyring() bool { - if x != nil { - return x.NoNewKeyring - } - return false -} - -func (x *Options) GetShimCgroup() string { - if x != nil { - return x.ShimCgroup - } - return "" -} - -func (x *Options) GetIoUid() uint32 { - if x != nil { - return x.IoUid - } - return 0 -} - -func (x *Options) GetIoGid() uint32 { - if x != nil { - return x.IoGid - } - return 0 -} - -func (x *Options) GetBinaryName() string { - if x != nil { - return x.BinaryName - } - return "" -} - -func (x *Options) GetRoot() string { - if x != nil { - return x.Root - } - return "" -} - -func (x *Options) GetSystemdCgroup() bool { - if x != nil { - return x.SystemdCgroup - } - return false -} - -func (x *Options) GetCriuImagePath() string { - if x != nil { - return x.CriuImagePath - } - return "" -} - -func (x *Options) GetCriuWorkPath() string { - if x != nil { - return x.CriuWorkPath - } - return "" -} - -func (x *Options) GetTaskApiAddress() string { - if x != nil { - return x.TaskApiAddress - } - return "" -} - -func (x *Options) GetTaskApiVersion() uint32 { - if x != nil { - return x.TaskApiVersion - } - return 0 -} - -type CheckpointOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // exit the container after a checkpoint - Exit bool `protobuf:"varint,1,opt,name=exit,proto3" json:"exit,omitempty"` - // checkpoint open tcp connections - OpenTcp bool `protobuf:"varint,2,opt,name=open_tcp,json=openTcp,proto3" json:"open_tcp,omitempty"` - // checkpoint external unix sockets - ExternalUnixSockets bool `protobuf:"varint,3,opt,name=external_unix_sockets,json=externalUnixSockets,proto3" json:"external_unix_sockets,omitempty"` - // checkpoint terminals (ptys) - Terminal bool `protobuf:"varint,4,opt,name=terminal,proto3" json:"terminal,omitempty"` - // allow checkpointing of file locks - FileLocks bool `protobuf:"varint,5,opt,name=file_locks,json=fileLocks,proto3" json:"file_locks,omitempty"` - // restore provided namespaces as empty namespaces - EmptyNamespaces []string `protobuf:"bytes,6,rep,name=empty_namespaces,json=emptyNamespaces,proto3" json:"empty_namespaces,omitempty"` - // set the cgroups mode, soft, full, strict - CgroupsMode string `protobuf:"bytes,7,opt,name=cgroups_mode,json=cgroupsMode,proto3" json:"cgroups_mode,omitempty"` - // checkpoint image path - ImagePath string `protobuf:"bytes,8,opt,name=image_path,json=imagePath,proto3" json:"image_path,omitempty"` - // checkpoint work path - WorkPath string `protobuf:"bytes,9,opt,name=work_path,json=workPath,proto3" json:"work_path,omitempty"` -} - -func (x *CheckpointOptions) Reset() { - *x = CheckpointOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_runc_options_oci_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CheckpointOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckpointOptions) ProtoMessage() {} - -func (x *CheckpointOptions) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_runc_options_oci_proto_msgTypes[1] - 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 CheckpointOptions.ProtoReflect.Descriptor instead. -func (*CheckpointOptions) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_runc_options_oci_proto_rawDescGZIP(), []int{1} -} - -func (x *CheckpointOptions) GetExit() bool { - if x != nil { - return x.Exit - } - return false -} - -func (x *CheckpointOptions) GetOpenTcp() bool { - if x != nil { - return x.OpenTcp - } - return false -} - -func (x *CheckpointOptions) GetExternalUnixSockets() bool { - if x != nil { - return x.ExternalUnixSockets - } - return false -} - -func (x *CheckpointOptions) GetTerminal() bool { - if x != nil { - return x.Terminal - } - return false -} - -func (x *CheckpointOptions) GetFileLocks() bool { - if x != nil { - return x.FileLocks - } - return false -} - -func (x *CheckpointOptions) GetEmptyNamespaces() []string { - if x != nil { - return x.EmptyNamespaces - } - return nil -} - -func (x *CheckpointOptions) GetCgroupsMode() string { - if x != nil { - return x.CgroupsMode - } - return "" -} - -func (x *CheckpointOptions) GetImagePath() string { - if x != nil { - return x.ImagePath - } - return "" -} - -func (x *CheckpointOptions) GetWorkPath() string { - if x != nil { - return x.WorkPath - } - return "" -} - -type ProcessDetails struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // exec process id if the process is managed by a shim - ExecID string `protobuf:"bytes,1,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` -} - -func (x *ProcessDetails) Reset() { - *x = ProcessDetails{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_runc_options_oci_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProcessDetails) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProcessDetails) ProtoMessage() {} - -func (x *ProcessDetails) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_runc_options_oci_proto_msgTypes[2] - 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 ProcessDetails.ProtoReflect.Descriptor instead. -func (*ProcessDetails) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_runc_options_oci_proto_rawDescGZIP(), []int{2} -} - -func (x *ProcessDetails) GetExecID() string { - if x != nil { - return x.ExecID - } - return "" -} - -var File_github_com_containerd_containerd_api_types_runc_options_oci_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_types_runc_options_oci_proto_rawDesc = []byte{ - 0x0a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x72, 0x75, 0x6e, - 0x63, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6f, 0x63, 0x69, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, - 0x72, 0x75, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x22, 0xa6, 0x03, 0x0a, 0x07, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x6e, 0x6f, 0x5f, 0x70, 0x69, 0x76, 0x6f, 0x74, 0x5f, - 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x6e, 0x6f, 0x50, 0x69, - 0x76, 0x6f, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x6e, 0x6f, 0x5f, 0x6e, 0x65, - 0x77, 0x5f, 0x6b, 0x65, 0x79, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0c, 0x6e, 0x6f, 0x4e, 0x65, 0x77, 0x4b, 0x65, 0x79, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x1f, 0x0a, - 0x0b, 0x73, 0x68, 0x69, 0x6d, 0x5f, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x73, 0x68, 0x69, 0x6d, 0x43, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x15, - 0x0a, 0x06, 0x69, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x69, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x6f, 0x5f, 0x67, 0x69, 0x64, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6f, 0x47, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, - 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6f, - 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x64, 0x5f, 0x63, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x73, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x64, 0x43, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x72, 0x69, 0x75, - 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x63, 0x72, 0x69, 0x75, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x50, 0x61, 0x74, 0x68, - 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x72, 0x69, 0x75, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x70, 0x61, - 0x74, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x72, 0x69, 0x75, 0x57, 0x6f, - 0x72, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x61, - 0x70, 0x69, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0e, 0x74, 0x61, 0x73, 0x6b, 0x41, 0x70, 0x69, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x28, 0x0a, 0x10, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x74, 0x61, 0x73, 0x6b, - 0x41, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, - 0x22, 0xbb, 0x02, 0x0a, 0x11, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x78, 0x69, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x65, 0x78, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x70, - 0x65, 0x6e, 0x5f, 0x74, 0x63, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6f, 0x70, - 0x65, 0x6e, 0x54, 0x63, 0x70, 0x12, 0x32, 0x0a, 0x15, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x55, 0x6e, - 0x69, 0x78, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x74, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6c, 0x6f, - 0x63, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x4c, - 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, - 0x65, 0x6d, 0x70, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, - 0x21, 0x0a, 0x0c, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x4d, 0x6f, - 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x50, 0x61, 0x74, - 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x22, 0x29, - 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, - 0x12, 0x17, 0x0a, 0x07, 0x65, 0x78, 0x65, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x65, 0x78, 0x65, 0x63, 0x49, 0x64, 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x72, 0x75, 0x6e, 0x63, 0x2f, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_types_runc_options_oci_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_types_runc_options_oci_proto_rawDescData = file_github_com_containerd_containerd_api_types_runc_options_oci_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_types_runc_options_oci_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_types_runc_options_oci_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_types_runc_options_oci_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_types_runc_options_oci_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_types_runc_options_oci_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_types_runc_options_oci_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_github_com_containerd_containerd_api_types_runc_options_oci_proto_goTypes = []interface{}{ - (*Options)(nil), // 0: containerd.runc.v1.Options - (*CheckpointOptions)(nil), // 1: containerd.runc.v1.CheckpointOptions - (*ProcessDetails)(nil), // 2: containerd.runc.v1.ProcessDetails -} -var file_github_com_containerd_containerd_api_types_runc_options_oci_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 - 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_github_com_containerd_containerd_api_types_runc_options_oci_proto_init() } -func file_github_com_containerd_containerd_api_types_runc_options_oci_proto_init() { - if File_github_com_containerd_containerd_api_types_runc_options_oci_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_types_runc_options_oci_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Options); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_types_runc_options_oci_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckpointOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_types_runc_options_oci_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProcessDetails); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_types_runc_options_oci_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_containerd_containerd_api_types_runc_options_oci_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_types_runc_options_oci_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_types_runc_options_oci_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_types_runc_options_oci_proto = out.File - file_github_com_containerd_containerd_api_types_runc_options_oci_proto_rawDesc = nil - file_github_com_containerd_containerd_api_types_runc_options_oci_proto_goTypes = nil - file_github_com_containerd_containerd_api_types_runc_options_oci_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/types/runc/options/oci.proto b/vendor/github.com/containerd/containerd/api/types/runc/options/oci.proto deleted file mode 100644 index a30b5bbff8..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/runc/options/oci.proto +++ /dev/null @@ -1,63 +0,0 @@ -syntax = "proto3"; - -package containerd.runc.v1; - -option go_package = "github.com/containerd/containerd/api/types/runc/options;options"; - -message Options { - // disable pivot root when creating a container - bool no_pivot_root = 1; - // create a new keyring for the container - bool no_new_keyring = 2; - // place the shim in a cgroup - string shim_cgroup = 3; - // set the I/O's pipes uid - uint32 io_uid = 4; - // set the I/O's pipes gid - uint32 io_gid = 5; - // binary name of the runc binary - string binary_name = 6; - // runc root directory - string root = 7; - // criu binary path. - // - // Removed in containerd v2.0: string criu_path = 8; - reserved 8; - // enable systemd cgroups - bool systemd_cgroup = 9; - // criu image path - string criu_image_path = 10; - // criu work path - string criu_work_path = 11; - // task api address, can be a unix domain socket, or vsock address. - // it is in the form of ttrpc+unix://path/to/uds or grpc+vsock://:. - string task_api_address = 12; - // task api version, currently supported value is 2 and 3. - uint32 task_api_version = 13; -} - -message CheckpointOptions { - // exit the container after a checkpoint - bool exit = 1; - // checkpoint open tcp connections - bool open_tcp = 2; - // checkpoint external unix sockets - bool external_unix_sockets = 3; - // checkpoint terminals (ptys) - bool terminal = 4; - // allow checkpointing of file locks - bool file_locks = 5; - // restore provided namespaces as empty namespaces - repeated string empty_namespaces = 6; - // set the cgroups mode, soft, full, strict - string cgroups_mode = 7; - // checkpoint image path - string image_path = 8; - // checkpoint work path - string work_path = 9; -} - -message ProcessDetails { - // exec process id if the process is managed by a shim - string exec_id = 1; -} diff --git a/vendor/github.com/containerd/containerd/api/types/task/doc.go b/vendor/github.com/containerd/containerd/api/types/task/doc.go deleted file mode 100644 index e10c7a4699..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/task/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Package task defines the task service. -package task diff --git a/vendor/github.com/containerd/containerd/api/types/task/task.pb.go b/vendor/github.com/containerd/containerd/api/types/task/task.pb.go deleted file mode 100644 index 5c58d1ef18..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/task/task.pb.go +++ /dev/null @@ -1,406 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/types/task/task.proto - -package task - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -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) -) - -type Status int32 - -const ( - Status_UNKNOWN Status = 0 - Status_CREATED Status = 1 - Status_RUNNING Status = 2 - Status_STOPPED Status = 3 - Status_PAUSED Status = 4 - Status_PAUSING Status = 5 -) - -// Enum value maps for Status. -var ( - Status_name = map[int32]string{ - 0: "UNKNOWN", - 1: "CREATED", - 2: "RUNNING", - 3: "STOPPED", - 4: "PAUSED", - 5: "PAUSING", - } - Status_value = map[string]int32{ - "UNKNOWN": 0, - "CREATED": 1, - "RUNNING": 2, - "STOPPED": 3, - "PAUSED": 4, - "PAUSING": 5, - } -) - -func (x Status) Enum() *Status { - p := new(Status) - *p = x - return p -} - -func (x Status) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Status) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_containerd_containerd_api_types_task_task_proto_enumTypes[0].Descriptor() -} - -func (Status) Type() protoreflect.EnumType { - return &file_github_com_containerd_containerd_api_types_task_task_proto_enumTypes[0] -} - -func (x Status) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Status.Descriptor instead. -func (Status) EnumDescriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_task_task_proto_rawDescGZIP(), []int{0} -} - -type Process struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - Pid uint32 `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,omitempty"` - Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=containerd.v1.types.Status" json:"status,omitempty"` - Stdin string `protobuf:"bytes,5,opt,name=stdin,proto3" json:"stdin,omitempty"` - Stdout string `protobuf:"bytes,6,opt,name=stdout,proto3" json:"stdout,omitempty"` - Stderr string `protobuf:"bytes,7,opt,name=stderr,proto3" json:"stderr,omitempty"` - Terminal bool `protobuf:"varint,8,opt,name=terminal,proto3" json:"terminal,omitempty"` - ExitStatus uint32 `protobuf:"varint,9,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` - ExitedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=exited_at,json=exitedAt,proto3" json:"exited_at,omitempty"` -} - -func (x *Process) Reset() { - *x = Process{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_task_task_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Process) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Process) ProtoMessage() {} - -func (x *Process) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_task_task_proto_msgTypes[0] - 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 Process.ProtoReflect.Descriptor instead. -func (*Process) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_task_task_proto_rawDescGZIP(), []int{0} -} - -func (x *Process) GetContainerID() string { - if x != nil { - return x.ContainerID - } - return "" -} - -func (x *Process) GetID() string { - if x != nil { - return x.ID - } - return "" -} - -func (x *Process) GetPid() uint32 { - if x != nil { - return x.Pid - } - return 0 -} - -func (x *Process) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_UNKNOWN -} - -func (x *Process) GetStdin() string { - if x != nil { - return x.Stdin - } - return "" -} - -func (x *Process) GetStdout() string { - if x != nil { - return x.Stdout - } - return "" -} - -func (x *Process) GetStderr() string { - if x != nil { - return x.Stderr - } - return "" -} - -func (x *Process) GetTerminal() bool { - if x != nil { - return x.Terminal - } - return false -} - -func (x *Process) GetExitStatus() uint32 { - if x != nil { - return x.ExitStatus - } - return 0 -} - -func (x *Process) GetExitedAt() *timestamppb.Timestamp { - if x != nil { - return x.ExitedAt - } - return nil -} - -type ProcessInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // PID is the process ID. - Pid uint32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` - // Info contains additional process information. - // - // Info varies by platform. - Info *anypb.Any `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` -} - -func (x *ProcessInfo) Reset() { - *x = ProcessInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_task_task_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProcessInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProcessInfo) ProtoMessage() {} - -func (x *ProcessInfo) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_task_task_proto_msgTypes[1] - 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 ProcessInfo.ProtoReflect.Descriptor instead. -func (*ProcessInfo) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_task_task_proto_rawDescGZIP(), []int{1} -} - -func (x *ProcessInfo) GetPid() uint32 { - if x != nil { - return x.Pid - } - return 0 -} - -func (x *ProcessInfo) GetInfo() *anypb.Any { - if x != nil { - return x.Info - } - return nil -} - -var File_github_com_containerd_containerd_api_types_task_task_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_types_task_task_proto_rawDesc = []byte{ - 0x0a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x61, 0x73, - 0x6b, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x02, - 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, - 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x33, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x64, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x64, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x64, - 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x64, 0x6f, 0x75, - 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x74, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x65, 0x78, 0x69, 0x74, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x37, 0x0a, 0x09, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, - 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, - 0x49, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, - 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x70, 0x69, 0x64, - 0x12, 0x28, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x2a, 0x55, 0x0a, 0x06, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, - 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, - 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, - 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x41, 0x55, 0x53, - 0x45, 0x44, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x41, 0x55, 0x53, 0x49, 0x4e, 0x47, 0x10, - 0x05, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x74, 0x61, 0x73, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_types_task_task_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_types_task_task_proto_rawDescData = file_github_com_containerd_containerd_api_types_task_task_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_types_task_task_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_types_task_task_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_types_task_task_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_types_task_task_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_types_task_task_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_types_task_task_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_github_com_containerd_containerd_api_types_task_task_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_github_com_containerd_containerd_api_types_task_task_proto_goTypes = []interface{}{ - (Status)(0), // 0: containerd.v1.types.Status - (*Process)(nil), // 1: containerd.v1.types.Process - (*ProcessInfo)(nil), // 2: containerd.v1.types.ProcessInfo - (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp - (*anypb.Any)(nil), // 4: google.protobuf.Any -} -var file_github_com_containerd_containerd_api_types_task_task_proto_depIdxs = []int32{ - 0, // 0: containerd.v1.types.Process.status:type_name -> containerd.v1.types.Status - 3, // 1: containerd.v1.types.Process.exited_at:type_name -> google.protobuf.Timestamp - 4, // 2: containerd.v1.types.ProcessInfo.info:type_name -> google.protobuf.Any - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_types_task_task_proto_init() } -func file_github_com_containerd_containerd_api_types_task_task_proto_init() { - if File_github_com_containerd_containerd_api_types_task_task_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_types_task_task_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Process); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_types_task_task_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProcessInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_types_task_task_proto_rawDesc, - NumEnums: 1, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_containerd_containerd_api_types_task_task_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_types_task_task_proto_depIdxs, - EnumInfos: file_github_com_containerd_containerd_api_types_task_task_proto_enumTypes, - MessageInfos: file_github_com_containerd_containerd_api_types_task_task_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_types_task_task_proto = out.File - file_github_com_containerd_containerd_api_types_task_task_proto_rawDesc = nil - file_github_com_containerd_containerd_api_types_task_task_proto_goTypes = nil - file_github_com_containerd_containerd_api_types_task_task_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/types/task/task.proto b/vendor/github.com/containerd/containerd/api/types/task/task.proto deleted file mode 100644 index afc8e94bb4..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/task/task.proto +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.v1.types; - -import "google/protobuf/timestamp.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/containerd/containerd/api/types/task"; - -enum Status { - UNKNOWN = 0; - CREATED = 1; - RUNNING = 2; - STOPPED = 3; - PAUSED = 4; - PAUSING = 5; -} - -message Process { - string container_id = 1; - string id = 2; - uint32 pid = 3; - Status status = 4; - string stdin = 5; - string stdout = 6; - string stderr = 7; - bool terminal = 8; - uint32 exit_status = 9; - google.protobuf.Timestamp exited_at = 10; -} - -message ProcessInfo { - // PID is the process ID. - uint32 pid = 1; - // Info contains additional process information. - // - // Info varies by platform. - google.protobuf.Any info = 2; -} diff --git a/vendor/github.com/containerd/containerd/api/types/transfer/doc.go b/vendor/github.com/containerd/containerd/api/types/transfer/doc.go deleted file mode 100644 index 82f94c2f15..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/transfer/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Package transfer defines the transfer types. -package transfer diff --git a/vendor/github.com/containerd/containerd/api/types/transfer/imagestore.pb.go b/vendor/github.com/containerd/containerd/api/types/transfer/imagestore.pb.go deleted file mode 100644 index b3c9830411..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/transfer/imagestore.pb.go +++ /dev/null @@ -1,451 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/types/transfer/imagestore.proto - -package transfer - -import ( - types "github.com/containerd/containerd/api/types" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -type ImageStore struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Platforms []*types.Platform `protobuf:"bytes,3,rep,name=platforms,proto3" json:"platforms,omitempty"` - AllMetadata bool `protobuf:"varint,4,opt,name=all_metadata,json=allMetadata,proto3" json:"all_metadata,omitempty"` - ManifestLimit uint32 `protobuf:"varint,5,opt,name=manifest_limit,json=manifestLimit,proto3" json:"manifest_limit,omitempty"` - // extra_references are used to set image names on imports of sub-images from the index - ExtraReferences []*ImageReference `protobuf:"bytes,6,rep,name=extra_references,json=extraReferences,proto3" json:"extra_references,omitempty"` - Unpacks []*UnpackConfiguration `protobuf:"bytes,10,rep,name=unpacks,proto3" json:"unpacks,omitempty"` -} - -func (x *ImageStore) Reset() { - *x = ImageStore{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ImageStore) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ImageStore) ProtoMessage() {} - -func (x *ImageStore) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_msgTypes[0] - 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 ImageStore.ProtoReflect.Descriptor instead. -func (*ImageStore) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_rawDescGZIP(), []int{0} -} - -func (x *ImageStore) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ImageStore) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -func (x *ImageStore) GetPlatforms() []*types.Platform { - if x != nil { - return x.Platforms - } - return nil -} - -func (x *ImageStore) GetAllMetadata() bool { - if x != nil { - return x.AllMetadata - } - return false -} - -func (x *ImageStore) GetManifestLimit() uint32 { - if x != nil { - return x.ManifestLimit - } - return 0 -} - -func (x *ImageStore) GetExtraReferences() []*ImageReference { - if x != nil { - return x.ExtraReferences - } - return nil -} - -func (x *ImageStore) GetUnpacks() []*UnpackConfiguration { - if x != nil { - return x.Unpacks - } - return nil -} - -type UnpackConfiguration struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // platform is the platform to unpack for, used for resolving manifest and snapshotter - // if not provided - Platform *types.Platform `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` - // snapshotter to unpack to, if not provided default for platform shoudl be used - Snapshotter string `protobuf:"bytes,2,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` -} - -func (x *UnpackConfiguration) Reset() { - *x = UnpackConfiguration{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UnpackConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UnpackConfiguration) ProtoMessage() {} - -func (x *UnpackConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_msgTypes[1] - 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 UnpackConfiguration.ProtoReflect.Descriptor instead. -func (*UnpackConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_rawDescGZIP(), []int{1} -} - -func (x *UnpackConfiguration) GetPlatform() *types.Platform { - if x != nil { - return x.Platform - } - return nil -} - -func (x *UnpackConfiguration) GetSnapshotter() string { - if x != nil { - return x.Snapshotter - } - return "" -} - -// ImageReference is used to create or find a reference for an image -type ImageReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // is_prefix determines whether the Name should be considered - // a prefix (without tag or digest). - // For lookup, this may allow matching multiple tags. - // For store, this must have a tag or digest added. - IsPrefix bool `protobuf:"varint,2,opt,name=is_prefix,json=isPrefix,proto3" json:"is_prefix,omitempty"` - // allow_overwrite allows overwriting or ignoring the name if - // another reference is provided (such as through an annotation). - // Only used if IsPrefix is true. - AllowOverwrite bool `protobuf:"varint,3,opt,name=allow_overwrite,json=allowOverwrite,proto3" json:"allow_overwrite,omitempty"` - // add_digest adds the manifest digest to the reference. - // For lookup, this allows matching tags with any digest. - // For store, this allows adding the digest to the name. - // Only used if IsPrefix is true. - AddDigest bool `protobuf:"varint,4,opt,name=add_digest,json=addDigest,proto3" json:"add_digest,omitempty"` - // skip_named_digest only considers digest references which do not - // have a non-digested named reference. - // For lookup, this will deduplicate digest references when there is a named match. - // For store, this only adds this digest reference when there is no matching full - // name reference from the prefix. - // Only used if IsPrefix is true. - SkipNamedDigest bool `protobuf:"varint,5,opt,name=skip_named_digest,json=skipNamedDigest,proto3" json:"skip_named_digest,omitempty"` -} - -func (x *ImageReference) Reset() { - *x = ImageReference{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ImageReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ImageReference) ProtoMessage() {} - -func (x *ImageReference) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_msgTypes[2] - 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 ImageReference.ProtoReflect.Descriptor instead. -func (*ImageReference) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_rawDescGZIP(), []int{2} -} - -func (x *ImageReference) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ImageReference) GetIsPrefix() bool { - if x != nil { - return x.IsPrefix - } - return false -} - -func (x *ImageReference) GetAllowOverwrite() bool { - if x != nil { - return x.AllowOverwrite - } - return false -} - -func (x *ImageReference) GetAddDigest() bool { - if x != nil { - return x.AddDigest - } - return false -} - -func (x *ImageReference) GetSkipNamedDigest() bool { - if x != nil { - return x.SkipNamedDigest - } - return false -} - -var File_github_com_containerd_containerd_api_types_transfer_imagestore_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_rawDesc = []byte{ - 0x0a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, - 0x72, 0x1a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x6c, - 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xca, 0x03, 0x0a, - 0x0a, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x49, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2e, 0x49, 0x6d, 0x61, 0x67, - 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x70, 0x6c, - 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x09, 0x70, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x6c, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x61, 0x6c, 0x6c, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x6e, 0x69, 0x66, - 0x65, 0x73, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x0d, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x54, - 0x0a, 0x10, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x66, 0x65, 0x72, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x52, 0x0f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x07, 0x75, 0x6e, 0x70, 0x61, 0x63, 0x6b, 0x73, 0x18, - 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, - 0x72, 0x2e, 0x55, 0x6e, 0x70, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x75, 0x6e, 0x70, 0x61, 0x63, 0x6b, 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, 0x22, 0x6f, 0x0a, 0x13, 0x55, 0x6e, 0x70, - 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x36, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x08, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x22, 0xb5, 0x01, 0x0a, 0x0e, 0x49, - 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x27, - 0x0a, 0x0f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x4f, 0x76, - 0x65, 0x72, 0x77, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x64, 0x64, 0x5f, 0x64, - 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x64, 0x64, - 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x64, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0f, 0x73, 0x6b, 0x69, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x44, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_rawDescData = file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_goTypes = []interface{}{ - (*ImageStore)(nil), // 0: containerd.types.transfer.ImageStore - (*UnpackConfiguration)(nil), // 1: containerd.types.transfer.UnpackConfiguration - (*ImageReference)(nil), // 2: containerd.types.transfer.ImageReference - nil, // 3: containerd.types.transfer.ImageStore.LabelsEntry - (*types.Platform)(nil), // 4: containerd.types.Platform -} -var file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_depIdxs = []int32{ - 3, // 0: containerd.types.transfer.ImageStore.labels:type_name -> containerd.types.transfer.ImageStore.LabelsEntry - 4, // 1: containerd.types.transfer.ImageStore.platforms:type_name -> containerd.types.Platform - 2, // 2: containerd.types.transfer.ImageStore.extra_references:type_name -> containerd.types.transfer.ImageReference - 1, // 3: containerd.types.transfer.ImageStore.unpacks:type_name -> containerd.types.transfer.UnpackConfiguration - 4, // 4: containerd.types.transfer.UnpackConfiguration.platform:type_name -> containerd.types.Platform - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_init() } -func file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_init() { - if File_github_com_containerd_containerd_api_types_transfer_imagestore_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImageStore); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnpackConfiguration); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImageReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_types_transfer_imagestore_proto = out.File - file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_rawDesc = nil - file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_goTypes = nil - file_github_com_containerd_containerd_api_types_transfer_imagestore_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/types/transfer/imagestore.proto b/vendor/github.com/containerd/containerd/api/types/transfer/imagestore.proto deleted file mode 100644 index 57ac2ebde5..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/transfer/imagestore.proto +++ /dev/null @@ -1,82 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.types.transfer; - -import "github.com/containerd/containerd/api/types/platform.proto"; - -option go_package = "github.com/containerd/containerd/api/types/transfer"; - -message ImageStore { - string name = 1; - map labels = 2; - - // Content filters - - repeated types.Platform platforms = 3; - bool all_metadata = 4; - uint32 manifest_limit = 5; - - // Import naming - - // extra_references are used to set image names on imports of sub-images from the index - repeated ImageReference extra_references = 6; - - // Unpack Configuration, multiple allowed - - repeated UnpackConfiguration unpacks = 10; -} - -message UnpackConfiguration { - // platform is the platform to unpack for, used for resolving manifest and snapshotter - // if not provided - types.Platform platform = 1; - - // snapshotter to unpack to, if not provided default for platform shoudl be used - string snapshotter = 2; -} - -// ImageReference is used to create or find a reference for an image -message ImageReference { - string name = 1; - - // is_prefix determines whether the Name should be considered - // a prefix (without tag or digest). - // For lookup, this may allow matching multiple tags. - // For store, this must have a tag or digest added. - bool is_prefix = 2; - - // allow_overwrite allows overwriting or ignoring the name if - // another reference is provided (such as through an annotation). - // Only used if IsPrefix is true. - bool allow_overwrite = 3; - - // add_digest adds the manifest digest to the reference. - // For lookup, this allows matching tags with any digest. - // For store, this allows adding the digest to the name. - // Only used if IsPrefix is true. - bool add_digest = 4; - - // skip_named_digest only considers digest references which do not - // have a non-digested named reference. - // For lookup, this will deduplicate digest references when there is a named match. - // For store, this only adds this digest reference when there is no matching full - // name reference from the prefix. - // Only used if IsPrefix is true. - bool skip_named_digest = 5; -} diff --git a/vendor/github.com/containerd/containerd/api/types/transfer/importexport.pb.go b/vendor/github.com/containerd/containerd/api/types/transfer/importexport.pb.go deleted file mode 100644 index a2a48ac152..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/transfer/importexport.pb.go +++ /dev/null @@ -1,320 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/types/transfer/importexport.proto - -package transfer - -import ( - types "github.com/containerd/containerd/api/types" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -type ImageImportStream struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Stream is used to identify the binary input stream for the import operation. - // The stream uses the transfer binary stream protocol with the client as the sender. - // The binary data is expected to be a raw tar stream. - Stream string `protobuf:"bytes,1,opt,name=stream,proto3" json:"stream,omitempty"` - MediaType string `protobuf:"bytes,2,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"` - ForceCompress bool `protobuf:"varint,3,opt,name=force_compress,json=forceCompress,proto3" json:"force_compress,omitempty"` -} - -func (x *ImageImportStream) Reset() { - *x = ImageImportStream{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_transfer_importexport_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ImageImportStream) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ImageImportStream) ProtoMessage() {} - -func (x *ImageImportStream) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_transfer_importexport_proto_msgTypes[0] - 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 ImageImportStream.ProtoReflect.Descriptor instead. -func (*ImageImportStream) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_transfer_importexport_proto_rawDescGZIP(), []int{0} -} - -func (x *ImageImportStream) GetStream() string { - if x != nil { - return x.Stream - } - return "" -} - -func (x *ImageImportStream) GetMediaType() string { - if x != nil { - return x.MediaType - } - return "" -} - -func (x *ImageImportStream) GetForceCompress() bool { - if x != nil { - return x.ForceCompress - } - return false -} - -type ImageExportStream struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Stream is used to identify the binary output stream for the export operation. - // The stream uses the transfer binary stream protocol with the server as the sender. - // The binary data is expected to be a raw tar stream. - Stream string `protobuf:"bytes,1,opt,name=stream,proto3" json:"stream,omitempty"` - MediaType string `protobuf:"bytes,2,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"` - // The specified platforms - Platforms []*types.Platform `protobuf:"bytes,3,rep,name=platforms,proto3" json:"platforms,omitempty"` - // Whether to include all platforms - AllPlatforms bool `protobuf:"varint,4,opt,name=all_platforms,json=allPlatforms,proto3" json:"all_platforms,omitempty"` - // Skips the creation of the Docker compatible manifest.json file - SkipCompatibilityManifest bool `protobuf:"varint,5,opt,name=skip_compatibility_manifest,json=skipCompatibilityManifest,proto3" json:"skip_compatibility_manifest,omitempty"` - // Excludes non-distributable blobs such as Windows base layers. - SkipNonDistributable bool `protobuf:"varint,6,opt,name=skip_non_distributable,json=skipNonDistributable,proto3" json:"skip_non_distributable,omitempty"` -} - -func (x *ImageExportStream) Reset() { - *x = ImageExportStream{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_transfer_importexport_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ImageExportStream) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ImageExportStream) ProtoMessage() {} - -func (x *ImageExportStream) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_transfer_importexport_proto_msgTypes[1] - 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 ImageExportStream.ProtoReflect.Descriptor instead. -func (*ImageExportStream) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_transfer_importexport_proto_rawDescGZIP(), []int{1} -} - -func (x *ImageExportStream) GetStream() string { - if x != nil { - return x.Stream - } - return "" -} - -func (x *ImageExportStream) GetMediaType() string { - if x != nil { - return x.MediaType - } - return "" -} - -func (x *ImageExportStream) GetPlatforms() []*types.Platform { - if x != nil { - return x.Platforms - } - return nil -} - -func (x *ImageExportStream) GetAllPlatforms() bool { - if x != nil { - return x.AllPlatforms - } - return false -} - -func (x *ImageExportStream) GetSkipCompatibilityManifest() bool { - if x != nil { - return x.SkipCompatibilityManifest - } - return false -} - -func (x *ImageExportStream) GetSkipNonDistributable() bool { - if x != nil { - return x.SkipNonDistributable - } - return false -} - -var File_github_com_containerd_containerd_api_types_transfer_importexport_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_types_transfer_importexport_proto_rawDesc = []byte{ - 0x0a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x66, 0x65, 0x72, 0x1a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x71, - 0x0a, 0x11, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, - 0x65, 0x64, 0x69, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x6f, - 0x72, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0d, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, - 0x73, 0x22, 0x9f, 0x02, 0x0a, 0x11, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x45, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, - 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x38, - 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x09, 0x70, - 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x6c, 0x6c, 0x5f, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0c, 0x61, 0x6c, 0x6c, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x12, 0x3e, 0x0a, - 0x1b, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x79, 0x5f, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x19, 0x73, 0x6b, 0x69, 0x70, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x12, 0x34, 0x0a, - 0x16, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x73, - 0x6b, 0x69, 0x70, 0x4e, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x61, - 0x62, 0x6c, 0x65, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_types_transfer_importexport_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_types_transfer_importexport_proto_rawDescData = file_github_com_containerd_containerd_api_types_transfer_importexport_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_types_transfer_importexport_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_types_transfer_importexport_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_types_transfer_importexport_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_types_transfer_importexport_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_types_transfer_importexport_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_types_transfer_importexport_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_github_com_containerd_containerd_api_types_transfer_importexport_proto_goTypes = []interface{}{ - (*ImageImportStream)(nil), // 0: containerd.types.transfer.ImageImportStream - (*ImageExportStream)(nil), // 1: containerd.types.transfer.ImageExportStream - (*types.Platform)(nil), // 2: containerd.types.Platform -} -var file_github_com_containerd_containerd_api_types_transfer_importexport_proto_depIdxs = []int32{ - 2, // 0: containerd.types.transfer.ImageExportStream.platforms:type_name -> containerd.types.Platform - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_types_transfer_importexport_proto_init() } -func file_github_com_containerd_containerd_api_types_transfer_importexport_proto_init() { - if File_github_com_containerd_containerd_api_types_transfer_importexport_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_types_transfer_importexport_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImageImportStream); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_types_transfer_importexport_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImageExportStream); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_types_transfer_importexport_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_containerd_containerd_api_types_transfer_importexport_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_types_transfer_importexport_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_types_transfer_importexport_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_types_transfer_importexport_proto = out.File - file_github_com_containerd_containerd_api_types_transfer_importexport_proto_rawDesc = nil - file_github_com_containerd_containerd_api_types_transfer_importexport_proto_goTypes = nil - file_github_com_containerd_containerd_api_types_transfer_importexport_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/types/transfer/importexport.proto b/vendor/github.com/containerd/containerd/api/types/transfer/importexport.proto deleted file mode 100644 index c18bae1c64..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/transfer/importexport.proto +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.types.transfer; - -option go_package = "github.com/containerd/containerd/api/types/transfer"; - -import "github.com/containerd/containerd/api/types/platform.proto"; - -message ImageImportStream { - // Stream is used to identify the binary input stream for the import operation. - // The stream uses the transfer binary stream protocol with the client as the sender. - // The binary data is expected to be a raw tar stream. - string stream = 1; - - string media_type = 2; - - bool force_compress = 3; -} - -message ImageExportStream { - // Stream is used to identify the binary output stream for the export operation. - // The stream uses the transfer binary stream protocol with the server as the sender. - // The binary data is expected to be a raw tar stream. - string stream = 1; - - string media_type = 2; - - // The specified platforms - repeated types.Platform platforms = 3; - // Whether to include all platforms - bool all_platforms = 4; - // Skips the creation of the Docker compatible manifest.json file - bool skip_compatibility_manifest = 5; - // Excludes non-distributable blobs such as Windows base layers. - bool skip_non_distributable = 6; -} diff --git a/vendor/github.com/containerd/containerd/api/types/transfer/progress.pb.go b/vendor/github.com/containerd/containerd/api/types/transfer/progress.pb.go deleted file mode 100644 index d1fb1625df..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/transfer/progress.pb.go +++ /dev/null @@ -1,219 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/types/transfer/progress.proto - -package transfer - -import ( - types "github.com/containerd/containerd/api/types" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -type Progress struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Event string `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Parents []string `protobuf:"bytes,3,rep,name=parents,proto3" json:"parents,omitempty"` - Progress int64 `protobuf:"varint,4,opt,name=progress,proto3" json:"progress,omitempty"` - Total int64 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"` - Desc *types.Descriptor `protobuf:"bytes,6,opt,name=desc,proto3" json:"desc,omitempty"` -} - -func (x *Progress) Reset() { - *x = Progress{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_transfer_progress_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Progress) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Progress) ProtoMessage() {} - -func (x *Progress) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_transfer_progress_proto_msgTypes[0] - 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 Progress.ProtoReflect.Descriptor instead. -func (*Progress) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_transfer_progress_proto_rawDescGZIP(), []int{0} -} - -func (x *Progress) GetEvent() string { - if x != nil { - return x.Event - } - return "" -} - -func (x *Progress) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Progress) GetParents() []string { - if x != nil { - return x.Parents - } - return nil -} - -func (x *Progress) GetProgress() int64 { - if x != nil { - return x.Progress - } - return 0 -} - -func (x *Progress) GetTotal() int64 { - if x != nil { - return x.Total - } - return 0 -} - -func (x *Progress) GetDesc() *types.Descriptor { - if x != nil { - return x.Desc - } - return nil -} - -var File_github_com_containerd_containerd_api_types_transfer_progress_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_types_transfer_progress_proto_rawDesc = []byte{ - 0x0a, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x1a, - 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb2, 0x01, 0x0a, - 0x08, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1a, 0x0a, - 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, - 0x30, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x04, 0x64, 0x65, 0x73, - 0x63, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_types_transfer_progress_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_types_transfer_progress_proto_rawDescData = file_github_com_containerd_containerd_api_types_transfer_progress_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_types_transfer_progress_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_types_transfer_progress_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_types_transfer_progress_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_types_transfer_progress_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_types_transfer_progress_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_types_transfer_progress_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_github_com_containerd_containerd_api_types_transfer_progress_proto_goTypes = []interface{}{ - (*Progress)(nil), // 0: containerd.types.transfer.Progress - (*types.Descriptor)(nil), // 1: containerd.types.Descriptor -} -var file_github_com_containerd_containerd_api_types_transfer_progress_proto_depIdxs = []int32{ - 1, // 0: containerd.types.transfer.Progress.desc:type_name -> containerd.types.Descriptor - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_types_transfer_progress_proto_init() } -func file_github_com_containerd_containerd_api_types_transfer_progress_proto_init() { - if File_github_com_containerd_containerd_api_types_transfer_progress_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_types_transfer_progress_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Progress); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_types_transfer_progress_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_containerd_containerd_api_types_transfer_progress_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_types_transfer_progress_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_types_transfer_progress_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_types_transfer_progress_proto = out.File - file_github_com_containerd_containerd_api_types_transfer_progress_proto_rawDesc = nil - file_github_com_containerd_containerd_api_types_transfer_progress_proto_goTypes = nil - file_github_com_containerd_containerd_api_types_transfer_progress_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/types/transfer/progress.proto b/vendor/github.com/containerd/containerd/api/types/transfer/progress.proto deleted file mode 100644 index 094c363b21..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/transfer/progress.proto +++ /dev/null @@ -1,32 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.types.transfer; - -import "github.com/containerd/containerd/api/types/descriptor.proto"; - -option go_package = "github.com/containerd/containerd/api/types/transfer"; - -message Progress { - string event = 1; - string name = 2; - repeated string parents = 3; - int64 progress = 4; - int64 total = 5; - containerd.types.Descriptor desc = 6; -} diff --git a/vendor/github.com/containerd/containerd/api/types/transfer/registry.pb.go b/vendor/github.com/containerd/containerd/api/types/transfer/registry.pb.go deleted file mode 100644 index 459b0ffecc..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/transfer/registry.pb.go +++ /dev/null @@ -1,624 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/types/transfer/registry.proto - -package transfer - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -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) -) - -type HTTPDebug int32 - -const ( - HTTPDebug_DISABLED HTTPDebug = 0 - // Enable HTTP debugging - HTTPDebug_DEBUG HTTPDebug = 1 - // Enable HTTP requests tracing - HTTPDebug_TRACE HTTPDebug = 2 - // Enable both HTTP debugging and requests tracing - HTTPDebug_BOTH HTTPDebug = 3 -) - -// Enum value maps for HTTPDebug. -var ( - HTTPDebug_name = map[int32]string{ - 0: "DISABLED", - 1: "DEBUG", - 2: "TRACE", - 3: "BOTH", - } - HTTPDebug_value = map[string]int32{ - "DISABLED": 0, - "DEBUG": 1, - "TRACE": 2, - "BOTH": 3, - } -) - -func (x HTTPDebug) Enum() *HTTPDebug { - p := new(HTTPDebug) - *p = x - return p -} - -func (x HTTPDebug) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (HTTPDebug) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_containerd_containerd_api_types_transfer_registry_proto_enumTypes[0].Descriptor() -} - -func (HTTPDebug) Type() protoreflect.EnumType { - return &file_github_com_containerd_containerd_api_types_transfer_registry_proto_enumTypes[0] -} - -func (x HTTPDebug) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use HTTPDebug.Descriptor instead. -func (HTTPDebug) EnumDescriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDescGZIP(), []int{0} -} - -type AuthType int32 - -const ( - AuthType_NONE AuthType = 0 - // CREDENTIALS is used to exchange username/password for access token - // using an oauth or "Docker Registry Token" server - AuthType_CREDENTIALS AuthType = 1 - // REFRESH is used to exchange secret for access token using an oauth - // or "Docker Registry Token" server - AuthType_REFRESH AuthType = 2 - // HEADER is used to set the HTTP Authorization header to secret - // directly for the registry. - // Value should be ` ` - AuthType_HEADER AuthType = 3 -) - -// Enum value maps for AuthType. -var ( - AuthType_name = map[int32]string{ - 0: "NONE", - 1: "CREDENTIALS", - 2: "REFRESH", - 3: "HEADER", - } - AuthType_value = map[string]int32{ - "NONE": 0, - "CREDENTIALS": 1, - "REFRESH": 2, - "HEADER": 3, - } -) - -func (x AuthType) Enum() *AuthType { - p := new(AuthType) - *p = x - return p -} - -func (x AuthType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AuthType) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_containerd_containerd_api_types_transfer_registry_proto_enumTypes[1].Descriptor() -} - -func (AuthType) Type() protoreflect.EnumType { - return &file_github_com_containerd_containerd_api_types_transfer_registry_proto_enumTypes[1] -} - -func (x AuthType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AuthType.Descriptor instead. -func (AuthType) EnumDescriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDescGZIP(), []int{1} -} - -type OCIRegistry struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Reference string `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"` - Resolver *RegistryResolver `protobuf:"bytes,2,opt,name=resolver,proto3" json:"resolver,omitempty"` -} - -func (x *OCIRegistry) Reset() { - *x = OCIRegistry{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_transfer_registry_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OCIRegistry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OCIRegistry) ProtoMessage() {} - -func (x *OCIRegistry) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_transfer_registry_proto_msgTypes[0] - 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 OCIRegistry.ProtoReflect.Descriptor instead. -func (*OCIRegistry) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDescGZIP(), []int{0} -} - -func (x *OCIRegistry) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -func (x *OCIRegistry) GetResolver() *RegistryResolver { - if x != nil { - return x.Resolver - } - return nil -} - -type RegistryResolver struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // auth_stream is used to refer to a stream which auth callbacks may be - // made on. - AuthStream string `protobuf:"bytes,1,opt,name=auth_stream,json=authStream,proto3" json:"auth_stream,omitempty"` - // Headers - Headers map[string]string `protobuf:"bytes,2,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - HostDir string `protobuf:"bytes,3,opt,name=host_dir,json=hostDir,proto3" json:"host_dir,omitempty"` - DefaultScheme string `protobuf:"bytes,4,opt,name=default_scheme,json=defaultScheme,proto3" json:"default_scheme,omitempty"` - // Whether to debug/trace HTTP requests to OCI registry. - HttpDebug HTTPDebug `protobuf:"varint,5,opt,name=http_debug,json=httpDebug,proto3,enum=containerd.types.transfer.HTTPDebug" json:"http_debug,omitempty"` - // Stream ID to use for HTTP logs (when logs are streamed to client). - // When empty, logs are written to containerd logs. - LogsStream string `protobuf:"bytes,6,opt,name=logs_stream,json=logsStream,proto3" json:"logs_stream,omitempty"` -} - -func (x *RegistryResolver) Reset() { - *x = RegistryResolver{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_transfer_registry_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegistryResolver) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegistryResolver) ProtoMessage() {} - -func (x *RegistryResolver) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_transfer_registry_proto_msgTypes[1] - 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 RegistryResolver.ProtoReflect.Descriptor instead. -func (*RegistryResolver) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDescGZIP(), []int{1} -} - -func (x *RegistryResolver) GetAuthStream() string { - if x != nil { - return x.AuthStream - } - return "" -} - -func (x *RegistryResolver) GetHeaders() map[string]string { - if x != nil { - return x.Headers - } - return nil -} - -func (x *RegistryResolver) GetHostDir() string { - if x != nil { - return x.HostDir - } - return "" -} - -func (x *RegistryResolver) GetDefaultScheme() string { - if x != nil { - return x.DefaultScheme - } - return "" -} - -func (x *RegistryResolver) GetHttpDebug() HTTPDebug { - if x != nil { - return x.HttpDebug - } - return HTTPDebug_DISABLED -} - -func (x *RegistryResolver) GetLogsStream() string { - if x != nil { - return x.LogsStream - } - return "" -} - -// AuthRequest is sent as a callback on a stream -type AuthRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // host is the registry host - Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` - // reference is the namespace and repository name requested from the registry - Reference string `protobuf:"bytes,2,opt,name=reference,proto3" json:"reference,omitempty"` - // wwwauthenticate is the HTTP WWW-Authenticate header values returned from the registry - Wwwauthenticate []string `protobuf:"bytes,3,rep,name=wwwauthenticate,proto3" json:"wwwauthenticate,omitempty"` -} - -func (x *AuthRequest) Reset() { - *x = AuthRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_transfer_registry_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AuthRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthRequest) ProtoMessage() {} - -func (x *AuthRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_transfer_registry_proto_msgTypes[2] - 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 AuthRequest.ProtoReflect.Descriptor instead. -func (*AuthRequest) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDescGZIP(), []int{2} -} - -func (x *AuthRequest) GetHost() string { - if x != nil { - return x.Host - } - return "" -} - -func (x *AuthRequest) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -func (x *AuthRequest) GetWwwauthenticate() []string { - if x != nil { - return x.Wwwauthenticate - } - return nil -} - -type AuthResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AuthType AuthType `protobuf:"varint,1,opt,name=authType,proto3,enum=containerd.types.transfer.AuthType" json:"authType,omitempty"` - Secret string `protobuf:"bytes,2,opt,name=secret,proto3" json:"secret,omitempty"` - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - ExpireAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=expire_at,json=expireAt,proto3" json:"expire_at,omitempty"` // TODO: Stream error -} - -func (x *AuthResponse) Reset() { - *x = AuthResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_transfer_registry_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AuthResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthResponse) ProtoMessage() {} - -func (x *AuthResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_transfer_registry_proto_msgTypes[3] - 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 AuthResponse.ProtoReflect.Descriptor instead. -func (*AuthResponse) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDescGZIP(), []int{3} -} - -func (x *AuthResponse) GetAuthType() AuthType { - if x != nil { - return x.AuthType - } - return AuthType_NONE -} - -func (x *AuthResponse) GetSecret() string { - if x != nil { - return x.Secret - } - return "" -} - -func (x *AuthResponse) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AuthResponse) GetExpireAt() *timestamppb.Timestamp { - if x != nil { - return x.ExpireAt - } - return nil -} - -var File_github_com_containerd_containerd_api_types_transfer_registry_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDesc = []byte{ - 0x0a, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x1a, - 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x74, 0x0a, 0x0b, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, - 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x47, 0x0a, - 0x08, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x52, 0x08, 0x72, 0x65, - 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x22, 0xeb, 0x02, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x61, - 0x75, 0x74, 0x68, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x52, 0x0a, 0x07, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, - 0x12, 0x19, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x44, 0x69, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x63, 0x68, 0x65, - 0x6d, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x64, 0x65, 0x62, 0x75, 0x67, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, - 0x65, 0x72, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x44, 0x65, 0x62, 0x75, 0x67, 0x52, 0x09, 0x68, 0x74, - 0x74, 0x70, 0x44, 0x65, 0x62, 0x75, 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x6f, 0x67, 0x73, 0x5f, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x6f, - 0x67, 0x73, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x1a, 0x3a, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 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, 0x22, 0x69, 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x77, 0x77, 0x77, 0x61, 0x75, 0x74, 0x68, - 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, - 0x77, 0x77, 0x77, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, - 0xbc, 0x01, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x3f, 0x0a, 0x08, 0x61, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2e, 0x41, - 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x61, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, - 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, - 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x5f, - 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x41, 0x74, 0x2a, 0x39, - 0x0a, 0x09, 0x48, 0x54, 0x54, 0x50, 0x44, 0x65, 0x62, 0x75, 0x67, 0x12, 0x0c, 0x0a, 0x08, 0x44, - 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x45, 0x42, - 0x55, 0x47, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x54, 0x52, 0x41, 0x43, 0x45, 0x10, 0x02, 0x12, - 0x08, 0x0a, 0x04, 0x42, 0x4f, 0x54, 0x48, 0x10, 0x03, 0x2a, 0x3e, 0x0a, 0x08, 0x41, 0x75, 0x74, - 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, - 0x0f, 0x0a, 0x0b, 0x43, 0x52, 0x45, 0x44, 0x45, 0x4e, 0x54, 0x49, 0x41, 0x4c, 0x53, 0x10, 0x01, - 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x46, 0x52, 0x45, 0x53, 0x48, 0x10, 0x02, 0x12, 0x0a, 0x0a, - 0x06, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x10, 0x03, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDescData = file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_types_transfer_registry_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_github_com_containerd_containerd_api_types_transfer_registry_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_github_com_containerd_containerd_api_types_transfer_registry_proto_goTypes = []interface{}{ - (HTTPDebug)(0), // 0: containerd.types.transfer.HTTPDebug - (AuthType)(0), // 1: containerd.types.transfer.AuthType - (*OCIRegistry)(nil), // 2: containerd.types.transfer.OCIRegistry - (*RegistryResolver)(nil), // 3: containerd.types.transfer.RegistryResolver - (*AuthRequest)(nil), // 4: containerd.types.transfer.AuthRequest - (*AuthResponse)(nil), // 5: containerd.types.transfer.AuthResponse - nil, // 6: containerd.types.transfer.RegistryResolver.HeadersEntry - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp -} -var file_github_com_containerd_containerd_api_types_transfer_registry_proto_depIdxs = []int32{ - 3, // 0: containerd.types.transfer.OCIRegistry.resolver:type_name -> containerd.types.transfer.RegistryResolver - 6, // 1: containerd.types.transfer.RegistryResolver.headers:type_name -> containerd.types.transfer.RegistryResolver.HeadersEntry - 0, // 2: containerd.types.transfer.RegistryResolver.http_debug:type_name -> containerd.types.transfer.HTTPDebug - 1, // 3: containerd.types.transfer.AuthResponse.authType:type_name -> containerd.types.transfer.AuthType - 7, // 4: containerd.types.transfer.AuthResponse.expire_at:type_name -> google.protobuf.Timestamp - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_types_transfer_registry_proto_init() } -func file_github_com_containerd_containerd_api_types_transfer_registry_proto_init() { - if File_github_com_containerd_containerd_api_types_transfer_registry_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_types_transfer_registry_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OCIRegistry); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_types_transfer_registry_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegistryResolver); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_types_transfer_registry_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AuthRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_types_transfer_registry_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AuthResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDesc, - NumEnums: 2, - NumMessages: 5, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_containerd_containerd_api_types_transfer_registry_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_types_transfer_registry_proto_depIdxs, - EnumInfos: file_github_com_containerd_containerd_api_types_transfer_registry_proto_enumTypes, - MessageInfos: file_github_com_containerd_containerd_api_types_transfer_registry_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_types_transfer_registry_proto = out.File - file_github_com_containerd_containerd_api_types_transfer_registry_proto_rawDesc = nil - file_github_com_containerd_containerd_api_types_transfer_registry_proto_goTypes = nil - file_github_com_containerd_containerd_api_types_transfer_registry_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/types/transfer/registry.proto b/vendor/github.com/containerd/containerd/api/types/transfer/registry.proto deleted file mode 100644 index 88248fd56f..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/transfer/registry.proto +++ /dev/null @@ -1,97 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.types.transfer; - -import "google/protobuf/timestamp.proto"; - -option go_package = "github.com/containerd/containerd/api/types/transfer"; - -message OCIRegistry { - string reference = 1; - RegistryResolver resolver = 2; -} - -enum HTTPDebug { - DISABLED = 0; - // Enable HTTP debugging - DEBUG = 1; - // Enable HTTP requests tracing - TRACE = 2; - // Enable both HTTP debugging and requests tracing - BOTH = 3; -} - -message RegistryResolver { - // auth_stream is used to refer to a stream which auth callbacks may be - // made on. - string auth_stream = 1; - - // Headers - map headers = 2; - - string host_dir = 3; - - string default_scheme = 4; - // Force skip verify - // CA callback? Client TLS callback? - - // Whether to debug/trace HTTP requests to OCI registry. - HTTPDebug http_debug = 5; - - // Stream ID to use for HTTP logs (when logs are streamed to client). - // When empty, logs are written to containerd logs. - string logs_stream = 6; -} - -// AuthRequest is sent as a callback on a stream -message AuthRequest { - // host is the registry host - string host = 1; - - // reference is the namespace and repository name requested from the registry - string reference = 2; - - // wwwauthenticate is the HTTP WWW-Authenticate header values returned from the registry - repeated string wwwauthenticate = 3; -} - -enum AuthType { - NONE = 0; - - // CREDENTIALS is used to exchange username/password for access token - // using an oauth or "Docker Registry Token" server - CREDENTIALS = 1; - - // REFRESH is used to exchange secret for access token using an oauth - // or "Docker Registry Token" server - REFRESH = 2; - - // HEADER is used to set the HTTP Authorization header to secret - // directly for the registry. - // Value should be ` ` - HEADER = 3; -} - -message AuthResponse { - AuthType authType = 1; - string secret = 2; - string username = 3; - google.protobuf.Timestamp expire_at = 4; - // TODO: Stream error -} diff --git a/vendor/github.com/containerd/containerd/api/types/transfer/streaming.pb.go b/vendor/github.com/containerd/containerd/api/types/transfer/streaming.pb.go deleted file mode 100644 index bdfa8d5d24..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/transfer/streaming.pb.go +++ /dev/null @@ -1,226 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/types/transfer/streaming.proto - -package transfer - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -type Data struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *Data) Reset() { - *x = Data{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_transfer_streaming_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Data) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Data) ProtoMessage() {} - -func (x *Data) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_transfer_streaming_proto_msgTypes[0] - 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 Data.ProtoReflect.Descriptor instead. -func (*Data) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_transfer_streaming_proto_rawDescGZIP(), []int{0} -} - -func (x *Data) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -type WindowUpdate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Update int32 `protobuf:"varint,1,opt,name=update,proto3" json:"update,omitempty"` -} - -func (x *WindowUpdate) Reset() { - *x = WindowUpdate{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_types_transfer_streaming_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WindowUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WindowUpdate) ProtoMessage() {} - -func (x *WindowUpdate) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_types_transfer_streaming_proto_msgTypes[1] - 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 WindowUpdate.ProtoReflect.Descriptor instead. -func (*WindowUpdate) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_types_transfer_streaming_proto_rawDescGZIP(), []int{1} -} - -func (x *WindowUpdate) GetUpdate() int32 { - if x != nil { - return x.Update - } - return 0 -} - -var File_github_com_containerd_containerd_api_types_transfer_streaming_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_types_transfer_streaming_proto_rawDesc = []byte{ - 0x0a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, - 0x22, 0x1a, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x26, 0x0a, 0x0c, - 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_types_transfer_streaming_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_types_transfer_streaming_proto_rawDescData = file_github_com_containerd_containerd_api_types_transfer_streaming_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_types_transfer_streaming_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_types_transfer_streaming_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_types_transfer_streaming_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_types_transfer_streaming_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_types_transfer_streaming_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_types_transfer_streaming_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_github_com_containerd_containerd_api_types_transfer_streaming_proto_goTypes = []interface{}{ - (*Data)(nil), // 0: containerd.types.transfer.Data - (*WindowUpdate)(nil), // 1: containerd.types.transfer.WindowUpdate -} -var file_github_com_containerd_containerd_api_types_transfer_streaming_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 - 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_github_com_containerd_containerd_api_types_transfer_streaming_proto_init() } -func file_github_com_containerd_containerd_api_types_transfer_streaming_proto_init() { - if File_github_com_containerd_containerd_api_types_transfer_streaming_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_types_transfer_streaming_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_types_transfer_streaming_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WindowUpdate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_types_transfer_streaming_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_containerd_containerd_api_types_transfer_streaming_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_types_transfer_streaming_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_types_transfer_streaming_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_types_transfer_streaming_proto = out.File - file_github_com_containerd_containerd_api_types_transfer_streaming_proto_rawDesc = nil - file_github_com_containerd_containerd_api_types_transfer_streaming_proto_goTypes = nil - file_github_com_containerd_containerd_api_types_transfer_streaming_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/types/transfer/streaming.proto b/vendor/github.com/containerd/containerd/api/types/transfer/streaming.proto deleted file mode 100644 index 234956c2c2..0000000000 --- a/vendor/github.com/containerd/containerd/api/types/transfer/streaming.proto +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.types.transfer; - -option go_package = "github.com/containerd/containerd/api/types/transfer"; - -message Data { - bytes data = 1; -} - -message WindowUpdate { - int32 update = 1; -} diff --git a/vendor/github.com/containerd/containerd/v2/client/client.go b/vendor/github.com/containerd/containerd/v2/client/client.go deleted file mode 100644 index 7996c4a5bc..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/client.go +++ /dev/null @@ -1,985 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "runtime" - "strconv" - "strings" - "sync" - "time" - - "google.golang.org/grpc/resolver" - - containersapi "github.com/containerd/containerd/api/services/containers/v1" - diffapi "github.com/containerd/containerd/api/services/diff/v1" - imagesapi "github.com/containerd/containerd/api/services/images/v1" - leasesapi "github.com/containerd/containerd/api/services/leases/v1" - namespacesapi "github.com/containerd/containerd/api/services/namespaces/v1" - sandboxsapi "github.com/containerd/containerd/api/services/sandbox/v1" - snapshotsapi "github.com/containerd/containerd/api/services/snapshots/v1" - "github.com/containerd/containerd/api/services/tasks/v1" - transferapi "github.com/containerd/containerd/api/services/transfer/v1" - versionservice "github.com/containerd/containerd/api/services/version/v1" - apitypes "github.com/containerd/containerd/api/types" - "github.com/containerd/containerd/v2/core/containers" - "github.com/containerd/containerd/v2/core/content" - contentproxy "github.com/containerd/containerd/v2/core/content/proxy" - "github.com/containerd/containerd/v2/core/events" - eventsproxy "github.com/containerd/containerd/v2/core/events/proxy" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/introspection" - introspectionproxy "github.com/containerd/containerd/v2/core/introspection/proxy" - "github.com/containerd/containerd/v2/core/leases" - leasesproxy "github.com/containerd/containerd/v2/core/leases/proxy" - "github.com/containerd/containerd/v2/core/remotes" - "github.com/containerd/containerd/v2/core/remotes/docker" - "github.com/containerd/containerd/v2/core/sandbox" - sandboxproxy "github.com/containerd/containerd/v2/core/sandbox/proxy" - "github.com/containerd/containerd/v2/core/snapshots" - snproxy "github.com/containerd/containerd/v2/core/snapshots/proxy" - "github.com/containerd/containerd/v2/core/transfer" - transferproxy "github.com/containerd/containerd/v2/core/transfer/proxy" - "github.com/containerd/containerd/v2/defaults" - "github.com/containerd/containerd/v2/pkg/dialer" - "github.com/containerd/containerd/v2/pkg/namespaces" - ptypes "github.com/containerd/containerd/v2/pkg/protobuf/types" - "github.com/containerd/containerd/v2/pkg/tracing" - "github.com/containerd/containerd/v2/plugins" - "github.com/containerd/errdefs" - "github.com/containerd/platforms" - "github.com/containerd/typeurl/v2" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/opencontainers/runtime-spec/specs-go" - "github.com/opencontainers/runtime-spec/specs-go/features" - "golang.org/x/sync/semaphore" - "google.golang.org/grpc" - "google.golang.org/grpc/backoff" - "google.golang.org/grpc/credentials/insecure" - "google.golang.org/grpc/health/grpc_health_v1" -) - -func init() { - const prefix = "types.containerd.io" - // register TypeUrls for commonly marshaled external types - major := strconv.Itoa(specs.VersionMajor) - typeurl.Register(&specs.Spec{}, prefix, "opencontainers/runtime-spec", major, "Spec") - typeurl.Register(&specs.Process{}, prefix, "opencontainers/runtime-spec", major, "Process") - typeurl.Register(&specs.LinuxResources{}, prefix, "opencontainers/runtime-spec", major, "LinuxResources") - typeurl.Register(&specs.WindowsResources{}, prefix, "opencontainers/runtime-spec", major, "WindowsResources") - typeurl.Register(&features.Features{}, prefix, "opencontainers/runtime-spec", major, "features", "Features") - - if runtime.GOOS == "windows" { - // After bumping GRPC to 1.64, Windows tests started failing with: "name resolver error: produced zero addresses". - // This is happening because grpc.NewClient uses DNS resolver by default, which apparently not what we want - // when using socket paths on Windows. - // Using a workaround from https://github.com/grpc/grpc-go/issues/1786#issuecomment-2119088770 - resolver.SetDefaultScheme("passthrough") - } -} - -// New returns a new containerd client that is connected to the containerd -// instance provided by address -func New(address string, opts ...Opt) (*Client, error) { - var copts clientOpts - for _, o := range opts { - if err := o(&copts); err != nil { - return nil, err - } - } - if copts.timeout == 0 { - copts.timeout = 10 * time.Second - } - - c := &Client{ - defaultns: copts.defaultns, - } - - if copts.defaultRuntime != "" { - c.runtime = copts.defaultRuntime - } else { - c.runtime = defaults.DefaultRuntime - } - - if copts.defaultPlatform != nil { - c.platform = copts.defaultPlatform - } else { - c.platform = platforms.Default() - } - - if copts.services != nil { - c.services = *copts.services - } - if address != "" { - backoffConfig := backoff.DefaultConfig - backoffConfig.MaxDelay = copts.timeout - connParams := grpc.ConnectParams{ - Backoff: backoffConfig, - MinConnectTimeout: copts.timeout, - } - gopts := []grpc.DialOption{ - grpc.WithTransportCredentials(insecure.NewCredentials()), - grpc.WithConnectParams(connParams), - grpc.WithContextDialer(dialer.ContextDialer), - } - if len(copts.dialOptions) > 0 { - gopts = copts.dialOptions - } - gopts = append(gopts, copts.extraDialOpts...) - - gopts = append(gopts, grpc.WithDefaultCallOptions( - grpc.MaxCallRecvMsgSize(defaults.DefaultMaxRecvMsgSize), - grpc.MaxCallSendMsgSize(defaults.DefaultMaxSendMsgSize))) - if len(copts.callOptions) > 0 { - gopts = append(gopts, grpc.WithDefaultCallOptions(copts.callOptions...)) - } - if copts.defaultns != "" { - unary, stream := newNSInterceptors(copts.defaultns) - gopts = append(gopts, grpc.WithChainUnaryInterceptor(unary)) - gopts = append(gopts, grpc.WithChainStreamInterceptor(stream)) - } - - connector := func() (*grpc.ClientConn, error) { - conn, err := grpc.NewClient(dialer.DialAddress(address), gopts...) - if err != nil { - return nil, fmt.Errorf("failed to dial %q: %w", address, err) - } - return conn, nil - } - conn, err := connector() - if err != nil { - return nil, err - } - c.conn, c.connector = conn, connector - } - if copts.services == nil && c.conn == nil { - return nil, fmt.Errorf("no grpc connection or services is available: %w", errdefs.ErrUnavailable) - } - - // check namespace labels for default runtime - if copts.defaultRuntime == "" && c.defaultns != "" { - if label, err := c.GetLabel(context.Background(), defaults.DefaultRuntimeNSLabel); err != nil { - return nil, err - } else if label != "" { - c.runtime = label - } - } - - return c, nil -} - -// NewWithConn returns a new containerd client that is connected to the containerd -// instance provided by the connection -func NewWithConn(conn *grpc.ClientConn, opts ...Opt) (*Client, error) { - var copts clientOpts - for _, o := range opts { - if err := o(&copts); err != nil { - return nil, err - } - } - c := &Client{ - defaultns: copts.defaultns, - conn: conn, - runtime: defaults.DefaultRuntime, - } - - if copts.defaultPlatform != nil { - c.platform = copts.defaultPlatform - } else { - c.platform = platforms.Default() - } - - // check namespace labels for default runtime - if copts.defaultRuntime == "" && c.defaultns != "" { - if label, err := c.GetLabel(context.Background(), defaults.DefaultRuntimeNSLabel); err != nil { - return nil, err - } else if label != "" { - c.runtime = label - } - } - - if copts.services != nil { - c.services = *copts.services - } - return c, nil -} - -// Client is the client to interact with containerd and its various services -// using a uniform interface -type Client struct { - services - connMu sync.Mutex - conn *grpc.ClientConn - runtime string - defaultns string - platform platforms.MatchComparer - connector func() (*grpc.ClientConn, error) -} - -// Reconnect re-establishes the GRPC connection to the containerd daemon -func (c *Client) Reconnect() error { - if c.connector == nil { - return fmt.Errorf("unable to reconnect to containerd, no connector available: %w", errdefs.ErrUnavailable) - } - c.connMu.Lock() - defer c.connMu.Unlock() - c.conn.Close() - conn, err := c.connector() - if err != nil { - return err - } - c.conn = conn - return nil -} - -// Runtime returns the name of the runtime being used -func (c *Client) Runtime() string { - return c.runtime -} - -// IsServing returns true if the client can successfully connect to the -// containerd daemon and the healthcheck service returns the SERVING -// response. -// This call will block if a transient error is encountered during -// connection. A timeout can be set in the context to ensure it returns -// early. -func (c *Client) IsServing(ctx context.Context) (bool, error) { - c.connMu.Lock() - if c.conn == nil { - c.connMu.Unlock() - return false, fmt.Errorf("no grpc connection available: %w", errdefs.ErrUnavailable) - } - c.connMu.Unlock() - r, err := c.HealthService().Check(ctx, &grpc_health_v1.HealthCheckRequest{}, grpc.WaitForReady(true)) - if err != nil { - return false, err - } - return r.Status == grpc_health_v1.HealthCheckResponse_SERVING, nil -} - -// Containers returns all containers created in containerd -func (c *Client) Containers(ctx context.Context, filters ...string) ([]Container, error) { - r, err := c.ContainerService().List(ctx, filters...) - if err != nil { - return nil, err - } - out := make([]Container, len(r)) - for i, container := range r { - out[i] = containerFromRecord(c, container) - } - return out, nil -} - -// NewContainer will create a new container with the provided id. -// The id must be unique within the namespace. -func (c *Client) NewContainer(ctx context.Context, id string, opts ...NewContainerOpts) (Container, error) { - ctx, span := tracing.StartSpan(ctx, "client.NewContainer") - defer span.End() - ctx, done, err := c.WithLease(ctx) - if err != nil { - return nil, err - } - defer done(ctx) - - container := containers.Container{ - ID: id, - Runtime: containers.RuntimeInfo{ - Name: c.runtime, - }, - } - for _, o := range opts { - if err := o(ctx, c, &container); err != nil { - return nil, err - } - } - - span.SetAttributes( - tracing.Attribute("container.id", container.ID), - tracing.Attribute("container.image.ref", container.Image), - tracing.Attribute("container.runtime.name", container.Runtime.Name), - tracing.Attribute("container.snapshotter.name", container.Snapshotter), - ) - r, err := c.ContainerService().Create(ctx, container) - if err != nil { - return nil, err - } - return containerFromRecord(c, r), nil -} - -// LoadContainer loads an existing container from metadata -func (c *Client) LoadContainer(ctx context.Context, id string) (Container, error) { - ctx, span := tracing.StartSpan(ctx, "client.LoadContainer") - defer span.End() - r, err := c.ContainerService().Get(ctx, id) - if err != nil { - return nil, err - } - - span.SetAttributes( - tracing.Attribute("container.id", r.ID), - tracing.Attribute("container.image.ref", r.Image), - tracing.Attribute("container.runtime.name", r.Runtime.Name), - tracing.Attribute("container.snapshotter.name", r.Snapshotter), - tracing.Attribute("container.createdAt", r.CreatedAt.Format(time.RFC3339)), - tracing.Attribute("container.updatedAt", r.UpdatedAt.Format(time.RFC3339)), - ) - return containerFromRecord(c, r), nil -} - -// RemoteContext is used to configure object resolutions and transfers with -// remote content stores and image providers. -type RemoteContext struct { - // Resolver is used to resolve names to objects, fetchers, and pushers. - // If no resolver is provided, defaults to Docker registry resolver. - Resolver remotes.Resolver - - // PlatformMatcher is used to match the platforms for an image - // operation and define the preference when a single match is required - // from multiple platforms. - PlatformMatcher platforms.MatchComparer - - // Unpack is done after an image is pulled to extract into a snapshotter. - // It is done simultaneously for schema 2 images when they are pulled. - // If an image is not unpacked on pull, it can be unpacked any time - // afterwards. Unpacking is required to run an image. - Unpack bool - - // UnpackOpts handles options to the unpack call. - UnpackOpts []UnpackOpt - - // Snapshotter used for unpacking - Snapshotter string - - // SnapshotterOpts are additional options to be passed to a snapshotter during pull - SnapshotterOpts []snapshots.Opt - - // Labels to be applied to the created image - Labels map[string]string - - // BaseHandlers are a set of handlers which get are called on dispatch. - // These handlers always get called before any operation specific - // handlers. - BaseHandlers []images.Handler - - // HandlerWrapper wraps the handler which gets sent to dispatch. - // Unlike BaseHandlers, this can run before and after the built - // in handlers, allowing operations to run on the descriptor - // after it has completed transferring. - HandlerWrapper func(images.Handler) images.Handler - - // Platforms defines which platforms to handle when doing the image operation. - // Platforms is ignored when a PlatformMatcher is set, otherwise the - // platforms will be used to create a PlatformMatcher with no ordering - // preference. - Platforms []string - - DownloadLimiter *semaphore.Weighted - - // MaxConcurrentDownloads restricts the total number of concurrent downloads - // across all layers during an image pull operation. This helps control the - // overall network bandwidth usage. - MaxConcurrentDownloads int - - // ConcurrentLayerFetchBuffer sets the maximum size in bytes for each chunk - // when downloading layers in parallel. Larger chunks reduce coordination - // overhead but use more memory. When ConcurrentLayerFetchBuffer is above - // 512 bytes, parallel layer fetch is enabled. It can accelerate pulls for - // big images. - ConcurrentLayerFetchBuffer int - - // MaxConcurrentUploadedLayers is the max concurrent uploaded layers for each push. - MaxConcurrentUploadedLayers int - - // AllMetadata downloads all manifests and known-configuration files - AllMetadata bool - - // ChildLabelMap sets the labels used to reference child objects in the content - // store. By default, all GC reference labels will be set for all fetched content. - ChildLabelMap func(ocispec.Descriptor) []string -} - -func defaultRemoteContext() *RemoteContext { - return &RemoteContext{ - Resolver: docker.NewResolver(docker.ResolverOptions{}), - } -} - -// Fetch downloads the provided content into containerd's content store -// and returns a non-platform specific image reference -func (c *Client) Fetch(ctx context.Context, ref string, opts ...RemoteOpt) (images.Image, error) { - fetchCtx := defaultRemoteContext() - for _, o := range opts { - if err := o(c, fetchCtx); err != nil { - return images.Image{}, err - } - } - - if fetchCtx.Unpack { - return images.Image{}, fmt.Errorf("unpack on fetch not supported, try pull: %w", errdefs.ErrNotImplemented) - } - - if fetchCtx.PlatformMatcher == nil { - if len(fetchCtx.Platforms) == 0 { - fetchCtx.PlatformMatcher = platforms.All - } else { - ps, err := platforms.ParseAll(fetchCtx.Platforms) - if err != nil { - return images.Image{}, err - } - - fetchCtx.PlatformMatcher = platforms.Any(ps...) - } - } - - ctx, done, err := c.WithLease(ctx) - if err != nil { - return images.Image{}, err - } - defer done(ctx) - - img, err := c.fetch(ctx, fetchCtx, ref, 0) - if err != nil { - return images.Image{}, err - } - return c.createNewImage(ctx, img) -} - -// Push uploads the provided content to a remote resource -func (c *Client) Push(ctx context.Context, ref string, desc ocispec.Descriptor, opts ...RemoteOpt) error { - pushCtx := defaultRemoteContext() - for _, o := range opts { - if err := o(c, pushCtx); err != nil { - return err - } - } - if pushCtx.PlatformMatcher == nil { - if len(pushCtx.Platforms) > 0 { - ps, err := platforms.ParseAll(pushCtx.Platforms) - if err != nil { - return err - } - pushCtx.PlatformMatcher = platforms.Any(ps...) - } else { - pushCtx.PlatformMatcher = platforms.All - } - } - - // Annotate ref with digest to push only push tag for single digest - if !strings.Contains(ref, "@") { - ref = ref + "@" + desc.Digest.String() - } - - pusher, err := pushCtx.Resolver.Pusher(ctx, ref) - if err != nil { - return err - } - - var wrapper func(images.Handler) images.Handler - - if len(pushCtx.BaseHandlers) > 0 { - wrapper = func(h images.Handler) images.Handler { - h = images.Handlers(append(pushCtx.BaseHandlers, h)...) - if pushCtx.HandlerWrapper != nil { - h = pushCtx.HandlerWrapper(h) - } - return h - } - } else if pushCtx.HandlerWrapper != nil { - wrapper = pushCtx.HandlerWrapper - } - - var limiter *semaphore.Weighted - if pushCtx.MaxConcurrentUploadedLayers > 0 { - limiter = semaphore.NewWeighted(int64(pushCtx.MaxConcurrentUploadedLayers)) - } - - return remotes.PushContent(ctx, pusher, desc, c.ContentStore(), limiter, pushCtx.PlatformMatcher, wrapper) -} - -// GetImage returns an existing image -func (c *Client) GetImage(ctx context.Context, ref string) (Image, error) { - i, err := c.ImageService().Get(ctx, ref) - if err != nil { - return nil, err - } - return NewImage(c, i), nil -} - -// ListImages returns all existing images -func (c *Client) ListImages(ctx context.Context, filters ...string) ([]Image, error) { - imgs, err := c.ImageService().List(ctx, filters...) - if err != nil { - return nil, err - } - images := make([]Image, len(imgs)) - for i, img := range imgs { - images[i] = NewImage(c, img) - } - return images, nil -} - -// Restore restores a container from a checkpoint -func (c *Client) Restore(ctx context.Context, id string, checkpoint Image, opts ...RestoreOpts) (Container, error) { - store := c.ContentStore() - index, err := decodeIndex(ctx, store, checkpoint.Target()) - if err != nil { - return nil, err - } - - ctx, done, err := c.WithLease(ctx) - if err != nil { - return nil, err - } - defer done(ctx) - - copts := make([]NewContainerOpts, len(opts)) - for i, o := range opts { - copts[i] = o(ctx, id, c, checkpoint, index) - } - - ctr, err := c.NewContainer(ctx, id, copts...) - if err != nil { - return nil, err - } - - return ctr, nil -} - -func writeIndex(ctx context.Context, index *ocispec.Index, client *Client, ref string) (d ocispec.Descriptor, err error) { - labels := map[string]string{} - for i, m := range index.Manifests { - labels[fmt.Sprintf("containerd.io/gc.ref.content.%d", i)] = m.Digest.String() - } - data, err := json.Marshal(index) - if err != nil { - return ocispec.Descriptor{}, err - } - return writeContent(ctx, client.ContentStore(), ocispec.MediaTypeImageIndex, ref, bytes.NewReader(data), content.WithLabels(labels)) -} - -func decodeIndex(ctx context.Context, store content.Provider, desc ocispec.Descriptor) (*ocispec.Index, error) { - var index ocispec.Index - p, err := content.ReadBlob(ctx, store, desc) - if err != nil { - return nil, err - } - if err := json.Unmarshal(p, &index); err != nil { - return nil, err - } - - return &index, nil -} - -// GetLabel gets a label value from namespace store -// If there is no default label, an empty string returned with nil error -func (c *Client) GetLabel(ctx context.Context, label string) (string, error) { - ns, err := namespaces.NamespaceRequired(ctx) - if err != nil { - if c.defaultns == "" { - return "", err - } - ns = c.defaultns - } - - srv := c.NamespaceService() - labels, err := srv.Labels(ctx, ns) - if err != nil { - return "", err - } - - value := labels[label] - return value, nil -} - -// Subscribe to events that match one or more of the provided filters. -// -// Callers should listen on both the envelope and errs channels. If the errs -// channel returns nil or an error, the subscriber should terminate. -// -// The subscriber can stop receiving events by canceling the provided context. -// The errs channel will be closed and return a nil error. -func (c *Client) Subscribe(ctx context.Context, filters ...string) (ch <-chan *events.Envelope, errs <-chan error) { - return c.EventService().Subscribe(ctx, filters...) -} - -// Close closes the clients connection to containerd -func (c *Client) Close() error { - c.connMu.Lock() - defer c.connMu.Unlock() - if c.conn != nil { - return c.conn.Close() - } - return nil -} - -// NamespaceService returns the underlying Namespaces Store -func (c *Client) NamespaceService() namespaces.Store { - if c.namespaceStore != nil { - return c.namespaceStore - } - c.connMu.Lock() - defer c.connMu.Unlock() - return NewNamespaceStoreFromClient(namespacesapi.NewNamespacesClient(c.conn)) -} - -// ContainerService returns the underlying container Store -func (c *Client) ContainerService() containers.Store { - if c.containerStore != nil { - return c.containerStore - } - c.connMu.Lock() - defer c.connMu.Unlock() - return NewRemoteContainerStore(containersapi.NewContainersClient(c.conn)) -} - -// ContentStore returns the underlying content Store -func (c *Client) ContentStore() content.Store { - if c.contentStore != nil { - return c.contentStore - } - c.connMu.Lock() - defer c.connMu.Unlock() - return contentproxy.NewContentStore(c.conn) -} - -// SnapshotService returns the underlying snapshotter for the provided snapshotter name -func (c *Client) SnapshotService(snapshotterName string) snapshots.Snapshotter { - snapshotterName, err := c.resolveSnapshotterName(context.Background(), snapshotterName) - if err != nil { - snapshotterName = defaults.DefaultSnapshotter - } - if c.snapshotters != nil { - return c.snapshotters[snapshotterName] - } - c.connMu.Lock() - defer c.connMu.Unlock() - return snproxy.NewSnapshotter(snapshotsapi.NewSnapshotsClient(c.conn), snapshotterName) -} - -// DefaultNamespace return the default namespace -func (c *Client) DefaultNamespace() string { - return c.defaultns -} - -// TaskService returns the underlying TasksClient -func (c *Client) TaskService() tasks.TasksClient { - if c.taskService != nil { - return c.taskService - } - c.connMu.Lock() - defer c.connMu.Unlock() - return tasks.NewTasksClient(c.conn) -} - -// ImageService returns the underlying image Store -func (c *Client) ImageService() images.Store { - if c.imageStore != nil { - return c.imageStore - } - c.connMu.Lock() - defer c.connMu.Unlock() - return NewImageStoreFromClient(imagesapi.NewImagesClient(c.conn)) -} - -// DiffService returns the underlying Differ -func (c *Client) DiffService() DiffService { - if c.diffService != nil { - return c.diffService - } - c.connMu.Lock() - defer c.connMu.Unlock() - return NewDiffServiceFromClient(diffapi.NewDiffClient(c.conn)) -} - -// IntrospectionService returns the underlying Introspection Client -func (c *Client) IntrospectionService() introspection.Service { - if c.introspectionService != nil { - return c.introspectionService - } - c.connMu.Lock() - defer c.connMu.Unlock() - return introspectionproxy.NewIntrospectionProxy(c.conn) -} - -// LeasesService returns the underlying Leases Client -func (c *Client) LeasesService() leases.Manager { - if c.leasesService != nil { - return c.leasesService - } - c.connMu.Lock() - defer c.connMu.Unlock() - return leasesproxy.NewLeaseManager(leasesapi.NewLeasesClient(c.conn)) -} - -// HealthService returns the underlying GRPC HealthClient -func (c *Client) HealthService() grpc_health_v1.HealthClient { - c.connMu.Lock() - defer c.connMu.Unlock() - return grpc_health_v1.NewHealthClient(c.conn) -} - -// EventService returns the underlying event service -func (c *Client) EventService() EventService { - if c.eventService != nil { - return c.eventService - } - c.connMu.Lock() - defer c.connMu.Unlock() - return eventsproxy.NewRemoteEvents(c.conn) -} - -// SandboxStore returns the underlying sandbox store client -func (c *Client) SandboxStore() sandbox.Store { - if c.sandboxStore != nil { - return c.sandboxStore - } - c.connMu.Lock() - defer c.connMu.Unlock() - return sandboxproxy.NewSandboxStore(sandboxsapi.NewStoreClient(c.conn)) -} - -// SandboxController returns the underlying sandbox controller client -func (c *Client) SandboxController(name string) sandbox.Controller { - if c.sandboxers != nil { - return c.sandboxers[name] - } - c.connMu.Lock() - defer c.connMu.Unlock() - return sandboxproxy.NewSandboxController(sandboxsapi.NewControllerClient(c.conn), name) -} - -// TranferService returns the underlying transferrer -func (c *Client) TransferService() transfer.Transferrer { - if c.transferService != nil { - return c.transferService - } - c.connMu.Lock() - defer c.connMu.Unlock() - return transferproxy.NewTransferrer(transferapi.NewTransferClient(c.conn), c.streamCreator()) -} - -// VersionService returns the underlying VersionClient -func (c *Client) VersionService() versionservice.VersionClient { - c.connMu.Lock() - defer c.connMu.Unlock() - return versionservice.NewVersionClient(c.conn) -} - -// Conn returns the underlying RPC connection object -// Either *grpc.ClientConn or *ttrpc.Conn -func (c *Client) Conn() any { - c.connMu.Lock() - defer c.connMu.Unlock() - return c.conn -} - -// Version of containerd -type Version struct { - // Version number - Version string - // Revision from git that was built - Revision string -} - -// Version returns the version of containerd that the client is connected to -func (c *Client) Version(ctx context.Context) (Version, error) { - c.connMu.Lock() - if c.conn == nil { - c.connMu.Unlock() - return Version{}, fmt.Errorf("no grpc connection available: %w", errdefs.ErrUnavailable) - } - c.connMu.Unlock() - response, err := c.VersionService().Version(ctx, &ptypes.Empty{}) - if err != nil { - return Version{}, err - } - return Version{ - Version: response.Version, - Revision: response.Revision, - }, nil -} - -// ServerInfo represents the introspected server information -type ServerInfo struct { - UUID string -} - -// Server returns server information from the introspection service -func (c *Client) Server(ctx context.Context) (ServerInfo, error) { - c.connMu.Lock() - if c.conn == nil { - c.connMu.Unlock() - return ServerInfo{}, fmt.Errorf("no grpc connection available: %w", errdefs.ErrUnavailable) - } - c.connMu.Unlock() - - response, err := c.IntrospectionService().Server(ctx) - if err != nil { - return ServerInfo{}, err - } - return ServerInfo{ - UUID: response.UUID, - }, nil -} - -func (c *Client) resolveSnapshotterName(ctx context.Context, name string) (string, error) { - if name == "" { - label, err := c.GetLabel(ctx, defaults.DefaultSnapshotterNSLabel) - if err != nil { - return "", err - } - - if label != "" { - name = label - } else { - name = defaults.DefaultSnapshotter - } - } - - return name, nil -} - -func (c *Client) getSnapshotter(ctx context.Context, name string) (snapshots.Snapshotter, error) { - name, err := c.resolveSnapshotterName(ctx, name) - if err != nil { - return nil, err - } - - s := c.SnapshotService(name) - if s == nil { - return nil, fmt.Errorf("snapshotter %s was not found: %w", name, errdefs.ErrNotFound) - } - - return s, nil -} - -// GetSnapshotterSupportedPlatforms returns a platform matchers which represents the -// supported platforms for the given snapshotters -func (c *Client) GetSnapshotterSupportedPlatforms(ctx context.Context, snapshotterName string) (platforms.MatchComparer, error) { - filters := []string{fmt.Sprintf("type==%s, id==%s", plugins.SnapshotPlugin, snapshotterName)} - in := c.IntrospectionService() - - resp, err := in.Plugins(ctx, filters...) - if err != nil { - return nil, err - } - - if len(resp.Plugins) <= 0 { - return nil, fmt.Errorf("inspection service could not find snapshotter %s plugin", snapshotterName) - } - - sn := resp.Plugins[0] - snPlatforms := toPlatforms(sn.Platforms) - return platforms.Any(snPlatforms...), nil -} - -func toPlatforms(pt []*apitypes.Platform) []ocispec.Platform { - platforms := make([]ocispec.Platform, len(pt)) - for i, p := range pt { - platforms[i] = ocispec.Platform{ - Architecture: p.Architecture, - OS: p.OS, - Variant: p.Variant, - } - } - return platforms -} - -// GetSnapshotterCapabilities returns the capabilities of a snapshotter. -func (c *Client) GetSnapshotterCapabilities(ctx context.Context, snapshotterName string) ([]string, error) { - filters := []string{fmt.Sprintf("type==%s, id==%s", plugins.SnapshotPlugin, snapshotterName)} - in := c.IntrospectionService() - - resp, err := in.Plugins(ctx, filters...) - if err != nil { - return nil, err - } - - if len(resp.Plugins) <= 0 { - return nil, fmt.Errorf("inspection service could not find snapshotter %s plugin", snapshotterName) - } - - sn := resp.Plugins[0] - return sn.Capabilities, nil -} - -type RuntimeVersion struct { - Version string - Revision string -} - -type RuntimeInfo struct { - Name string - Version RuntimeVersion - Options interface{} - Features interface{} - Annotations map[string]string -} - -func (c *Client) RuntimeInfo(ctx context.Context, runtimePath string, runtimeOptions interface{}) (*RuntimeInfo, error) { - rt := c.runtime - if runtimePath != "" { - rt = runtimePath - } - rr := &apitypes.RuntimeRequest{ - RuntimePath: rt, - } - var err error - if runtimeOptions != nil { - rr.Options, err = typeurl.MarshalAnyToProto(runtimeOptions) - if err != nil { - return nil, fmt.Errorf("failed to marshal %T: %w", runtimeOptions, err) - } - } - - s := c.IntrospectionService() - - resp, err := s.PluginInfo(ctx, string(plugins.RuntimePluginV2), "task", rr) - if err != nil { - return nil, err - } - - var info apitypes.RuntimeInfo - if err := typeurl.UnmarshalTo(resp.Extra, &info); err != nil { - return nil, fmt.Errorf("failed to get runtime info from plugin info: %w", err) - } - - var result RuntimeInfo - result.Name = info.Name - if info.Version != nil { - result.Version.Version = info.Version.Version - result.Version.Revision = info.Version.Revision - } - if info.Options != nil { - result.Options, err = typeurl.UnmarshalAny(info.Options) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal RuntimeInfo.Options (%T): %w", info.Options, err) - } - } - if info.Features != nil { - result.Features, err = typeurl.UnmarshalAny(info.Features) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal RuntimeInfo.Features (%T): %w", info.Features, err) - } - } - result.Annotations = info.Annotations - return &result, nil -} diff --git a/vendor/github.com/containerd/containerd/v2/client/client_opts.go b/vendor/github.com/containerd/containerd/v2/client/client_opts.go deleted file mode 100644 index 48f3ff2a26..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/client_opts.go +++ /dev/null @@ -1,277 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "time" - - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/remotes" - "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/platforms" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "golang.org/x/sync/semaphore" - - "google.golang.org/grpc" -) - -type clientOpts struct { - defaultns string - defaultRuntime string - defaultPlatform platforms.MatchComparer - services *services - dialOptions []grpc.DialOption - extraDialOpts []grpc.DialOption - callOptions []grpc.CallOption - timeout time.Duration -} - -// Opt allows callers to set options on the containerd client -type Opt func(c *clientOpts) error - -// WithDefaultNamespace sets the default namespace on the client -// -// Any operation that does not have a namespace set on the context will -// be provided the default namespace -func WithDefaultNamespace(ns string) Opt { - return func(c *clientOpts) error { - c.defaultns = ns - return nil - } -} - -// WithDefaultRuntime sets the default runtime on the client -func WithDefaultRuntime(rt string) Opt { - return func(c *clientOpts) error { - c.defaultRuntime = rt - return nil - } -} - -// WithDefaultPlatform sets the default platform matcher on the client -func WithDefaultPlatform(platform platforms.MatchComparer) Opt { - return func(c *clientOpts) error { - c.defaultPlatform = platform - return nil - } -} - -// WithDialOpts allows grpc.DialOptions to be set on the connection -func WithDialOpts(opts []grpc.DialOption) Opt { - return func(c *clientOpts) error { - c.dialOptions = opts - return nil - } -} - -// WithExtraDialOpts allows additional grpc.DialOptions to be set on the -// connection. Unlike [WithDialOpts], options set here are appended to, -// instead of overriding previous options, which allows setting options -// to extend containerd client's defaults. -// -// This option can be used multiple times to set additional dial options. -func WithExtraDialOpts(opts []grpc.DialOption) Opt { - return func(c *clientOpts) error { - c.extraDialOpts = append(c.extraDialOpts, opts...) - return nil - } -} - -// WithCallOpts allows grpc.CallOptions to be set on the connection -func WithCallOpts(opts []grpc.CallOption) Opt { - return func(c *clientOpts) error { - c.callOptions = opts - return nil - } -} - -// WithServices sets services used by the client. -func WithServices(opts ...ServicesOpt) Opt { - return func(c *clientOpts) error { - c.services = &services{} - for _, o := range opts { - o(c.services) - } - return nil - } -} - -// WithTimeout sets the connection timeout for the client -func WithTimeout(d time.Duration) Opt { - return func(c *clientOpts) error { - c.timeout = d - return nil - } -} - -// RemoteOpt allows the caller to set distribution options for a remote -type RemoteOpt func(*Client, *RemoteContext) error - -// WithPlatform allows the caller to specify a platform to retrieve -// content for -func WithPlatform(platform string) RemoteOpt { - if platform == "" { - platform = platforms.DefaultString() - } - return func(_ *Client, c *RemoteContext) error { - for _, p := range c.Platforms { - if p == platform { - return nil - } - } - - c.Platforms = append(c.Platforms, platform) - return nil - } -} - -// WithPlatformMatcher specifies the matcher to use for -// determining which platforms to pull content for. -// This value supersedes anything set with `WithPlatform`. -func WithPlatformMatcher(m platforms.MatchComparer) RemoteOpt { - return func(_ *Client, c *RemoteContext) error { - c.PlatformMatcher = m - return nil - } -} - -// WithPullUnpack is used to unpack an image after pull. This -// uses the snapshotter, content store, and diff service -// configured for the client. -func WithPullUnpack(_ *Client, c *RemoteContext) error { - c.Unpack = true - return nil -} - -// WithUnpackOpts is used to add unpack options to the unpacker. -func WithUnpackOpts(opts []UnpackOpt) RemoteOpt { - return func(_ *Client, c *RemoteContext) error { - c.UnpackOpts = append(c.UnpackOpts, opts...) - return nil - } -} - -// WithPullSnapshotter specifies snapshotter name used for unpacking. -func WithPullSnapshotter(snapshotterName string, opts ...snapshots.Opt) RemoteOpt { - return func(_ *Client, c *RemoteContext) error { - c.Snapshotter = snapshotterName - c.SnapshotterOpts = opts - return nil - } -} - -// WithPullLabel sets a label to be associated with a pulled reference -func WithPullLabel(key, value string) RemoteOpt { - return func(_ *Client, rc *RemoteContext) error { - if rc.Labels == nil { - rc.Labels = make(map[string]string) - } - - rc.Labels[key] = value - return nil - } -} - -// WithPullLabels associates a set of labels to a pulled reference -func WithPullLabels(labels map[string]string) RemoteOpt { - return func(_ *Client, rc *RemoteContext) error { - if rc.Labels == nil { - rc.Labels = make(map[string]string) - } - - for k, v := range labels { - rc.Labels[k] = v - } - return nil - } -} - -// WithChildLabelMap sets the map function used to define the labels set -// on referenced child content in the content store. This can be used -// to overwrite the default GC labels or filter which labels get set -// for content. -// The default is `images.ChildGCLabels`. -func WithChildLabelMap(fn func(ocispec.Descriptor) []string) RemoteOpt { - return func(_ *Client, c *RemoteContext) error { - c.ChildLabelMap = fn - return nil - } -} - -// WithResolver specifies the resolver to use. -func WithResolver(resolver remotes.Resolver) RemoteOpt { - return func(client *Client, c *RemoteContext) error { - c.Resolver = resolver - return nil - } -} - -// WithImageHandler adds a base handler to be called on dispatch. -func WithImageHandler(h images.Handler) RemoteOpt { - return func(client *Client, c *RemoteContext) error { - c.BaseHandlers = append(c.BaseHandlers, h) - return nil - } -} - -// WithImageHandlerWrapper wraps the handlers to be called on dispatch. -func WithImageHandlerWrapper(w func(images.Handler) images.Handler) RemoteOpt { - return func(client *Client, c *RemoteContext) error { - c.HandlerWrapper = w - return nil - } -} - -// WithDownloadLimiter sets the limiter for concurrent download operations. -func WithDownloadLimiter(limiter *semaphore.Weighted) RemoteOpt { - return func(client *Client, c *RemoteContext) error { - c.DownloadLimiter = limiter - return nil - } -} - -// WithMaxConcurrentDownloads sets max concurrent download limit. -func WithMaxConcurrentDownloads(max int) RemoteOpt { - return func(client *Client, c *RemoteContext) error { - c.MaxConcurrentDownloads = max - return nil - } -} - -// WithConcurrentLayerFetchBuffer sets the buffer size for concurrent layer fetches. -func WithConcurrentLayerFetchBuffer(buffer int) RemoteOpt { - return func(client *Client, c *RemoteContext) error { - c.ConcurrentLayerFetchBuffer = buffer - return nil - } -} - -// WithMaxConcurrentUploadedLayers sets max concurrent uploaded layer limit. -func WithMaxConcurrentUploadedLayers(max int) RemoteOpt { - return func(client *Client, c *RemoteContext) error { - c.MaxConcurrentUploadedLayers = max - return nil - } -} - -// WithAllMetadata downloads all manifests and known-configuration files -func WithAllMetadata() RemoteOpt { - return func(_ *Client, c *RemoteContext) error { - c.AllMetadata = true - return nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/client/container.go b/vendor/github.com/containerd/containerd/v2/client/container.go deleted file mode 100644 index 7845de10b3..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/container.go +++ /dev/null @@ -1,553 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "encoding/json" - "fmt" - "os" - "path/filepath" - "strings" - - "github.com/containerd/containerd/api/services/tasks/v1" - "github.com/containerd/containerd/api/types" - "github.com/containerd/containerd/api/types/runc/options" - tasktypes "github.com/containerd/containerd/api/types/task" - "github.com/containerd/errdefs" - "github.com/containerd/errdefs/pkg/errgrpc" - "github.com/containerd/fifo" - "github.com/containerd/typeurl/v2" - ver "github.com/opencontainers/image-spec/specs-go" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/opencontainers/selinux/go-selinux/label" - - "github.com/containerd/containerd/v2/core/containers" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/containerd/v2/pkg/oci" - "github.com/containerd/containerd/v2/pkg/tracing" -) - -const ( - checkpointRuntimeNameLabel = "io.containerd.checkpoint.runtime" - checkpointSnapshotterNameLabel = "io.containerd.checkpoint.snapshotter" -) - -// Container is a metadata object for container resources and task creation -type Container interface { - // ID identifies the container - ID() string - // Info returns the underlying container record type - Info(context.Context, ...InfoOpts) (containers.Container, error) - // Delete removes the container - Delete(context.Context, ...DeleteOpts) error - // NewTask creates a new task based on the container metadata - NewTask(context.Context, cio.Creator, ...NewTaskOpts) (Task, error) - // Spec returns the OCI runtime specification - Spec(context.Context) (*oci.Spec, error) - // Task returns the current task for the container - // - // If cio.Load options are passed the client will Load the IO for the running - // task. - // - // If cio.Attach options are passed the client will reattach to the IO for the running - // task. - // - // If no task exists for the container a NotFound error is returned - // - // Clients must make sure that only one reader is attached to the task and consuming - // the output from the task's fifos - Task(context.Context, cio.Attach) (Task, error) - // Image returns the image that the container is based on - Image(context.Context) (Image, error) - // Labels returns the labels set on the container - Labels(context.Context) (map[string]string, error) - // SetLabels sets the provided labels for the container and returns the final label set - SetLabels(context.Context, map[string]string) (map[string]string, error) - // Extensions returns the extensions set on the container - Extensions(context.Context) (map[string]typeurl.Any, error) - // Update a container - Update(context.Context, ...UpdateContainerOpts) error - // Checkpoint creates a checkpoint image of the current container - Checkpoint(context.Context, string, ...CheckpointOpts) (Image, error) - // Restore restores a container and returns the PID of the - // restored containers init process. - Restore(context.Context, cio.Creator, string) (int, error) -} - -func containerFromRecord(client *Client, c containers.Container) *container { - return &container{ - client: client, - id: c.ID, - metadata: c, - } -} - -var _ = (Container)(&container{}) - -type container struct { - client *Client - id string - metadata containers.Container -} - -// ID returns the container's unique id -func (c *container) ID() string { - return c.id -} - -func (c *container) Info(ctx context.Context, opts ...InfoOpts) (containers.Container, error) { - i := &InfoConfig{ - // default to refreshing the container's local metadata - Refresh: true, - } - for _, o := range opts { - o(i) - } - if i.Refresh { - metadata, err := c.get(ctx) - if err != nil { - return c.metadata, err - } - c.metadata = metadata - } - return c.metadata, nil -} - -func (c *container) Extensions(ctx context.Context) (map[string]typeurl.Any, error) { - r, err := c.get(ctx) - if err != nil { - return nil, err - } - return r.Extensions, nil -} - -func (c *container) Labels(ctx context.Context) (map[string]string, error) { - r, err := c.get(ctx) - if err != nil { - return nil, err - } - return r.Labels, nil -} - -func (c *container) SetLabels(ctx context.Context, labels map[string]string) (map[string]string, error) { - ctx, span := tracing.StartSpan(ctx, "container.SetLabels", - tracing.WithAttribute("container.id", c.id), - ) - defer span.End() - container := containers.Container{ - ID: c.id, - Labels: labels, - } - - var paths []string - // mask off paths so we only muck with the labels encountered in labels. - // Labels not in the passed in argument will be left alone. - for k := range labels { - paths = append(paths, strings.Join([]string{"labels", k}, ".")) - } - - r, err := c.client.ContainerService().Update(ctx, container, paths...) - if err != nil { - return nil, err - } - return r.Labels, nil -} - -// Spec returns the current OCI specification for the container -func (c *container) Spec(ctx context.Context) (*oci.Spec, error) { - r, err := c.get(ctx) - if err != nil { - return nil, err - } - var s oci.Spec - if err := json.Unmarshal(r.Spec.GetValue(), &s); err != nil { - return nil, err - } - return &s, nil -} - -// Delete deletes an existing container -// an error is returned if the container has running tasks -func (c *container) Delete(ctx context.Context, opts ...DeleteOpts) error { - ctx, span := tracing.StartSpan(ctx, "container.Delete", - tracing.WithAttribute("container.id", c.id), - ) - defer span.End() - if _, err := c.loadTask(ctx, nil); err == nil { - return fmt.Errorf("cannot delete running task %v: %w", c.id, errdefs.ErrFailedPrecondition) - } - r, err := c.get(ctx) - if err != nil { - return err - } - for _, o := range opts { - if err := o(ctx, c.client, r); err != nil { - return err - } - } - return c.client.ContainerService().Delete(ctx, c.id) -} - -func (c *container) Task(ctx context.Context, attach cio.Attach) (Task, error) { - return c.loadTask(ctx, attach) -} - -// Image returns the image that the container is based on -func (c *container) Image(ctx context.Context) (Image, error) { - r, err := c.get(ctx) - if err != nil { - return nil, err - } - if r.Image == "" { - return nil, fmt.Errorf("container not created from an image: %w", errdefs.ErrNotFound) - } - i, err := c.client.ImageService().Get(ctx, r.Image) - if err != nil { - return nil, fmt.Errorf("failed to get image %s for container: %w", r.Image, err) - } - return NewImage(c.client, i), nil -} - -func (c *container) NewTask(ctx context.Context, ioCreate cio.Creator, opts ...NewTaskOpts) (_ Task, retErr error) { - ctx, span := tracing.StartSpan(ctx, "container.NewTask") - defer span.End() - i, err := ioCreate(c.id) - if err != nil { - return nil, err - } - defer func() { - if retErr != nil && i != nil { - i.Cancel() - i.Close() - } - }() - cfg := i.Config() - request := &tasks.CreateTaskRequest{ - ContainerID: c.id, - Terminal: cfg.Terminal, - Stdin: cfg.Stdin, - Stdout: cfg.Stdout, - Stderr: cfg.Stderr, - } - if err := c.handleMounts(ctx, request); err != nil { - return nil, err - } - - r, err := c.get(ctx) - if err != nil { - return nil, err - } - info := TaskInfo{ - runtime: r.Runtime.Name, - runtimeOptions: r.Runtime.Options, - } - for _, o := range opts { - if err := o(ctx, c.client, &info); err != nil { - return nil, err - } - } - for _, m := range info.RootFS { - request.Rootfs = append(request.Rootfs, &types.Mount{ - Type: m.Type, - Source: m.Source, - Target: m.Target, - Options: m.Options, - }) - } - request.RuntimePath = info.RuntimePath - if info.Options != nil { - o, err := typeurl.MarshalAny(info.Options) - if err != nil { - return nil, err - } - request.Options = typeurl.MarshalProto(o) - } - t := &task{ - client: c.client, - io: i, - id: c.id, - c: c, - } - if info.Checkpoint != nil { - request.Checkpoint = info.Checkpoint - } - - span.SetAttributes( - tracing.Attribute("task.container.id", request.ContainerID), - tracing.Attribute("task.request.options", request.Options.String()), - tracing.Attribute("task.runtime.name", info.runtime), - ) - response, err := c.client.TaskService().Create(ctx, request) - if err != nil { - return nil, errgrpc.ToNative(err) - } - - span.AddEvent("task created", - tracing.Attribute("task.process.id", int(response.Pid)), - ) - t.pid = response.Pid - return t, nil -} - -func (c *container) Update(ctx context.Context, opts ...UpdateContainerOpts) error { - // fetch the current container config before updating it - ctx, span := tracing.StartSpan(ctx, "container.Update") - defer span.End() - r, err := c.get(ctx) - if err != nil { - return err - } - for _, o := range opts { - if err := o(ctx, c.client, &r); err != nil { - return err - } - } - if _, err := c.client.ContainerService().Update(ctx, r); err != nil { - return errgrpc.ToNative(err) - } - return nil -} - -func (c *container) handleMounts(ctx context.Context, request *tasks.CreateTaskRequest) error { - r, err := c.get(ctx) - if err != nil { - return err - } - - if r.SnapshotKey != "" { - if r.Snapshotter == "" { - return fmt.Errorf("unable to resolve rootfs mounts without snapshotter on container: %w", errdefs.ErrInvalidArgument) - } - - // get the rootfs from the snapshotter and add it to the request - s, err := c.client.getSnapshotter(ctx, r.Snapshotter) - if err != nil { - return err - } - mounts, err := s.Mounts(ctx, r.SnapshotKey) - if err != nil { - return err - } - spec, err := c.Spec(ctx) - if err != nil { - return err - } - for _, m := range mounts { - if spec.Linux != nil && spec.Linux.MountLabel != "" { - if ml := label.FormatMountLabel("", spec.Linux.MountLabel); ml != "" { - m.Options = append(m.Options, ml) - } - } - request.Rootfs = append(request.Rootfs, &types.Mount{ - Type: m.Type, - Source: m.Source, - Target: m.Target, - Options: m.Options, - }) - } - } - - return nil -} - -func (c *container) Restore(ctx context.Context, ioCreate cio.Creator, rootDir string) (_ int, retErr error) { - errorPid := -1 - i, err := ioCreate(c.id) - if err != nil { - return errorPid, err - } - defer func() { - if retErr != nil && i != nil { - i.Cancel() - i.Close() - } - }() - cfg := i.Config() - - request := &tasks.CreateTaskRequest{ - ContainerID: c.id, - Terminal: cfg.Terminal, - Stdin: cfg.Stdin, - Stdout: cfg.Stdout, - Stderr: cfg.Stderr, - } - - if err := c.handleMounts(ctx, request); err != nil { - return errorPid, err - } - - request.Checkpoint = &types.Descriptor{ - Annotations: map[string]string{ - // The following annotation is used to restore a checkpoint - // via CRI. This is mainly used to restore a container - // in Kubernetes. - "RestoreFromPath": rootDir, - }, - } - // (adrianreber): it is not totally clear to me, but it seems the only - // way to restore a container in containerd is going through Create(). - // This functions sets up Create() in such a way to handle container - // restore coming through the CRI. - response, err := c.client.TaskService().Create(ctx, request) - if err != nil { - return errorPid, errgrpc.ToNative(err) - } - - return int(response.GetPid()), nil -} - -func (c *container) Checkpoint(ctx context.Context, ref string, opts ...CheckpointOpts) (Image, error) { - index := &ocispec.Index{ - Versioned: ver.Versioned{ - SchemaVersion: 2, - }, - Annotations: make(map[string]string), - } - copts := &options.CheckpointOptions{ - Exit: false, - OpenTcp: false, - ExternalUnixSockets: false, - Terminal: false, - FileLocks: true, - EmptyNamespaces: nil, - } - info, err := c.Info(ctx) - if err != nil { - return nil, err - } - - img, err := c.Image(ctx) - if err != nil { - return nil, err - } - - ctx, done, err := c.client.WithLease(ctx) - if err != nil { - return nil, err - } - defer done(ctx) - - // add image name to manifest - index.Annotations[ocispec.AnnotationRefName] = img.Name() - // add runtime info to index - index.Annotations[checkpointRuntimeNameLabel] = info.Runtime.Name - // add snapshotter info to index - index.Annotations[checkpointSnapshotterNameLabel] = info.Snapshotter - - // process remaining opts - for _, o := range opts { - if err := o(ctx, c.client, &info, index, copts); err != nil { - err = errgrpc.ToNative(err) - if !errdefs.IsAlreadyExists(err) { - return nil, err - } - } - } - - desc, err := writeIndex(ctx, index, c.client, c.ID()+"index") - if err != nil { - return nil, err - } - i := images.Image{ - Name: ref, - Target: desc, - } - checkpoint, err := c.client.ImageService().Create(ctx, i) - if err != nil { - return nil, err - } - - return NewImage(c.client, checkpoint), nil -} - -func (c *container) loadTask(ctx context.Context, ioAttach cio.Attach) (Task, error) { - response, err := c.client.TaskService().Get(ctx, &tasks.GetRequest{ - ContainerID: c.id, - }) - if err != nil { - err = errgrpc.ToNative(err) - if errdefs.IsNotFound(err) { - return nil, fmt.Errorf("no running task found: %w", err) - } - return nil, err - } - var i cio.IO - if ioAttach != nil && response.Process.Status != tasktypes.Status_UNKNOWN { - // Do not attach IO for task in unknown state, because there - // are no fifo paths anyway. - if i, err = attachExistingIO(response, ioAttach); err != nil { - return nil, err - } - } - t := &task{ - client: c.client, - io: i, - id: response.Process.ID, - pid: response.Process.Pid, - c: c, - } - return t, nil -} - -func (c *container) get(ctx context.Context) (containers.Container, error) { - return c.client.ContainerService().Get(ctx, c.id) -} - -// get the existing fifo paths from the task information stored by the daemon -func attachExistingIO(response *tasks.GetResponse, ioAttach cio.Attach) (cio.IO, error) { - fifoSet := loadFifos(response) - return ioAttach(fifoSet) -} - -// loadFifos loads the containers fifos -func loadFifos(response *tasks.GetResponse) *cio.FIFOSet { - fifos := []string{ - response.Process.Stdin, - response.Process.Stdout, - response.Process.Stderr, - } - closer := func() error { - var ( - err error - dirs = map[string]struct{}{} - ) - for _, f := range fifos { - if isFifo, _ := fifo.IsFifo(f); isFifo { - if rerr := os.Remove(f); err == nil { - err = rerr - } - dirs[filepath.Dir(f)] = struct{}{} - } - } - for dir := range dirs { - // we ignore errors here because we don't - // want to remove the directory if it isn't - // empty - _ = os.Remove(dir) - } - return err - } - - return cio.NewFIFOSet(cio.Config{ - Stdin: response.Process.Stdin, - Stdout: response.Process.Stdout, - Stderr: response.Process.Stderr, - Terminal: response.Process.Terminal, - }, closer) -} diff --git a/vendor/github.com/containerd/containerd/v2/client/container_checkpoint_opts.go b/vendor/github.com/containerd/containerd/v2/client/container_checkpoint_opts.go deleted file mode 100644 index 4edb937f62..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/container_checkpoint_opts.go +++ /dev/null @@ -1,155 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "bytes" - "context" - "errors" - "fmt" - "runtime" - - tasks "github.com/containerd/containerd/api/services/tasks/v1" - "github.com/containerd/containerd/api/types/runc/options" - "github.com/containerd/containerd/v2/core/containers" - "github.com/containerd/containerd/v2/core/diff" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/protobuf/proto" - "github.com/containerd/containerd/v2/pkg/rootfs" - "github.com/containerd/platforms" - "github.com/containerd/typeurl/v2" - "github.com/opencontainers/go-digest" - imagespec "github.com/opencontainers/image-spec/specs-go/v1" -) - -// ErrMediaTypeNotFound returns an error when a media type in the manifest is unknown -var ErrMediaTypeNotFound = errors.New("media type not found") - -// CheckpointOpts are options to manage the checkpoint operation -type CheckpointOpts func(context.Context, *Client, *containers.Container, *imagespec.Index, *options.CheckpointOptions) error - -// WithCheckpointImage includes the container image in the checkpoint -func WithCheckpointImage(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error { - ir, err := client.ImageService().Get(ctx, c.Image) - if err != nil { - return err - } - index.Manifests = append(index.Manifests, ir.Target) - return nil -} - -// WithCheckpointTask includes the running task -func WithCheckpointTask(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error { - opt, err := typeurl.MarshalAnyToProto(copts) - if err != nil { - return nil - } - task, err := client.TaskService().Checkpoint(ctx, &tasks.CheckpointTaskRequest{ - ContainerID: c.ID, - Options: opt, - }) - if err != nil { - return err - } - for _, d := range task.Descriptors { - platformSpec := platforms.DefaultSpec() - index.Manifests = append(index.Manifests, imagespec.Descriptor{ - MediaType: d.MediaType, - Size: d.Size, - Digest: digest.Digest(d.Digest), - Platform: &platformSpec, - Annotations: d.Annotations, - }) - } - // save copts - data, err := proto.Marshal(opt) - if err != nil { - return err - } - r := bytes.NewReader(data) - desc, err := writeContent(ctx, client.ContentStore(), images.MediaTypeContainerd1CheckpointOptions, c.ID+"-checkpoint-options", r) - if err != nil { - return err - } - desc.Platform = &imagespec.Platform{ - OS: runtime.GOOS, - Architecture: runtime.GOARCH, - } - index.Manifests = append(index.Manifests, desc) - return nil -} - -// WithCheckpointRuntime includes the container runtime info -func WithCheckpointRuntime(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error { - if c.Runtime.Options != nil && c.Runtime.Options.GetValue() != nil { - opt := typeurl.MarshalProto(c.Runtime.Options) - data, err := proto.Marshal(opt) - if err != nil { - return err - } - r := bytes.NewReader(data) - desc, err := writeContent(ctx, client.ContentStore(), images.MediaTypeContainerd1CheckpointRuntimeOptions, c.ID+"-runtime-options", r) - if err != nil { - return err - } - desc.Platform = &imagespec.Platform{ - OS: runtime.GOOS, - Architecture: runtime.GOARCH, - } - index.Manifests = append(index.Manifests, desc) - } - return nil -} - -// WithCheckpointRW includes the rw in the checkpoint -func WithCheckpointRW(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error { - diffOpts := []diff.Opt{ - diff.WithReference(fmt.Sprintf("checkpoint-rw-%s", c.SnapshotKey)), - } - rw, err := rootfs.CreateDiff(ctx, - c.SnapshotKey, - client.SnapshotService(c.Snapshotter), - client.DiffService(), - diffOpts..., - ) - if err != nil { - return err - - } - rw.Platform = &imagespec.Platform{ - OS: runtime.GOOS, - Architecture: runtime.GOARCH, - } - index.Manifests = append(index.Manifests, rw) - return nil -} - -// WithCheckpointTaskExit causes the task to exit after checkpoint -func WithCheckpointTaskExit(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error { - copts.Exit = true - return nil -} - -// GetIndexByMediaType returns the index in a manifest for the specified media type -func GetIndexByMediaType(index *imagespec.Index, mt string) (*imagespec.Descriptor, error) { - for _, d := range index.Manifests { - if d.MediaType == mt { - return &d, nil - } - } - return nil, ErrMediaTypeNotFound -} diff --git a/vendor/github.com/containerd/containerd/v2/client/container_opts.go b/vendor/github.com/containerd/containerd/v2/client/container_opts.go deleted file mode 100644 index 04f2a90621..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/container_opts.go +++ /dev/null @@ -1,331 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "encoding/json" - "errors" - "fmt" - - "github.com/containerd/containerd/v2/core/containers" - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/pkg/namespaces" - "github.com/containerd/containerd/v2/pkg/oci" - "github.com/containerd/errdefs" - "github.com/containerd/typeurl/v2" - "github.com/opencontainers/image-spec/identity" - v1 "github.com/opencontainers/image-spec/specs-go/v1" -) - -// DeleteOpts allows the caller to set options for the deletion of a container -type DeleteOpts func(ctx context.Context, client *Client, c containers.Container) error - -// NewContainerOpts allows the caller to set additional options when creating a container -type NewContainerOpts func(ctx context.Context, client *Client, c *containers.Container) error - -// UpdateContainerOpts allows the caller to set additional options when updating a container -type UpdateContainerOpts func(ctx context.Context, client *Client, c *containers.Container) error - -// InfoOpts controls how container metadata is fetched and returned -type InfoOpts func(*InfoConfig) - -// InfoConfig specifies how container metadata is fetched -type InfoConfig struct { - // Refresh will to a fetch of the latest container metadata - Refresh bool -} - -// WithRuntime allows a user to specify the runtime name and additional options that should -// be used to create tasks for the container -func WithRuntime(name string, options interface{}) NewContainerOpts { - return func(ctx context.Context, client *Client, c *containers.Container) error { - var ( - opts typeurl.Any - err error - ) - if options != nil { - opts, err = typeurl.MarshalAny(options) - if err != nil { - return err - } - } - c.Runtime = containers.RuntimeInfo{ - Name: name, - Options: opts, - } - return nil - } -} - -// WithSandbox joins the container to a container group (aka sandbox) from the given ID -// Note: shim runtime must support sandboxes environments. -func WithSandbox(sandboxID string) NewContainerOpts { - return func(ctx context.Context, client *Client, c *containers.Container) error { - c.SandboxID = sandboxID - return nil - } -} - -// WithImage sets the provided image as the base for the container -func WithImage(i Image) NewContainerOpts { - return func(ctx context.Context, client *Client, c *containers.Container) error { - c.Image = i.Name() - return nil - } -} - -// WithImageName allows setting the image name as the base for the container -func WithImageName(n string) NewContainerOpts { - return func(ctx context.Context, _ *Client, c *containers.Container) error { - c.Image = n - return nil - } -} - -// WithContainerLabels sets the provided labels to the container. -// The existing labels are cleared. -// Use WithAdditionalContainerLabels to preserve the existing labels. -func WithContainerLabels(labels map[string]string) NewContainerOpts { - return func(_ context.Context, _ *Client, c *containers.Container) error { - c.Labels = labels - return nil - } -} - -// WithImageConfigLabels sets the image config labels on the container. -// The existing labels are cleared as this is expected to be the first -// operation in setting up a container's labels. Use WithAdditionalContainerLabels -// to add/overwrite the existing image config labels. -func WithImageConfigLabels(image Image) NewContainerOpts { - return func(ctx context.Context, _ *Client, c *containers.Container) error { - ic, err := image.Config(ctx) - if err != nil { - return err - } - if !images.IsConfigType(ic.MediaType) { - return fmt.Errorf("unknown image config media type %s", ic.MediaType) - } - - var ( - ociimage v1.Image - config v1.ImageConfig - ) - p, err := content.ReadBlob(ctx, image.ContentStore(), ic) - if err != nil { - return err - } - - if err = json.Unmarshal(p, &ociimage); err != nil { - return err - } - config = ociimage.Config - - c.Labels = config.Labels - return nil - } -} - -// WithAdditionalContainerLabels adds the provided labels to the container -// The existing labels are preserved as long as they do not conflict with the added labels. -func WithAdditionalContainerLabels(labels map[string]string) NewContainerOpts { - return func(_ context.Context, _ *Client, c *containers.Container) error { - if c.Labels == nil { - c.Labels = labels - return nil - } - for k, v := range labels { - c.Labels[k] = v - } - return nil - } -} - -// WithImageStopSignal sets a well-known containerd label (StopSignalLabel) -// on the container for storing the stop signal specified in the OCI image -// config -func WithImageStopSignal(image Image, defaultSignal string) NewContainerOpts { - return func(ctx context.Context, _ *Client, c *containers.Container) error { - if c.Labels == nil { - c.Labels = make(map[string]string) - } - stopSignal, err := GetOCIStopSignal(ctx, image, defaultSignal) - if err != nil { - return err - } - c.Labels[StopSignalLabel] = stopSignal - return nil - } -} - -// WithSnapshotter sets the provided snapshotter for use by the container -// -// This option must appear before other snapshotter options to have an effect. -func WithSnapshotter(name string) NewContainerOpts { - return func(ctx context.Context, client *Client, c *containers.Container) error { - c.Snapshotter = name - return nil - } -} - -// WithSnapshot uses an existing root filesystem for the container -func WithSnapshot(id string) NewContainerOpts { - return func(ctx context.Context, client *Client, c *containers.Container) error { - // check that the snapshot exists, if not, fail on creation - var err error - c.Snapshotter, err = client.resolveSnapshotterName(ctx, c.Snapshotter) - if err != nil { - return err - } - s, err := client.getSnapshotter(ctx, c.Snapshotter) - if err != nil { - return err - } - if _, err := s.Mounts(ctx, id); err != nil { - return err - } - c.SnapshotKey = id - return nil - } -} - -// WithSnapshotCleanup deletes the rootfs snapshot allocated for the container -func WithSnapshotCleanup(ctx context.Context, client *Client, c containers.Container) error { - if c.SnapshotKey != "" { - if c.Snapshotter == "" { - return fmt.Errorf("container.Snapshotter must be set to cleanup rootfs snapshot: %w", errdefs.ErrInvalidArgument) - } - s, err := client.getSnapshotter(ctx, c.Snapshotter) - if err != nil { - return err - } - if err := s.Remove(ctx, c.SnapshotKey); err != nil && !errdefs.IsNotFound(err) { - return err - } - } - return nil -} - -// WithNewSnapshot allocates a new snapshot to be used by the container as the -// root filesystem in read-write mode -func WithNewSnapshot(id string, i Image, opts ...snapshots.Opt) NewContainerOpts { - return withNewSnapshot(id, i, false, opts...) -} - -// WithNewSnapshotView allocates a new snapshot to be used by the container as the -// root filesystem in read-only mode -func WithNewSnapshotView(id string, i Image, opts ...snapshots.Opt) NewContainerOpts { - return withNewSnapshot(id, i, true, opts...) -} - -func withNewSnapshot(id string, i Image, readonly bool, opts ...snapshots.Opt) NewContainerOpts { - return func(ctx context.Context, client *Client, c *containers.Container) error { - diffIDs, err := i.RootFS(ctx) - if err != nil { - return err - } - - parent := identity.ChainID(diffIDs).String() - c.Snapshotter, err = client.resolveSnapshotterName(ctx, c.Snapshotter) - if err != nil { - return err - } - s, err := client.getSnapshotter(ctx, c.Snapshotter) - if err != nil { - return err - } - parent, err = resolveSnapshotOptions(ctx, client, c.Snapshotter, s, parent, opts...) - if err != nil { - return err - } - - if readonly { - _, err = s.View(ctx, id, parent, opts...) - } else { - _, err = s.Prepare(ctx, id, parent, opts...) - } - if err != nil { - return err - } - c.SnapshotKey = id - c.Image = i.Name() - return nil - } -} - -// WithContainerExtension appends extension data to the container object. -// Use this to decorate the container object with additional data for the client -// integration. -// -// Make sure to register the type of `extension` in the typeurl package via -// `typeurl.Register` or container creation may fail. -func WithContainerExtension(name string, extension interface{}) NewContainerOpts { - return func(ctx context.Context, client *Client, c *containers.Container) error { - if name == "" { - return fmt.Errorf("extension key must not be zero-length: %w", errdefs.ErrInvalidArgument) - } - - ext, err := typeurl.MarshalAny(extension) - if err != nil { - if errors.Is(err, typeurl.ErrNotFound) { - return fmt.Errorf("extension %q is not registered with the typeurl package, see `typeurl.Register`: %w", name, err) - } - return fmt.Errorf("error marshalling extension: %w", err) - } - - if c.Extensions == nil { - c.Extensions = make(map[string]typeurl.Any) - } - c.Extensions[name] = ext - return nil - } -} - -// WithNewSpec generates a new spec for a new container -func WithNewSpec(opts ...oci.SpecOpts) NewContainerOpts { - return func(ctx context.Context, client *Client, c *containers.Container) error { - if _, ok := namespaces.Namespace(ctx); !ok { - ctx = namespaces.WithNamespace(ctx, client.DefaultNamespace()) - } - s, err := oci.GenerateSpec(ctx, client, c, opts...) - if err != nil { - return err - } - c.Spec, err = typeurl.MarshalAny(s) - return err - } -} - -// WithSpec sets the provided spec on the container -func WithSpec(s *oci.Spec, opts ...oci.SpecOpts) NewContainerOpts { - return func(ctx context.Context, client *Client, c *containers.Container) error { - if err := oci.ApplyOpts(ctx, client, c, s, opts...); err != nil { - return err - } - - var err error - c.Spec, err = typeurl.MarshalAnyToProto(s) - return err - } -} - -// WithoutRefreshedMetadata will use the current metadata attached to the container object -func WithoutRefreshedMetadata(i *InfoConfig) { - i.Refresh = false -} diff --git a/vendor/github.com/containerd/containerd/v2/client/container_opts_unix.go b/vendor/github.com/containerd/containerd/v2/client/container_opts_unix.go deleted file mode 100644 index fc56292392..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/container_opts_unix.go +++ /dev/null @@ -1,147 +0,0 @@ -//go:build !windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "fmt" - "os" - "path/filepath" - "syscall" - - "github.com/containerd/containerd/v2/core/containers" - "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/containerd/v2/internal/userns" - - "github.com/containerd/errdefs" - "github.com/opencontainers/image-spec/identity" - "github.com/opencontainers/runtime-spec/specs-go" -) - -// WithRemappedSnapshot creates a new snapshot and remaps the uid/gid for the -// filesystem to be used by a container with user namespaces -func WithRemappedSnapshot(id string, i Image, uid, gid uint32) NewContainerOpts { - uidmaps := []specs.LinuxIDMapping{{ContainerID: 0, HostID: uid, Size: 65536}} - gidmaps := []specs.LinuxIDMapping{{ContainerID: 0, HostID: gid, Size: 65536}} - return withRemappedSnapshotBase(id, i, uidmaps, gidmaps, false) -} - -// WithUserNSRemappedSnapshot creates a new snapshot and remaps the uid/gid for the -// filesystem to be used by a container with user namespaces -func WithUserNSRemappedSnapshot(id string, i Image, uidmaps, gidmaps []specs.LinuxIDMapping) NewContainerOpts { - return withRemappedSnapshotBase(id, i, uidmaps, gidmaps, false) -} - -// WithRemappedSnapshotView is similar to WithRemappedSnapshot but rootfs is mounted as read-only. -func WithRemappedSnapshotView(id string, i Image, uid, gid uint32) NewContainerOpts { - uidmaps := []specs.LinuxIDMapping{{ContainerID: 0, HostID: uid, Size: 65536}} - gidmaps := []specs.LinuxIDMapping{{ContainerID: 0, HostID: gid, Size: 65536}} - return withRemappedSnapshotBase(id, i, uidmaps, gidmaps, true) -} - -// WithUserNSRemappedSnapshotView is similar to WithUserNSRemappedSnapshot but rootfs is mounted as read-only. -func WithUserNSRemappedSnapshotView(id string, i Image, uidmaps, gidmaps []specs.LinuxIDMapping) NewContainerOpts { - return withRemappedSnapshotBase(id, i, uidmaps, gidmaps, true) -} - -func withRemappedSnapshotBase(id string, i Image, uidmaps, gidmaps []specs.LinuxIDMapping, readonly bool) NewContainerOpts { - return func(ctx context.Context, client *Client, c *containers.Container) error { - diffIDs, err := i.(*image).i.RootFS(ctx, client.ContentStore(), client.platform) - if err != nil { - return err - } - - rsn := remappedSnapshot{ - Parent: identity.ChainID(diffIDs).String(), - IDMap: userns.IDMap{UidMap: uidmaps, GidMap: gidmaps}, - } - usernsID, err := rsn.ID() - if err != nil { - return fmt.Errorf("failed to remap snapshot: %w", err) - } - - c.Snapshotter, err = client.resolveSnapshotterName(ctx, c.Snapshotter) - if err != nil { - return err - } - snapshotter, err := client.getSnapshotter(ctx, c.Snapshotter) - if err != nil { - return err - } - if _, err := snapshotter.Stat(ctx, usernsID); err == nil { - if _, err := snapshotter.Prepare(ctx, id, usernsID); err == nil { - c.SnapshotKey = id - c.Image = i.Name() - return nil - } else if !errdefs.IsNotFound(err) { - return err - } - } - mounts, err := snapshotter.Prepare(ctx, usernsID+"-remap", rsn.Parent) - if err != nil { - return err - } - if err := remapRootFS(ctx, mounts, rsn.IDMap); err != nil { - snapshotter.Remove(ctx, usernsID) - return err - } - if err := snapshotter.Commit(ctx, usernsID, usernsID+"-remap"); err != nil { - return err - } - if readonly { - _, err = snapshotter.View(ctx, id, usernsID) - } else { - _, err = snapshotter.Prepare(ctx, id, usernsID) - } - if err != nil { - return err - } - c.SnapshotKey = id - c.Image = i.Name() - return nil - } -} - -func remapRootFS(ctx context.Context, mounts []mount.Mount, idMap userns.IDMap) error { - return mount.WithTempMount(ctx, mounts, func(root string) error { - return filepath.Walk(root, chown(root, idMap)) - }) -} - -func chown(root string, idMap userns.IDMap) filepath.WalkFunc { - return func(path string, info os.FileInfo, err error) error { - if err != nil { - return err - } - stat := info.Sys().(*syscall.Stat_t) - h, cerr := idMap.ToHost(userns.User{Uid: stat.Uid, Gid: stat.Gid}) - if cerr != nil { - return cerr - } - // be sure the lchown the path as to not de-reference the symlink to a host file - if cerr = os.Lchown(path, int(h.Uid), int(h.Gid)); cerr != nil { - return cerr - } - // we must retain special permissions such as setuid, setgid and sticky bits - if mode := info.Mode(); mode&os.ModeSymlink == 0 && mode&(os.ModeSetuid|os.ModeSetgid|os.ModeSticky) != 0 { - return os.Chmod(path, mode) - } - return nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/client/container_restore_opts.go b/vendor/github.com/containerd/containerd/v2/client/container_restore_opts.go deleted file mode 100644 index 174ae89d12..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/container_restore_opts.go +++ /dev/null @@ -1,150 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "errors" - "fmt" - - "github.com/containerd/containerd/v2/core/containers" - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/protobuf/proto" - ptypes "github.com/containerd/containerd/v2/pkg/protobuf/types" - "github.com/opencontainers/image-spec/identity" - imagespec "github.com/opencontainers/image-spec/specs-go/v1" -) - -var ( - // ErrImageNameNotFoundInIndex is returned when the image name is not found in the index - ErrImageNameNotFoundInIndex = errors.New("image name not found in index") - // ErrRuntimeNameNotFoundInIndex is returned when the runtime is not found in the index - ErrRuntimeNameNotFoundInIndex = errors.New("runtime not found in index") - // ErrSnapshotterNameNotFoundInIndex is returned when the snapshotter is not found in the index - ErrSnapshotterNameNotFoundInIndex = errors.New("snapshotter not found in index") -) - -// RestoreOpts are options to manage the restore operation -type RestoreOpts func(context.Context, string, *Client, Image, *imagespec.Index) NewContainerOpts - -// WithRestoreImage restores the image for the container -func WithRestoreImage(ctx context.Context, id string, client *Client, checkpoint Image, index *imagespec.Index) NewContainerOpts { - return func(ctx context.Context, client *Client, c *containers.Container) error { - name, ok := index.Annotations[imagespec.AnnotationRefName] - if !ok || name == "" { - return ErrImageNameNotFoundInIndex - } - snapshotter, ok := index.Annotations[checkpointSnapshotterNameLabel] - if !ok || name == "" { - return ErrSnapshotterNameNotFoundInIndex - } - i, err := client.GetImage(ctx, name) - if err != nil { - return err - } - - diffIDs, err := i.(*image).i.RootFS(ctx, client.ContentStore(), client.platform) - if err != nil { - return err - } - parent := identity.ChainID(diffIDs).String() - if _, err := client.SnapshotService(snapshotter).Prepare(ctx, id, parent); err != nil { - return err - } - c.Image = i.Name() - c.SnapshotKey = id - c.Snapshotter = snapshotter - return nil - } -} - -// WithRestoreRuntime restores the runtime for the container -func WithRestoreRuntime(ctx context.Context, id string, client *Client, checkpoint Image, index *imagespec.Index) NewContainerOpts { - return func(ctx context.Context, client *Client, c *containers.Container) error { - name, ok := index.Annotations[checkpointRuntimeNameLabel] - if !ok { - return ErrRuntimeNameNotFoundInIndex - } - - // restore options if present - m, err := GetIndexByMediaType(index, images.MediaTypeContainerd1CheckpointRuntimeOptions) - if err != nil { - if err != ErrMediaTypeNotFound { - return err - } - } - var options ptypes.Any - if m != nil { - store := client.ContentStore() - data, err := content.ReadBlob(ctx, store, *m) - if err != nil { - return fmt.Errorf("unable to read checkpoint runtime: %w", err) - } - if err := proto.Unmarshal(data, &options); err != nil { - return err - } - } - - c.Runtime = containers.RuntimeInfo{ - Name: name, - Options: &options, - } - return nil - } -} - -// WithRestoreSpec restores the spec from the checkpoint for the container -func WithRestoreSpec(ctx context.Context, id string, client *Client, checkpoint Image, index *imagespec.Index) NewContainerOpts { - return func(ctx context.Context, client *Client, c *containers.Container) error { - m, err := GetIndexByMediaType(index, images.MediaTypeContainerd1CheckpointConfig) - if err != nil { - return err - } - store := client.ContentStore() - data, err := content.ReadBlob(ctx, store, *m) - if err != nil { - return fmt.Errorf("unable to read checkpoint config: %w", err) - } - var any ptypes.Any - if err := proto.Unmarshal(data, &any); err != nil { - return err - } - c.Spec = &any - return nil - } -} - -// WithRestoreRW restores the rw layer from the checkpoint for the container -func WithRestoreRW(ctx context.Context, id string, client *Client, checkpoint Image, index *imagespec.Index) NewContainerOpts { - return func(ctx context.Context, client *Client, c *containers.Container) error { - // apply rw layer - rw, err := GetIndexByMediaType(index, imagespec.MediaTypeImageLayerGzip) - if err != nil { - return err - } - mounts, err := client.SnapshotService(c.Snapshotter).Mounts(ctx, c.SnapshotKey) - if err != nil { - return err - } - - if _, err := client.DiffService().Apply(ctx, *rw, mounts); err != nil { - return err - } - return nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/client/containerstore.go b/vendor/github.com/containerd/containerd/v2/client/containerstore.go deleted file mode 100644 index ec354a50ba..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/containerstore.go +++ /dev/null @@ -1,209 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "errors" - "io" - - containersapi "github.com/containerd/containerd/api/services/containers/v1" - "github.com/containerd/errdefs/pkg/errgrpc" - "github.com/containerd/typeurl/v2" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/containerd/containerd/v2/core/containers" - "github.com/containerd/containerd/v2/pkg/protobuf" - ptypes "github.com/containerd/containerd/v2/pkg/protobuf/types" -) - -type remoteContainers struct { - client containersapi.ContainersClient -} - -var _ containers.Store = &remoteContainers{} - -// NewRemoteContainerStore returns the container Store connected with the provided client -func NewRemoteContainerStore(client containersapi.ContainersClient) containers.Store { - return &remoteContainers{ - client: client, - } -} - -func (r *remoteContainers) Get(ctx context.Context, id string) (containers.Container, error) { - resp, err := r.client.Get(ctx, &containersapi.GetContainerRequest{ - ID: id, - }) - if err != nil { - return containers.Container{}, errgrpc.ToNative(err) - } - - return containerFromProto(resp.Container), nil -} - -func (r *remoteContainers) List(ctx context.Context, filters ...string) ([]containers.Container, error) { - containers, err := r.stream(ctx, filters...) - if err != nil { - if err == errStreamNotAvailable { - return r.list(ctx, filters...) - } - return nil, err - } - return containers, nil -} - -func (r *remoteContainers) list(ctx context.Context, filters ...string) ([]containers.Container, error) { - resp, err := r.client.List(ctx, &containersapi.ListContainersRequest{ - Filters: filters, - }) - if err != nil { - return nil, errgrpc.ToNative(err) - } - return containersFromProto(resp.Containers), nil -} - -var errStreamNotAvailable = errors.New("streaming api not available") - -func (r *remoteContainers) stream(ctx context.Context, filters ...string) ([]containers.Container, error) { - session, err := r.client.ListStream(ctx, &containersapi.ListContainersRequest{ - Filters: filters, - }) - if err != nil { - return nil, errgrpc.ToNative(err) - } - var containers []containers.Container - for { - c, err := session.Recv() - if err != nil { - if err == io.EOF { - return containers, nil - } - if s, ok := status.FromError(err); ok { - if s.Code() == codes.Unimplemented { - return nil, errStreamNotAvailable - } - } - return nil, errgrpc.ToNative(err) - } - select { - case <-ctx.Done(): - return containers, ctx.Err() - default: - containers = append(containers, containerFromProto(c.Container)) - } - } -} - -func (r *remoteContainers) Create(ctx context.Context, container containers.Container) (containers.Container, error) { - created, err := r.client.Create(ctx, &containersapi.CreateContainerRequest{ - Container: containerToProto(&container), - }) - if err != nil { - return containers.Container{}, errgrpc.ToNative(err) - } - - return containerFromProto(created.Container), nil - -} - -func (r *remoteContainers) Update(ctx context.Context, container containers.Container, fieldpaths ...string) (containers.Container, error) { - var updateMask *ptypes.FieldMask - if len(fieldpaths) > 0 { - updateMask = &ptypes.FieldMask{ - Paths: fieldpaths, - } - } - - updated, err := r.client.Update(ctx, &containersapi.UpdateContainerRequest{ - Container: containerToProto(&container), - UpdateMask: updateMask, - }) - if err != nil { - return containers.Container{}, errgrpc.ToNative(err) - } - - return containerFromProto(updated.Container), nil - -} - -func (r *remoteContainers) Delete(ctx context.Context, id string) error { - _, err := r.client.Delete(ctx, &containersapi.DeleteContainerRequest{ - ID: id, - }) - - return errgrpc.ToNative(err) - -} - -func containerToProto(container *containers.Container) *containersapi.Container { - extensions := make(map[string]*ptypes.Any) - for k, v := range container.Extensions { - extensions[k] = typeurl.MarshalProto(v) - } - return &containersapi.Container{ - ID: container.ID, - Labels: container.Labels, - Image: container.Image, - Runtime: &containersapi.Container_Runtime{ - Name: container.Runtime.Name, - Options: typeurl.MarshalProto(container.Runtime.Options), - }, - Spec: typeurl.MarshalProto(container.Spec), - Snapshotter: container.Snapshotter, - SnapshotKey: container.SnapshotKey, - Extensions: extensions, - Sandbox: container.SandboxID, - } -} - -func containerFromProto(containerpb *containersapi.Container) containers.Container { - var runtime containers.RuntimeInfo - if containerpb.Runtime != nil { - runtime = containers.RuntimeInfo{ - Name: containerpb.Runtime.Name, - Options: containerpb.Runtime.Options, - } - } - extensions := make(map[string]typeurl.Any) - for k, v := range containerpb.Extensions { - extensions[k] = v - } - return containers.Container{ - ID: containerpb.ID, - Labels: containerpb.Labels, - Image: containerpb.Image, - Runtime: runtime, - Spec: containerpb.Spec, - Snapshotter: containerpb.Snapshotter, - SnapshotKey: containerpb.SnapshotKey, - CreatedAt: protobuf.FromTimestamp(containerpb.CreatedAt), - UpdatedAt: protobuf.FromTimestamp(containerpb.UpdatedAt), - Extensions: extensions, - SandboxID: containerpb.Sandbox, - } -} - -func containersFromProto(containerspb []*containersapi.Container) []containers.Container { - var containers []containers.Container - - for _, container := range containerspb { - containers = append(containers, containerFromProto(container)) - } - - return containers -} diff --git a/vendor/github.com/containerd/containerd/v2/client/diff.go b/vendor/github.com/containerd/containerd/v2/client/diff.go deleted file mode 100644 index 2af19d4a7a..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/diff.go +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - diffapi "github.com/containerd/containerd/api/services/diff/v1" - "github.com/containerd/containerd/v2/core/diff" - "github.com/containerd/containerd/v2/core/diff/proxy" -) - -// DiffService handles the computation and application of diffs -type DiffService interface { - diff.Comparer - diff.Applier -} - -// NewDiffServiceFromClient returns a new diff service which communicates -// over a GRPC connection. -func NewDiffServiceFromClient(client diffapi.DiffClient) DiffService { - return proxy.NewDiffApplier(client).(DiffService) -} diff --git a/vendor/github.com/containerd/containerd/v2/client/events.go b/vendor/github.com/containerd/containerd/v2/client/events.go deleted file mode 100644 index 3f6e252b37..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/events.go +++ /dev/null @@ -1,125 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - - eventsapi "github.com/containerd/containerd/api/services/events/v1" - "github.com/containerd/containerd/api/types" - "github.com/containerd/errdefs/pkg/errgrpc" - "github.com/containerd/typeurl/v2" - - "github.com/containerd/containerd/v2/core/events" - "github.com/containerd/containerd/v2/pkg/protobuf" -) - -// EventService handles the publish, forward and subscribe of events. -type EventService interface { - events.Publisher - events.Forwarder - events.Subscriber -} - -// NewEventServiceFromClient returns a new event service which communicates -// over a GRPC connection. -func NewEventServiceFromClient(client eventsapi.EventsClient) EventService { - return &eventRemote{ - client: client, - } -} - -type eventRemote struct { - client eventsapi.EventsClient -} - -func (e *eventRemote) Publish(ctx context.Context, topic string, event events.Event) error { - evt, err := typeurl.MarshalAny(event) - if err != nil { - return err - } - req := &eventsapi.PublishRequest{ - Topic: topic, - Event: typeurl.MarshalProto(evt), - } - if _, err := e.client.Publish(ctx, req); err != nil { - return errgrpc.ToNative(err) - } - return nil -} - -func (e *eventRemote) Forward(ctx context.Context, envelope *events.Envelope) error { - req := &eventsapi.ForwardRequest{ - Envelope: &types.Envelope{ - Timestamp: protobuf.ToTimestamp(envelope.Timestamp), - Namespace: envelope.Namespace, - Topic: envelope.Topic, - Event: typeurl.MarshalProto(envelope.Event), - }, - } - if _, err := e.client.Forward(ctx, req); err != nil { - return errgrpc.ToNative(err) - } - return nil -} - -func (e *eventRemote) Subscribe(ctx context.Context, filters ...string) (ch <-chan *events.Envelope, errs <-chan error) { - var ( - evq = make(chan *events.Envelope) - errq = make(chan error, 1) - ) - - errs = errq - ch = evq - - session, err := e.client.Subscribe(ctx, &eventsapi.SubscribeRequest{ - Filters: filters, - }) - if err != nil { - errq <- err - close(errq) - return - } - - go func() { - defer close(errq) - - for { - ev, err := session.Recv() - if err != nil { - errq <- err - return - } - - select { - case evq <- &events.Envelope{ - Timestamp: protobuf.FromTimestamp(ev.Timestamp), - Namespace: ev.Namespace, - Topic: ev.Topic, - Event: ev.Event, - }: - case <-ctx.Done(): - if cerr := ctx.Err(); cerr != context.Canceled { - errq <- cerr - } - return - } - } - }() - - return ch, errs -} diff --git a/vendor/github.com/containerd/containerd/v2/client/export.go b/vendor/github.com/containerd/containerd/v2/client/export.go deleted file mode 100644 index bd34c65d42..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/export.go +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "io" - - "github.com/containerd/containerd/v2/core/images/archive" -) - -// Export exports images to a Tar stream. -// The tar archive is in OCI format with a Docker compatible manifest -// when a single target platform is given. -func (c *Client) Export(ctx context.Context, w io.Writer, opts ...archive.ExportOpt) error { - return archive.Export(ctx, c.ContentStore(), w, opts...) -} diff --git a/vendor/github.com/containerd/containerd/v2/client/grpc.go b/vendor/github.com/containerd/containerd/v2/client/grpc.go deleted file mode 100644 index 99325094a9..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/grpc.go +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - - "github.com/containerd/containerd/v2/pkg/namespaces" - "google.golang.org/grpc" -) - -type namespaceInterceptor struct { - namespace string -} - -func (ni namespaceInterceptor) unary(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { - _, ok := namespaces.Namespace(ctx) - if !ok { - ctx = namespaces.WithNamespace(ctx, ni.namespace) - } - return invoker(ctx, method, req, reply, cc, opts...) -} - -func (ni namespaceInterceptor) stream(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) { - _, ok := namespaces.Namespace(ctx) - if !ok { - ctx = namespaces.WithNamespace(ctx, ni.namespace) - } - - return streamer(ctx, desc, cc, method, opts...) -} - -func newNSInterceptors(ns string) (grpc.UnaryClientInterceptor, grpc.StreamClientInterceptor) { - ni := namespaceInterceptor{ - namespace: ns, - } - return grpc.UnaryClientInterceptor(ni.unary), grpc.StreamClientInterceptor(ni.stream) -} diff --git a/vendor/github.com/containerd/containerd/v2/client/image.go b/vendor/github.com/containerd/containerd/v2/client/image.go deleted file mode 100644 index 355bcba73e..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/image.go +++ /dev/null @@ -1,436 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "sync" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/diff" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/images/usage" - "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/internal/kmutex" - "github.com/containerd/containerd/v2/pkg/labels" - "github.com/containerd/containerd/v2/pkg/rootfs" - "github.com/containerd/errdefs" - "github.com/containerd/platforms" - "github.com/opencontainers/go-digest" - "github.com/opencontainers/image-spec/identity" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -// Image describes an image used by containers -type Image interface { - // Name of the image - Name() string - // Target descriptor for the image content - Target() ocispec.Descriptor - // Labels of the image - Labels() map[string]string - // Unpack unpacks the image's content into a snapshot - Unpack(context.Context, string, ...UnpackOpt) error - // RootFS returns the unpacked diffids that make up images rootfs. - RootFS(ctx context.Context) ([]digest.Digest, error) - // Size returns the total size of the image's packed resources. - Size(ctx context.Context) (int64, error) - // Usage returns a usage calculation for the image. - Usage(context.Context, ...UsageOpt) (int64, error) - // Config descriptor for the image. - Config(ctx context.Context) (ocispec.Descriptor, error) - // IsUnpacked returns whether an image is unpacked. - IsUnpacked(context.Context, string) (bool, error) - // ContentStore provides a content store which contains image blob data - ContentStore() content.Store - // Metadata returns the underlying image metadata - Metadata() images.Image - // Platform returns the platform match comparer. Can be nil. - Platform() platforms.MatchComparer - // Spec returns the OCI image spec for a given image. - Spec(ctx context.Context) (ocispec.Image, error) -} - -type usageOptions struct { - manifestLimit *int - manifestOnly bool - snapshots bool -} - -// UsageOpt is used to configure the usage calculation -type UsageOpt func(*usageOptions) error - -// WithUsageManifestLimit sets the limit to the number of manifests which will -// be walked for usage. Setting this value to 0 will require all manifests to -// be walked, returning ErrNotFound if manifests are missing. -// NOTE: By default all manifests which exist will be walked -// and any non-existent manifests and their subobjects will be ignored. -func WithUsageManifestLimit(i int) UsageOpt { - // If 0 then don't filter any manifests - // By default limits to current platform - return func(o *usageOptions) error { - o.manifestLimit = &i - return nil - } -} - -// WithSnapshotUsage will check for referenced snapshots from the image objects -// and include the snapshot size in the total usage. -func WithSnapshotUsage() UsageOpt { - return func(o *usageOptions) error { - o.snapshots = true - return nil - } -} - -// WithManifestUsage is used to get the usage for an image based on what is -// reported by the manifests rather than what exists in the content store. -// NOTE: This function is best used with the manifest limit set to get a -// consistent value, otherwise non-existent manifests will be excluded. -func WithManifestUsage() UsageOpt { - return func(o *usageOptions) error { - o.manifestOnly = true - return nil - } -} - -var _ = (Image)(&image{}) - -// NewImage returns a client image object from the metadata image -func NewImage(client *Client, i images.Image) Image { - return &image{ - client: client, - i: i, - platform: client.platform, - } -} - -// NewImageWithPlatform returns a client image object from the metadata image -func NewImageWithPlatform(client *Client, i images.Image, platform platforms.MatchComparer) Image { - return &image{ - client: client, - i: i, - platform: platform, - } -} - -type image struct { - client *Client - - i images.Image - platform platforms.MatchComparer - diffIDs []digest.Digest - - mu sync.Mutex -} - -func (i *image) Metadata() images.Image { - return i.i -} - -func (i *image) Name() string { - return i.i.Name -} - -func (i *image) Target() ocispec.Descriptor { - return i.i.Target -} - -func (i *image) Labels() map[string]string { - return i.i.Labels -} - -func (i *image) RootFS(ctx context.Context) ([]digest.Digest, error) { - i.mu.Lock() - defer i.mu.Unlock() - if i.diffIDs != nil { - return i.diffIDs, nil - } - - provider := i.client.ContentStore() - diffIDs, err := i.i.RootFS(ctx, provider, i.platform) - if err != nil { - return nil, err - } - i.diffIDs = diffIDs - return diffIDs, nil -} - -func (i *image) Size(ctx context.Context) (int64, error) { - return usage.CalculateImageUsage(ctx, i.i, i.client.ContentStore(), usage.WithManifestLimit(i.platform, 1), usage.WithManifestUsage()) -} - -func (i *image) Usage(ctx context.Context, opts ...UsageOpt) (int64, error) { - var config usageOptions - for _, opt := range opts { - if err := opt(&config); err != nil { - return 0, err - } - } - - var usageOpts []usage.Opt - if config.manifestLimit != nil { - usageOpts = append(usageOpts, usage.WithManifestLimit(i.platform, *config.manifestLimit)) - } - if config.snapshots { - usageOpts = append(usageOpts, usage.WithSnapshotters(i.client.SnapshotService)) - } - if config.manifestOnly { - usageOpts = append(usageOpts, usage.WithManifestUsage()) - } - - return usage.CalculateImageUsage(ctx, i.i, i.client.ContentStore(), usageOpts...) -} - -func (i *image) Config(ctx context.Context) (ocispec.Descriptor, error) { - provider := i.client.ContentStore() - return i.i.Config(ctx, provider, i.platform) -} - -func (i *image) IsUnpacked(ctx context.Context, snapshotterName string) (bool, error) { - sn, err := i.client.getSnapshotter(ctx, snapshotterName) - if err != nil { - return false, err - } - - diffs, err := i.RootFS(ctx) - if err != nil { - return false, err - } - - if _, err := sn.Stat(ctx, identity.ChainID(diffs).String()); err != nil { - if errdefs.IsNotFound(err) { - return false, nil - } - return false, err - } - - return true, nil -} - -func (i *image) Spec(ctx context.Context) (ocispec.Image, error) { - var ociImage ocispec.Image - - desc, err := i.Config(ctx) - if err != nil { - return ociImage, fmt.Errorf("get image config descriptor: %w", err) - } - - blob, err := content.ReadBlob(ctx, i.ContentStore(), desc) - if err != nil { - return ociImage, fmt.Errorf("read image config from content store: %w", err) - } - - if err := json.Unmarshal(blob, &ociImage); err != nil { - return ociImage, fmt.Errorf("unmarshal image config %s: %w", blob, err) - } - - return ociImage, nil -} - -// UnpackConfig provides configuration for the unpack of an image -type UnpackConfig struct { - // ApplyOpts for applying a diff to a snapshotter - ApplyOpts []diff.ApplyOpt - // SnapshotOpts for configuring a snapshotter - SnapshotOpts []snapshots.Opt - // CheckPlatformSupported is whether to validate that a snapshotter - // supports an image's platform before unpacking - CheckPlatformSupported bool - // DuplicationSuppressor is used to make sure that there is only one - // in-flight fetch request or unpack handler for a given descriptor's - // digest or chain ID. - DuplicationSuppressor kmutex.KeyedLocker -} - -// UnpackOpt provides configuration for unpack -type UnpackOpt func(context.Context, *UnpackConfig) error - -// WithSnapshotterPlatformCheck sets `CheckPlatformSupported` on the UnpackConfig -func WithSnapshotterPlatformCheck() UnpackOpt { - return func(ctx context.Context, uc *UnpackConfig) error { - uc.CheckPlatformSupported = true - return nil - } -} - -// WithUnpackDuplicationSuppressor sets `DuplicationSuppressor` on the UnpackConfig. -func WithUnpackDuplicationSuppressor(suppressor kmutex.KeyedLocker) UnpackOpt { - return func(ctx context.Context, uc *UnpackConfig) error { - uc.DuplicationSuppressor = suppressor - return nil - } -} - -// WithUnpackApplyOpts appends new apply options on the UnpackConfig. -func WithUnpackApplyOpts(opts ...diff.ApplyOpt) UnpackOpt { - return func(ctx context.Context, uc *UnpackConfig) error { - uc.ApplyOpts = append(uc.ApplyOpts, opts...) - return nil - } -} - -func (i *image) Unpack(ctx context.Context, snapshotterName string, opts ...UnpackOpt) error { - ctx, done, err := i.client.WithLease(ctx) - if err != nil { - return err - } - defer done(ctx) - - var config UnpackConfig - for _, o := range opts { - if err := o(ctx, &config); err != nil { - return err - } - } - - manifest, err := i.getManifest(ctx, i.platform) - if err != nil { - return err - } - - layers, err := i.getLayers(ctx, manifest) - if err != nil { - return err - } - - var ( - a = i.client.DiffService() - cs = i.client.ContentStore() - - chain []digest.Digest - unpacked bool - ) - snapshotterName, err = i.client.resolveSnapshotterName(ctx, snapshotterName) - if err != nil { - return err - } - sn, err := i.client.getSnapshotter(ctx, snapshotterName) - if err != nil { - return err - } - if config.CheckPlatformSupported { - if err := i.checkSnapshotterSupport(ctx, snapshotterName, manifest); err != nil { - return err - } - } - - for _, layer := range layers { - unpacked, err = rootfs.ApplyLayerWithOpts(ctx, layer, chain, sn, a, config.SnapshotOpts, config.ApplyOpts) - if err != nil { - return fmt.Errorf("apply layer error for %q: %w", i.Name(), err) - } - - if unpacked { - // Set the uncompressed label after the uncompressed - // digest has been verified through apply. - cinfo := content.Info{ - Digest: layer.Blob.Digest, - Labels: map[string]string{ - labels.LabelUncompressed: layer.Diff.Digest.String(), - }, - } - if _, err := cs.Update(ctx, cinfo, "labels."+labels.LabelUncompressed); err != nil { - return err - } - } - - chain = append(chain, layer.Diff.Digest) - } - - desc, err := i.i.Config(ctx, cs, i.platform) - if err != nil { - return err - } - - rootFS := identity.ChainID(chain).String() - - cinfo := content.Info{ - Digest: desc.Digest, - Labels: map[string]string{ - fmt.Sprintf("containerd.io/gc.ref.snapshot.%s", snapshotterName): rootFS, - }, - } - - _, err = cs.Update(ctx, cinfo, fmt.Sprintf("labels.containerd.io/gc.ref.snapshot.%s", snapshotterName)) - return err -} - -func (i *image) getManifest(ctx context.Context, platform platforms.MatchComparer) (ocispec.Manifest, error) { - cs := i.ContentStore() - manifest, err := images.Manifest(ctx, cs, i.i.Target, platform) - if err != nil { - return ocispec.Manifest{}, err - } - return manifest, nil -} - -func (i *image) getLayers(ctx context.Context, manifest ocispec.Manifest) ([]rootfs.Layer, error) { - diffIDs, err := i.RootFS(ctx) - if err != nil { - return nil, fmt.Errorf("failed to resolve rootfs: %w", err) - } - - // parse out the image layers from oci artifact layers - imageLayers := []ocispec.Descriptor{} - for _, ociLayer := range manifest.Layers { - if images.IsLayerType(ociLayer.MediaType) { - imageLayers = append(imageLayers, ociLayer) - } - } - if len(diffIDs) != len(imageLayers) { - return nil, errors.New("mismatched image rootfs and manifest layers") - } - layers := make([]rootfs.Layer, len(diffIDs)) - for i := range diffIDs { - layers[i].Diff = ocispec.Descriptor{ - // TODO: derive media type from compressed type - MediaType: ocispec.MediaTypeImageLayer, - Digest: diffIDs[i], - } - layers[i].Blob = imageLayers[i] - } - return layers, nil -} - -func (i *image) checkSnapshotterSupport(ctx context.Context, snapshotterName string, manifest ocispec.Manifest) error { - snapshotterPlatformMatcher, err := i.client.GetSnapshotterSupportedPlatforms(ctx, snapshotterName) - if err != nil { - return err - } - - manifestPlatform, err := images.ConfigPlatform(ctx, i.ContentStore(), manifest.Config) - if err != nil { - return err - } - - if snapshotterPlatformMatcher.Match(manifestPlatform) { - return nil - } - return fmt.Errorf("snapshotter %s does not support platform %s for image %s", snapshotterName, manifestPlatform, manifest.Config.Digest) -} - -func (i *image) ContentStore() content.Store { - return i.client.ContentStore() -} - -func (i *image) Platform() platforms.MatchComparer { - return i.platform -} diff --git a/vendor/github.com/containerd/containerd/v2/client/image_store.go b/vendor/github.com/containerd/containerd/v2/client/image_store.go deleted file mode 100644 index a5a7d1c9d9..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/image_store.go +++ /dev/null @@ -1,149 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - - imagesapi "github.com/containerd/containerd/api/services/images/v1" - "github.com/containerd/errdefs/pkg/errgrpc" - "google.golang.org/protobuf/types/known/timestamppb" - - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/epoch" - "github.com/containerd/containerd/v2/pkg/oci" - "github.com/containerd/containerd/v2/pkg/protobuf" - ptypes "github.com/containerd/containerd/v2/pkg/protobuf/types" -) - -type remoteImages struct { - client imagesapi.ImagesClient -} - -// NewImageStoreFromClient returns a new image store client -func NewImageStoreFromClient(client imagesapi.ImagesClient) images.Store { - return &remoteImages{ - client: client, - } -} - -func (s *remoteImages) Get(ctx context.Context, name string) (images.Image, error) { - resp, err := s.client.Get(ctx, &imagesapi.GetImageRequest{ - Name: name, - }) - if err != nil { - return images.Image{}, errgrpc.ToNative(err) - } - - return imageFromProto(resp.Image), nil -} - -func (s *remoteImages) List(ctx context.Context, filters ...string) ([]images.Image, error) { - resp, err := s.client.List(ctx, &imagesapi.ListImagesRequest{ - Filters: filters, - }) - if err != nil { - return nil, errgrpc.ToNative(err) - } - - return imagesFromProto(resp.Images), nil -} - -func (s *remoteImages) Create(ctx context.Context, image images.Image) (images.Image, error) { - req := &imagesapi.CreateImageRequest{ - Image: imageToProto(&image), - } - if tm := epoch.FromContext(ctx); tm != nil { - req.SourceDateEpoch = timestamppb.New(*tm) - } - created, err := s.client.Create(ctx, req) - if err != nil { - return images.Image{}, errgrpc.ToNative(err) - } - - return imageFromProto(created.Image), nil -} - -func (s *remoteImages) Update(ctx context.Context, image images.Image, fieldpaths ...string) (images.Image, error) { - var updateMask *ptypes.FieldMask - if len(fieldpaths) > 0 { - updateMask = &ptypes.FieldMask{ - Paths: fieldpaths, - } - } - req := &imagesapi.UpdateImageRequest{ - Image: imageToProto(&image), - UpdateMask: updateMask, - } - if tm := epoch.FromContext(ctx); tm != nil { - req.SourceDateEpoch = timestamppb.New(*tm) - } - updated, err := s.client.Update(ctx, req) - if err != nil { - return images.Image{}, errgrpc.ToNative(err) - } - - return imageFromProto(updated.Image), nil -} - -func (s *remoteImages) Delete(ctx context.Context, name string, opts ...images.DeleteOpt) error { - var do images.DeleteOptions - for _, opt := range opts { - if err := opt(ctx, &do); err != nil { - return err - } - } - req := &imagesapi.DeleteImageRequest{ - Name: name, - Sync: do.Synchronous, - } - if do.Target != nil { - req.Target = oci.DescriptorToProto(*do.Target) - } - _, err := s.client.Delete(ctx, req) - return errgrpc.ToNative(err) -} - -func imageToProto(image *images.Image) *imagesapi.Image { - return &imagesapi.Image{ - Name: image.Name, - Labels: image.Labels, - Target: oci.DescriptorToProto(image.Target), - CreatedAt: protobuf.ToTimestamp(image.CreatedAt), - UpdatedAt: protobuf.ToTimestamp(image.UpdatedAt), - } -} - -func imageFromProto(imagepb *imagesapi.Image) images.Image { - return images.Image{ - Name: imagepb.Name, - Labels: imagepb.Labels, - Target: oci.DescriptorFromProto(imagepb.Target), - CreatedAt: protobuf.FromTimestamp(imagepb.CreatedAt), - UpdatedAt: protobuf.FromTimestamp(imagepb.UpdatedAt), - } -} - -func imagesFromProto(imagespb []*imagesapi.Image) []images.Image { - var images []images.Image - - for _, image := range imagespb { - images = append(images, imageFromProto(image)) - } - - return images -} diff --git a/vendor/github.com/containerd/containerd/v2/client/import.go b/vendor/github.com/containerd/containerd/v2/client/import.go deleted file mode 100644 index 65ae95e22d..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/import.go +++ /dev/null @@ -1,269 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "io" - - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/images/archive" - "github.com/containerd/errdefs" - "github.com/containerd/platforms" - digest "github.com/opencontainers/go-digest" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -type importOpts struct { - indexName string - imageRefT func(string) string - dgstRefT func(digest.Digest) string - skipDgstRef func(string) bool - allPlatforms bool - platformMatcher platforms.MatchComparer - compress bool - discardLayers bool - skipMissing bool - imageLabels map[string]string -} - -// ImportOpt allows the caller to specify import specific options -type ImportOpt func(*importOpts) error - -// WithImageRefTranslator is used to translate the index reference -// to an image reference for the image store. -func WithImageRefTranslator(f func(string) string) ImportOpt { - return func(c *importOpts) error { - c.imageRefT = f - return nil - } -} - -// WithImageLabels are the image labels to apply to a new image -func WithImageLabels(labels map[string]string) ImportOpt { - return func(c *importOpts) error { - c.imageLabels = labels - return nil - } -} - -// WithDigestRef is used to create digest images for each -// manifest in the index. -func WithDigestRef(f func(digest.Digest) string) ImportOpt { - return func(c *importOpts) error { - c.dgstRefT = f - return nil - } -} - -// WithSkipDigestRef is used to specify when to skip applying -// WithDigestRef. The callback receives an image reference (or an empty -// string if not specified in the image). When the callback returns true, -// the skip occurs. -func WithSkipDigestRef(f func(string) bool) ImportOpt { - return func(c *importOpts) error { - c.skipDgstRef = f - return nil - } -} - -// WithIndexName creates a tag pointing to the imported index -func WithIndexName(name string) ImportOpt { - return func(c *importOpts) error { - c.indexName = name - return nil - } -} - -// WithAllPlatforms is used to import content for all platforms. -func WithAllPlatforms(allPlatforms bool) ImportOpt { - return func(c *importOpts) error { - c.allPlatforms = allPlatforms - return nil - } -} - -// WithImportPlatform is used to import content for specific platform. -func WithImportPlatform(platformMacher platforms.MatchComparer) ImportOpt { - return func(c *importOpts) error { - c.platformMatcher = platformMacher - return nil - } -} - -// WithImportCompression compresses uncompressed layers on import. -// This is used for import formats which do not include the manifest. -func WithImportCompression() ImportOpt { - return func(c *importOpts) error { - c.compress = true - return nil - } -} - -// WithDiscardUnpackedLayers allows the garbage collector to clean up -// layers from content store after unpacking. -func WithDiscardUnpackedLayers() ImportOpt { - return func(c *importOpts) error { - c.discardLayers = true - return nil - } -} - -// WithSkipMissing allows to import an archive which doesn't contain all the -// referenced blobs. -func WithSkipMissing() ImportOpt { - return func(c *importOpts) error { - c.skipMissing = true - return nil - } -} - -// Import imports an image from a Tar stream using reader. -// Caller needs to specify importer. Future version may use oci.v1 as the default. -// Note that unreferenced blobs may be imported to the content store as well. -func (c *Client) Import(ctx context.Context, reader io.Reader, opts ...ImportOpt) ([]images.Image, error) { - var iopts importOpts - for _, o := range opts { - if err := o(&iopts); err != nil { - return nil, err - } - } - - ctx, done, err := c.WithLease(ctx) - if err != nil { - return nil, err - } - defer done(ctx) - - var aio []archive.ImportOpt - if iopts.compress { - aio = append(aio, archive.WithImportCompression()) - } - - index, err := archive.ImportIndex(ctx, c.ContentStore(), reader, aio...) - if err != nil { - return nil, err - } - - var ( - imgs []images.Image - cs = c.ContentStore() - is = c.ImageService() - ) - - if iopts.indexName != "" { - imgs = append(imgs, images.Image{ - Name: iopts.indexName, - Target: index, - }) - } - var platformMatcher = c.platform - if iopts.allPlatforms { - platformMatcher = platforms.All - } else if iopts.platformMatcher != nil { - platformMatcher = iopts.platformMatcher - } - - var handler images.HandlerFunc = func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - // Only save images at top level - if desc.Digest != index.Digest { - // Don't set labels on missing content. - children, err := images.Children(ctx, cs, desc) - if iopts.skipMissing && errdefs.IsNotFound(err) { - return nil, images.ErrSkipDesc - } - return children, err - } - - idx, err := decodeIndex(ctx, cs, desc) - if err != nil { - return nil, err - } - - for _, m := range idx.Manifests { - name := imageName(m.Annotations, iopts.imageRefT) - if name != "" { - imgs = append(imgs, images.Image{ - Name: name, - Target: m, - }) - } - if iopts.skipDgstRef != nil { - if iopts.skipDgstRef(name) { - continue - } - } - if iopts.dgstRefT != nil { - ref := iopts.dgstRefT(m.Digest) - if ref != "" { - imgs = append(imgs, images.Image{ - Name: ref, - Target: m, - }) - } - } - } - - return idx.Manifests, nil - } - - handler = images.FilterPlatforms(handler, platformMatcher) - if iopts.discardLayers { - handler = images.SetChildrenMappedLabels(cs, handler, images.ChildGCLabelsFilterLayers) - } else { - handler = images.SetChildrenLabels(cs, handler) - } - if err := images.WalkNotEmpty(ctx, handler, index); err != nil { - return nil, err - } - - for i := range imgs { - fieldsPath := []string{"target"} - if iopts.imageLabels != nil { - fieldsPath = append(fieldsPath, "labels") - imgs[i].Labels = iopts.imageLabels - } - img, err := is.Update(ctx, imgs[i], fieldsPath...) - if err != nil { - if !errdefs.IsNotFound(err) { - return nil, err - } - - img, err = is.Create(ctx, imgs[i]) - if err != nil { - return nil, err - } - } - imgs[i] = img - } - - return imgs, nil -} - -func imageName(annotations map[string]string, ociCleanup func(string) string) string { - name := annotations[images.AnnotationImageName] - if name != "" { - return name - } - name = annotations[ocispec.AnnotationRefName] - if name != "" { - if ociCleanup != nil { - name = ociCleanup(name) - } - } - return name -} diff --git a/vendor/github.com/containerd/containerd/v2/client/install.go b/vendor/github.com/containerd/containerd/v2/client/install.go deleted file mode 100644 index 2f636b277c..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/install.go +++ /dev/null @@ -1,127 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "archive/tar" - "context" - "errors" - "fmt" - "os" - "path/filepath" - "runtime" - "strings" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/archive" - "github.com/containerd/containerd/v2/pkg/archive/compression" -) - -// Install a binary image into the opt service. -// More info: https://github.com/containerd/containerd/blob/main/docs/managed-opt.md. -func (c *Client) Install(ctx context.Context, image Image, opts ...InstallOpts) error { - var config InstallConfig - for _, o := range opts { - o(&config) - } - path, err := c.getInstallPath(ctx, config) - if err != nil { - return err - } - var ( - cs = image.ContentStore() - platform = c.platform - ) - manifest, err := images.Manifest(ctx, cs, image.Target(), platform) - if err != nil { - return err - } - - var binDir, libDir string - if runtime.GOOS == "windows" { - binDir = "Files\\bin" - libDir = "Files\\lib" - } else { - binDir = "bin" - libDir = "lib" - } - for _, layer := range manifest.Layers { - ra, err := cs.ReaderAt(ctx, layer) - if err != nil { - return err - } - cr := content.NewReader(ra) - r, err := compression.DecompressStream(cr) - if err != nil { - ra.Close() - return err - } - - filter := archive.WithFilter(func(hdr *tar.Header) (bool, error) { - d := filepath.Dir(hdr.Name) - result := d == binDir - - if config.Libs { - result = result || d == libDir - } - - if runtime.GOOS == "windows" { - hdr.Name = strings.Replace(hdr.Name, "Files", "", 1) - } - if result && !config.Replace { - if _, err := os.Lstat(filepath.Join(path, hdr.Name)); err == nil { - return false, fmt.Errorf("cannot replace %s in %s", hdr.Name, path) - } - } - return result, nil - }) - - opts := []archive.ApplyOpt{filter} - - if runtime.GOOS == "windows" { - opts = append(opts, archive.WithNoSameOwner()) - } - - if _, err := archive.Apply(ctx, path, r, opts...); err != nil { - r.Close() - ra.Close() - return err - } - r.Close() - ra.Close() - } - return nil -} - -func (c *Client) getInstallPath(ctx context.Context, config InstallConfig) (string, error) { - if config.Path != "" { - return config.Path, nil - } - resp, err := c.IntrospectionService().Plugins(ctx, "id==opt") - if err != nil { - return "", err - } - if len(resp.Plugins) != 1 { - return "", errors.New("opt service not enabled") - } - path := resp.Plugins[0].Exports["path"] - if path == "" { - return "", errors.New("opt path not exported") - } - return path, nil -} diff --git a/vendor/github.com/containerd/containerd/v2/client/install_opts.go b/vendor/github.com/containerd/containerd/v2/client/install_opts.go deleted file mode 100644 index c42d910e87..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/install_opts.go +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -// InstallOpts configures binary installs -type InstallOpts func(*InstallConfig) - -// InstallConfig sets the binary install configuration -type InstallConfig struct { - // Libs installs libs from the image - Libs bool - // Replace will overwrite existing binaries or libs in the opt directory - Replace bool - // Path to install libs and binaries to - Path string -} - -// WithInstallLibs installs libs from the image -func WithInstallLibs(c *InstallConfig) { - c.Libs = true -} - -// WithInstallReplace will replace existing files -func WithInstallReplace(c *InstallConfig) { - c.Replace = true -} - -// WithInstallPath sets the optional install path -func WithInstallPath(path string) InstallOpts { - return func(c *InstallConfig) { - c.Path = path - } -} diff --git a/vendor/github.com/containerd/containerd/v2/client/lease.go b/vendor/github.com/containerd/containerd/v2/client/lease.go deleted file mode 100644 index e0608a7c6c..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/lease.go +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "time" - - "github.com/containerd/containerd/v2/core/leases" -) - -// WithLease attaches a lease on the context -func (c *Client) WithLease(ctx context.Context, opts ...leases.Opt) (context.Context, func(context.Context) error, error) { - nop := func(context.Context) error { return nil } - - _, ok := leases.FromContext(ctx) - if ok { - return ctx, nop, nil - } - - ls := c.LeasesService() - - if len(opts) == 0 { - // Use default lease configuration if no options provided - opts = []leases.Opt{ - leases.WithRandomID(), - leases.WithExpiration(24 * time.Hour), - } - } - - l, err := ls.Create(ctx, opts...) - if err != nil { - return ctx, nop, err - } - - ctx = leases.WithLease(ctx, l.ID) - return ctx, func(ctx context.Context) error { - return ls.Delete(ctx, l) - }, nil -} diff --git a/vendor/github.com/containerd/containerd/v2/client/namespaces.go b/vendor/github.com/containerd/containerd/v2/client/namespaces.go deleted file mode 100644 index ca93e80f62..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/namespaces.go +++ /dev/null @@ -1,122 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "strings" - - api "github.com/containerd/containerd/api/services/namespaces/v1" - "github.com/containerd/errdefs/pkg/errgrpc" - - "github.com/containerd/containerd/v2/pkg/namespaces" - "github.com/containerd/containerd/v2/pkg/protobuf/types" -) - -// NewNamespaceStoreFromClient returns a new namespace store -func NewNamespaceStoreFromClient(client api.NamespacesClient) namespaces.Store { - return &remoteNamespaces{client: client} -} - -type remoteNamespaces struct { - client api.NamespacesClient -} - -func (r *remoteNamespaces) Create(ctx context.Context, namespace string, labels map[string]string) error { - var req api.CreateNamespaceRequest - - req.Namespace = &api.Namespace{ - Name: namespace, - Labels: labels, - } - - _, err := r.client.Create(ctx, &req) - if err != nil { - return errgrpc.ToNative(err) - } - - return nil -} - -func (r *remoteNamespaces) Labels(ctx context.Context, namespace string) (map[string]string, error) { - var req api.GetNamespaceRequest - req.Name = namespace - - resp, err := r.client.Get(ctx, &req) - if err != nil { - return nil, errgrpc.ToNative(err) - } - - return resp.Namespace.Labels, nil -} - -func (r *remoteNamespaces) SetLabel(ctx context.Context, namespace, key, value string) error { - var req api.UpdateNamespaceRequest - - req.Namespace = &api.Namespace{ - Name: namespace, - Labels: map[string]string{key: value}, - } - - req.UpdateMask = &types.FieldMask{ - Paths: []string{strings.Join([]string{"labels", key}, ".")}, - } - - _, err := r.client.Update(ctx, &req) - if err != nil { - return errgrpc.ToNative(err) - } - - return nil -} - -func (r *remoteNamespaces) List(ctx context.Context) ([]string, error) { - var req api.ListNamespacesRequest - - resp, err := r.client.List(ctx, &req) - if err != nil { - return nil, errgrpc.ToNative(err) - } - - var namespaces []string - - for _, ns := range resp.Namespaces { - namespaces = append(namespaces, ns.Name) - } - - return namespaces, nil -} - -func (r *remoteNamespaces) Delete(ctx context.Context, namespace string, opts ...namespaces.DeleteOpts) error { - i := namespaces.DeleteInfo{ - Name: namespace, - } - for _, o := range opts { - if err := o(ctx, &i); err != nil { - return err - } - } - req := api.DeleteNamespaceRequest{ - Name: namespace, - } - _, err := r.client.Delete(ctx, &req) - if err != nil { - return errgrpc.ToNative(err) - } - - return nil -} diff --git a/vendor/github.com/containerd/containerd/v2/client/process.go b/vendor/github.com/containerd/containerd/v2/client/process.go deleted file mode 100644 index e451eaa7d1..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/process.go +++ /dev/null @@ -1,280 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "fmt" - "strings" - "syscall" - "time" - - "github.com/containerd/containerd/api/services/tasks/v1" - "github.com/containerd/errdefs" - "github.com/containerd/errdefs/pkg/errgrpc" - - "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/containerd/v2/pkg/protobuf" - "github.com/containerd/containerd/v2/pkg/tracing" -) - -// Process represents a system process -type Process interface { - // ID of the process - ID() string - // Pid is the system specific process id - Pid() uint32 - // Start starts the process executing the user's defined binary - Start(context.Context) error - // Delete removes the process and any resources allocated returning the exit status - Delete(context.Context, ...ProcessDeleteOpts) (*ExitStatus, error) - // Kill sends the provided signal to the process - Kill(context.Context, syscall.Signal, ...KillOpts) error - // Wait asynchronously waits for the process to exit, and sends the exit code to the returned channel - Wait(context.Context) (<-chan ExitStatus, error) - // CloseIO allows various pipes to be closed on the process - CloseIO(context.Context, ...IOCloserOpts) error - // Resize changes the width and height of the process's terminal - Resize(ctx context.Context, w, h uint32) error - // IO returns the io set for the process - IO() cio.IO - // Status returns the executing status of the process - Status(context.Context) (Status, error) -} - -// NewExitStatus populates an ExitStatus -func NewExitStatus(code uint32, t time.Time, err error) *ExitStatus { - return &ExitStatus{ - code: code, - exitedAt: t, - err: err, - } -} - -// ExitStatus encapsulates a process's exit status. -// It is used by `Wait()` to return either a process exit code or an error -type ExitStatus struct { - code uint32 - exitedAt time.Time - err error -} - -// Result returns the exit code and time of the exit status. -// An error may be returned here to which indicates there was an error -// -// at some point while waiting for the exit status. It does not signify -// an error with the process itself. -// -// If an error is returned, the process may still be running. -func (s ExitStatus) Result() (uint32, time.Time, error) { - return s.code, s.exitedAt, s.err -} - -// ExitCode returns the exit code of the process. -// This is only valid if Error() returns nil. -func (s ExitStatus) ExitCode() uint32 { - return s.code -} - -// ExitTime returns the exit time of the process -// This is only valid if Error() returns nil. -func (s ExitStatus) ExitTime() time.Time { - return s.exitedAt -} - -// Error returns the error, if any, that occurred while waiting for the -// process. -func (s ExitStatus) Error() error { - return s.err -} - -type process struct { - id string - task *task - pid uint32 - io cio.IO -} - -func (p *process) ID() string { - return p.id -} - -// Pid returns the pid of the process -// The pid is not set until start is called and returns -func (p *process) Pid() uint32 { - return p.pid -} - -// Start starts the exec process -func (p *process) Start(ctx context.Context) error { - ctx, span := tracing.StartSpan(ctx, "process.Start", - tracing.WithAttribute("process.id", p.ID()), - tracing.WithAttribute("process.task.id", p.task.ID()), - ) - defer span.End() - r, err := p.task.client.TaskService().Start(ctx, &tasks.StartRequest{ - ContainerID: p.task.id, - ExecID: p.id, - }) - if err != nil { - if p.io != nil { - p.io.Cancel() - p.io.Wait() - p.io.Close() - } - return errgrpc.ToNative(err) - } - span.SetAttributes(tracing.Attribute("process.pid", int(r.Pid))) - p.pid = r.Pid - return nil -} - -func (p *process) Kill(ctx context.Context, s syscall.Signal, opts ...KillOpts) error { - ctx, span := tracing.StartSpan(ctx, "process.Kill", - tracing.WithAttribute("process.id", p.ID()), - tracing.WithAttribute("process.pid", int(p.Pid())), - tracing.WithAttribute("process.task.id", p.task.ID()), - ) - defer span.End() - var i KillInfo - for _, o := range opts { - if err := o(ctx, &i); err != nil { - return err - } - } - _, err := p.task.client.TaskService().Kill(ctx, &tasks.KillRequest{ - Signal: uint32(s), - ContainerID: p.task.id, - ExecID: p.id, - All: i.All, - }) - return errgrpc.ToNative(err) -} - -func (p *process) Wait(ctx context.Context) (<-chan ExitStatus, error) { - c := make(chan ExitStatus, 1) - go func() { - defer close(c) - ctx, span := tracing.StartSpan(ctx, "process.Wait", - tracing.WithAttribute("process.id", p.ID()), - tracing.WithAttribute("process.task.id", p.task.ID()), - ) - defer span.End() - r, err := p.task.client.TaskService().Wait(ctx, &tasks.WaitRequest{ - ContainerID: p.task.id, - ExecID: p.id, - }) - if err != nil { - c <- ExitStatus{ - code: UnknownExitStatus, - err: err, - } - return - } - c <- ExitStatus{ - code: r.ExitStatus, - exitedAt: protobuf.FromTimestamp(r.ExitedAt), - } - }() - return c, nil -} - -func (p *process) CloseIO(ctx context.Context, opts ...IOCloserOpts) error { - ctx, span := tracing.StartSpan(ctx, "process.CloseIO", - tracing.WithAttribute("process.id", p.ID()), - ) - defer span.End() - r := &tasks.CloseIORequest{ - ContainerID: p.task.id, - ExecID: p.id, - } - var i IOCloseInfo - for _, o := range opts { - o(&i) - } - r.Stdin = i.Stdin - _, err := p.task.client.TaskService().CloseIO(ctx, r) - return errgrpc.ToNative(err) -} - -func (p *process) IO() cio.IO { - return p.io -} - -func (p *process) Resize(ctx context.Context, w, h uint32) error { - ctx, span := tracing.StartSpan(ctx, "process.Resize", - tracing.WithAttribute("process.id", p.ID()), - ) - defer span.End() - _, err := p.task.client.TaskService().ResizePty(ctx, &tasks.ResizePtyRequest{ - ContainerID: p.task.id, - Width: w, - Height: h, - ExecID: p.id, - }) - return errgrpc.ToNative(err) -} - -func (p *process) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitStatus, error) { - ctx, span := tracing.StartSpan(ctx, "process.Delete", - tracing.WithAttribute("process.id", p.ID()), - ) - defer span.End() - for _, o := range opts { - if err := o(ctx, p); err != nil { - return nil, err - } - } - status, err := p.Status(ctx) - if err != nil { - return nil, err - } - switch status.Status { - case Running, Paused, Pausing: - return nil, fmt.Errorf("current process state: %s, process must be stopped before deletion: %w", status.Status, errdefs.ErrFailedPrecondition) - } - r, err := p.task.client.TaskService().DeleteProcess(ctx, &tasks.DeleteProcessRequest{ - ContainerID: p.task.id, - ExecID: p.id, - }) - if err != nil { - return nil, errgrpc.ToNative(err) - } - if p.io != nil { - p.io.Cancel() - p.io.Wait() - p.io.Close() - } - return &ExitStatus{code: r.ExitStatus, exitedAt: protobuf.FromTimestamp(r.ExitedAt)}, nil -} - -func (p *process) Status(ctx context.Context) (Status, error) { - r, err := p.task.client.TaskService().Get(ctx, &tasks.GetRequest{ - ContainerID: p.task.id, - ExecID: p.id, - }) - if err != nil { - return Status{}, errgrpc.ToNative(err) - } - status := ProcessStatus(strings.ToLower(r.Process.Status.String())) - exitStatus := r.Process.ExitStatus - - return Status{ - Status: status, - ExitStatus: exitStatus, - }, nil -} diff --git a/vendor/github.com/containerd/containerd/v2/client/pull.go b/vendor/github.com/containerd/containerd/v2/client/pull.go deleted file mode 100644 index c7d169f6a4..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/pull.go +++ /dev/null @@ -1,301 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "errors" - "fmt" - - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "golang.org/x/sync/semaphore" - - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/remotes" - "github.com/containerd/containerd/v2/core/remotes/docker" - "github.com/containerd/containerd/v2/core/transfer" - "github.com/containerd/containerd/v2/core/unpack" - "github.com/containerd/containerd/v2/pkg/tracing" - "github.com/containerd/errdefs" - "github.com/containerd/platforms" -) - -const ( - pullSpanPrefix = "pull" -) - -// Pull downloads the provided content into containerd's content store -// and returns a platform specific image object -func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpt) (_ Image, retErr error) { - ctx, span := tracing.StartSpan(ctx, tracing.Name(pullSpanPrefix, "Pull")) - defer span.End() - - pullCtx := defaultRemoteContext() - - for _, o := range opts { - if err := o(c, pullCtx); err != nil { - return nil, err - } - } - - if resolver, ok := pullCtx.Resolver.(remotes.ResolverWithOptions); ok { - resolver.SetOptions( - transfer.WithConcurrentLayerFetchBuffer(pullCtx.ConcurrentLayerFetchBuffer), - transfer.WithMaxConcurrentDownloads(pullCtx.MaxConcurrentDownloads), - transfer.WithDownloadLimiter(pullCtx.DownloadLimiter), - ) - } - - if pullCtx.PlatformMatcher == nil { - if len(pullCtx.Platforms) > 1 { - return nil, errors.New("cannot pull multiplatform image locally, try Fetch") - } else if len(pullCtx.Platforms) == 0 { - pullCtx.PlatformMatcher = c.platform - } else { - p, err := platforms.Parse(pullCtx.Platforms[0]) - if err != nil { - return nil, fmt.Errorf("invalid platform %s: %w", pullCtx.Platforms[0], err) - } - - pullCtx.PlatformMatcher = platforms.Only(p) - } - } - - span.SetAttributes( - tracing.Attribute("image.ref", ref), - tracing.Attribute("unpack", pullCtx.Unpack), - tracing.Attribute("max.concurrent.downloads", pullCtx.MaxConcurrentDownloads), - tracing.Attribute("concurrent.layer.fetch.buffer", pullCtx.ConcurrentLayerFetchBuffer), - tracing.Attribute("platforms.count", len(pullCtx.Platforms)), - ) - - ctx, done, err := c.WithLease(ctx) - if err != nil { - return nil, err - } - defer done(ctx) - - var unpacker *unpack.Unpacker - - if pullCtx.Unpack { - snapshotterName, err := c.resolveSnapshotterName(ctx, pullCtx.Snapshotter) - if err != nil { - return nil, fmt.Errorf("unable to resolve snapshotter: %w", err) - } - span.SetAttributes(tracing.Attribute("snapshotter.name", snapshotterName)) - var uconfig UnpackConfig - for _, opt := range pullCtx.UnpackOpts { - if err := opt(ctx, &uconfig); err != nil { - return nil, err - } - } - var platformMatcher platforms.Matcher - if !uconfig.CheckPlatformSupported { - platformMatcher = platforms.All - } - - // Check client Unpack config - platform := unpack.Platform{ - Platform: platformMatcher, - SnapshotterKey: snapshotterName, - Snapshotter: c.SnapshotService(snapshotterName), - SnapshotOpts: append(pullCtx.SnapshotterOpts, uconfig.SnapshotOpts...), - Applier: c.DiffService(), - ApplyOpts: uconfig.ApplyOpts, - } - uopts := []unpack.UnpackerOpt{unpack.WithUnpackPlatform(platform)} - if uconfig.DuplicationSuppressor != nil { - uopts = append(uopts, unpack.WithDuplicationSuppressor(uconfig.DuplicationSuppressor)) - } - unpacker, err = unpack.NewUnpacker(ctx, c.ContentStore(), uopts...) - if err != nil { - return nil, fmt.Errorf("unable to initialize unpacker: %w", err) - } - defer func() { - if _, err := unpacker.Wait(); err != nil { - if retErr == nil { - retErr = fmt.Errorf("unpack: %w", err) - } - } - }() - wrapper := pullCtx.HandlerWrapper - pullCtx.HandlerWrapper = func(h images.Handler) images.Handler { - if wrapper == nil { - return unpacker.Unpack(h) - } - return unpacker.Unpack(wrapper(h)) - } - } - - img, err := c.fetch(ctx, pullCtx, ref, 1) - if err != nil { - return nil, err - } - - // NOTE(fuweid): unpacker defers blobs download. before create image - // record in ImageService, should wait for unpacking(including blobs - // download). - var ur unpack.Result - if unpacker != nil { - _, unpackSpan := tracing.StartSpan(ctx, tracing.Name(pullSpanPrefix, "UnpackWait")) - if ur, err = unpacker.Wait(); err != nil { - unpackSpan.SetStatus(err) - unpackSpan.End() - return nil, err - } - unpackSpan.End() - } - - img, err = c.createNewImage(ctx, img) - if err != nil { - return nil, err - } - - i := NewImageWithPlatform(c, img, pullCtx.PlatformMatcher) - span.SetAttributes(tracing.Attribute("image.ref", i.Name())) - - if unpacker != nil && ur.Unpacks == 0 { - // Unpack was tried previously but nothing was unpacked - // This was at least required for schema 1 image. - if err := i.Unpack(ctx, pullCtx.Snapshotter, pullCtx.UnpackOpts...); err != nil { - return nil, fmt.Errorf("failed to unpack image on snapshotter %s: %w", pullCtx.Snapshotter, err) - } - } - - return i, nil -} - -func (c *Client) fetch(ctx context.Context, rCtx *RemoteContext, ref string, limit int) (images.Image, error) { - ctx, span := tracing.StartSpan(ctx, tracing.Name(pullSpanPrefix, "fetch")) - defer span.End() - store := c.ContentStore() - name, desc, err := rCtx.Resolver.Resolve(ctx, ref) - if err != nil { - return images.Image{}, fmt.Errorf("failed to resolve reference %q: %w", ref, err) - } - - fetcher, err := rCtx.Resolver.Fetcher(ctx, name) - if err != nil { - return images.Image{}, fmt.Errorf("failed to get fetcher for %q: %w", name, err) - } - - var ( - handler images.Handler - - isConvertible bool - converterFunc func(context.Context, ocispec.Descriptor) (ocispec.Descriptor, error) - limiter *semaphore.Weighted - ) - if desc.MediaType == images.MediaTypeDockerSchema1Manifest { - return images.Image{}, fmt.Errorf("%w: media type %q is no longer supported since containerd v2.1, please rebuild the image as %q or %q", - errdefs.ErrNotImplemented, - images.MediaTypeDockerSchema1Manifest, images.MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest) - } - // Get all the children for a descriptor - childrenHandler := images.ChildrenHandler(store) - // Set any children labels for that content - childrenHandler = images.SetChildrenMappedLabels(store, childrenHandler, rCtx.ChildLabelMap) - if rCtx.AllMetadata { - // Filter manifests by platforms but allow to handle manifest - // and configuration for not-target platforms - childrenHandler = remotes.FilterManifestByPlatformHandler(childrenHandler, rCtx.PlatformMatcher) - } else { - // Filter children by platforms if specified. - childrenHandler = images.FilterPlatforms(childrenHandler, rCtx.PlatformMatcher) - } - // Sort and limit manifests if a finite number is needed - if limit > 0 { - childrenHandler = images.LimitManifests(childrenHandler, rCtx.PlatformMatcher, limit) - } - - // set isConvertible to true if there is application/octet-stream media type - convertibleHandler := images.HandlerFunc( - func(_ context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - if desc.MediaType == docker.LegacyConfigMediaType { - isConvertible = true - } - - return []ocispec.Descriptor{}, nil - }, - ) - - appendDistSrcLabelHandler, err := docker.AppendDistributionSourceLabel(store, ref) - if err != nil { - return images.Image{}, err - } - - handlers := append(rCtx.BaseHandlers, - remotes.FetchHandler(store, fetcher), - convertibleHandler, - childrenHandler, - appendDistSrcLabelHandler, - ) - - handler = images.Handlers(handlers...) - - converterFunc = func(ctx context.Context, desc ocispec.Descriptor) (ocispec.Descriptor, error) { - return docker.ConvertManifest(ctx, store, desc) - } - - if rCtx.HandlerWrapper != nil { - handler = rCtx.HandlerWrapper(handler) - } - - if err := images.Dispatch(ctx, handler, limiter, desc); err != nil { - return images.Image{}, err - } - - if isConvertible { - if desc, err = converterFunc(ctx, desc); err != nil { - return images.Image{}, err - } - } - - return images.Image{ - Name: name, - Target: desc, - Labels: rCtx.Labels, - }, nil -} - -func (c *Client) createNewImage(ctx context.Context, img images.Image) (images.Image, error) { - ctx, span := tracing.StartSpan(ctx, tracing.Name(pullSpanPrefix, "pull.createNewImage")) - defer span.End() - is := c.ImageService() - for { - if created, err := is.Create(ctx, img); err != nil { - if !errdefs.IsAlreadyExists(err) { - return images.Image{}, err - } - - updated, err := is.Update(ctx, img) - if err != nil { - // if image was removed, try create again - if errdefs.IsNotFound(err) { - continue - } - return images.Image{}, err - } - - img = updated - } else { - img = created - } - - return img, nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/client/sandbox.go b/vendor/github.com/containerd/containerd/v2/client/sandbox.go deleted file mode 100644 index 335debe226..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/sandbox.go +++ /dev/null @@ -1,236 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "errors" - "fmt" - "time" - - "github.com/containerd/errdefs" - "github.com/containerd/typeurl/v2" - - "github.com/containerd/containerd/v2/core/containers" - api "github.com/containerd/containerd/v2/core/sandbox" - "github.com/containerd/containerd/v2/pkg/oci" - "github.com/containerd/containerd/v2/pkg/protobuf/types" -) - -// Sandbox is a high level client to containerd's sandboxes. -type Sandbox interface { - // ID is a sandbox identifier - ID() string - // Metadata returns metadata of the sandbox - Metadata() api.Sandbox - // NewContainer creates new container that will belong to this sandbox - NewContainer(ctx context.Context, id string, opts ...NewContainerOpts) (Container, error) - // Labels returns the labels set on the sandbox - Labels(ctx context.Context) (map[string]string, error) - // Start starts new sandbox instance - Start(ctx context.Context) error - // Stop sends stop request to the shim instance. - Stop(ctx context.Context) error - // Wait blocks until sandbox process exits. - Wait(ctx context.Context) (<-chan ExitStatus, error) - // Shutdown removes sandbox from the metadata store and shutdowns shim instance. - Shutdown(ctx context.Context) error -} - -type sandboxClient struct { - client *Client - metadata api.Sandbox -} - -func (s *sandboxClient) ID() string { - return s.metadata.ID -} - -func (s *sandboxClient) Metadata() api.Sandbox { - return s.metadata -} - -func (s *sandboxClient) NewContainer(ctx context.Context, id string, opts ...NewContainerOpts) (Container, error) { - return s.client.NewContainer(ctx, id, append(opts, WithSandbox(s.ID()))...) -} - -func (s *sandboxClient) Labels(ctx context.Context) (map[string]string, error) { - sandbox, err := s.client.SandboxStore().Get(ctx, s.ID()) - if err != nil { - return nil, err - } - - return sandbox.Labels, nil -} - -func (s *sandboxClient) Start(ctx context.Context) error { - _, err := s.client.SandboxController(s.metadata.Sandboxer).Start(ctx, s.ID()) - if err != nil { - return err - } - - return nil -} - -func (s *sandboxClient) Wait(ctx context.Context) (<-chan ExitStatus, error) { - c := make(chan ExitStatus, 1) - go func() { - defer close(c) - - exitStatus, err := s.client.SandboxController(s.metadata.Sandboxer).Wait(ctx, s.ID()) - if err != nil { - c <- ExitStatus{ - code: UnknownExitStatus, - err: err, - } - return - } - - c <- ExitStatus{ - code: exitStatus.ExitStatus, - exitedAt: exitStatus.ExitedAt, - } - }() - - return c, nil -} - -func (s *sandboxClient) Stop(ctx context.Context) error { - return s.client.SandboxController(s.metadata.Sandboxer).Stop(ctx, s.ID()) -} - -func (s *sandboxClient) Shutdown(ctx context.Context) error { - if err := s.client.SandboxController(s.metadata.Sandboxer).Shutdown(ctx, s.ID()); err != nil && errdefs.IsNotFound(err) { - return fmt.Errorf("failed to shutdown sandbox: %w", err) - } - - if err := s.client.SandboxStore().Delete(ctx, s.ID()); err != nil && !errdefs.IsNotFound(err) { - return fmt.Errorf("failed to delete sandbox from store: %w", err) - } - - return nil -} - -// NewSandbox creates new sandbox client -func (c *Client) NewSandbox(ctx context.Context, sandboxID string, opts ...NewSandboxOpts) (Sandbox, error) { - if sandboxID == "" { - return nil, errors.New("sandbox ID must be specified") - } - - newSandbox := api.Sandbox{ - ID: sandboxID, - CreatedAt: time.Now().UTC(), - UpdatedAt: time.Now().UTC(), - } - - for _, opt := range opts { - if err := opt(ctx, c, &newSandbox); err != nil { - return nil, err - } - } - - metadata, err := c.SandboxStore().Create(ctx, newSandbox) - if err != nil { - return nil, err - } - - return &sandboxClient{ - client: c, - metadata: metadata, - }, nil -} - -// LoadSandbox laods existing sandbox metadata object using the id -func (c *Client) LoadSandbox(ctx context.Context, id string) (Sandbox, error) { - sandbox, err := c.SandboxStore().Get(ctx, id) - if err != nil { - return nil, err - } - - return &sandboxClient{ - client: c, - metadata: sandbox, - }, nil -} - -// NewSandboxOpts is a sandbox options and extensions to be provided by client -type NewSandboxOpts func(ctx context.Context, client *Client, sandbox *api.Sandbox) error - -// WithSandboxRuntime allows a user to specify the runtime to be used to run a sandbox -func WithSandboxRuntime(name string, options interface{}) NewSandboxOpts { - return func(ctx context.Context, client *Client, s *api.Sandbox) error { - if options == nil { - options = &types.Empty{} - } - - opts, err := typeurl.MarshalAny(options) - if err != nil { - return fmt.Errorf("failed to marshal sandbox runtime options: %w", err) - } - - s.Runtime = api.RuntimeOpts{ - Name: name, - Options: opts, - } - - return nil - } -} - -// WithSandboxSpec will provide the sandbox runtime spec -func WithSandboxSpec(s *oci.Spec, opts ...oci.SpecOpts) NewSandboxOpts { - return func(ctx context.Context, client *Client, sandbox *api.Sandbox) error { - c := &containers.Container{ID: sandbox.ID} - - if err := oci.ApplyOpts(ctx, client, c, s, opts...); err != nil { - return err - } - - spec, err := typeurl.MarshalAny(s) - if err != nil { - return fmt.Errorf("failed to marshal spec: %w", err) - } - - sandbox.Spec = spec - return nil - } -} - -// WithSandboxExtension attaches an extension to sandbox -func WithSandboxExtension(name string, extension interface{}) NewSandboxOpts { - return func(ctx context.Context, client *Client, s *api.Sandbox) error { - if s.Extensions == nil { - s.Extensions = make(map[string]typeurl.Any) - } - - ext, err := typeurl.MarshalAny(extension) - if err != nil { - return fmt.Errorf("failed to marshal sandbox extension: %w", err) - } - - s.Extensions[name] = ext - return nil - } -} - -// WithSandboxLabels attaches map of labels to sandbox -func WithSandboxLabels(labels map[string]string) NewSandboxOpts { - return func(ctx context.Context, client *Client, sandbox *api.Sandbox) error { - sandbox.Labels = labels - return nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/client/services.go b/vendor/github.com/containerd/containerd/v2/client/services.go deleted file mode 100644 index 6772aa9c6f..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/services.go +++ /dev/null @@ -1,244 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "fmt" - - containersapi "github.com/containerd/containerd/api/services/containers/v1" - "github.com/containerd/containerd/api/services/diff/v1" - imagesapi "github.com/containerd/containerd/api/services/images/v1" - namespacesapi "github.com/containerd/containerd/api/services/namespaces/v1" - "github.com/containerd/containerd/api/services/tasks/v1" - "github.com/containerd/containerd/v2/core/containers" - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/introspection" - "github.com/containerd/containerd/v2/core/leases" - "github.com/containerd/containerd/v2/core/sandbox" - "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/core/transfer" - "github.com/containerd/containerd/v2/pkg/namespaces" - "github.com/containerd/containerd/v2/plugins" - srv "github.com/containerd/containerd/v2/plugins/services" - "github.com/containerd/plugin" -) - -type services struct { - contentStore content.Store - imageStore images.Store - containerStore containers.Store - namespaceStore namespaces.Store - snapshotters map[string]snapshots.Snapshotter - taskService tasks.TasksClient - diffService DiffService - eventService EventService - leasesService leases.Manager - introspectionService introspection.Service - sandboxStore sandbox.Store - sandboxers map[string]sandbox.Controller - transferService transfer.Transferrer -} - -// ServicesOpt allows callers to set options on the services -type ServicesOpt func(c *services) - -// WithContentStore sets the content store. -func WithContentStore(contentStore content.Store) ServicesOpt { - return func(s *services) { - s.contentStore = contentStore - } -} - -// WithImageClient sets the image service to use using an images client. -func WithImageClient(imageService imagesapi.ImagesClient) ServicesOpt { - return func(s *services) { - s.imageStore = NewImageStoreFromClient(imageService) - } -} - -// WithImageStore sets the image store. -func WithImageStore(imageStore images.Store) ServicesOpt { - return func(s *services) { - s.imageStore = imageStore - } -} - -// WithSnapshotters sets the snapshotters. -func WithSnapshotters(snapshotters map[string]snapshots.Snapshotter) ServicesOpt { - return func(s *services) { - s.snapshotters = make(map[string]snapshots.Snapshotter) - for n, sn := range snapshotters { - s.snapshotters[n] = sn - } - } -} - -// WithContainerClient sets the container service to use using a containers client. -func WithContainerClient(containerService containersapi.ContainersClient) ServicesOpt { - return func(s *services) { - s.containerStore = NewRemoteContainerStore(containerService) - } -} - -// WithContainerStore sets the container store. -func WithContainerStore(containerStore containers.Store) ServicesOpt { - return func(s *services) { - s.containerStore = containerStore - } -} - -// WithTaskClient sets the task service to use from a tasks client. -func WithTaskClient(taskService tasks.TasksClient) ServicesOpt { - return func(s *services) { - s.taskService = taskService - } -} - -// WithDiffClient sets the diff service to use from a diff client. -func WithDiffClient(diffService diff.DiffClient) ServicesOpt { - return func(s *services) { - s.diffService = NewDiffServiceFromClient(diffService) - } -} - -// WithDiffService sets the diff store. -func WithDiffService(diffService DiffService) ServicesOpt { - return func(s *services) { - s.diffService = diffService - } -} - -// WithEventService sets the event service. -func WithEventService(eventService EventService) ServicesOpt { - return func(s *services) { - s.eventService = eventService - } -} - -// WithNamespaceClient sets the namespace service using a namespaces client. -func WithNamespaceClient(namespaceService namespacesapi.NamespacesClient) ServicesOpt { - return func(s *services) { - s.namespaceStore = NewNamespaceStoreFromClient(namespaceService) - } -} - -// WithNamespaceService sets the namespace service. -func WithNamespaceService(namespaceService namespaces.Store) ServicesOpt { - return func(s *services) { - s.namespaceStore = namespaceService - } -} - -// WithLeasesService sets the lease service. -func WithLeasesService(leasesService leases.Manager) ServicesOpt { - return func(s *services) { - s.leasesService = leasesService - } -} - -// WithIntrospectionService sets the introspection service. -func WithIntrospectionService(in introspection.Service) ServicesOpt { - return func(s *services) { - s.introspectionService = in - } -} - -// WithSandboxStore sets the sandbox store. -func WithSandboxStore(client sandbox.Store) ServicesOpt { - return func(s *services) { - s.sandboxStore = client - } -} - -// WithTransferService sets the transfer service. -func WithTransferService(tr transfer.Transferrer) ServicesOpt { - return func(s *services) { - s.transferService = tr - } -} - -// WithInMemoryServices is suitable for cases when there is need to use containerd's client from -// another (in-memory) containerd plugin (such as CRI). -func WithInMemoryServices(ic *plugin.InitContext) Opt { - return func(c *clientOpts) error { - var opts []ServicesOpt - for t, fn := range map[plugin.Type]func(interface{}) ServicesOpt{ - plugins.EventPlugin: func(i interface{}) ServicesOpt { - return WithEventService(i.(EventService)) - }, - plugins.LeasePlugin: func(i interface{}) ServicesOpt { - return WithLeasesService(i.(leases.Manager)) - }, - plugins.SandboxStorePlugin: func(i interface{}) ServicesOpt { - return WithSandboxStore(i.(sandbox.Store)) - }, - plugins.TransferPlugin: func(i interface{}) ServicesOpt { - return WithTransferService(i.(transfer.Transferrer)) - }, - } { - i, err := ic.GetSingle(t) - if err != nil { - return fmt.Errorf("failed to get %q plugin: %w", t, err) - } - opts = append(opts, fn(i)) - } - - plugins, err := ic.GetByType(plugins.ServicePlugin) - if err != nil { - return fmt.Errorf("failed to get service plugin: %w", err) - } - for s, fn := range map[string]func(interface{}) ServicesOpt{ - srv.ContentService: func(s interface{}) ServicesOpt { - return WithContentStore(s.(content.Store)) - }, - srv.ImagesService: func(s interface{}) ServicesOpt { - return WithImageClient(s.(imagesapi.ImagesClient)) - }, - srv.SnapshotsService: func(s interface{}) ServicesOpt { - return WithSnapshotters(s.(map[string]snapshots.Snapshotter)) - }, - srv.ContainersService: func(s interface{}) ServicesOpt { - return WithContainerClient(s.(containersapi.ContainersClient)) - }, - srv.TasksService: func(s interface{}) ServicesOpt { - return WithTaskClient(s.(tasks.TasksClient)) - }, - srv.DiffService: func(s interface{}) ServicesOpt { - return WithDiffClient(s.(diff.DiffClient)) - }, - srv.NamespacesService: func(s interface{}) ServicesOpt { - return WithNamespaceClient(s.(namespacesapi.NamespacesClient)) - }, - srv.IntrospectionService: func(s interface{}) ServicesOpt { - return WithIntrospectionService(s.(introspection.Service)) - }, - } { - i := plugins[s] - if i == nil { - return fmt.Errorf("service %q not found", s) - } - opts = append(opts, fn(i)) - } - - c.services = &services{} - for _, o := range opts { - o(c.services) - } - return nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/client/signals.go b/vendor/github.com/containerd/containerd/v2/client/signals.go deleted file mode 100644 index 9488b22996..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/signals.go +++ /dev/null @@ -1,83 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "encoding/json" - "fmt" - "syscall" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/images" - "github.com/moby/sys/signal" - v1 "github.com/opencontainers/image-spec/specs-go/v1" -) - -// StopSignalLabel is a well-known containerd label for storing the stop -// signal specified in the OCI image config -const StopSignalLabel = "io.containerd.image.config.stop-signal" - -// GetStopSignal retrieves the container stop signal, specified by the -// well-known containerd label (StopSignalLabel) -func GetStopSignal(ctx context.Context, container Container, defaultSignal syscall.Signal) (syscall.Signal, error) { - labels, err := container.Labels(ctx) - if err != nil { - return -1, err - } - - if stopSignal, ok := labels[StopSignalLabel]; ok { - return signal.ParseSignal(stopSignal) - } - - return defaultSignal, nil -} - -// GetOCIStopSignal retrieves the stop signal specified in the OCI image config -func GetOCIStopSignal(ctx context.Context, image Image, defaultSignal string) (string, error) { - _, err := signal.ParseSignal(defaultSignal) - if err != nil { - return "", err - } - ic, err := image.Config(ctx) - if err != nil { - return "", err - } - if !images.IsConfigType(ic.MediaType) { - return "", fmt.Errorf("unknown image config media type %s", ic.MediaType) - } - - var ( - ociimage v1.Image - config v1.ImageConfig - ) - p, err := content.ReadBlob(ctx, image.ContentStore(), ic) - if err != nil { - return "", err - } - - if err = json.Unmarshal(p, &ociimage); err != nil { - return "", err - } - config = ociimage.Config - - if config.StopSignal == "" { - return defaultSignal, nil - } - - return config.StopSignal, nil -} diff --git a/vendor/github.com/containerd/containerd/v2/client/snapshotter_opts_unix.go b/vendor/github.com/containerd/containerd/v2/client/snapshotter_opts_unix.go deleted file mode 100644 index 4e7cca6e85..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/snapshotter_opts_unix.go +++ /dev/null @@ -1,162 +0,0 @@ -//go:build !windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "encoding/json" - "fmt" - "slices" - - "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/internal/userns" - "github.com/opencontainers/go-digest" - "github.com/opencontainers/runtime-spec/specs-go" -) - -const ( - capaRemapIDs = "remap-ids" - capaOnlyRemapIDs = "only-remap-ids" -) - -// WithRemapperLabels creates the labels used by any supporting snapshotter -// to shift the filesystem ownership (user namespace mapping) automatically; currently -// supported by the fuse-overlayfs and overlay snapshotters -func WithRemapperLabels(ctrUID, hostUID, ctrGID, hostGID, length uint32) snapshots.Opt { - uidMap := []specs.LinuxIDMapping{{ContainerID: ctrUID, HostID: hostUID, Size: length}} - gidMap := []specs.LinuxIDMapping{{ContainerID: ctrGID, HostID: hostGID, Size: length}} - return WithUserNSRemapperLabels(uidMap, gidMap) -} - -// WithUserNSRemapperLabels creates the labels used by any supporting snapshotter -// to shift the filesystem ownership (user namespace mapping) automatically; currently -// supported by the fuse-overlayfs and overlay snapshotters -func WithUserNSRemapperLabels(uidmaps, gidmaps []specs.LinuxIDMapping) snapshots.Opt { - idMap := userns.IDMap{ - UidMap: uidmaps, - GidMap: gidmaps, - } - uidmapLabel, gidmapLabel := idMap.Marshal() - return snapshots.WithLabels(map[string]string{ - snapshots.LabelSnapshotUIDMapping: uidmapLabel, - snapshots.LabelSnapshotGIDMapping: gidmapLabel, - }) -} - -func resolveSnapshotOptions(ctx context.Context, client *Client, snapshotterName string, snapshotter snapshots.Snapshotter, parent string, opts ...snapshots.Opt) (string, error) { - capabs, err := client.GetSnapshotterCapabilities(ctx, snapshotterName) - if err != nil { - return "", err - } - - for _, capab := range capabs { - if capab == capaRemapIDs { - // Snapshotter supports ID remapping, we don't need to do anything. - return parent, nil - } - } - - var local snapshots.Info - for _, opt := range opts { - opt(&local) - } - - needsRemap := false - var uidMapLabel, gidMapLabel string - - if value, ok := local.Labels[snapshots.LabelSnapshotUIDMapping]; ok { - needsRemap = true - uidMapLabel = value - } - if value, ok := local.Labels[snapshots.LabelSnapshotGIDMapping]; ok { - needsRemap = true - gidMapLabel = value - } - - if !needsRemap { - return parent, nil - } - - capaOnlyRemap := false - for _, capa := range capabs { - if capa == capaOnlyRemapIDs { - capaOnlyRemap = true - } - } - - if capaOnlyRemap { - return "", fmt.Errorf("snapshotter %q doesn't support idmap mounts on this host, configure `slow_chown` to allow a slower and expensive fallback", snapshotterName) - } - - rsn := remappedSnapshot{Parent: parent} - if err = rsn.IDMap.Unmarshal(uidMapLabel, gidMapLabel); err != nil { - return "", fmt.Errorf("failed to unmarshal uid/gid map snapshotter labels: %w", err) - } - - if _, err := rsn.IDMap.RootPair(); err != nil { - return "", fmt.Errorf("container UID/GID mapping entries of 0 are required but not found") - } - - usernsID, err := rsn.ID() - if err != nil { - return "", fmt.Errorf("failed to remap snapshot: %w", err) - } - - if _, err := snapshotter.Stat(ctx, usernsID); err == nil { - return usernsID, nil - } - mounts, err := snapshotter.Prepare(ctx, usernsID+"-remap", parent) - if err != nil { - return "", err - } - - if err := remapRootFS(ctx, mounts, rsn.IDMap); err != nil { - snapshotter.Remove(ctx, usernsID+"-remap") - return "", err - } - if err := snapshotter.Commit(ctx, usernsID, usernsID+"-remap"); err != nil { - return "", err - } - - return usernsID, nil -} - -type remappedSnapshot struct { - Parent string `json:"Parent"` - IDMap userns.IDMap `json:"IDMap"` -} - -func (s *remappedSnapshot) ID() (string, error) { - compare := func(a, b specs.LinuxIDMapping) int { - if a.ContainerID < b.ContainerID { - return -1 - } else if a.ContainerID == b.ContainerID { - return 0 - } - return 1 - } - slices.SortStableFunc(s.IDMap.UidMap, compare) - slices.SortStableFunc(s.IDMap.GidMap, compare) - - buf, err := json.Marshal(s) - if err != nil { - return "", err - } - return digest.FromBytes(buf).String(), nil -} diff --git a/vendor/github.com/containerd/containerd/v2/client/snapshotter_opts_windows.go b/vendor/github.com/containerd/containerd/v2/client/snapshotter_opts_windows.go deleted file mode 100644 index ab78663c51..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/snapshotter_opts_windows.go +++ /dev/null @@ -1,27 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - - "github.com/containerd/containerd/v2/core/snapshots" -) - -func resolveSnapshotOptions(ctx context.Context, client *Client, snapshotterName string, snapshotter snapshots.Snapshotter, parent string, opts ...snapshots.Opt) (string, error) { - return parent, nil -} diff --git a/vendor/github.com/containerd/containerd/v2/client/task.go b/vendor/github.com/containerd/containerd/v2/client/task.go deleted file mode 100644 index bfe8569e58..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/task.go +++ /dev/null @@ -1,785 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "errors" - "fmt" - "io" - goruntime "runtime" - "strings" - "syscall" - "time" - - "github.com/containerd/containerd/api/services/tasks/v1" - "github.com/containerd/containerd/api/types" - "github.com/containerd/containerd/api/types/runc/options" - "github.com/containerd/errdefs" - "github.com/containerd/errdefs/pkg/errgrpc" - "github.com/containerd/typeurl/v2" - digest "github.com/opencontainers/go-digest" - is "github.com/opencontainers/image-spec/specs-go" - v1 "github.com/opencontainers/image-spec/specs-go/v1" - specs "github.com/opencontainers/runtime-spec/specs-go" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/diff" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/containerd/v2/pkg/oci" - "github.com/containerd/containerd/v2/pkg/protobuf" - google_protobuf "github.com/containerd/containerd/v2/pkg/protobuf/types" - "github.com/containerd/containerd/v2/pkg/rootfs" - "github.com/containerd/containerd/v2/pkg/tracing" - "github.com/containerd/containerd/v2/plugins" -) - -// UnknownExitStatus is returned when containerd is unable to -// determine the exit status of a process. This can happen if the process never starts -// or if an error was encountered when obtaining the exit status, it is set to 255. -const UnknownExitStatus = 255 - -const ( - checkpointDateFormat = "01-02-2006-15:04:05" - checkpointNameFormat = "containerd.io/checkpoint/%s:%s" -) - -// Status returns process status and exit information -type Status struct { - // Status of the process - Status ProcessStatus - // ExitStatus returned by the process - ExitStatus uint32 - // ExitedTime is the time at which the process died - ExitTime time.Time -} - -// ProcessInfo provides platform specific process information -type ProcessInfo struct { - // Pid is the process ID - Pid uint32 - // Info includes additional process information - // Info varies by platform - Info *google_protobuf.Any -} - -// ProcessStatus returns a human readable status for the Process representing its current status -type ProcessStatus string - -const ( - // Running indicates the process is currently executing - Running ProcessStatus = "running" - // Created indicates the process has been created within containerd but the - // user's defined process has not started - Created ProcessStatus = "created" - // Stopped indicates that the process has ran and exited - Stopped ProcessStatus = "stopped" - // Paused indicates that the process is currently paused - Paused ProcessStatus = "paused" - // Pausing indicates that the process is currently switching from a - // running state into a paused state - Pausing ProcessStatus = "pausing" - // Unknown indicates that we could not determine the status from the runtime - Unknown ProcessStatus = "unknown" -) - -// IOCloseInfo allows specific io pipes to be closed on a process -type IOCloseInfo struct { - Stdin bool -} - -// IOCloserOpts allows the caller to set specific pipes as closed on a process -type IOCloserOpts func(*IOCloseInfo) - -// WithStdinCloser closes the stdin of a process -func WithStdinCloser(r *IOCloseInfo) { - r.Stdin = true -} - -// CheckpointTaskInfo allows specific checkpoint information to be set for the task -type CheckpointTaskInfo struct { - Name string - // ParentCheckpoint is the digest of a parent checkpoint - ParentCheckpoint digest.Digest - // Options hold runtime specific settings for checkpointing a task - Options interface{} - - runtime string -} - -// Runtime name for the container -func (i *CheckpointTaskInfo) Runtime() string { - return i.runtime -} - -// CheckpointTaskOpts allows the caller to set checkpoint options -type CheckpointTaskOpts func(*CheckpointTaskInfo) error - -// TaskInfo sets options for task creation -type TaskInfo struct { - // Checkpoint is the Descriptor for an existing checkpoint that can be used - // to restore a task's runtime and memory state - Checkpoint *types.Descriptor - // RootFS is a list of mounts to use as the task's root filesystem - RootFS []mount.Mount - // Options hold runtime specific settings for task creation - Options interface{} - // RuntimePath is an absolute path that can be used to overwrite path - // to a shim runtime binary. - RuntimePath string - - // runtime is the runtime name for the container, and cannot be changed. - runtime string - - // runtimeOptions is the runtime options for the container, and when task options are set, - // they will be based on the runtimeOptions. - // https://github.com/containerd/containerd/issues/11568 - runtimeOptions typeurl.Any -} - -// Runtime name for the container -func (i *TaskInfo) Runtime() string { - return i.runtime -} - -// getRuncOptions returns a reference to the runtime options for use by the task. -// If the set of options is not set by the opts passed into the NewTask creation -// this function first attempts to initialize the runtime options with a copy of the runtimeOptions, -// otherwise an empty set of options is assigned and returned -func (i *TaskInfo) getRuncOptions() (*options.Options, error) { - if i.Options != nil { - opts, ok := i.Options.(*options.Options) - if !ok { - return nil, errors.New("invalid runtime v2 options format") - } - return opts, nil - } - - opts := &options.Options{} - if i.runtimeOptions != nil && i.runtimeOptions.GetValue() != nil { - if err := typeurl.UnmarshalTo(i.runtimeOptions, opts); err != nil { - return nil, fmt.Errorf("failed to get runtime v2 options: %w", err) - } - } - i.Options = opts - return opts, nil -} - -// Task is the executable object within containerd -type Task interface { - Process - - // Pause suspends the execution of the task - Pause(context.Context) error - // Resume the execution of the task - Resume(context.Context) error - // Exec creates a new process inside the task - Exec(context.Context, string, *specs.Process, cio.Creator) (Process, error) - // Pids returns a list of system specific process ids inside the task - Pids(context.Context) ([]ProcessInfo, error) - // Checkpoint serializes the runtime and memory information of a task into an - // OCI Index that can be pushed and pulled from a remote resource. - // - // Additional software like CRIU maybe required to checkpoint and restore tasks - // NOTE: Checkpoint supports to dump task information to a directory, in this way, - // an empty OCI Index will be returned. - Checkpoint(context.Context, ...CheckpointTaskOpts) (Image, error) - // Update modifies executing tasks with updated settings - Update(context.Context, ...UpdateTaskOpts) error - // LoadProcess loads a previously created exec'd process - LoadProcess(context.Context, string, cio.Attach) (Process, error) - // Metrics returns task metrics for runtime specific metrics - // - // The metric types are generic to containerd and change depending on the runtime - // For the built in Linux runtime, github.com/containerd/cgroups.Metrics - // are returned in protobuf format - Metrics(context.Context) (*types.Metric, error) - // Spec returns the current OCI specification for the task - Spec(context.Context) (*oci.Spec, error) -} - -var _ = (Task)(&task{}) - -type task struct { - client *Client - c Container - - io cio.IO - id string - pid uint32 -} - -// Spec returns the current OCI specification for the task -func (t *task) Spec(ctx context.Context) (*oci.Spec, error) { - return t.c.Spec(ctx) -} - -// ID of the task -func (t *task) ID() string { - return t.id -} - -// Pid returns the pid or process id for the task -func (t *task) Pid() uint32 { - return t.pid -} - -func (t *task) Start(ctx context.Context) error { - ctx, span := tracing.StartSpan(ctx, "task.Start", - tracing.WithAttribute("task.id", t.ID()), - ) - defer span.End() - r, err := t.client.TaskService().Start(ctx, &tasks.StartRequest{ - ContainerID: t.id, - }) - if err != nil { - if t.io != nil { - t.io.Cancel() - t.io.Close() - } - return errgrpc.ToNative(err) - } - span.SetAttributes(tracing.Attribute("task.pid", r.Pid)) - t.pid = r.Pid - return nil -} - -func (t *task) Kill(ctx context.Context, s syscall.Signal, opts ...KillOpts) error { - ctx, span := tracing.StartSpan(ctx, "task.Kill", - tracing.WithAttribute("task.id", t.ID()), - tracing.WithAttribute("task.pid", int(t.Pid())), - ) - defer span.End() - var i KillInfo - for _, o := range opts { - if err := o(ctx, &i); err != nil { - return err - } - } - - span.SetAttributes( - tracing.Attribute("task.exec.id", i.ExecID), - tracing.Attribute("task.exec.killall", i.All), - ) - _, err := t.client.TaskService().Kill(ctx, &tasks.KillRequest{ - Signal: uint32(s), - ContainerID: t.id, - ExecID: i.ExecID, - All: i.All, - }) - if err != nil { - return errgrpc.ToNative(err) - } - return nil -} - -func (t *task) Pause(ctx context.Context) error { - ctx, span := tracing.StartSpan(ctx, "task.Pause", - tracing.WithAttribute("task.id", t.ID()), - ) - defer span.End() - _, err := t.client.TaskService().Pause(ctx, &tasks.PauseTaskRequest{ - ContainerID: t.id, - }) - return errgrpc.ToNative(err) -} - -func (t *task) Resume(ctx context.Context) error { - ctx, span := tracing.StartSpan(ctx, "task.Resume", - tracing.WithAttribute("task.id", t.ID()), - ) - defer span.End() - _, err := t.client.TaskService().Resume(ctx, &tasks.ResumeTaskRequest{ - ContainerID: t.id, - }) - return errgrpc.ToNative(err) -} - -func (t *task) Status(ctx context.Context) (Status, error) { - r, err := t.client.TaskService().Get(ctx, &tasks.GetRequest{ - ContainerID: t.id, - }) - if err != nil { - return Status{}, errgrpc.ToNative(err) - } - status := ProcessStatus(strings.ToLower(r.Process.Status.String())) - exitStatus := r.Process.ExitStatus - exitTime := protobuf.FromTimestamp(r.Process.ExitedAt) - - return Status{ - Status: status, - ExitStatus: exitStatus, - ExitTime: exitTime, - }, nil -} - -func (t *task) Wait(ctx context.Context) (<-chan ExitStatus, error) { - c := make(chan ExitStatus, 1) - go func() { - defer close(c) - ctx, span := tracing.StartSpan(ctx, "task.Wait", - tracing.WithAttribute("task.id", t.ID()), - ) - defer span.End() - r, err := t.client.TaskService().Wait(ctx, &tasks.WaitRequest{ - ContainerID: t.id, - }) - if err != nil { - c <- ExitStatus{ - code: UnknownExitStatus, - err: err, - } - return - } - c <- ExitStatus{ - code: r.ExitStatus, - exitedAt: protobuf.FromTimestamp(r.ExitedAt), - } - }() - return c, nil -} - -// Delete deletes the task and its runtime state -// it returns the exit status of the task and any errors that were encountered -// during cleanup -func (t *task) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitStatus, error) { - ctx, span := tracing.StartSpan(ctx, "task.Delete", - tracing.WithAttribute("task.id", t.ID()), - ) - defer span.End() - for _, o := range opts { - if err := o(ctx, t); err != nil { - return nil, err - } - } - status, err := t.Status(ctx) - if err != nil && errdefs.IsNotFound(err) { - return nil, err - } - - switch status.Status { - case Stopped, Unknown, "": - case Created: - if t.client.runtime == plugins.RuntimePlugin.String()+".windows" { - // On windows Created is akin to Stopped - break - } - if t.pid == 0 { - // allow for deletion of created tasks with PID 0 - // https://github.com/containerd/containerd/issues/7357 - break - } - fallthrough - default: - return nil, fmt.Errorf("task must be stopped before deletion: %s: %w", status.Status, errdefs.ErrFailedPrecondition) - } - if t.io != nil { - // io.Wait locks for restored tasks on Windows unless we call - // io.Close first (https://github.com/containerd/containerd/issues/5621) - // in other cases, preserve the contract and let IO finish before closing - if t.client.runtime == plugins.RuntimePlugin.String()+".windows" { - t.io.Close() - } - // io.Cancel is used to cancel the io goroutine while it is in - // fifo-opening state. It does not stop the pipes since these - // should be closed on the shim's side, otherwise we might lose - // data from the container! - t.io.Cancel() - t.io.Wait() - } - r, err := t.client.TaskService().Delete(ctx, &tasks.DeleteTaskRequest{ - ContainerID: t.id, - }) - if err != nil { - return nil, errgrpc.ToNative(err) - } - // Only cleanup the IO after a successful Delete - if t.io != nil { - t.io.Close() - } - return &ExitStatus{code: r.ExitStatus, exitedAt: protobuf.FromTimestamp(r.ExitedAt)}, nil -} - -func (t *task) Exec(ctx context.Context, id string, spec *specs.Process, ioCreate cio.Creator) (_ Process, retErr error) { - ctx, span := tracing.StartSpan(ctx, "task.Exec", - tracing.WithAttribute("task.id", t.ID()), - ) - defer span.End() - if id == "" { - return nil, fmt.Errorf("exec id must not be empty: %w", errdefs.ErrInvalidArgument) - } - span.SetAttributes(tracing.Attribute("task.exec.id", id)) - i, err := ioCreate(id) - if err != nil { - return nil, err - } - defer func() { - if retErr != nil && i != nil { - i.Cancel() - i.Close() - } - }() - pSpec, err := typeurl.MarshalAnyToProto(spec) - if err != nil { - return nil, err - } - cfg := i.Config() - request := &tasks.ExecProcessRequest{ - ContainerID: t.id, - ExecID: id, - Terminal: cfg.Terminal, - Stdin: cfg.Stdin, - Stdout: cfg.Stdout, - Stderr: cfg.Stderr, - Spec: pSpec, - } - if _, err := t.client.TaskService().Exec(ctx, request); err != nil { - i.Cancel() - i.Wait() - i.Close() - return nil, errgrpc.ToNative(err) - } - return &process{ - id: id, - task: t, - io: i, - }, nil -} - -func (t *task) Pids(ctx context.Context) ([]ProcessInfo, error) { - response, err := t.client.TaskService().ListPids(ctx, &tasks.ListPidsRequest{ - ContainerID: t.id, - }) - if err != nil { - return nil, errgrpc.ToNative(err) - } - var processList []ProcessInfo - for _, p := range response.Processes { - processList = append(processList, ProcessInfo{ - Pid: p.Pid, - Info: p.Info, - }) - } - return processList, nil -} - -func (t *task) CloseIO(ctx context.Context, opts ...IOCloserOpts) error { - ctx, span := tracing.StartSpan(ctx, "task.CloseIO", - tracing.WithAttribute("task.id", t.ID()), - ) - defer span.End() - r := &tasks.CloseIORequest{ - ContainerID: t.id, - } - var i IOCloseInfo - for _, o := range opts { - o(&i) - } - r.Stdin = i.Stdin - - _, err := t.client.TaskService().CloseIO(ctx, r) - return errgrpc.ToNative(err) -} - -func (t *task) IO() cio.IO { - return t.io -} - -func (t *task) Resize(ctx context.Context, w, h uint32) error { - ctx, span := tracing.StartSpan(ctx, "task.Resize", - tracing.WithAttribute("task.id", t.ID()), - ) - defer span.End() - _, err := t.client.TaskService().ResizePty(ctx, &tasks.ResizePtyRequest{ - ContainerID: t.id, - Width: w, - Height: h, - }) - return errgrpc.ToNative(err) -} - -// NOTE: Checkpoint supports to dump task information to a directory, in this way, an empty -// OCI Index will be returned. -func (t *task) Checkpoint(ctx context.Context, opts ...CheckpointTaskOpts) (Image, error) { - ctx, done, err := t.client.WithLease(ctx) - if err != nil { - return nil, err - } - defer done(ctx) - cr, err := t.client.ContainerService().Get(ctx, t.id) - if err != nil { - return nil, err - } - - request := &tasks.CheckpointTaskRequest{ - ContainerID: t.id, - } - i := CheckpointTaskInfo{ - runtime: cr.Runtime.Name, - } - for _, o := range opts { - if err := o(&i); err != nil { - return nil, err - } - } - // set a default name - if i.Name == "" { - i.Name = fmt.Sprintf(checkpointNameFormat, t.id, time.Now().Format(checkpointDateFormat)) - } - request.ParentCheckpoint = i.ParentCheckpoint.String() - if i.Options != nil { - o, err := typeurl.MarshalAnyToProto(i.Options) - if err != nil { - return nil, err - } - request.Options = o - } - - status, err := t.Status(ctx) - if err != nil { - return nil, err - } - - if status.Status != Paused { - // make sure we pause it and resume after all other filesystem operations are completed - if err := t.Pause(ctx); err != nil { - return nil, err - } - defer t.Resume(ctx) - } - - index := v1.Index{ - Versioned: is.Versioned{ - SchemaVersion: 2, - }, - Annotations: make(map[string]string), - } - if err := t.checkpointTask(ctx, &index, request); err != nil { - return nil, err - } - // if checkpoint image path passed, jump checkpoint image, - // return an empty image - if isCheckpointPathExist(cr.Runtime.Name, i.Options) { - return NewImage(t.client, images.Image{}), nil - } - - if cr.Image != "" { - if err := t.checkpointImage(ctx, &index, cr.Image); err != nil { - return nil, err - } - index.Annotations["image.name"] = cr.Image - } - if cr.SnapshotKey != "" { - if err := t.checkpointRWSnapshot(ctx, &index, cr.Snapshotter, cr.SnapshotKey); err != nil { - return nil, err - } - } - desc, err := writeIndex(ctx, &index, t.client, t.id) - if err != nil { - return nil, err - } - im := images.Image{ - Name: i.Name, - Target: desc, - Labels: map[string]string{ - "containerd.io/checkpoint": "true", - }, - } - if im, err = t.client.ImageService().Create(ctx, im); err != nil { - return nil, err - } - return NewImage(t.client, im), nil -} - -// UpdateTaskInfo allows updated specific settings to be changed on a task -type UpdateTaskInfo struct { - // Resources updates a tasks resource constraints - Resources interface{} - // Annotations allows arbitrary and/or experimental resource constraints for task update - Annotations map[string]string -} - -// UpdateTaskOpts allows a caller to update task settings -type UpdateTaskOpts func(context.Context, *Client, *UpdateTaskInfo) error - -func (t *task) Update(ctx context.Context, opts ...UpdateTaskOpts) error { - ctx, span := tracing.StartSpan(ctx, "task.Update", - tracing.WithAttribute("task.id", t.ID()), - ) - defer span.End() - request := &tasks.UpdateTaskRequest{ - ContainerID: t.id, - } - var i UpdateTaskInfo - for _, o := range opts { - if err := o(ctx, t.client, &i); err != nil { - return err - } - } - if i.Resources != nil { - r, err := typeurl.MarshalAny(i.Resources) - if err != nil { - return err - } - request.Resources = typeurl.MarshalProto(r) - } - if i.Annotations != nil { - request.Annotations = i.Annotations - } - _, err := t.client.TaskService().Update(ctx, request) - return errgrpc.ToNative(err) -} - -func (t *task) LoadProcess(ctx context.Context, id string, ioAttach cio.Attach) (Process, error) { - if id == t.id && ioAttach == nil { - return t, nil - } - response, err := t.client.TaskService().Get(ctx, &tasks.GetRequest{ - ContainerID: t.id, - ExecID: id, - }) - if err != nil { - err = errgrpc.ToNative(err) - if errdefs.IsNotFound(err) { - return nil, fmt.Errorf("no running process found: %w", err) - } - return nil, err - } - var i cio.IO - if ioAttach != nil { - if i, err = attachExistingIO(response, ioAttach); err != nil { - return nil, err - } - } - return &process{ - id: id, - task: t, - io: i, - }, nil -} - -func (t *task) Metrics(ctx context.Context) (*types.Metric, error) { - response, err := t.client.TaskService().Metrics(ctx, &tasks.MetricsRequest{ - Filters: []string{ - "id==" + t.id, - }, - }) - if err != nil { - return nil, errgrpc.ToNative(err) - } - - if response.Metrics == nil { - _, err := t.Status(ctx) - if err != nil && errdefs.IsNotFound(err) { - return nil, err - } - return nil, errors.New("no metrics received") - } - - return response.Metrics[0], nil -} - -func (t *task) checkpointTask(ctx context.Context, index *v1.Index, request *tasks.CheckpointTaskRequest) error { - response, err := t.client.TaskService().Checkpoint(ctx, request) - if err != nil { - return errgrpc.ToNative(err) - } - // NOTE: response.Descriptors can be an empty slice if checkpoint image is jumped - // add the checkpoint descriptors to the index - for _, d := range response.Descriptors { - index.Manifests = append(index.Manifests, v1.Descriptor{ - MediaType: d.MediaType, - Size: d.Size, - Digest: digest.Digest(d.Digest), - Platform: &v1.Platform{ - OS: goruntime.GOOS, - Architecture: goruntime.GOARCH, - }, - Annotations: d.Annotations, - }) - } - return nil -} - -func (t *task) checkpointRWSnapshot(ctx context.Context, index *v1.Index, snapshotterName string, id string) error { - opts := []diff.Opt{ - diff.WithReference(fmt.Sprintf("checkpoint-rw-%s", id)), - } - rw, err := rootfs.CreateDiff(ctx, id, t.client.SnapshotService(snapshotterName), t.client.DiffService(), opts...) - if err != nil { - return err - } - rw.Platform = &v1.Platform{ - OS: goruntime.GOOS, - Architecture: goruntime.GOARCH, - } - index.Manifests = append(index.Manifests, rw) - return nil -} - -func (t *task) checkpointImage(ctx context.Context, index *v1.Index, image string) error { - if image == "" { - return fmt.Errorf("cannot checkpoint image with empty name") - } - ir, err := t.client.ImageService().Get(ctx, image) - if err != nil { - return err - } - index.Manifests = append(index.Manifests, ir.Target) - return nil -} - -func writeContent(ctx context.Context, store content.Ingester, mediaType, ref string, r io.Reader, opts ...content.Opt) (d v1.Descriptor, err error) { - writer, err := store.Writer(ctx, content.WithRef(ref)) - if err != nil { - return d, err - } - defer writer.Close() - size, err := io.Copy(writer, r) - if err != nil { - return d, err - } - - if err := writer.Commit(ctx, size, "", opts...); err != nil { - if !errdefs.IsAlreadyExists(err) { - return d, err - } - } - return v1.Descriptor{ - MediaType: mediaType, - Digest: writer.Digest(), - Size: size, - }, nil -} - -// isCheckpointPathExist only suitable for runc runtime now -func isCheckpointPathExist(runtime string, v interface{}) bool { - if v == nil { - return false - } - - switch runtime { - case plugins.RuntimeRuncV2: - if opts, ok := v.(*options.CheckpointOptions); ok && opts.ImagePath != "" { - return true - } - } - - return false -} diff --git a/vendor/github.com/containerd/containerd/v2/client/task_opts.go b/vendor/github.com/containerd/containerd/v2/client/task_opts.go deleted file mode 100644 index 27bde35068..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/task_opts.go +++ /dev/null @@ -1,228 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - "errors" - "fmt" - "syscall" - - "github.com/containerd/containerd/api/types" - "github.com/containerd/containerd/api/types/runc/options" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/errdefs" - "github.com/opencontainers/runtime-spec/specs-go" -) - -// NewTaskOpts allows the caller to set options on a new task -type NewTaskOpts func(context.Context, *Client, *TaskInfo) error - -// WithRootFS allows a task to be created without a snapshot being allocated to its container -func WithRootFS(mounts []mount.Mount) NewTaskOpts { - return func(ctx context.Context, c *Client, ti *TaskInfo) error { - ti.RootFS = mounts - return nil - } -} - -// WithRuntimePath will force task service to use a custom path to the runtime binary -// instead of resolving it from runtime name. -func WithRuntimePath(absRuntimePath string) NewTaskOpts { - return func(ctx context.Context, client *Client, info *TaskInfo) error { - info.RuntimePath = absRuntimePath - return nil - } -} - -// WithTaskAPIEndpoint allow task service to manage a task through a given endpoint, -// usually it is served inside a sandbox, and we can get it from sandbox status. -func WithTaskAPIEndpoint(address string, version uint32) NewTaskOpts { - return func(ctx context.Context, client *Client, info *TaskInfo) error { - opts, err := info.getRuncOptions() - if err != nil { - return err - } - opts.TaskApiAddress = address - opts.TaskApiVersion = version - return nil - } -} - -// WithTaskCheckpoint allows a task to be created with live runtime and memory data from a -// previous checkpoint. Additional software such as CRIU may be required to -// restore a task from a checkpoint -func WithTaskCheckpoint(im Image) NewTaskOpts { - return func(ctx context.Context, c *Client, info *TaskInfo) error { - desc := im.Target() - id := desc.Digest - index, err := decodeIndex(ctx, c.ContentStore(), desc) - if err != nil { - return err - } - for _, m := range index.Manifests { - if m.MediaType == images.MediaTypeContainerd1Checkpoint { - info.Checkpoint = &types.Descriptor{ - MediaType: m.MediaType, - Size: m.Size, - Digest: m.Digest.String(), - Annotations: m.Annotations, - } - return nil - } - } - return fmt.Errorf("checkpoint not found in index %s", id) - } -} - -// WithCheckpointName sets the image name for the checkpoint -func WithCheckpointName(name string) CheckpointTaskOpts { - return func(r *CheckpointTaskInfo) error { - r.Name = name - return nil - } -} - -// WithCheckpointImagePath sets image path for checkpoint option -func WithCheckpointImagePath(path string) CheckpointTaskOpts { - return func(r *CheckpointTaskInfo) error { - if r.Options == nil { - r.Options = &options.CheckpointOptions{} - } - opts, ok := r.Options.(*options.CheckpointOptions) - if !ok { - return errors.New("invalid runtime v2 checkpoint options format") - } - opts.ImagePath = path - return nil - } -} - -// WithRestoreImagePath sets image path for create option -func WithRestoreImagePath(path string) NewTaskOpts { - return func(ctx context.Context, c *Client, ti *TaskInfo) error { - opts, err := ti.getRuncOptions() - if err != nil { - return err - } - opts.CriuImagePath = path - return nil - } -} - -// WithRestoreWorkPath sets criu work path for create option -func WithRestoreWorkPath(path string) NewTaskOpts { - return func(ctx context.Context, c *Client, ti *TaskInfo) error { - opts, err := ti.getRuncOptions() - if err != nil { - return err - } - opts.CriuWorkPath = path - return nil - } -} - -// ProcessDeleteOpts allows the caller to set options for the deletion of a task -type ProcessDeleteOpts func(context.Context, Process) error - -// WithProcessKill will forcefully kill and delete a process -func WithProcessKill(ctx context.Context, p Process) error { - // Skip killing tasks with PID 0 - // https://github.com/containerd/containerd/issues/10441 - if p.Pid() == 0 { - return nil - } - - ctx, cancel := context.WithCancel(ctx) - defer cancel() - // ignore errors to wait and kill as we are forcefully killing - // the process and don't care about the exit status - s, err := p.Wait(ctx) - if err != nil { - return err - } - if err := p.Kill(ctx, syscall.SIGKILL, WithKillAll); err != nil { - // Kill might still return an IsNotFound error, even if it actually - // killed the process. - if errdefs.IsNotFound(err) { - select { - case <-ctx.Done(): - return ctx.Err() - case <-s: - return nil - } - } - if errdefs.IsFailedPrecondition(err) { - return nil - } - return err - } - // wait for the process to fully stop before letting the rest of the deletion complete - <-s - return nil -} - -// KillInfo contains information on how to process a Kill action -type KillInfo struct { - // All kills all processes inside the task - // only valid on tasks, ignored on processes - All bool - // ExecID is the ID of a process to kill - ExecID string -} - -// KillOpts allows options to be set for the killing of a process -type KillOpts func(context.Context, *KillInfo) error - -// WithKillAll kills all processes for a task -func WithKillAll(ctx context.Context, i *KillInfo) error { - i.All = true - return nil -} - -// WithKillExecID specifies the process ID -func WithKillExecID(execID string) KillOpts { - return func(ctx context.Context, i *KillInfo) error { - i.ExecID = execID - return nil - } -} - -// WithResources sets the provided resources for task updates. Resources must be -// either a *specs.LinuxResources or a *specs.WindowsResources -func WithResources(resources interface{}) UpdateTaskOpts { - return func(ctx context.Context, client *Client, r *UpdateTaskInfo) error { - switch resources.(type) { - case *specs.LinuxResources: - case *specs.WindowsResources: - default: - return errors.New("WithResources requires a *specs.LinuxResources or *specs.WindowsResources") - } - - r.Resources = resources - return nil - } -} - -// WithAnnotations sets the provided annotations for task updates. -func WithAnnotations(annotations map[string]string) UpdateTaskOpts { - return func(ctx context.Context, client *Client, r *UpdateTaskInfo) error { - r.Annotations = annotations - return nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/client/task_opts_unix.go b/vendor/github.com/containerd/containerd/v2/client/task_opts_unix.go deleted file mode 100644 index 26b5c17bee..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/task_opts_unix.go +++ /dev/null @@ -1,80 +0,0 @@ -//go:build !windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" -) - -// WithNoNewKeyring causes tasks not to be created with a new keyring for secret storage. -// There is an upper limit on the number of keyrings in a linux system -func WithNoNewKeyring(ctx context.Context, c *Client, ti *TaskInfo) error { - opts, err := ti.getRuncOptions() - if err != nil { - return err - } - opts.NoNewKeyring = true - return nil -} - -// WithNoPivotRoot instructs the runtime not to you pivot_root -func WithNoPivotRoot(_ context.Context, _ *Client, ti *TaskInfo) error { - opts, err := ti.getRuncOptions() - if err != nil { - return err - } - opts.NoPivotRoot = true - return nil -} - -// WithShimCgroup sets the existing cgroup for the shim -func WithShimCgroup(path string) NewTaskOpts { - return func(ctx context.Context, c *Client, ti *TaskInfo) error { - opts, err := ti.getRuncOptions() - if err != nil { - return err - } - opts.ShimCgroup = path - return nil - } -} - -// WithUIDOwner allows console I/O to work with the remapped UID in user namespace -func WithUIDOwner(uid uint32) NewTaskOpts { - return func(ctx context.Context, c *Client, ti *TaskInfo) error { - opts, err := ti.getRuncOptions() - if err != nil { - return err - } - opts.IoUid = uid - return nil - } -} - -// WithGIDOwner allows console I/O to work with the remapped GID in user namespace -func WithGIDOwner(gid uint32) NewTaskOpts { - return func(ctx context.Context, c *Client, ti *TaskInfo) error { - opts, err := ti.getRuncOptions() - if err != nil { - return err - } - opts.IoGid = gid - return nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/client/transfer.go b/vendor/github.com/containerd/containerd/v2/client/transfer.go deleted file mode 100644 index 5bd02aa6d2..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/transfer.go +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package client - -import ( - "context" - - "github.com/containerd/containerd/v2/core/streaming" - streamproxy "github.com/containerd/containerd/v2/core/streaming/proxy" - "github.com/containerd/containerd/v2/core/transfer" - "github.com/containerd/containerd/v2/core/transfer/proxy" -) - -func (c *Client) Transfer(ctx context.Context, src interface{}, dest interface{}, opts ...transfer.Opt) error { - ctx, done, err := c.WithLease(ctx) - if err != nil { - return err - } - defer done(ctx) - - return proxy.NewTransferrer(c.conn, c.streamCreator()).Transfer(ctx, src, dest, opts...) -} - -func (c *Client) streamCreator() streaming.StreamCreator { - return streamproxy.NewStreamCreator(c.conn) -} diff --git a/vendor/github.com/containerd/containerd/v2/core/content/proxy/content_reader.go b/vendor/github.com/containerd/containerd/v2/core/content/proxy/content_reader.go deleted file mode 100644 index b591a7749d..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/content/proxy/content_reader.go +++ /dev/null @@ -1,71 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package proxy - -import ( - "context" - - contentapi "github.com/containerd/containerd/api/services/content/v1" - digest "github.com/opencontainers/go-digest" -) - -type remoteReaderAt struct { - ctx context.Context - digest digest.Digest - size int64 - client contentapi.TTRPCContentClient -} - -func (ra *remoteReaderAt) Size() int64 { - return ra.size -} - -func (ra *remoteReaderAt) ReadAt(p []byte, off int64) (n int, err error) { - rr := &contentapi.ReadContentRequest{ - Digest: ra.digest.String(), - Offset: off, - Size: int64(len(p)), - } - // we need a child context with cancel, or the eventually called - // grpc.NewStream will leak the goroutine until the whole thing is cleared. - // See comment at https://godoc.org/google.golang.org/grpc#ClientConn.NewStream - childCtx, cancel := context.WithCancel(ra.ctx) - // we MUST cancel the child context; see comment above - defer cancel() - rc, err := ra.client.Read(childCtx, rr) - if err != nil { - return 0, err - } - - for len(p) > 0 { - var resp *contentapi.ReadContentResponse - // fill our buffer up until we can fill p. - resp, err = rc.Recv() - if err != nil { - return n, err - } - - copied := copy(p, resp.Data) - n += copied - p = p[copied:] - } - return n, nil -} - -func (ra *remoteReaderAt) Close() error { - return nil -} diff --git a/vendor/github.com/containerd/containerd/v2/core/content/proxy/content_store.go b/vendor/github.com/containerd/containerd/v2/core/content/proxy/content_store.go deleted file mode 100644 index 1c1c1cfc86..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/content/proxy/content_store.go +++ /dev/null @@ -1,324 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package proxy - -import ( - "context" - "fmt" - "io" - - contentapi "github.com/containerd/containerd/api/services/content/v1" - "github.com/containerd/errdefs" - "github.com/containerd/errdefs/pkg/errgrpc" - "github.com/containerd/ttrpc" - digest "github.com/opencontainers/go-digest" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "google.golang.org/grpc" - "google.golang.org/protobuf/types/known/emptypb" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/pkg/protobuf" - protobuftypes "github.com/containerd/containerd/v2/pkg/protobuf/types" -) - -type proxyContentStore struct { - // client is the rpc content client - // NOTE: ttrpc is used because it is the smaller interface shared with grpc - client contentapi.TTRPCContentClient -} - -// NewContentStore returns a new content store which communicates over a GRPC -// connection using the containerd content GRPC API. -func NewContentStore(client any) content.Store { - switch c := client.(type) { - case contentapi.ContentClient: - return &proxyContentStore{ - client: convertClient{c}, - } - case grpc.ClientConnInterface: - return &proxyContentStore{ - client: convertClient{contentapi.NewContentClient(c)}, - } - case contentapi.TTRPCContentClient: - return &proxyContentStore{ - client: c, - } - case *ttrpc.Client: - return &proxyContentStore{ - client: contentapi.NewTTRPCContentClient(c), - } - default: - panic(fmt.Errorf("unsupported content client %T: %w", client, errdefs.ErrNotImplemented)) - } -} - -func (pcs *proxyContentStore) Info(ctx context.Context, dgst digest.Digest) (content.Info, error) { - resp, err := pcs.client.Info(ctx, &contentapi.InfoRequest{ - Digest: dgst.String(), - }) - if err != nil { - return content.Info{}, errgrpc.ToNative(err) - } - - return infoFromGRPC(resp.Info), nil -} - -func (pcs *proxyContentStore) Walk(ctx context.Context, fn content.WalkFunc, filters ...string) error { - session, err := pcs.client.List(ctx, &contentapi.ListContentRequest{ - Filters: filters, - }) - if err != nil { - return errgrpc.ToNative(err) - } - - for { - msg, err := session.Recv() - if err != nil { - if err != io.EOF { - return errgrpc.ToNative(err) - } - - break - } - - for _, info := range msg.Info { - if err := fn(infoFromGRPC(info)); err != nil { - return err - } - } - } - - return nil -} - -func (pcs *proxyContentStore) Delete(ctx context.Context, dgst digest.Digest) error { - if _, err := pcs.client.Delete(ctx, &contentapi.DeleteContentRequest{ - Digest: dgst.String(), - }); err != nil { - return errgrpc.ToNative(err) - } - - return nil -} - -// ReaderAt ignores MediaType. -func (pcs *proxyContentStore) ReaderAt(ctx context.Context, desc ocispec.Descriptor) (content.ReaderAt, error) { - i, err := pcs.Info(ctx, desc.Digest) - if err != nil { - return nil, err - } - - return &remoteReaderAt{ - ctx: ctx, - digest: desc.Digest, - size: i.Size, - client: pcs.client, - }, nil -} - -func (pcs *proxyContentStore) Status(ctx context.Context, ref string) (content.Status, error) { - resp, err := pcs.client.Status(ctx, &contentapi.StatusRequest{ - Ref: ref, - }) - if err != nil { - return content.Status{}, errgrpc.ToNative(err) - } - - status := resp.Status - return content.Status{ - Ref: status.Ref, - StartedAt: protobuf.FromTimestamp(status.StartedAt), - UpdatedAt: protobuf.FromTimestamp(status.UpdatedAt), - Offset: status.Offset, - Total: status.Total, - Expected: digest.Digest(status.Expected), - }, nil -} - -func (pcs *proxyContentStore) Update(ctx context.Context, info content.Info, fieldpaths ...string) (content.Info, error) { - resp, err := pcs.client.Update(ctx, &contentapi.UpdateRequest{ - Info: infoToGRPC(&info), - UpdateMask: &protobuftypes.FieldMask{ - Paths: fieldpaths, - }, - }) - if err != nil { - return content.Info{}, errgrpc.ToNative(err) - } - return infoFromGRPC(resp.Info), nil -} - -func (pcs *proxyContentStore) ListStatuses(ctx context.Context, filters ...string) ([]content.Status, error) { - resp, err := pcs.client.ListStatuses(ctx, &contentapi.ListStatusesRequest{ - Filters: filters, - }) - if err != nil { - return nil, errgrpc.ToNative(err) - } - - var statuses []content.Status - for _, status := range resp.Statuses { - statuses = append(statuses, content.Status{ - Ref: status.Ref, - StartedAt: protobuf.FromTimestamp(status.StartedAt), - UpdatedAt: protobuf.FromTimestamp(status.UpdatedAt), - Offset: status.Offset, - Total: status.Total, - Expected: digest.Digest(status.Expected), - }) - } - - return statuses, nil -} - -// Writer ignores MediaType. -func (pcs *proxyContentStore) Writer(ctx context.Context, opts ...content.WriterOpt) (content.Writer, error) { - var wOpts content.WriterOpts - for _, opt := range opts { - if err := opt(&wOpts); err != nil { - return nil, err - } - } - wrclient, offset, err := pcs.negotiate(ctx, wOpts.Ref, wOpts.Desc.Size, wOpts.Desc.Digest) - if err != nil { - return nil, errgrpc.ToNative(err) - } - - return &remoteWriter{ - ref: wOpts.Ref, - client: wrclient, - offset: offset, - }, nil -} - -// Abort implements asynchronous abort. It starts a new write session on the ref l -func (pcs *proxyContentStore) Abort(ctx context.Context, ref string) error { - if _, err := pcs.client.Abort(ctx, &contentapi.AbortRequest{ - Ref: ref, - }); err != nil { - return errgrpc.ToNative(err) - } - - return nil -} - -func (pcs *proxyContentStore) negotiate(ctx context.Context, ref string, size int64, expected digest.Digest) (contentapi.TTRPCContent_WriteClient, int64, error) { - wrclient, err := pcs.client.Write(ctx) - if err != nil { - return nil, 0, err - } - - if err := wrclient.Send(&contentapi.WriteContentRequest{ - Action: contentapi.WriteAction_STAT, - Ref: ref, - Total: size, - Expected: expected.String(), - }); err != nil { - return nil, 0, err - } - - resp, err := wrclient.Recv() - if err != nil { - return nil, 0, err - } - - return wrclient, resp.Offset, nil -} - -type convertClient struct { - contentapi.ContentClient -} - -func (c convertClient) Info(ctx context.Context, req *contentapi.InfoRequest) (*contentapi.InfoResponse, error) { - return c.ContentClient.Info(ctx, req) -} - -func (c convertClient) Update(ctx context.Context, req *contentapi.UpdateRequest) (*contentapi.UpdateResponse, error) { - return c.ContentClient.Update(ctx, req) -} - -type convertListClient struct { - contentapi.Content_ListClient -} - -func (c convertClient) List(ctx context.Context, req *contentapi.ListContentRequest) (contentapi.TTRPCContent_ListClient, error) { - lc, err := c.ContentClient.List(ctx, req) - if lc == nil { - return nil, err - } - return convertListClient{lc}, err -} - -func (c convertClient) Delete(ctx context.Context, req *contentapi.DeleteContentRequest) (*emptypb.Empty, error) { - return c.ContentClient.Delete(ctx, req) -} - -type convertReadClient struct { - contentapi.Content_ReadClient -} - -func (c convertClient) Read(ctx context.Context, req *contentapi.ReadContentRequest) (contentapi.TTRPCContent_ReadClient, error) { - rc, err := c.ContentClient.Read(ctx, req) - if rc == nil { - return nil, err - } - return convertReadClient{rc}, err -} - -func (c convertClient) Status(ctx context.Context, req *contentapi.StatusRequest) (*contentapi.StatusResponse, error) { - return c.ContentClient.Status(ctx, req) -} - -func (c convertClient) ListStatuses(ctx context.Context, req *contentapi.ListStatusesRequest) (*contentapi.ListStatusesResponse, error) { - return c.ContentClient.ListStatuses(ctx, req) -} - -type convertWriteClient struct { - contentapi.Content_WriteClient -} - -func (c convertClient) Write(ctx context.Context) (contentapi.TTRPCContent_WriteClient, error) { - wc, err := c.ContentClient.Write(ctx) - if wc == nil { - return nil, err - } - return convertWriteClient{wc}, err -} - -func (c convertClient) Abort(ctx context.Context, req *contentapi.AbortRequest) (*emptypb.Empty, error) { - return c.ContentClient.Abort(ctx, req) -} - -func infoToGRPC(info *content.Info) *contentapi.Info { - return &contentapi.Info{ - Digest: info.Digest.String(), - Size: info.Size, - CreatedAt: protobuf.ToTimestamp(info.CreatedAt), - UpdatedAt: protobuf.ToTimestamp(info.UpdatedAt), - Labels: info.Labels, - } -} - -func infoFromGRPC(info *contentapi.Info) content.Info { - return content.Info{ - Digest: digest.Digest(info.Digest), - Size: info.Size, - CreatedAt: protobuf.FromTimestamp(info.CreatedAt), - UpdatedAt: protobuf.FromTimestamp(info.UpdatedAt), - Labels: info.Labels, - } -} diff --git a/vendor/github.com/containerd/containerd/v2/core/content/proxy/content_writer.go b/vendor/github.com/containerd/containerd/v2/core/content/proxy/content_writer.go deleted file mode 100644 index 45718be7d8..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/content/proxy/content_writer.go +++ /dev/null @@ -1,155 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package proxy - -import ( - "context" - "fmt" - "io" - "slices" - - contentapi "github.com/containerd/containerd/api/services/content/v1" - "github.com/containerd/errdefs/pkg/errgrpc" - digest "github.com/opencontainers/go-digest" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/defaults" - "github.com/containerd/containerd/v2/pkg/protobuf" -) - -type remoteWriter struct { - ref string - client contentapi.TTRPCContent_WriteClient - offset int64 - digest digest.Digest -} - -// send performs a synchronous req-resp cycle on the client. -func (rw *remoteWriter) send(req *contentapi.WriteContentRequest) (*contentapi.WriteContentResponse, error) { - if err := rw.client.Send(req); err != nil { - return nil, err - } - - resp, err := rw.client.Recv() - - if err == nil { - // try to keep these in sync - if resp.Digest != "" { - rw.digest = digest.Digest(resp.Digest) - } - } - - return resp, err -} - -func (rw *remoteWriter) Status() (content.Status, error) { - resp, err := rw.send(&contentapi.WriteContentRequest{ - Action: contentapi.WriteAction_STAT, - }) - if err != nil { - return content.Status{}, fmt.Errorf("error getting writer status: %w", errgrpc.ToNative(err)) - } - - return content.Status{ - Ref: rw.ref, - Offset: resp.Offset, - Total: resp.Total, - StartedAt: protobuf.FromTimestamp(resp.StartedAt), - UpdatedAt: protobuf.FromTimestamp(resp.UpdatedAt), - }, nil -} - -func (rw *remoteWriter) Digest() digest.Digest { - return rw.digest -} - -func (rw *remoteWriter) Write(p []byte) (n int, err error) { - const maxBufferSize = defaults.DefaultMaxSendMsgSize >> 1 - for data := range slices.Chunk(p, maxBufferSize) { - offset := rw.offset - - resp, err := rw.send(&contentapi.WriteContentRequest{ - Action: contentapi.WriteAction_WRITE, - Offset: offset, - Data: data, - }) - if err != nil { - return 0, fmt.Errorf("failed to send write: %w", errgrpc.ToNative(err)) - } - - written := int(resp.Offset - offset) - rw.offset += int64(written) - if resp.Digest != "" { - rw.digest = digest.Digest(resp.Digest) - } - n += written - - if written < len(data) { - return n, io.ErrShortWrite - } - } - return n, nil -} - -func (rw *remoteWriter) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) (err error) { - defer func() { - err1 := rw.Close() - if err == nil { - err = err1 - } - }() - - var base content.Info - for _, opt := range opts { - if err := opt(&base); err != nil { - return err - } - } - resp, err := rw.send(&contentapi.WriteContentRequest{ - Action: contentapi.WriteAction_COMMIT, - Total: size, - Offset: rw.offset, - Expected: expected.String(), - Labels: base.Labels, - }) - if err != nil { - return fmt.Errorf("commit failed: %w", errgrpc.ToNative(err)) - } - - if size != 0 && resp.Offset != size { - return fmt.Errorf("unexpected size: %v != %v", resp.Offset, size) - } - - actual := digest.Digest(resp.Digest) - if expected != "" && actual != expected { - return fmt.Errorf("unexpected digest: %v != %v", resp.Digest, expected) - } - - rw.digest = actual - rw.offset = resp.Offset - return nil -} - -func (rw *remoteWriter) Truncate(size int64) error { - // This truncation won't actually be validated until a write is issued. - rw.offset = size - return nil -} - -func (rw *remoteWriter) Close() error { - return rw.client.CloseSend() -} diff --git a/vendor/github.com/containerd/containerd/v2/core/diff/diff.go b/vendor/github.com/containerd/containerd/v2/core/diff/diff.go deleted file mode 100644 index 4838a1c37e..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/diff/diff.go +++ /dev/null @@ -1,148 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package diff - -import ( - "context" - "io" - "time" - - "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/typeurl/v2" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -// Config is used to hold parameters needed for a diff operation -type Config struct { - // MediaType is the type of diff to generate - // Default depends on the differ, - // i.e. application/vnd.oci.image.layer.v1.tar+gzip - MediaType string - - // Reference is the content upload reference - // Default will use a random reference string - Reference string - - // Labels are the labels to apply to the generated content - Labels map[string]string - - // Compressor is a function to compress the diff stream - // instead of the default gzip compressor. Differ passes - // the MediaType of the target diff content to the compressor. - // When using this config, MediaType must be specified as well. - Compressor func(dest io.Writer, mediaType string) (io.WriteCloser, error) - - // SourceDateEpoch specifies the SOURCE_DATE_EPOCH without touching the env vars. - SourceDateEpoch *time.Time -} - -// Opt is used to configure a diff operation -type Opt func(*Config) error - -// Comparer allows creation of filesystem diffs between mounts -type Comparer interface { - // Compare computes the difference between two mounts and returns a - // descriptor for the computed diff. The options can provide - // a ref which can be used to track the content creation of the diff. - // The media type which is used to determine the format of the created - // content can also be provided as an option. - Compare(ctx context.Context, lower, upper []mount.Mount, opts ...Opt) (ocispec.Descriptor, error) -} - -// ApplyConfig is used to hold parameters needed for a apply operation -type ApplyConfig struct { - // ProcessorPayloads specifies the payload sent to various processors - ProcessorPayloads map[string]typeurl.Any - // SyncFs is to synchronize the underlying filesystem containing files - SyncFs bool -} - -// ApplyOpt is used to configure an Apply operation -type ApplyOpt func(context.Context, ocispec.Descriptor, *ApplyConfig) error - -// Applier allows applying diffs between mounts -type Applier interface { - // Apply applies the content referred to by the given descriptor to - // the provided mount. The method of applying is based on the - // implementation and content descriptor. For example, in the common - // case the descriptor is a file system difference in tar format, - // that tar would be applied on top of the mounts. - Apply(ctx context.Context, desc ocispec.Descriptor, mount []mount.Mount, opts ...ApplyOpt) (ocispec.Descriptor, error) -} - -// WithCompressor sets the function to be used to compress the diff stream. -func WithCompressor(f func(dest io.Writer, mediaType string) (io.WriteCloser, error)) Opt { - return func(c *Config) error { - c.Compressor = f - return nil - } -} - -// WithMediaType sets the media type to use for creating the diff, without -// specifying the differ will choose a default. -func WithMediaType(m string) Opt { - return func(c *Config) error { - c.MediaType = m - return nil - } -} - -// WithReference is used to set the content upload reference used by -// the diff operation. This allows the caller to track the upload through -// the content store. -func WithReference(ref string) Opt { - return func(c *Config) error { - c.Reference = ref - return nil - } -} - -// WithLabels is used to set content labels on the created diff content. -func WithLabels(labels map[string]string) Opt { - return func(c *Config) error { - c.Labels = labels - return nil - } -} - -// WithPayloads sets the apply processor payloads to the config -func WithPayloads(payloads map[string]typeurl.Any) ApplyOpt { - return func(_ context.Context, _ ocispec.Descriptor, c *ApplyConfig) error { - c.ProcessorPayloads = payloads - return nil - } -} - -// WithSyncFs sets sync flag to the config. -func WithSyncFs(sync bool) ApplyOpt { - return func(_ context.Context, _ ocispec.Descriptor, c *ApplyConfig) error { - c.SyncFs = sync - return nil - } -} - -// WithSourceDateEpoch specifies the timestamp used to provide control for reproducibility. -// See also https://reproducible-builds.org/docs/source-date-epoch/ . -// -// Since containerd v2.0, the whiteout timestamps are set to zero (1970-01-01), -// not to the source date epoch. -func WithSourceDateEpoch(tm *time.Time) Opt { - return func(c *Config) error { - c.SourceDateEpoch = tm - return nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/core/diff/proxy/differ.go b/vendor/github.com/containerd/containerd/v2/core/diff/proxy/differ.go deleted file mode 100644 index 8a5a4abd1e..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/diff/proxy/differ.go +++ /dev/null @@ -1,100 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package proxy - -import ( - "context" - - diffapi "github.com/containerd/containerd/api/services/diff/v1" - "github.com/containerd/errdefs/pkg/errgrpc" - "github.com/containerd/typeurl/v2" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "google.golang.org/protobuf/types/known/timestamppb" - - "github.com/containerd/containerd/v2/core/diff" - "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/containerd/v2/pkg/epoch" - "github.com/containerd/containerd/v2/pkg/oci" - ptypes "github.com/containerd/containerd/v2/pkg/protobuf/types" -) - -// NewDiffApplier returns a new comparer and applier which communicates -// over a GRPC connection. -func NewDiffApplier(client diffapi.DiffClient) interface{} { - return &diffRemote{ - client: client, - } -} - -type diffRemote struct { - client diffapi.DiffClient -} - -func (r *diffRemote) Apply(ctx context.Context, desc ocispec.Descriptor, mounts []mount.Mount, opts ...diff.ApplyOpt) (ocispec.Descriptor, error) { - var config diff.ApplyConfig - for _, opt := range opts { - if err := opt(ctx, desc, &config); err != nil { - return ocispec.Descriptor{}, err - } - } - - payloads := make(map[string]*ptypes.Any) - for k, v := range config.ProcessorPayloads { - payloads[k] = typeurl.MarshalProto(v) - } - - req := &diffapi.ApplyRequest{ - Diff: oci.DescriptorToProto(desc), - Mounts: mount.ToProto(mounts), - Payloads: payloads, - SyncFs: config.SyncFs, - } - resp, err := r.client.Apply(ctx, req) - if err != nil { - return ocispec.Descriptor{}, errgrpc.ToNative(err) - } - return oci.DescriptorFromProto(resp.Applied), nil -} - -func (r *diffRemote) Compare(ctx context.Context, a, b []mount.Mount, opts ...diff.Opt) (ocispec.Descriptor, error) { - var config diff.Config - for _, opt := range opts { - if err := opt(&config); err != nil { - return ocispec.Descriptor{}, err - } - } - if tm := epoch.FromContext(ctx); tm != nil && config.SourceDateEpoch == nil { - config.SourceDateEpoch = tm - } - var sourceDateEpoch *timestamppb.Timestamp - if config.SourceDateEpoch != nil { - sourceDateEpoch = timestamppb.New(*config.SourceDateEpoch) - } - req := &diffapi.DiffRequest{ - Left: mount.ToProto(a), - Right: mount.ToProto(b), - MediaType: config.MediaType, - Ref: config.Reference, - Labels: config.Labels, - SourceDateEpoch: sourceDateEpoch, - } - resp, err := r.client.Diff(ctx, req) - if err != nil { - return ocispec.Descriptor{}, errgrpc.ToNative(err) - } - return oci.DescriptorFromProto(resp.Diff), nil -} diff --git a/vendor/github.com/containerd/containerd/v2/core/diff/stream.go b/vendor/github.com/containerd/containerd/v2/core/diff/stream.go deleted file mode 100644 index f44f8fa9ca..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/diff/stream.go +++ /dev/null @@ -1,191 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package diff - -import ( - "context" - "errors" - "io" - "os" - - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/archive/compression" - "github.com/containerd/typeurl/v2" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -var ( - handlers []Handler - - // ErrNoProcessor is returned when no stream processor is available for a media-type - ErrNoProcessor = errors.New("no processor for media-type") -) - -func init() { - // register the default compression handler - RegisterProcessor(compressedHandler) -} - -// RegisterProcessor registers a stream processor for media-types -func RegisterProcessor(handler Handler) { - handlers = append(handlers, handler) -} - -// GetProcessor returns the processor for a media-type -func GetProcessor(ctx context.Context, stream StreamProcessor, payloads map[string]typeurl.Any) (StreamProcessor, error) { - // reverse this list so that user configured handlers come up first - for i := len(handlers) - 1; i >= 0; i-- { - processor, ok := handlers[i](ctx, stream.MediaType()) - if ok { - return processor(ctx, stream, payloads) - } - } - return nil, ErrNoProcessor -} - -// Handler checks a media-type and initializes the processor -type Handler func(ctx context.Context, mediaType string) (StreamProcessorInit, bool) - -// StaticHandler returns the processor init func for a static media-type -func StaticHandler(expectedMediaType string, fn StreamProcessorInit) Handler { - return func(ctx context.Context, mediaType string) (StreamProcessorInit, bool) { - if mediaType == expectedMediaType { - return fn, true - } - return nil, false - } -} - -// StreamProcessorInit returns the initialized stream processor -type StreamProcessorInit func(ctx context.Context, stream StreamProcessor, payloads map[string]typeurl.Any) (StreamProcessor, error) - -// RawProcessor provides access to direct fd for processing -type RawProcessor interface { - // File returns the fd for the read stream of the underlying processor - File() *os.File -} - -// StreamProcessor handles processing a content stream and transforming it into a different media-type -type StreamProcessor interface { - io.ReadCloser - - // MediaType is the resulting media-type that the processor processes the stream into - MediaType() string -} - -func compressedHandler(ctx context.Context, mediaType string) (StreamProcessorInit, bool) { - compressed, err := images.DiffCompression(ctx, mediaType) - if err != nil { - return nil, false - } - if compressed != "" { - return func(ctx context.Context, stream StreamProcessor, payloads map[string]typeurl.Any) (StreamProcessor, error) { - ds, err := compression.DecompressStream(stream) - if err != nil { - return nil, err - } - - return &compressedProcessor{ - rc: ds, - }, nil - }, true - } - return func(ctx context.Context, stream StreamProcessor, payloads map[string]typeurl.Any) (StreamProcessor, error) { - return &stdProcessor{ - rc: stream, - }, nil - }, true -} - -// NewProcessorChain initialized the root StreamProcessor -func NewProcessorChain(mt string, r io.Reader) StreamProcessor { - return &processorChain{ - mt: mt, - rc: r, - } -} - -type processorChain struct { - mt string - rc io.Reader -} - -func (c *processorChain) MediaType() string { - return c.mt -} - -func (c *processorChain) Read(p []byte) (int, error) { - return c.rc.Read(p) -} - -func (c *processorChain) Close() error { - return nil -} - -type stdProcessor struct { - rc StreamProcessor -} - -func (c *stdProcessor) MediaType() string { - return ocispec.MediaTypeImageLayer -} - -func (c *stdProcessor) Read(p []byte) (int, error) { - return c.rc.Read(p) -} - -func (c *stdProcessor) Close() error { - return nil -} - -type compressedProcessor struct { - rc io.ReadCloser -} - -func (c *compressedProcessor) MediaType() string { - return ocispec.MediaTypeImageLayer -} - -func (c *compressedProcessor) Read(p []byte) (int, error) { - return c.rc.Read(p) -} - -func (c *compressedProcessor) Close() error { - return c.rc.Close() -} - -// BinaryHandler creates a new stream processor handler which calls out to the given binary. -// The id is used to identify the stream processor and allows the caller to send -// payloads specific for that stream processor (i.e. decryption keys for decrypt stream processor). -// The binary will be called for the provided mediaTypes and return the given media type. -func BinaryHandler(id, returnsMediaType string, mediaTypes []string, path string, args, env []string) Handler { - set := make(map[string]struct{}, len(mediaTypes)) - for _, m := range mediaTypes { - set[m] = struct{}{} - } - return func(_ context.Context, mediaType string) (StreamProcessorInit, bool) { - if _, ok := set[mediaType]; ok { - return func(ctx context.Context, stream StreamProcessor, payloads map[string]typeurl.Any) (StreamProcessor, error) { - payload := payloads[id] - return NewBinaryProcessor(ctx, mediaType, returnsMediaType, stream, path, args, env, payload) - }, true - } - return nil, false - } -} - -const mediaTypeEnvVar = "STREAM_PROCESSOR_MEDIATYPE" diff --git a/vendor/github.com/containerd/containerd/v2/core/diff/stream_unix.go b/vendor/github.com/containerd/containerd/v2/core/diff/stream_unix.go deleted file mode 100644 index 28ef3b45b9..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/diff/stream_unix.go +++ /dev/null @@ -1,164 +0,0 @@ -//go:build !windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package diff - -import ( - "bytes" - "context" - "errors" - "fmt" - "io" - "os" - "os/exec" - "sync" - - "github.com/containerd/containerd/v2/pkg/protobuf/proto" - "github.com/containerd/typeurl/v2" -) - -// NewBinaryProcessor returns a binary processor for use with processing content streams -func NewBinaryProcessor(ctx context.Context, imt, rmt string, stream StreamProcessor, name string, args, env []string, payload typeurl.Any) (StreamProcessor, error) { - cmd := exec.CommandContext(ctx, name, args...) - cmd.Env = os.Environ() - cmd.Env = append(cmd.Env, env...) - - var payloadC io.Closer - if payload != nil { - pb := typeurl.MarshalProto(payload) - data, err := proto.Marshal(pb) - if err != nil { - return nil, err - } - r, w, err := os.Pipe() - if err != nil { - return nil, err - } - go func() { - io.Copy(w, bytes.NewReader(data)) - w.Close() - }() - - cmd.ExtraFiles = append(cmd.ExtraFiles, r) - payloadC = r - } - cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", mediaTypeEnvVar, imt)) - var ( - stdin io.Reader - closer func() error - err error - ) - if f, ok := stream.(RawProcessor); ok { - stdin = f.File() - closer = f.File().Close - } else { - stdin = stream - } - cmd.Stdin = stdin - r, w, err := os.Pipe() - if err != nil { - return nil, err - } - cmd.Stdout = w - - stderr := bytes.NewBuffer(nil) - cmd.Stderr = stderr - - if err := cmd.Start(); err != nil { - return nil, err - } - p := &binaryProcessor{ - cmd: cmd, - r: r, - mt: rmt, - stderr: stderr, - done: make(chan struct{}), - } - go p.wait() - - // close after start and dup - w.Close() - if closer != nil { - closer() - } - if payloadC != nil { - payloadC.Close() - } - return p, nil -} - -type binaryProcessor struct { - cmd *exec.Cmd - r *os.File - mt string - stderr *bytes.Buffer - - mu sync.Mutex - err error - - // There is a race condition between waiting on c.cmd.Wait() and setting c.err within - // c.wait(), and reading that value from c.Err(). - // Use done to wait for the returned error to be captured and set. - done chan struct{} -} - -func (c *binaryProcessor) Err() error { - c.mu.Lock() - defer c.mu.Unlock() - return c.err -} - -func (c *binaryProcessor) wait() { - if err := c.cmd.Wait(); err != nil { - if _, ok := err.(*exec.ExitError); ok { - c.mu.Lock() - c.err = errors.New(c.stderr.String()) - c.mu.Unlock() - } - } - close(c.done) -} - -func (c *binaryProcessor) Wait(ctx context.Context) error { - select { - case <-c.done: - return c.Err() - case <-ctx.Done(): - return ctx.Err() - } -} - -func (c *binaryProcessor) File() *os.File { - return c.r -} - -func (c *binaryProcessor) MediaType() string { - return c.mt -} - -func (c *binaryProcessor) Read(p []byte) (int, error) { - return c.r.Read(p) -} - -func (c *binaryProcessor) Close() error { - err := c.r.Close() - if kerr := c.cmd.Process.Kill(); err == nil { - err = kerr - } - return err -} diff --git a/vendor/github.com/containerd/containerd/v2/core/diff/stream_windows.go b/vendor/github.com/containerd/containerd/v2/core/diff/stream_windows.go deleted file mode 100644 index 4f068cfc15..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/diff/stream_windows.go +++ /dev/null @@ -1,181 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package diff - -import ( - "bytes" - "context" - "errors" - "fmt" - "io" - "os" - "os/exec" - "path/filepath" - "sync" - - "github.com/Microsoft/go-winio" - - "github.com/containerd/containerd/v2/pkg/protobuf/proto" - "github.com/containerd/log" - "github.com/containerd/typeurl/v2" -) - -const processorPipe = "STREAM_PROCESSOR_PIPE" - -// NewBinaryProcessor returns a binary processor for use with processing content streams -func NewBinaryProcessor(ctx context.Context, imt, rmt string, stream StreamProcessor, name string, args, env []string, payload typeurl.Any) (StreamProcessor, error) { - cmd := exec.CommandContext(ctx, name, args...) - cmd.Env = os.Environ() - cmd.Env = append(cmd.Env, env...) - - if payload != nil { - pb := typeurl.MarshalProto(payload) - data, err := proto.Marshal(pb) - if err != nil { - return nil, err - } - up, err := getUiqPath() - if err != nil { - return nil, err - } - path := fmt.Sprintf("\\\\.\\pipe\\containerd-processor-%s-pipe", up) - l, err := winio.ListenPipe(path, nil) - if err != nil { - return nil, err - } - go func() { - defer l.Close() - conn, err := l.Accept() - if err != nil { - log.G(ctx).WithError(err).Error("accept npipe connection") - return - } - io.Copy(conn, bytes.NewReader(data)) - conn.Close() - }() - cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", processorPipe, path)) - } - cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", mediaTypeEnvVar, imt)) - var ( - stdin io.Reader - closer func() error - err error - ) - if f, ok := stream.(RawProcessor); ok { - stdin = f.File() - closer = f.File().Close - } else { - stdin = stream - } - cmd.Stdin = stdin - r, w, err := os.Pipe() - if err != nil { - return nil, err - } - cmd.Stdout = w - stderr := bytes.NewBuffer(nil) - cmd.Stderr = stderr - - if err := cmd.Start(); err != nil { - return nil, err - } - p := &binaryProcessor{ - cmd: cmd, - r: r, - mt: rmt, - stderr: stderr, - done: make(chan struct{}), - } - go p.wait() - - // close after start and dup - w.Close() - if closer != nil { - closer() - } - return p, nil -} - -type binaryProcessor struct { - cmd *exec.Cmd - r *os.File - mt string - stderr *bytes.Buffer - - mu sync.Mutex - err error - - // There is a race condition between waiting on c.cmd.Wait() and setting c.err within - // c.wait(), and reading that value from c.Err(). - // Use done to wait for the returned error to be captured and set. - done chan struct{} -} - -func (c *binaryProcessor) Err() error { - c.mu.Lock() - defer c.mu.Unlock() - return c.err -} - -func (c *binaryProcessor) wait() { - if err := c.cmd.Wait(); err != nil { - if _, ok := err.(*exec.ExitError); ok { - c.mu.Lock() - c.err = errors.New(c.stderr.String()) - c.mu.Unlock() - } - } - close(c.done) -} - -func (c *binaryProcessor) Wait(ctx context.Context) error { - select { - case <-c.done: - return c.Err() - case <-ctx.Done(): - return ctx.Err() - } -} - -func (c *binaryProcessor) File() *os.File { - return c.r -} - -func (c *binaryProcessor) MediaType() string { - return c.mt -} - -func (c *binaryProcessor) Read(p []byte) (int, error) { - return c.r.Read(p) -} - -func (c *binaryProcessor) Close() error { - err := c.r.Close() - if kerr := c.cmd.Process.Kill(); err == nil { - err = kerr - } - return err -} - -func getUiqPath() (string, error) { - dir, err := os.MkdirTemp("", "") - if err != nil { - return "", err - } - os.Remove(dir) - return filepath.Base(dir), nil -} diff --git a/vendor/github.com/containerd/containerd/v2/core/events/events.go b/vendor/github.com/containerd/containerd/v2/core/events/events.go deleted file mode 100644 index ff5642301f..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/events/events.go +++ /dev/null @@ -1,80 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package events - -import ( - "context" - "time" - - "github.com/containerd/typeurl/v2" -) - -// Envelope provides the packaging for an event. -type Envelope struct { - Timestamp time.Time - Namespace string - Topic string - Event typeurl.Any -} - -// Field returns the value for the given fieldpath as a string, if defined. -// If the value is not defined, the second value will be false. -func (e *Envelope) Field(fieldpath []string) (string, bool) { - if len(fieldpath) == 0 { - return "", false - } - - switch fieldpath[0] { - // unhandled: timestamp - case "namespace": - return e.Namespace, len(e.Namespace) > 0 - case "topic": - return e.Topic, len(e.Topic) > 0 - case "event": - decoded, err := typeurl.UnmarshalAny(e.Event) - if err != nil { - return "", false - } - - adaptor, ok := decoded.(interface { - Field([]string) (string, bool) - }) - if !ok { - return "", false - } - return adaptor.Field(fieldpath[1:]) - } - return "", false -} - -// Event is a generic interface for any type of event -type Event interface{} - -// Publisher posts the event. -type Publisher interface { - Publish(ctx context.Context, topic string, event Event) error -} - -// Forwarder forwards an event to the underlying event bus -type Forwarder interface { - Forward(ctx context.Context, envelope *Envelope) error -} - -// Subscriber allows callers to subscribe to events -type Subscriber interface { - Subscribe(ctx context.Context, filters ...string) (ch <-chan *Envelope, errs <-chan error) -} diff --git a/vendor/github.com/containerd/containerd/v2/core/events/proxy/remote_events.go b/vendor/github.com/containerd/containerd/v2/core/events/proxy/remote_events.go deleted file mode 100644 index db989230d5..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/events/proxy/remote_events.go +++ /dev/null @@ -1,224 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package proxy - -import ( - "context" - "fmt" - - api "github.com/containerd/containerd/api/services/events/v1" - "github.com/containerd/containerd/api/types" - "github.com/containerd/errdefs" - "github.com/containerd/errdefs/pkg/errgrpc" - "github.com/containerd/ttrpc" - "github.com/containerd/typeurl/v2" - "google.golang.org/grpc" - - "github.com/containerd/containerd/v2/core/events" - "github.com/containerd/containerd/v2/pkg/protobuf" -) - -type EventService interface { - events.Publisher - events.Forwarder - events.Subscriber -} - -func NewRemoteEvents(client any) EventService { - switch c := client.(type) { - case api.EventsClient: - return &grpcEventsProxy{ - client: c, - } - case api.TTRPCEventsClient: - return &ttrpcEventsProxy{ - client: c, - } - case grpc.ClientConnInterface: - return &grpcEventsProxy{ - client: api.NewEventsClient(c), - } - case *ttrpc.Client: - return &ttrpcEventsProxy{ - client: api.NewTTRPCEventsClient(c), - } - default: - panic(fmt.Errorf("unsupported events client %T: %w", client, errdefs.ErrNotImplemented)) - } -} - -type grpcEventsProxy struct { - client api.EventsClient -} - -func (p *grpcEventsProxy) Publish(ctx context.Context, topic string, event events.Event) error { - evt, err := typeurl.MarshalAny(event) - if err != nil { - return err - } - req := &api.PublishRequest{ - Topic: topic, - Event: typeurl.MarshalProto(evt), - } - if _, err := p.client.Publish(ctx, req); err != nil { - return errgrpc.ToNative(err) - } - return nil -} - -func (p *grpcEventsProxy) Forward(ctx context.Context, envelope *events.Envelope) error { - req := &api.ForwardRequest{ - Envelope: &types.Envelope{ - Timestamp: protobuf.ToTimestamp(envelope.Timestamp), - Namespace: envelope.Namespace, - Topic: envelope.Topic, - Event: typeurl.MarshalProto(envelope.Event), - }, - } - if _, err := p.client.Forward(ctx, req); err != nil { - return errgrpc.ToNative(err) - } - return nil -} - -func (p *grpcEventsProxy) Subscribe(ctx context.Context, filters ...string) (ch <-chan *events.Envelope, errs <-chan error) { - var ( - evq = make(chan *events.Envelope) - errq = make(chan error, 1) - ) - - errs = errq - ch = evq - - session, err := p.client.Subscribe(ctx, &api.SubscribeRequest{ - Filters: filters, - }) - if err != nil { - errq <- err - close(errq) - return - } - - go func() { - defer close(errq) - - for { - ev, err := session.Recv() - if err != nil { - errq <- err - return - } - - select { - case evq <- &events.Envelope{ - Timestamp: protobuf.FromTimestamp(ev.Timestamp), - Namespace: ev.Namespace, - Topic: ev.Topic, - Event: ev.Event, - }: - case <-ctx.Done(): - if cerr := ctx.Err(); cerr != context.Canceled { - errq <- cerr - } - return - } - } - }() - - return ch, errs -} - -type ttrpcEventsProxy struct { - client api.TTRPCEventsClient -} - -func (p *ttrpcEventsProxy) Publish(ctx context.Context, topic string, event events.Event) error { - evt, err := typeurl.MarshalAny(event) - if err != nil { - return err - } - req := &api.PublishRequest{ - Topic: topic, - Event: typeurl.MarshalProto(evt), - } - if _, err := p.client.Publish(ctx, req); err != nil { - return errgrpc.ToNative(err) - } - return nil -} - -func (p *ttrpcEventsProxy) Forward(ctx context.Context, envelope *events.Envelope) error { - req := &api.ForwardRequest{ - Envelope: &types.Envelope{ - Timestamp: protobuf.ToTimestamp(envelope.Timestamp), - Namespace: envelope.Namespace, - Topic: envelope.Topic, - Event: typeurl.MarshalProto(envelope.Event), - }, - } - if _, err := p.client.Forward(ctx, req); err != nil { - return errgrpc.ToNative(err) - } - return nil -} - -func (p *ttrpcEventsProxy) Subscribe(ctx context.Context, filters ...string) (ch <-chan *events.Envelope, errs <-chan error) { - var ( - evq = make(chan *events.Envelope) - errq = make(chan error, 1) - ) - - errs = errq - ch = evq - - session, err := p.client.Subscribe(ctx, &api.SubscribeRequest{ - Filters: filters, - }) - if err != nil { - errq <- err - close(errq) - return - } - - go func() { - defer close(errq) - - for { - ev, err := session.Recv() - if err != nil { - errq <- err - return - } - - select { - case evq <- &events.Envelope{ - Timestamp: protobuf.FromTimestamp(ev.Timestamp), - Namespace: ev.Namespace, - Topic: ev.Topic, - Event: ev.Event, - }: - case <-ctx.Done(): - if cerr := ctx.Err(); cerr != context.Canceled { - errq <- cerr - } - return - } - } - }() - - return ch, errs -} diff --git a/vendor/github.com/containerd/containerd/v2/core/images/archive/exporter.go b/vendor/github.com/containerd/containerd/v2/core/images/archive/exporter.go deleted file mode 100644 index 3d98daea1d..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/images/archive/exporter.go +++ /dev/null @@ -1,589 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package archive - -import ( - "archive/tar" - "context" - "encoding/json" - "fmt" - "io" - "path" - "sort" - "strings" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/labels" - "github.com/containerd/errdefs" - "github.com/containerd/log" - "github.com/containerd/platforms" - digest "github.com/opencontainers/go-digest" - ocispecs "github.com/opencontainers/image-spec/specs-go" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -type exportOptions struct { - manifests []ocispec.Descriptor - platform platforms.MatchComparer - allPlatforms bool - skipDockerManifest bool - blobRecordOptions blobRecordOptions -} - -// ExportOpt defines options for configuring exported descriptors -type ExportOpt func(context.Context, *exportOptions) error - -// WithPlatform defines the platform to require manifest lists have -// not exporting all platforms. -// Additionally, platform is used to resolve image configs for -// Docker v1.1, v1.2 format compatibility. -func WithPlatform(p platforms.MatchComparer) ExportOpt { - return func(ctx context.Context, o *exportOptions) error { - o.platform = p - return nil - } -} - -// WithAllPlatforms exports all manifests from a manifest list. -// Missing content will fail the export. -func WithAllPlatforms() ExportOpt { - return func(ctx context.Context, o *exportOptions) error { - o.allPlatforms = true - return nil - } -} - -// WithSkipDockerManifest skips creation of the Docker compatible -// manifest.json file. -func WithSkipDockerManifest() ExportOpt { - return func(ctx context.Context, o *exportOptions) error { - o.skipDockerManifest = true - return nil - } -} - -// WithImage adds the provided images to the exported archive. -func WithImage(is images.Store, name string) ExportOpt { - return func(ctx context.Context, o *exportOptions) error { - img, err := is.Get(ctx, name) - if err != nil { - return err - } - - img.Target.Annotations = addNameAnnotation(name, img.Target.Annotations) - o.manifests = append(o.manifests, img.Target) - - return nil - } -} - -// WithImages adds multiples images to the exported archive. -func WithImages(imgs []images.Image) ExportOpt { - return func(ctx context.Context, o *exportOptions) error { - for _, img := range imgs { - img.Target.Annotations = addNameAnnotation(img.Name, img.Target.Annotations) - o.manifests = append(o.manifests, img.Target) - } - - return nil - } -} - -// WithManifest adds a manifest to the exported archive. -// When names are given they will be set on the manifest in the -// exported archive, creating an index record for each name. -// When no names are provided, it is up to caller to put name annotation to -// on the manifest descriptor if needed. -func WithManifest(manifest ocispec.Descriptor, names ...string) ExportOpt { - return func(ctx context.Context, o *exportOptions) error { - if len(names) == 0 { - o.manifests = append(o.manifests, manifest) - } - for _, name := range names { - mc := manifest - mc.Annotations = addNameAnnotation(name, manifest.Annotations) - o.manifests = append(o.manifests, mc) - } - - return nil - } -} - -// BlobFilter returns false if the blob should not be included in the archive. -type BlobFilter func(ocispec.Descriptor) bool - -// WithBlobFilter specifies BlobFilter. -func WithBlobFilter(f BlobFilter) ExportOpt { - return func(ctx context.Context, o *exportOptions) error { - o.blobRecordOptions.blobFilter = f - return nil - } -} - -// WithSkipNonDistributableBlobs excludes non-distributable blobs such as Windows base layers. -func WithSkipNonDistributableBlobs() ExportOpt { - f := func(desc ocispec.Descriptor) bool { - return !images.IsNonDistributable(desc.MediaType) - } - return WithBlobFilter(f) -} - -// WithSkipMissing excludes blobs referenced by manifests if not all blobs -// would be included in the archive. -// The manifest itself is excluded only if it's not present locally. -// This allows to export multi-platform images if not all platforms are present -// while still persisting the multi-platform index. -func WithSkipMissing(store content.InfoReaderProvider) ExportOpt { - return func(ctx context.Context, o *exportOptions) error { - o.blobRecordOptions.childrenHandler = images.HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) (subdescs []ocispec.Descriptor, err error) { - children, err := images.Children(ctx, store, desc) - if !images.IsManifestType(desc.MediaType) { - return children, err - } - - if err != nil { - // If manifest itself is missing, skip it from export. - if errdefs.IsNotFound(err) { - return nil, images.ErrSkipDesc - } - return nil, err - } - - // Don't export manifest descendants if any of them doesn't exist. - for _, child := range children { - exists, err := content.Exists(ctx, store, child) - if err != nil { - return nil, err - } - - // If any child is missing, only export the manifest, but don't export its descendants. - if !exists { - return nil, nil - } - } - return children, nil - }) - return nil - } -} - -func addNameAnnotation(name string, base map[string]string) map[string]string { - annotations := map[string]string{} - for k, v := range base { - annotations[k] = v - } - - annotations[images.AnnotationImageName] = name - annotations[ocispec.AnnotationRefName] = ociReferenceName(name) - - return annotations -} - -func copySourceLabels(ctx context.Context, infoProvider content.InfoProvider, desc ocispec.Descriptor) (ocispec.Descriptor, error) { - info, err := infoProvider.Info(ctx, desc.Digest) - if err != nil { - return desc, err - } - for k, v := range info.Labels { - if strings.HasPrefix(k, labels.LabelDistributionSource) { - if desc.Annotations == nil { - desc.Annotations = map[string]string{k: v} - } else { - desc.Annotations[k] = v - } - } - } - return desc, nil -} - -// Export implements Exporter. -func Export(ctx context.Context, store content.InfoReaderProvider, writer io.Writer, opts ...ExportOpt) error { - var eo exportOptions - for _, opt := range opts { - if err := opt(ctx, &eo); err != nil { - return err - } - } - - records := []tarRecord{ - ociLayoutFile(""), - } - - manifests := make([]ocispec.Descriptor, 0, len(eo.manifests)) - for _, desc := range eo.manifests { - d, err := copySourceLabels(ctx, store, desc) - if err != nil { - log.G(ctx).WithError(err).WithField("desc", desc).Warn("failed to copy distribution.source labels") - continue - } - manifests = append(manifests, d) - } - - algorithms := map[string]struct{}{} - dManifests := map[digest.Digest]*exportManifest{} - resolvedIndex := map[digest.Digest]digest.Digest{} - for _, desc := range manifests { - if images.IsManifestType(desc.MediaType) { - mt, ok := dManifests[desc.Digest] - if !ok { - // TODO(containerd): Skip if already added - r, err := getRecords(ctx, store, desc, algorithms, &eo.blobRecordOptions) - if err != nil { - return err - } - records = append(records, r...) - - mt = &exportManifest{ - manifest: desc, - } - dManifests[desc.Digest] = mt - } - - name := desc.Annotations[images.AnnotationImageName] - if name != "" { - mt.names = append(mt.names, name) - } - } else if images.IsIndexType(desc.MediaType) { - d, ok := resolvedIndex[desc.Digest] - if !ok { - if err := desc.Digest.Validate(); err != nil { - return err - } - records = append(records, blobRecord(store, desc, &eo.blobRecordOptions)) - - p, err := content.ReadBlob(ctx, store, desc) - if err != nil { - return err - } - - var index ocispec.Index - if err := json.Unmarshal(p, &index); err != nil { - return err - } - - var manifests []ocispec.Descriptor - for _, m := range index.Manifests { - if eo.platform != nil { - if m.Platform == nil || eo.platform.Match(*m.Platform) { - manifests = append(manifests, m) - } else if !eo.allPlatforms { - continue - } - } - - r, err := getRecords(ctx, store, m, algorithms, &eo.blobRecordOptions) - if err != nil { - return err - } - - records = append(records, r...) - } - - if len(manifests) >= 1 { - if len(manifests) > 1 { - sort.SliceStable(manifests, func(i, j int) bool { - if manifests[i].Platform == nil { - return false - } - if manifests[j].Platform == nil { - return true - } - return eo.platform.Less(*manifests[i].Platform, *manifests[j].Platform) - }) - } - d = manifests[0].Digest - dManifests[d] = &exportManifest{ - manifest: manifests[0], - } - } else if eo.platform != nil { - return fmt.Errorf("no manifest found for platform: %w", errdefs.ErrNotFound) - } - resolvedIndex[desc.Digest] = d - } - if d != "" { - if name := desc.Annotations[images.AnnotationImageName]; name != "" { - mt := dManifests[d] - mt.names = append(mt.names, name) - } - - } - } else { - return fmt.Errorf("only manifests may be exported: %w", errdefs.ErrInvalidArgument) - } - } - - records = append(records, ociIndexRecord(manifests)) - - if !eo.skipDockerManifest && len(dManifests) > 0 { - tr, err := manifestsRecord(ctx, store, dManifests) - if err != nil { - return fmt.Errorf("unable to create manifests file: %w", err) - } - - records = append(records, tr) - } - - if len(algorithms) > 0 { - records = append(records, directoryRecord("blobs/", 0755)) - for alg := range algorithms { - records = append(records, directoryRecord("blobs/"+alg+"/", 0755)) - } - } - - tw := tar.NewWriter(writer) - defer tw.Close() - return writeTar(ctx, tw, records) -} - -func getRecords(ctx context.Context, store content.Provider, desc ocispec.Descriptor, algorithms map[string]struct{}, brOpts *blobRecordOptions) ([]tarRecord, error) { - var records []tarRecord - exportHandler := func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - if err := desc.Digest.Validate(); err != nil { - return nil, err - } - records = append(records, blobRecord(store, desc, brOpts)) - algorithms[desc.Digest.Algorithm().String()] = struct{}{} - return nil, nil - } - - childrenHandler := brOpts.childrenHandler - if childrenHandler == nil { - childrenHandler = images.ChildrenHandler(store) - } - - handlers := images.Handlers( - childrenHandler, - images.HandlerFunc(exportHandler), - ) - - // Walk sequentially since the number of fetches is likely one and doing in - // parallel requires locking the export handler - if err := images.Walk(ctx, handlers, desc); err != nil { - return nil, err - } - - return records, nil -} - -type tarRecord struct { - Header *tar.Header - CopyTo func(context.Context, io.Writer) (int64, error) -} - -type blobRecordOptions struct { - blobFilter BlobFilter - childrenHandler images.HandlerFunc -} - -func blobRecord(cs content.Provider, desc ocispec.Descriptor, opts *blobRecordOptions) tarRecord { - if opts != nil && opts.blobFilter != nil && !opts.blobFilter(desc) { - return tarRecord{} - } - return tarRecord{ - Header: &tar.Header{ - Name: path.Join(ocispec.ImageBlobsDir, desc.Digest.Algorithm().String(), desc.Digest.Encoded()), - Mode: 0444, - Size: desc.Size, - Typeflag: tar.TypeReg, - }, - CopyTo: func(ctx context.Context, w io.Writer) (int64, error) { - r, err := cs.ReaderAt(ctx, desc) - if err != nil { - return 0, fmt.Errorf("failed to get reader: %w", err) - } - defer r.Close() - - // Verify digest - dgstr := desc.Digest.Algorithm().Digester() - - n, err := io.Copy(io.MultiWriter(w, dgstr.Hash()), content.NewReader(r)) - if err != nil { - return 0, fmt.Errorf("failed to copy to tar: %w", err) - } - if dgstr.Digest() != desc.Digest { - return 0, fmt.Errorf("unexpected digest %s copied", dgstr.Digest()) - } - return n, nil - }, - } -} - -func directoryRecord(name string, mode int64) tarRecord { - return tarRecord{ - Header: &tar.Header{ - Name: name, - Mode: mode, - Typeflag: tar.TypeDir, - }, - } -} - -func ociLayoutFile(version string) tarRecord { - if version == "" { - version = ocispec.ImageLayoutVersion - } - layout := ocispec.ImageLayout{ - Version: version, - } - - b, err := json.Marshal(layout) - if err != nil { - panic(err) - } - - return tarRecord{ - Header: &tar.Header{ - Name: ocispec.ImageLayoutFile, - Mode: 0444, - Size: int64(len(b)), - Typeflag: tar.TypeReg, - }, - CopyTo: func(ctx context.Context, w io.Writer) (int64, error) { - n, err := w.Write(b) - return int64(n), err - }, - } - -} - -func ociIndexRecord(manifests []ocispec.Descriptor) tarRecord { - index := ocispec.Index{ - Versioned: ocispecs.Versioned{ - SchemaVersion: 2, - }, - MediaType: ocispec.MediaTypeImageIndex, - Manifests: manifests, - } - - b, err := json.Marshal(index) - if err != nil { - panic(err) - } - - return tarRecord{ - Header: &tar.Header{ - Name: ocispec.ImageIndexFile, - Mode: 0644, - Size: int64(len(b)), - Typeflag: tar.TypeReg, - }, - CopyTo: func(ctx context.Context, w io.Writer) (int64, error) { - n, err := w.Write(b) - return int64(n), err - }, - } -} - -type exportManifest struct { - manifest ocispec.Descriptor - names []string -} - -func manifestsRecord(ctx context.Context, store content.Provider, manifests map[digest.Digest]*exportManifest) (tarRecord, error) { - mfsts := make([]struct { - Config string - RepoTags []string - Layers []string - }, len(manifests)) - - var i int - for _, m := range manifests { - p, err := content.ReadBlob(ctx, store, m.manifest) - if err != nil { - return tarRecord{}, err - } - - var manifest ocispec.Manifest - if err := json.Unmarshal(p, &manifest); err != nil { - return tarRecord{}, err - } - - dgst := manifest.Config.Digest - if err := dgst.Validate(); err != nil { - return tarRecord{}, err - } - mfsts[i].Config = path.Join(ocispec.ImageBlobsDir, dgst.Algorithm().String(), dgst.Encoded()) - for _, l := range manifest.Layers { - mfsts[i].Layers = append(mfsts[i].Layers, path.Join(ocispec.ImageBlobsDir, l.Digest.Algorithm().String(), l.Digest.Encoded())) - } - - for _, name := range m.names { - nname, err := familiarizeReference(name) - if err != nil { - return tarRecord{}, err - } - - mfsts[i].RepoTags = append(mfsts[i].RepoTags, nname) - } - - i++ - } - - b, err := json.Marshal(mfsts) - if err != nil { - return tarRecord{}, err - } - - return tarRecord{ - Header: &tar.Header{ - Name: "manifest.json", - Mode: 0644, - Size: int64(len(b)), - Typeflag: tar.TypeReg, - }, - CopyTo: func(ctx context.Context, w io.Writer) (int64, error) { - n, err := w.Write(b) - return int64(n), err - }, - }, nil -} - -func writeTar(ctx context.Context, tw *tar.Writer, recordsWithEmpty []tarRecord) error { - var records []tarRecord - for _, r := range recordsWithEmpty { - if r.Header != nil { - records = append(records, r) - } - } - sort.Slice(records, func(i, j int) bool { - return records[i].Header.Name < records[j].Header.Name - }) - - var last string - for _, record := range records { - if record.Header.Name == last { - continue - } - last = record.Header.Name - if err := tw.WriteHeader(record.Header); err != nil { - return err - } - if record.CopyTo != nil { - n, err := record.CopyTo(ctx, tw) - if err != nil { - return err - } - if n != record.Header.Size { - return fmt.Errorf("unexpected copy size for %s", record.Header.Name) - } - } else if record.Header.Size > 0 { - return fmt.Errorf("no content to write to record with non-zero size for %s", record.Header.Name) - } - } - return nil -} diff --git a/vendor/github.com/containerd/containerd/v2/core/images/archive/importer.go b/vendor/github.com/containerd/containerd/v2/core/images/archive/importer.go deleted file mode 100644 index 64a1587f77..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/images/archive/importer.go +++ /dev/null @@ -1,420 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Package archive provides a Docker and OCI compatible importer -package archive - -import ( - "archive/tar" - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "path" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/archive/compression" - "github.com/containerd/containerd/v2/pkg/labels" - "github.com/containerd/errdefs" - "github.com/containerd/log" - "github.com/containerd/platforms" - digest "github.com/opencontainers/go-digest" - specs "github.com/opencontainers/image-spec/specs-go" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -type importOpts struct { - compress bool -} - -// ImportOpt is an option for importing an OCI index -type ImportOpt func(*importOpts) error - -// WithImportCompression compresses uncompressed layers on import. -// This is used for import formats which do not include the manifest. -func WithImportCompression() ImportOpt { - return func(io *importOpts) error { - io.compress = true - return nil - } -} - -// ImportIndex imports an index from a tar archive image bundle -// - implements Docker v1.1, v1.2 and OCI v1. -// - prefers OCI v1 when provided -// - creates OCI index for Docker formats -// - normalizes Docker references and adds as OCI ref name -// e.g. alpine:latest -> docker.io/library/alpine:latest -// - existing OCI reference names are untouched -func ImportIndex(ctx context.Context, store content.Store, reader io.Reader, opts ...ImportOpt) (ocispec.Descriptor, error) { - var ( - tr = tar.NewReader(reader) - - ociLayout ocispec.ImageLayout - mfsts []struct { - Config string - RepoTags []string - Layers []string - } - symlinks = make(map[string]string) - blobs = make(map[string]ocispec.Descriptor) - iopts importOpts - ) - - for _, o := range opts { - if err := o(&iopts); err != nil { - return ocispec.Descriptor{}, err - } - } - - for { - hdr, err := tr.Next() - if err == io.EOF { - break - } - if err != nil { - return ocispec.Descriptor{}, err - } - if hdr.Typeflag == tar.TypeSymlink { - symlinks[hdr.Name] = path.Join(path.Dir(hdr.Name), hdr.Linkname) - } - - //nolint:staticcheck // TypeRegA is deprecated but we may still receive an external tar with TypeRegA - if hdr.Typeflag != tar.TypeReg && hdr.Typeflag != tar.TypeRegA { - if hdr.Typeflag != tar.TypeDir { - log.G(ctx).WithField("file", hdr.Name).Debug("file type ignored") - } - continue - } - - hdrName := path.Clean(hdr.Name) - if hdrName == ocispec.ImageLayoutFile { - if err = onUntarJSON(tr, &ociLayout); err != nil { - return ocispec.Descriptor{}, fmt.Errorf("untar oci layout %q: %w", hdr.Name, err) - } - } else if hdrName == "manifest.json" { - if err = onUntarJSON(tr, &mfsts); err != nil { - return ocispec.Descriptor{}, fmt.Errorf("untar manifest %q: %w", hdr.Name, err) - } - } else { - dgst, err := onUntarBlob(ctx, tr, store, hdr.Size, "tar-"+hdrName) - if err != nil { - return ocispec.Descriptor{}, fmt.Errorf("failed to ingest %q: %w", hdr.Name, err) - } - - blobs[hdrName] = ocispec.Descriptor{ - Digest: dgst, - Size: hdr.Size, - } - } - } - - // If OCI layout was given, interpret the tar as an OCI layout. - // When not provided, the layout of the tar will be interpreted - // as Docker v1.1 or v1.2. - if ociLayout.Version != "" { - if ociLayout.Version != ocispec.ImageLayoutVersion { - return ocispec.Descriptor{}, fmt.Errorf("unsupported OCI version %s", ociLayout.Version) - } - - idx, ok := blobs[ocispec.ImageIndexFile] - if !ok { - return ocispec.Descriptor{}, fmt.Errorf("missing index.json in OCI layout %s", ocispec.ImageLayoutVersion) - } - - idx.MediaType = ocispec.MediaTypeImageIndex - return idx, nil - } - - if mfsts == nil { - return ocispec.Descriptor{}, errors.New("unrecognized image format") - } - - for name, linkname := range symlinks { - desc, ok := blobs[linkname] - if !ok { - return ocispec.Descriptor{}, fmt.Errorf("no target for symlink layer from %q to %q", name, linkname) - } - blobs[name] = desc - } - - idx := ocispec.Index{ - Versioned: specs.Versioned{ - SchemaVersion: 2, - }, - } - for _, mfst := range mfsts { - config, ok := blobs[mfst.Config] - if !ok { - return ocispec.Descriptor{}, fmt.Errorf("image config %q not found", mfst.Config) - } - config.MediaType = images.MediaTypeDockerSchema2Config - - layers, err := resolveLayers(ctx, store, mfst.Layers, blobs, iopts.compress) - if err != nil { - return ocispec.Descriptor{}, fmt.Errorf("failed to resolve layers: %w", err) - } - - manifest := struct { - SchemaVersion int `json:"schemaVersion"` - MediaType string `json:"mediaType"` - Config ocispec.Descriptor `json:"config"` - Layers []ocispec.Descriptor `json:"layers"` - }{ - SchemaVersion: 2, - MediaType: images.MediaTypeDockerSchema2Manifest, - Config: config, - Layers: layers, - } - - desc, err := writeManifest(ctx, store, manifest, manifest.MediaType) - if err != nil { - return ocispec.Descriptor{}, fmt.Errorf("write docker manifest: %w", err) - } - - imgPlatforms, err := images.Platforms(ctx, store, desc) - if err != nil { - return ocispec.Descriptor{}, fmt.Errorf("unable to resolve platform: %w", err) - } - if len(imgPlatforms) > 0 { - // Only one platform can be resolved from non-index manifest, - // The platform can only come from the config included above, - // if the config has no platform it can be safely omitted. - desc.Platform = &imgPlatforms[0] - - // If the image we've just imported is a Windows image without the OSVersion set, - // we could just assume it matches this host's OS Version. Without this, the - // children labels might not be set on the image content, leading to it being - // garbage collected, breaking the image. - // See: https://github.com/containerd/containerd/issues/5690 - if desc.Platform.OS == "windows" && desc.Platform.OSVersion == "" { - platform := platforms.DefaultSpec() - desc.Platform.OSVersion = platform.OSVersion - } - } - - if len(mfst.RepoTags) == 0 { - idx.Manifests = append(idx.Manifests, desc) - } else { - // Add descriptor per tag - for _, ref := range mfst.RepoTags { - mfstdesc := desc - - normalized, err := normalizeReference(ref) - if err != nil { - return ocispec.Descriptor{}, err - } - - mfstdesc.Annotations = map[string]string{ - images.AnnotationImageName: normalized, - ocispec.AnnotationRefName: ociReferenceName(normalized), - } - - idx.Manifests = append(idx.Manifests, mfstdesc) - } - } - } - - return writeManifest(ctx, store, idx, ocispec.MediaTypeImageIndex) -} - -const ( - kib = 1024 - mib = 1024 * kib - jsonLimit = 20 * mib -) - -func onUntarJSON(r io.Reader, j interface{}) error { - return json.NewDecoder(io.LimitReader(r, jsonLimit)).Decode(j) -} - -func onUntarBlob(ctx context.Context, r io.Reader, store content.Ingester, size int64, ref string) (digest.Digest, error) { - dgstr := digest.Canonical.Digester() - - if err := content.WriteBlob(ctx, store, ref, io.TeeReader(r, dgstr.Hash()), ocispec.Descriptor{Size: size}); err != nil { - return "", err - } - - return dgstr.Digest(), nil -} - -func resolveLayers(ctx context.Context, store content.Store, layerFiles []string, blobs map[string]ocispec.Descriptor, compress bool) ([]ocispec.Descriptor, error) { - layers := make([]ocispec.Descriptor, len(layerFiles)) - filters := make([]string, len(layerFiles)) - descs := map[digest.Digest]*ocispec.Descriptor{} - for i, f := range layerFiles { - desc, ok := blobs[f] - if !ok { - return nil, fmt.Errorf("layer %q not found", f) - } - layers[i] = desc - descs[desc.Digest] = &layers[i] - filters[i] = fmt.Sprintf("labels.\"%s\"==%s", labels.LabelUncompressed, desc.Digest.String()) - } - - err := store.Walk(ctx, func(info content.Info) error { - dgst, ok := info.Labels[labels.LabelUncompressed] - if ok { - desc := descs[digest.Digest(dgst)] - if desc != nil { - desc.Digest = info.Digest - desc.Size = info.Size - mediaType, err := detectLayerMediaType(ctx, store, *desc) - if err != nil { - return fmt.Errorf("failed to detect media type of layer: %w", err) - } - desc.MediaType = mediaType - } - } - return nil - }, filters...) - if err != nil { - return nil, fmt.Errorf("failure checking for compressed blobs: %w", err) - } - - for i, desc := range layers { - if desc.MediaType != "" { - continue - } - // Open blob, resolve media type - ra, err := store.ReaderAt(ctx, desc) - if err != nil { - return nil, fmt.Errorf("failed to open %q (%s): %w", layerFiles[i], desc.Digest, err) - } - s, err := compression.DecompressStream(content.NewReader(ra)) - if err != nil { - ra.Close() - return nil, fmt.Errorf("failed to detect compression for %q: %w", layerFiles[i], err) - } - if s.GetCompression() == compression.Uncompressed { - if compress { - if err := desc.Digest.Validate(); err != nil { - return nil, err - } - ref := fmt.Sprintf("compress-blob-%s-%s", desc.Digest.Algorithm().String(), desc.Digest.Encoded()) - labels := map[string]string{ - labels.LabelUncompressed: desc.Digest.String(), - } - layers[i], err = compressBlob(ctx, store, s, ref, content.WithLabels(labels)) - if err != nil { - s.Close() - ra.Close() - return nil, err - } - layers[i].MediaType = images.MediaTypeDockerSchema2LayerGzip - } else { - layers[i].MediaType = images.MediaTypeDockerSchema2Layer - } - } else { - layers[i].MediaType = images.MediaTypeDockerSchema2LayerGzip - } - s.Close() - ra.Close() - } - return layers, nil -} - -func compressBlob(ctx context.Context, cs content.Store, r io.Reader, ref string, opts ...content.Opt) (desc ocispec.Descriptor, err error) { - w, err := content.OpenWriter(ctx, cs, content.WithRef(ref)) - if err != nil { - return ocispec.Descriptor{}, fmt.Errorf("failed to open writer: %w", err) - } - - defer func() { - w.Close() - if err != nil { - cs.Abort(ctx, ref) - } - }() - if err := w.Truncate(0); err != nil { - return ocispec.Descriptor{}, fmt.Errorf("failed to truncate writer: %w", err) - } - - cw, err := compression.CompressStream(w, compression.Gzip) - if err != nil { - return ocispec.Descriptor{}, err - } - - if _, err := io.Copy(cw, r); err != nil { - return ocispec.Descriptor{}, err - } - if err := cw.Close(); err != nil { - return ocispec.Descriptor{}, err - } - - cst, err := w.Status() - if err != nil { - return ocispec.Descriptor{}, fmt.Errorf("failed to get writer status: %w", err) - } - - desc.Digest = w.Digest() - desc.Size = cst.Offset - - if err := w.Commit(ctx, desc.Size, desc.Digest, opts...); err != nil { - if !errdefs.IsAlreadyExists(err) { - return ocispec.Descriptor{}, fmt.Errorf("failed to commit: %w", err) - } - } - - return desc, nil -} - -func writeManifest(ctx context.Context, cs content.Ingester, manifest interface{}, mediaType string) (ocispec.Descriptor, error) { - manifestBytes, err := json.Marshal(manifest) - if err != nil { - return ocispec.Descriptor{}, err - } - - desc := ocispec.Descriptor{ - MediaType: mediaType, - Digest: digest.FromBytes(manifestBytes), - Size: int64(len(manifestBytes)), - } - if err := content.WriteBlob(ctx, cs, "manifest-"+desc.Digest.String(), bytes.NewReader(manifestBytes), desc); err != nil { - return ocispec.Descriptor{}, err - } - - return desc, nil -} - -func detectLayerMediaType(ctx context.Context, store content.Store, desc ocispec.Descriptor) (string, error) { - var mediaType string - // need to parse existing blob to use the proper media type - bytes := make([]byte, 10) - ra, err := store.ReaderAt(ctx, desc) - if err != nil { - return "", fmt.Errorf("failed to read content store to detect layer media type: %w", err) - } - defer ra.Close() - _, err = ra.ReadAt(bytes, 0) - if err != nil && err != io.EOF { - return "", fmt.Errorf("failed to read header bytes from layer to detect media type: %w", err) - } - if err == io.EOF { - // in the case of an empty layer then the media type should be uncompressed - return images.MediaTypeDockerSchema2Layer, nil - } - switch c := compression.DetectCompression(bytes); c { - case compression.Uncompressed: - mediaType = images.MediaTypeDockerSchema2Layer - default: - mediaType = images.MediaTypeDockerSchema2LayerGzip - } - return mediaType, nil -} diff --git a/vendor/github.com/containerd/containerd/v2/core/images/archive/reference.go b/vendor/github.com/containerd/containerd/v2/core/images/archive/reference.go deleted file mode 100644 index 5e12eb98f4..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/images/archive/reference.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package archive - -import ( - "fmt" - "strings" - - "github.com/containerd/containerd/v2/pkg/reference" - distref "github.com/distribution/reference" - "github.com/opencontainers/go-digest" -) - -// FilterRefPrefix restricts references to having the given image -// prefix. Tag-only references will have the prefix prepended. -func FilterRefPrefix(image string) func(string) string { - return refTranslator(image, true) -} - -// AddRefPrefix prepends the given image prefix to tag-only references, -// while leaving returning full references unmodified. -func AddRefPrefix(image string) func(string) string { - return refTranslator(image, false) -} - -// refTranslator creates a reference which only has a tag or verifies -// a full reference. -func refTranslator(image string, checkPrefix bool) func(string) string { - return func(ref string) string { - if image == "" { - return "" - } - // Check if ref is full reference - if strings.ContainsAny(ref, "/:@") { - // If not prefixed, don't include image - if checkPrefix && !isImagePrefix(ref, image) { - return "" - } - return ref - } - return image + ":" + ref - } -} - -func isImagePrefix(s, prefix string) bool { - if !strings.HasPrefix(s, prefix) { - return false - } - if len(s) > len(prefix) { - switch s[len(prefix)] { - case '/', ':', '@': - // Prevent matching partial namespaces - default: - return false - } - } - return true -} - -func normalizeReference(ref string) (string, error) { - normalized, err := distref.ParseDockerRef(ref) - if err != nil { - return "", fmt.Errorf("normalize image ref %q: %w", ref, err) - } - - return normalized.String(), nil -} - -func familiarizeReference(ref string) (string, error) { - named, err := distref.ParseNormalizedNamed(ref) - if err != nil { - return "", fmt.Errorf("failed to parse %q: %w", ref, err) - } - named = distref.TagNameOnly(named) - - return distref.FamiliarString(named), nil -} - -func ociReferenceName(name string) string { - // OCI defines the reference name as only a tag excluding the - // repository. The containerd annotation contains the full image name - // since the tag is insufficient for correctly naming and referring to an - // image - var ociRef string - if spec, err := reference.Parse(name); err == nil { - ociRef = spec.Object - } else { - ociRef = name - } - - return ociRef -} - -// DigestTranslator creates a digest reference by adding the -// digest to an image name -func DigestTranslator(prefix string) func(digest.Digest) string { - return func(dgst digest.Digest) string { - return prefix + "@" + dgst.String() - } -} diff --git a/vendor/github.com/containerd/containerd/v2/core/images/usage/calculator.go b/vendor/github.com/containerd/containerd/v2/core/images/usage/calculator.go deleted file mode 100644 index fd5493958a..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/images/usage/calculator.go +++ /dev/null @@ -1,167 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package usage - -import ( - "context" - "strings" - "sync/atomic" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/errdefs" - "github.com/containerd/platforms" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - - "golang.org/x/sync/semaphore" -) - -type usageOptions struct { - platform platforms.MatchComparer - manifestLimit int - manifestOnly bool - snapshots func(name string) snapshots.Snapshotter -} - -type Opt func(*usageOptions) error - -// WithManifestLimit sets the limit to the number of manifests which will -// be walked for usage. Setting this value to 0 will require all manifests to -// be walked, returning ErrNotFound if manifests are missing. -// NOTE: By default all manifests which exist will be walked -// and any non-existent manifests and their subobjects will be ignored. -func WithManifestLimit(platform platforms.MatchComparer, i int) Opt { - // If 0 then don't filter any manifests - // By default limits to current platform - return func(o *usageOptions) error { - o.manifestLimit = i - o.platform = platform - return nil - } -} - -// WithSnapshotters will check for referenced snapshots from the image objects -// and include the snapshot size in the total usage. -func WithSnapshotters(f func(string) snapshots.Snapshotter) Opt { - return func(o *usageOptions) error { - o.snapshots = f - return nil - } -} - -// WithManifestUsage is used to get the usage for an image based on what is -// reported by the manifests rather than what exists in the content store. -// NOTE: This function is best used with the manifest limit set to get a -// consistent value, otherwise non-existent manifests will be excluded. -func WithManifestUsage() Opt { - return func(o *usageOptions) error { - o.manifestOnly = true - return nil - } -} - -func CalculateImageUsage(ctx context.Context, i images.Image, provider content.InfoReaderProvider, opts ...Opt) (int64, error) { - var config usageOptions - for _, opt := range opts { - if err := opt(&config); err != nil { - return 0, err - } - } - - var ( - handler = images.ChildrenHandler(provider) - size atomic.Int64 - mustExist bool - ) - - if config.platform != nil { - handler = images.LimitManifests(handler, config.platform, config.manifestLimit) - mustExist = true - } - - var wh images.HandlerFunc = func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - var usage int64 - children, err := handler(ctx, desc) - if err != nil { - if !errdefs.IsNotFound(err) || mustExist { - return nil, err - } - if !config.manifestOnly { - // Do not count size of non-existent objects - desc.Size = 0 - } - } else if config.snapshots != nil || !config.manifestOnly { - info, err := provider.Info(ctx, desc.Digest) - if err != nil { - if !errdefs.IsNotFound(err) { - return nil, err - } - if !config.manifestOnly { - // Do not count size of non-existent objects - desc.Size = 0 - } - } else { - if info.Size > desc.Size { - // Count actual usage, Size may be unset or -1 - desc.Size = info.Size - } - - if config.snapshots != nil { - for k, v := range info.Labels { - const prefix = "containerd.io/gc.ref.snapshot." - if !strings.HasPrefix(k, prefix) { - continue - } - - sn := config.snapshots(k[len(prefix):]) - if sn == nil { - continue - } - - u, err := sn.Usage(ctx, v) - if err != nil { - if !errdefs.IsNotFound(err) && !errdefs.IsInvalidArgument(err) { - return nil, err - } - } else { - usage += u.Size - } - } - } - } - } - - // Ignore unknown sizes. Generally unknown sizes should - // never be set in manifests, however, the usage - // calculation does not need to enforce this. - if desc.Size >= 0 { - usage += desc.Size - } - - size.Add(usage) - - return children, nil - } - - l := semaphore.NewWeighted(3) - if err := images.Dispatch(ctx, wh, l, i.Target); err != nil { - return 0, err - } - - return size.Load(), nil -} diff --git a/vendor/github.com/containerd/containerd/v2/core/introspection/introspection.go b/vendor/github.com/containerd/containerd/v2/core/introspection/introspection.go deleted file mode 100644 index 6859a2b7c4..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/introspection/introspection.go +++ /dev/null @@ -1,30 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package introspection - -import ( - context "context" - - api "github.com/containerd/containerd/api/services/introspection/v1" -) - -// Service defines the introspection service interface -type Service interface { - Plugins(context.Context, ...string) (*api.PluginsResponse, error) - Server(context.Context) (*api.ServerResponse, error) - PluginInfo(context.Context, string, string, any) (*api.PluginInfoResponse, error) -} diff --git a/vendor/github.com/containerd/containerd/v2/core/introspection/proxy/remote.go b/vendor/github.com/containerd/containerd/v2/core/introspection/proxy/remote.go deleted file mode 100644 index 9e9b9b5d44..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/introspection/proxy/remote.go +++ /dev/null @@ -1,110 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package introspectionproxy - -import ( - "context" - "fmt" - - api "github.com/containerd/containerd/api/services/introspection/v1" - "github.com/containerd/errdefs" - "github.com/containerd/errdefs/pkg/errgrpc" - "github.com/containerd/log" - "github.com/containerd/ttrpc" - "github.com/containerd/typeurl/v2" - "google.golang.org/grpc" - "google.golang.org/protobuf/types/known/anypb" - "google.golang.org/protobuf/types/known/emptypb" - - "github.com/containerd/containerd/v2/core/introspection" -) - -var _ = (introspection.Service)(&introspectionRemote{}) - -// NewIntrospectionServiceFromClient creates a new introspection service from an API client -func NewIntrospectionProxy(client any) introspection.Service { - switch c := client.(type) { - case api.IntrospectionClient: - return &introspectionRemote{client: convertIntrospection{c}} - case api.TTRPCIntrospectionService: - return &introspectionRemote{client: c} - case grpc.ClientConnInterface: - return &introspectionRemote{client: convertIntrospection{api.NewIntrospectionClient(c)}} - case *ttrpc.Client: - return &introspectionRemote{client: api.NewTTRPCIntrospectionClient(c)} - default: - panic(fmt.Errorf("unsupported introspection client %T: %w", client, errdefs.ErrNotImplemented)) - } -} - -type introspectionRemote struct { - client api.TTRPCIntrospectionService -} - -func (i *introspectionRemote) Plugins(ctx context.Context, filters ...string) (*api.PluginsResponse, error) { - log.G(ctx).WithField("filters", filters).Debug("remote introspection plugin filters") - resp, err := i.client.Plugins(ctx, &api.PluginsRequest{ - Filters: filters, - }) - - if err != nil { - return nil, errgrpc.ToNative(err) - } - - return resp, nil -} - -func (i *introspectionRemote) Server(ctx context.Context) (*api.ServerResponse, error) { - resp, err := i.client.Server(ctx, &emptypb.Empty{}) - - if err != nil { - return nil, errgrpc.ToNative(err) - } - - return resp, nil -} - -func (i *introspectionRemote) PluginInfo(ctx context.Context, pluginType, id string, options any) (resp *api.PluginInfoResponse, err error) { - var optionsPB *anypb.Any - if options != nil { - optionsPB, err = typeurl.MarshalAnyToProto(options) - if err != nil { - return nil, fmt.Errorf("failed to marshal runtime requst: %w", err) - } - } - resp, err = i.client.PluginInfo(ctx, &api.PluginInfoRequest{ - Type: pluginType, - ID: id, - Options: optionsPB, - }) - - return resp, errgrpc.ToNative(err) -} - -type convertIntrospection struct { - client api.IntrospectionClient -} - -func (c convertIntrospection) Plugins(ctx context.Context, req *api.PluginsRequest) (*api.PluginsResponse, error) { - return c.client.Plugins(ctx, req) -} -func (c convertIntrospection) Server(ctx context.Context, in *emptypb.Empty) (*api.ServerResponse, error) { - return c.client.Server(ctx, in) -} -func (c convertIntrospection) PluginInfo(ctx context.Context, req *api.PluginInfoRequest) (*api.PluginInfoResponse, error) { - return c.client.PluginInfo(ctx, req) -} diff --git a/vendor/github.com/containerd/containerd/v2/core/leases/context.go b/vendor/github.com/containerd/containerd/v2/core/leases/context.go deleted file mode 100644 index 599c549d31..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/leases/context.go +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package leases - -import "context" - -type leaseKey struct{} - -// WithLease sets a given lease on the context -func WithLease(ctx context.Context, lid string) context.Context { - ctx = context.WithValue(ctx, leaseKey{}, lid) - - // also store on the grpc headers so it gets picked up by any clients that - // are using this. - return withGRPCLeaseHeader(ctx, lid) -} - -// FromContext returns the lease from the context. -func FromContext(ctx context.Context) (string, bool) { - lid, ok := ctx.Value(leaseKey{}).(string) - if !ok { - return fromGRPCHeader(ctx) - } - - return lid, ok -} diff --git a/vendor/github.com/containerd/containerd/v2/core/leases/grpc.go b/vendor/github.com/containerd/containerd/v2/core/leases/grpc.go deleted file mode 100644 index 22f287a8bf..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/leases/grpc.go +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package leases - -import ( - "context" - - "google.golang.org/grpc/metadata" -) - -const ( - // GRPCHeader defines the header name for specifying a containerd lease. - GRPCHeader = "containerd-lease" -) - -func withGRPCLeaseHeader(ctx context.Context, lid string) context.Context { - // also store on the grpc headers so it gets picked up by any clients - // that are using this. - txheader := metadata.Pairs(GRPCHeader, lid) - md, ok := metadata.FromOutgoingContext(ctx) // merge with outgoing context. - if !ok { - md = txheader - } else { - // order ensures the latest is first in this list. - md = metadata.Join(txheader, md) - } - - return metadata.NewOutgoingContext(ctx, md) -} - -func fromGRPCHeader(ctx context.Context) (string, bool) { - // try to extract for use in grpc servers. - md, ok := metadata.FromIncomingContext(ctx) - if !ok { - return "", false - } - - values := md[GRPCHeader] - if len(values) == 0 { - return "", false - } - - return values[0], true -} diff --git a/vendor/github.com/containerd/containerd/v2/core/leases/id.go b/vendor/github.com/containerd/containerd/v2/core/leases/id.go deleted file mode 100644 index 8f5dc93f34..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/leases/id.go +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package leases - -import ( - "crypto/rand" - "encoding/base64" - "fmt" - "time" -) - -// WithRandomID sets the lease ID to a random unique value -func WithRandomID() Opt { - return func(l *Lease) error { - t := time.Now() - var b [3]byte - rand.Read(b[:]) - l.ID = fmt.Sprintf("%d-%s", t.Nanosecond(), base64.URLEncoding.EncodeToString(b[:])) - return nil - } -} - -// WithID sets the ID for the lease -func WithID(id string) Opt { - return func(l *Lease) error { - l.ID = id - return nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/core/leases/lease.go b/vendor/github.com/containerd/containerd/v2/core/leases/lease.go deleted file mode 100644 index d842c4081a..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/leases/lease.go +++ /dev/null @@ -1,104 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package leases - -import ( - "context" - "time" -) - -// Opt is used to set options on a lease -type Opt func(*Lease) error - -// DeleteOpt allows configuring a delete operation -type DeleteOpt func(context.Context, *DeleteOptions) error - -// Manager is used to create, list, and remove leases -type Manager interface { - Create(context.Context, ...Opt) (Lease, error) - Delete(context.Context, Lease, ...DeleteOpt) error - List(context.Context, ...string) ([]Lease, error) - AddResource(context.Context, Lease, Resource) error - DeleteResource(context.Context, Lease, Resource) error - ListResources(context.Context, Lease) ([]Resource, error) -} - -// Lease retains resources to prevent cleanup before -// the resources can be fully referenced. -type Lease struct { - ID string - CreatedAt time.Time - Labels map[string]string -} - -// Resource represents low level resource of image, like content, ingest and -// snapshotter. -type Resource struct { - ID string - Type string -} - -// DeleteOptions provide options on image delete -type DeleteOptions struct { - Synchronous bool -} - -// SynchronousDelete is used to indicate that a lease deletion and removal of -// any unreferenced resources should occur synchronously before returning the -// result. -func SynchronousDelete(ctx context.Context, o *DeleteOptions) error { - o.Synchronous = true - return nil -} - -// WithLabel sets a label on a lease, and merges it with existing labels. -// It overwrites the existing value of the given label (if present). -func WithLabel(label, value string) Opt { - return func(l *Lease) error { - if l.Labels == nil { - l.Labels = map[string]string{label: value} - return nil - } - l.Labels[label] = value - return nil - } -} - -// WithLabels merges labels on a lease -func WithLabels(labels map[string]string) Opt { - return func(l *Lease) error { - if l.Labels == nil { - l.Labels = map[string]string{} - } - for k, v := range labels { - l.Labels[k] = v - } - return nil - } -} - -// WithExpiration sets an expiration on the lease -func WithExpiration(d time.Duration) Opt { - return func(l *Lease) error { - if l.Labels == nil { - l.Labels = map[string]string{} - } - l.Labels["containerd.io/gc.expire"] = time.Now().Add(d).Format(time.RFC3339) - - return nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/core/leases/proxy/manager.go b/vendor/github.com/containerd/containerd/v2/core/leases/proxy/manager.go deleted file mode 100644 index 1b5da798f4..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/leases/proxy/manager.go +++ /dev/null @@ -1,135 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package proxy - -import ( - "context" - - leasesapi "github.com/containerd/containerd/api/services/leases/v1" - "github.com/containerd/errdefs/pkg/errgrpc" - - "github.com/containerd/containerd/v2/core/leases" - "github.com/containerd/containerd/v2/pkg/protobuf" -) - -type proxyManager struct { - client leasesapi.LeasesClient -} - -// NewLeaseManager returns a lease manager which communicates -// through a grpc lease service. -func NewLeaseManager(client leasesapi.LeasesClient) leases.Manager { - return &proxyManager{ - client: client, - } -} - -func (pm *proxyManager) Create(ctx context.Context, opts ...leases.Opt) (leases.Lease, error) { - l := leases.Lease{} - for _, opt := range opts { - if err := opt(&l); err != nil { - return leases.Lease{}, err - } - } - resp, err := pm.client.Create(ctx, &leasesapi.CreateRequest{ - ID: l.ID, - Labels: l.Labels, - }) - if err != nil { - return leases.Lease{}, errgrpc.ToNative(err) - } - - return leases.Lease{ - ID: resp.Lease.ID, - CreatedAt: protobuf.FromTimestamp(resp.Lease.CreatedAt), - Labels: resp.Lease.Labels, - }, nil -} - -func (pm *proxyManager) Delete(ctx context.Context, l leases.Lease, opts ...leases.DeleteOpt) error { - var do leases.DeleteOptions - for _, opt := range opts { - if err := opt(ctx, &do); err != nil { - return err - } - } - - _, err := pm.client.Delete(ctx, &leasesapi.DeleteRequest{ - ID: l.ID, - Sync: do.Synchronous, - }) - return errgrpc.ToNative(err) -} - -func (pm *proxyManager) List(ctx context.Context, filters ...string) ([]leases.Lease, error) { - resp, err := pm.client.List(ctx, &leasesapi.ListRequest{ - Filters: filters, - }) - if err != nil { - return nil, errgrpc.ToNative(err) - } - l := make([]leases.Lease, len(resp.Leases)) - for i := range resp.Leases { - l[i] = leases.Lease{ - ID: resp.Leases[i].ID, - CreatedAt: protobuf.FromTimestamp(resp.Leases[i].CreatedAt), - Labels: resp.Leases[i].Labels, - } - } - - return l, nil -} - -func (pm *proxyManager) AddResource(ctx context.Context, lease leases.Lease, r leases.Resource) error { - _, err := pm.client.AddResource(ctx, &leasesapi.AddResourceRequest{ - ID: lease.ID, - Resource: &leasesapi.Resource{ - ID: r.ID, - Type: r.Type, - }, - }) - return errgrpc.ToNative(err) -} - -func (pm *proxyManager) DeleteResource(ctx context.Context, lease leases.Lease, r leases.Resource) error { - _, err := pm.client.DeleteResource(ctx, &leasesapi.DeleteResourceRequest{ - ID: lease.ID, - Resource: &leasesapi.Resource{ - ID: r.ID, - Type: r.Type, - }, - }) - return errgrpc.ToNative(err) -} - -func (pm *proxyManager) ListResources(ctx context.Context, lease leases.Lease) ([]leases.Resource, error) { - resp, err := pm.client.ListResources(ctx, &leasesapi.ListResourcesRequest{ - ID: lease.ID, - }) - if err != nil { - return nil, errgrpc.ToNative(err) - } - - rs := make([]leases.Resource, 0, len(resp.Resources)) - for _, i := range resp.Resources { - rs = append(rs, leases.Resource{ - ID: i.ID, - Type: i.Type, - }) - } - return rs, nil -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/auth/fetch.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/auth/fetch.go deleted file mode 100644 index f68c22ab7a..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/auth/fetch.go +++ /dev/null @@ -1,234 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package auth - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "net/url" - "strings" - "time" - - remoteserrors "github.com/containerd/containerd/v2/core/remotes/errors" - "github.com/containerd/containerd/v2/pkg/tracing" - "github.com/containerd/containerd/v2/version" - "github.com/containerd/log" -) - -var ( - // ErrNoToken is returned if a request is successful but the body does not - // contain an authorization token. - ErrNoToken = errors.New("authorization server did not include a token in the response") -) - -// GenerateTokenOptions generates options for fetching a token based on a challenge -func GenerateTokenOptions(ctx context.Context, host, username, secret string, c Challenge) (TokenOptions, error) { - realm, ok := c.Parameters["realm"] - if !ok { - return TokenOptions{}, errors.New("no realm specified for token auth challenge") - } - - realmURL, err := url.Parse(realm) - if err != nil { - return TokenOptions{}, fmt.Errorf("invalid token auth challenge realm: %w", err) - } - - to := TokenOptions{ - Realm: realmURL.String(), - Service: c.Parameters["service"], - Username: username, - Secret: secret, - } - - scope, ok := c.Parameters["scope"] - if ok { - to.Scopes = append(to.Scopes, strings.Split(scope, " ")...) - } else { - log.G(ctx).WithField("host", host).Debug("no scope specified for token auth challenge") - } - - return to, nil -} - -// TokenOptions are options for requesting a token -type TokenOptions struct { - Realm string - Service string - Scopes []string - Username string - Secret string - - // FetchRefreshToken enables fetching a refresh token (aka "identity token", "offline token") along with the bearer token. - // - // For HTTP GET mode (FetchToken), FetchRefreshToken sets `offline_token=true` in the request. - // https://distribution.github.io/distribution/spec/auth/token/#requesting-a-token - // - // For HTTP POST mode (FetchTokenWithOAuth), FetchRefreshToken sets `access_type=offline` in the request. - // https://distribution.github.io/distribution/spec/auth/oauth/#getting-a-token - FetchRefreshToken bool -} - -// OAuthTokenResponse is response from fetching token with a OAuth POST request -type OAuthTokenResponse struct { - AccessToken string `json:"access_token"` - RefreshToken string `json:"refresh_token"` - ExpiresInSeconds int `json:"expires_in"` - IssuedAt time.Time `json:"issued_at"` - Scope string `json:"scope"` -} - -// FetchTokenWithOAuth fetches a token using a POST request -func FetchTokenWithOAuth(ctx context.Context, client *http.Client, headers http.Header, clientID string, to TokenOptions) (*OAuthTokenResponse, error) { - c := *client - client = &c - tracing.UpdateHTTPClient(client, tracing.Name("remotes.docker.resolver", "FetchTokenWithOAuth")) - - form := url.Values{} - if len(to.Scopes) > 0 { - form.Set("scope", strings.Join(to.Scopes, " ")) - } - form.Set("service", to.Service) - form.Set("client_id", clientID) - - if to.Username == "" { - form.Set("grant_type", "refresh_token") - form.Set("refresh_token", to.Secret) - } else { - form.Set("grant_type", "password") - form.Set("username", to.Username) - form.Set("password", to.Secret) - } - if to.FetchRefreshToken { - form.Set("access_type", "offline") - } - - req, err := http.NewRequestWithContext(ctx, http.MethodPost, to.Realm, strings.NewReader(form.Encode())) - if err != nil { - return nil, err - } - req.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8") - for k, v := range headers { - req.Header[k] = append(req.Header[k], v...) - } - if len(req.Header.Get("User-Agent")) == 0 { - req.Header.Set("User-Agent", "containerd/"+version.Version) - } - - resp, err := client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - if resp.StatusCode < 200 || resp.StatusCode >= 400 { - return nil, remoteserrors.NewUnexpectedStatusErr(resp) - } - - decoder := json.NewDecoder(resp.Body) - - var tr OAuthTokenResponse - if err = decoder.Decode(&tr); err != nil { - return nil, fmt.Errorf("unable to decode token response: %w", err) - } - - if tr.AccessToken == "" { - return nil, ErrNoToken - } - - return &tr, nil -} - -// FetchTokenResponse is response from fetching token with GET request -type FetchTokenResponse struct { - Token string `json:"token"` - AccessToken string `json:"access_token"` - ExpiresInSeconds int `json:"expires_in"` - IssuedAt time.Time `json:"issued_at"` - RefreshToken string `json:"refresh_token"` -} - -// FetchToken fetches a token using a GET request -func FetchToken(ctx context.Context, client *http.Client, headers http.Header, to TokenOptions) (*FetchTokenResponse, error) { - c := *client - client = &c - tracing.UpdateHTTPClient(client, tracing.Name("remotes.docker.resolver", "FetchToken")) - - req, err := http.NewRequestWithContext(ctx, http.MethodGet, to.Realm, nil) - if err != nil { - return nil, err - } - - for k, v := range headers { - req.Header[k] = append(req.Header[k], v...) - } - if len(req.Header.Get("User-Agent")) == 0 { - req.Header.Set("User-Agent", "containerd/"+version.Version) - } - - reqParams := req.URL.Query() - - if to.Service != "" { - reqParams.Add("service", to.Service) - } - - for _, scope := range to.Scopes { - reqParams.Add("scope", scope) - } - - if to.Secret != "" { - req.SetBasicAuth(to.Username, to.Secret) - } - - if to.FetchRefreshToken { - reqParams.Add("offline_token", "true") - } - - req.URL.RawQuery = reqParams.Encode() - - resp, err := client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - if resp.StatusCode < 200 || resp.StatusCode >= 400 { - return nil, remoteserrors.NewUnexpectedStatusErr(resp) - } - - decoder := json.NewDecoder(resp.Body) - - var tr FetchTokenResponse - if err = decoder.Decode(&tr); err != nil { - return nil, fmt.Errorf("unable to decode token response: %w", err) - } - - // `access_token` is equivalent to `token` and if both are specified - // the choice is undefined. Canonicalize `access_token` by sticking - // things in `token`. - if tr.AccessToken != "" { - tr.Token = tr.AccessToken - } - - if tr.Token == "" { - return nil, ErrNoToken - } - - return &tr, nil -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/auth/parse.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/auth/parse.go deleted file mode 100644 index 6ca935158e..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/auth/parse.go +++ /dev/null @@ -1,200 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package auth - -import ( - "net/http" - "sort" - "strings" -) - -// AuthenticationScheme defines scheme of the authentication method -type AuthenticationScheme byte - -const ( - // BasicAuth is scheme for Basic HTTP Authentication RFC 7617 - BasicAuth AuthenticationScheme = 1 << iota - // DigestAuth is scheme for HTTP Digest Access Authentication RFC 7616 - DigestAuth - // BearerAuth is scheme for OAuth 2.0 Bearer Tokens RFC 6750 - BearerAuth -) - -// Challenge carries information from a WWW-Authenticate response header. -// See RFC 2617. -type Challenge struct { - // scheme is the auth-scheme according to RFC 2617 - Scheme AuthenticationScheme - - // parameters are the auth-params according to RFC 2617 - Parameters map[string]string -} - -type byScheme []Challenge - -func (bs byScheme) Len() int { return len(bs) } -func (bs byScheme) Swap(i, j int) { bs[i], bs[j] = bs[j], bs[i] } - -// Less sorts in priority order: token > digest > basic -func (bs byScheme) Less(i, j int) bool { return bs[i].Scheme > bs[j].Scheme } - -// Octet types from RFC 2616. -type octetType byte - -var octetTypes [256]octetType - -const ( - isToken octetType = 1 << iota - isSpace -) - -func init() { - // OCTET = - // CHAR = - // CTL = - // CR = - // LF = - // SP = - // HT = - // <"> = - // CRLF = CR LF - // LWS = [CRLF] 1*( SP | HT ) - // TEXT = - // separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> - // | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT - // token = 1* - // qdtext = > - - for c := 0; c < 256; c++ { - var t octetType - isCtl := c <= 31 || c == 127 - isChar := 0 <= c && c <= 127 - isSeparator := strings.ContainsRune(" \t\"(),/:;<=>?@[]\\{}", rune(c)) - if strings.ContainsRune(" \t\r\n", rune(c)) { - t |= isSpace - } - if isChar && !isCtl && !isSeparator { - t |= isToken - } - octetTypes[c] = t - } -} - -// ParseAuthHeader parses challenges from WWW-Authenticate header -func ParseAuthHeader(header http.Header) []Challenge { - challenges := []Challenge{} - for _, h := range header[http.CanonicalHeaderKey("WWW-Authenticate")] { - v, p := parseValueAndParams(h) - var s AuthenticationScheme - switch v { - case "basic": - s = BasicAuth - case "digest": - s = DigestAuth - case "bearer": - s = BearerAuth - default: - continue - } - challenges = append(challenges, Challenge{Scheme: s, Parameters: p}) - } - sort.Stable(byScheme(challenges)) - return challenges -} - -func parseValueAndParams(header string) (value string, params map[string]string) { - params = make(map[string]string) - value, s := expectToken(header) - if value == "" { - return - } - value = strings.ToLower(value) - for { - var pkey string - pkey, s = expectToken(skipSpace(s)) - if pkey == "" { - return - } - if !strings.HasPrefix(s, "=") { - return - } - var pvalue string - pvalue, s = expectTokenOrQuoted(s[1:]) - pkey = strings.ToLower(pkey) - params[pkey] = pvalue - s = skipSpace(s) - if !strings.HasPrefix(s, ",") { - return - } - s = s[1:] - } -} - -func skipSpace(s string) (rest string) { - i := 0 - for ; i < len(s); i++ { - if octetTypes[s[i]]&isSpace == 0 { - break - } - } - return s[i:] -} - -func expectToken(s string) (token, rest string) { - i := 0 - for ; i < len(s); i++ { - if octetTypes[s[i]]&isToken == 0 { - break - } - } - return s[:i], s[i:] -} - -func expectTokenOrQuoted(s string) (value string, rest string) { - if !strings.HasPrefix(s, "\"") { - return expectToken(s) - } - s = s[1:] - for i := 0; i < len(s); i++ { - switch s[i] { - case '"': - return s[:i], s[i+1:] - case '\\': - p := make([]byte, len(s)-1) - j := copy(p, s[:i]) - escape := true - for i = i + 1; i < len(s); i++ { - b := s[i] - switch { - case escape: - escape = false - p[j] = b - j++ - case b == '\\': - escape = true - case b == '"': - return string(p[:j]), s[i+1:] - default: - p[j] = b - j++ - } - } - return "", "" - } - } - return "", "" -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/authorizer.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/authorizer.go deleted file mode 100644 index 00d1b34114..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/authorizer.go +++ /dev/null @@ -1,387 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import ( - "context" - "encoding/base64" - "errors" - "fmt" - "net/http" - "strings" - "sync" - "time" - - "github.com/containerd/containerd/v2/core/remotes/docker/auth" - remoteerrors "github.com/containerd/containerd/v2/core/remotes/errors" - "github.com/containerd/errdefs" - "github.com/containerd/log" -) - -type dockerAuthorizer struct { - credentials func(string) (string, string, error) - - client *http.Client - header http.Header - mu sync.RWMutex - - // indexed by host name - handlers map[string]*authHandler - - onFetchRefreshToken OnFetchRefreshToken -} - -type authorizerConfig struct { - credentials func(string) (string, string, error) - client *http.Client - header http.Header - onFetchRefreshToken OnFetchRefreshToken -} - -// AuthorizerOpt configures an authorizer -type AuthorizerOpt func(*authorizerConfig) - -// WithAuthClient provides the HTTP client for the authorizer -func WithAuthClient(client *http.Client) AuthorizerOpt { - return func(opt *authorizerConfig) { - opt.client = client - } -} - -// WithAuthCreds provides a credential function to the authorizer -func WithAuthCreds(creds func(string) (string, string, error)) AuthorizerOpt { - return func(opt *authorizerConfig) { - opt.credentials = creds - } -} - -// WithAuthHeader provides HTTP headers for authorization -// -// We need to merge instead of replacing because header may be set by -// a per-host hosts.toml or/AND by a global header config (e.g., cri.config.headers) -func WithAuthHeader(hdr http.Header) AuthorizerOpt { - return func(opt *authorizerConfig) { - if opt.header == nil { - opt.header = hdr.Clone() - } else { - for k, v := range hdr { - opt.header[k] = append(opt.header[k], v...) - } - } - } -} - -// OnFetchRefreshToken is called on fetching request token. -type OnFetchRefreshToken func(ctx context.Context, refreshToken string, req *http.Request) - -// WithFetchRefreshToken enables fetching "refresh token" (aka "identity token", "offline token"). -func WithFetchRefreshToken(f OnFetchRefreshToken) AuthorizerOpt { - return func(opt *authorizerConfig) { - opt.onFetchRefreshToken = f - } -} - -// NewDockerAuthorizer creates an authorizer using Docker's registry -// authentication spec. -// See https://distribution.github.io/distribution/spec/auth/ -func NewDockerAuthorizer(opts ...AuthorizerOpt) Authorizer { - var ao authorizerConfig - for _, opt := range opts { - opt(&ao) - } - - if ao.client == nil { - ao.client = http.DefaultClient - } - - return &dockerAuthorizer{ - credentials: ao.credentials, - client: ao.client, - header: ao.header, - handlers: make(map[string]*authHandler), - onFetchRefreshToken: ao.onFetchRefreshToken, - } -} - -// Authorize handles auth request. -func (a *dockerAuthorizer) Authorize(ctx context.Context, req *http.Request) error { - // skip if there is no auth handler - ah := a.getAuthHandler(req.URL.Host) - if ah == nil { - return nil - } - - auth, refreshToken, err := ah.authorize(ctx) - if err != nil { - return err - } - - req.Header.Set("Authorization", auth) - - if refreshToken != "" { - a.mu.RLock() - onFetchRefreshToken := a.onFetchRefreshToken - a.mu.RUnlock() - if onFetchRefreshToken != nil { - onFetchRefreshToken(ctx, refreshToken, req) - } - } - return nil -} - -func (a *dockerAuthorizer) getAuthHandler(host string) *authHandler { - a.mu.Lock() - defer a.mu.Unlock() - - return a.handlers[host] -} - -func (a *dockerAuthorizer) AddResponses(ctx context.Context, responses []*http.Response) error { - last := responses[len(responses)-1] - host := last.Request.URL.Host - - a.mu.Lock() - defer a.mu.Unlock() - for _, c := range auth.ParseAuthHeader(last.Header) { - if c.Scheme == auth.BearerAuth { - if retry, err := invalidAuthorization(ctx, c, responses); err != nil { - delete(a.handlers, host) - return err - } else if retry { - delete(a.handlers, host) - } - - // reuse existing handler - // - // assume that one registry will return the common - // challenge information, including realm and service. - // and the resource scope is only different part - // which can be provided by each request. - if _, ok := a.handlers[host]; ok { - return nil - } - - var username, secret string - if a.credentials != nil { - var err error - username, secret, err = a.credentials(host) - if err != nil { - return err - } - } - - common, err := auth.GenerateTokenOptions(ctx, host, username, secret, c) - if err != nil { - return err - } - common.FetchRefreshToken = a.onFetchRefreshToken != nil - - a.handlers[host] = newAuthHandler(a.client, a.header, c.Scheme, common) - return nil - } else if c.Scheme == auth.BasicAuth && a.credentials != nil { - username, secret, err := a.credentials(host) - if err != nil { - return err - } - - if username == "" || secret == "" { - return fmt.Errorf("%w: no basic auth credentials", ErrInvalidAuthorization) - } - - a.handlers[host] = newAuthHandler(a.client, a.header, c.Scheme, auth.TokenOptions{ - Username: username, - Secret: secret, - }) - return nil - } - } - return fmt.Errorf("failed to find supported auth scheme: %w", errdefs.ErrNotImplemented) -} - -// authResult is used to control limit rate. -type authResult struct { - sync.WaitGroup - token string - refreshToken string - expirationTime *time.Time - err error -} - -// authHandler is used to handle auth request per registry server. -type authHandler struct { - sync.Mutex - - header http.Header - - client *http.Client - - // only support basic and bearer schemes - scheme auth.AuthenticationScheme - - // common contains common challenge answer - common auth.TokenOptions - - // scopedTokens caches token indexed by scopes, which used in - // bearer auth case - scopedTokens map[string]*authResult -} - -func newAuthHandler(client *http.Client, hdr http.Header, scheme auth.AuthenticationScheme, opts auth.TokenOptions) *authHandler { - return &authHandler{ - header: hdr, - client: client, - scheme: scheme, - common: opts, - scopedTokens: map[string]*authResult{}, - } -} - -func (ah *authHandler) authorize(ctx context.Context) (string, string, error) { - switch ah.scheme { - case auth.BasicAuth: - return ah.doBasicAuth(ctx) - case auth.BearerAuth: - return ah.doBearerAuth(ctx) - default: - return "", "", fmt.Errorf("failed to find supported auth scheme: %s: %w", string(ah.scheme), errdefs.ErrNotImplemented) - } -} - -func (ah *authHandler) doBasicAuth(ctx context.Context) (string, string, error) { - username, secret := ah.common.Username, ah.common.Secret - - if username == "" || secret == "" { - return "", "", fmt.Errorf("failed to handle basic auth because missing username or secret") - } - - auth := base64.StdEncoding.EncodeToString([]byte(username + ":" + secret)) - return fmt.Sprintf("Basic %s", auth), "", nil -} - -func (ah *authHandler) doBearerAuth(ctx context.Context) (token, refreshToken string, err error) { - // copy common tokenOptions - to := ah.common - - to.Scopes = GetTokenScopes(ctx, to.Scopes) - - // Docs: https://distribution.github.io/distribution/spec/auth/scope/ - scoped := strings.Join(to.Scopes, " ") - - // Keep track of the expiration time of cached bearer tokens so they can be - // refreshed when they expire without a server roundtrip. - var expirationTime *time.Time - - ah.Lock() - if r, exist := ah.scopedTokens[scoped]; exist && (r.expirationTime == nil || r.expirationTime.After(time.Now())) { - ah.Unlock() - r.Wait() - return r.token, r.refreshToken, r.err - } - - // only one fetch token job - r := new(authResult) - r.Add(1) - ah.scopedTokens[scoped] = r - ah.Unlock() - - defer func() { - token = fmt.Sprintf("Bearer %s", token) - r.token, r.refreshToken, r.err, r.expirationTime = token, refreshToken, err, expirationTime - r.Done() - }() - - // fetch token for the resource scope - if to.Secret != "" { - defer func() { - if err != nil { - err = fmt.Errorf("failed to fetch oauth token: %w", err) - } - }() - // credential information is provided, use oauth POST endpoint - // TODO: Allow setting client_id - resp, err := auth.FetchTokenWithOAuth(ctx, ah.client, ah.header, "containerd-client", to) - if err != nil { - var errStatus remoteerrors.ErrUnexpectedStatus - if errors.As(err, &errStatus) { - // Registries without support for POST may return 404 for POST /v2/token. - // As of September 2017, GCR is known to return 404. - // As of February 2018, JFrog Artifactory is known to return 401. - // As of January 2022, ACR is known to return 400. - if (errStatus.StatusCode == 405 && to.Username != "") || errStatus.StatusCode == 404 || errStatus.StatusCode == 401 || errStatus.StatusCode == 400 { - resp, err := auth.FetchToken(ctx, ah.client, ah.header, to) - if err != nil { - return "", "", err - } - expirationTime = getExpirationTime(resp.ExpiresInSeconds) - return resp.Token, resp.RefreshToken, nil - } - log.G(ctx).WithFields(log.Fields{ - "status": errStatus.Status, - "body": string(errStatus.Body), - }).Debugf("token request failed") - } - return "", "", err - } - expirationTime = getExpirationTime(resp.ExpiresInSeconds) - return resp.AccessToken, resp.RefreshToken, nil - } - // do request anonymously - resp, err := auth.FetchToken(ctx, ah.client, ah.header, to) - if err != nil { - return "", "", fmt.Errorf("failed to fetch anonymous token: %w", err) - } - expirationTime = getExpirationTime(resp.ExpiresInSeconds) - return resp.Token, resp.RefreshToken, nil -} - -func getExpirationTime(expiresInSeconds int) *time.Time { - if expiresInSeconds <= 0 { - return nil - } - expirationTime := time.Now().Add(time.Duration(expiresInSeconds) * time.Second) - return &expirationTime -} - -func invalidAuthorization(ctx context.Context, c auth.Challenge, responses []*http.Response) (retry bool, _ error) { - errStr := c.Parameters["error"] - if errStr == "" { - return retry, nil - } - - n := len(responses) - if n == 1 || (n > 1 && !sameRequest(responses[n-2].Request, responses[n-1].Request)) { - limitedErr := errStr - errLenghLimit := 64 - if len(limitedErr) > errLenghLimit { - limitedErr = limitedErr[:errLenghLimit] + "..." - } - log.G(ctx).WithField("error", limitedErr).Debug("authorization error using bearer token, retrying") - return true, nil - } - - return retry, fmt.Errorf("server message: %s: %w", errStr, ErrInvalidAuthorization) -} - -func sameRequest(r1, r2 *http.Request) bool { - if r1.Method != r2.Method { - return false - } - if *r1.URL != *r2.URL { - return false - } - return true -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/converter.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/converter.go deleted file mode 100644 index f21103e17f..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/converter.go +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/remotes" - "github.com/containerd/log" - digest "github.com/opencontainers/go-digest" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -// LegacyConfigMediaType should be replaced by OCI image spec. -// -// More detail: docker/distribution#1622 -const LegacyConfigMediaType = "application/octet-stream" - -// ConvertManifest changes application/octet-stream to schema2 config media type if need. -// -// NOTE: -// 1. original manifest will be deleted by next gc round. -// 2. don't cover manifest list. -func ConvertManifest(ctx context.Context, store content.Store, desc ocispec.Descriptor) (ocispec.Descriptor, error) { - if !images.IsManifestType(desc.MediaType) { - log.G(ctx).Warnf("do nothing for media type: %s", desc.MediaType) - return desc, nil - } - - // read manifest data - mb, err := content.ReadBlob(ctx, store, desc) - if err != nil { - return ocispec.Descriptor{}, fmt.Errorf("failed to read index data: %w", err) - } - - var manifest ocispec.Manifest - if err := json.Unmarshal(mb, &manifest); err != nil { - return ocispec.Descriptor{}, fmt.Errorf("failed to unmarshal data into manifest: %w", err) - } - - // check config media type - if manifest.Config.MediaType != LegacyConfigMediaType { - return desc, nil - } - - manifest.Config.MediaType = images.MediaTypeDockerSchema2Config - data, err := json.MarshalIndent(manifest, "", " ") - if err != nil { - return ocispec.Descriptor{}, fmt.Errorf("failed to marshal manifest: %w", err) - } - - // update manifest with gc labels - desc.Digest = digest.Canonical.FromBytes(data) - desc.Size = int64(len(data)) - - labels := map[string]string{} - for i, c := range append([]ocispec.Descriptor{manifest.Config}, manifest.Layers...) { - labels[fmt.Sprintf("containerd.io/gc.ref.content.%d", i)] = c.Digest.String() - } - - ref := remotes.MakeRefKey(ctx, desc) - if err := content.WriteBlob(ctx, store, ref, bytes.NewReader(data), desc, content.WithLabels(labels)); err != nil { - return ocispec.Descriptor{}, fmt.Errorf("failed to update content: %w", err) - } - return desc, nil -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/errcode.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/errcode.go deleted file mode 100644 index 8c623bcbef..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/errcode.go +++ /dev/null @@ -1,283 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import ( - "encoding/json" - "fmt" - "strings" -) - -// ErrorCoder is the base interface for ErrorCode and Error allowing -// users of each to just call ErrorCode to get the real ID of each -type ErrorCoder interface { - ErrorCode() ErrorCode -} - -// ErrorCode represents the error type. The errors are serialized via strings -// and the integer format may change and should *never* be exported. -type ErrorCode int - -var _ error = ErrorCode(0) - -// ErrorCode just returns itself -func (ec ErrorCode) ErrorCode() ErrorCode { - return ec -} - -// Error returns the ID/Value -func (ec ErrorCode) Error() string { - // NOTE(stevvooe): Cannot use message here since it may have unpopulated args. - return strings.ToLower(strings.Replace(ec.String(), "_", " ", -1)) -} - -// Descriptor returns the descriptor for the error code. -func (ec ErrorCode) Descriptor() ErrorDescriptor { - d, ok := errorCodeToDescriptors[ec] - - if !ok { - return ErrorCodeUnknown.Descriptor() - } - - return d -} - -// String returns the canonical identifier for this error code. -func (ec ErrorCode) String() string { - return ec.Descriptor().Value -} - -// Message returned the human-readable error message for this error code. -func (ec ErrorCode) Message() string { - return ec.Descriptor().Message -} - -// MarshalText encodes the receiver into UTF-8-encoded text and returns the -// result. -func (ec ErrorCode) MarshalText() (text []byte, err error) { - return []byte(ec.String()), nil -} - -// UnmarshalText decodes the form generated by MarshalText. -func (ec *ErrorCode) UnmarshalText(text []byte) error { - desc, ok := idToDescriptors[string(text)] - - if !ok { - desc = ErrorCodeUnknown.Descriptor() - } - - *ec = desc.Code - - return nil -} - -// WithMessage creates a new Error struct based on the passed-in info and -// overrides the Message property. -func (ec ErrorCode) WithMessage(message string) Error { - return Error{ - Code: ec, - Message: message, - } -} - -// WithDetail creates a new Error struct based on the passed-in info and -// set the Detail property appropriately -func (ec ErrorCode) WithDetail(detail interface{}) Error { - return Error{ - Code: ec, - Message: ec.Message(), - }.WithDetail(detail) -} - -// WithArgs creates a new Error struct and sets the Args slice -func (ec ErrorCode) WithArgs(args ...interface{}) Error { - return Error{ - Code: ec, - Message: ec.Message(), - }.WithArgs(args...) -} - -// Error provides a wrapper around ErrorCode with extra Details provided. -type Error struct { - Code ErrorCode `json:"code"` - Message string `json:"message"` - Detail interface{} `json:"detail,omitempty"` - - // TODO(duglin): See if we need an "args" property so we can do the - // variable substitution right before showing the message to the user -} - -var _ error = Error{} - -// ErrorCode returns the ID/Value of this Error -func (e Error) ErrorCode() ErrorCode { - return e.Code -} - -// Error returns a human readable representation of the error. -func (e Error) Error() string { - return fmt.Sprintf("%s: %s", e.Code.Error(), e.Message) -} - -// WithDetail will return a new Error, based on the current one, but with -// some Detail info added -func (e Error) WithDetail(detail interface{}) Error { - return Error{ - Code: e.Code, - Message: e.Message, - Detail: detail, - } -} - -// WithArgs uses the passed-in list of interface{} as the substitution -// variables in the Error's Message string, but returns a new Error -func (e Error) WithArgs(args ...interface{}) Error { - return Error{ - Code: e.Code, - Message: fmt.Sprintf(e.Code.Message(), args...), - Detail: e.Detail, - } -} - -// ErrorDescriptor provides relevant information about a given error code. -type ErrorDescriptor struct { - // Code is the error code that this descriptor describes. - Code ErrorCode - - // Value provides a unique, string key, often captilized with - // underscores, to identify the error code. This value is used as the - // keyed value when serializing api errors. - Value string - - // Message is a short, human readable description of the error condition - // included in API responses. - Message string - - // Description provides a complete account of the errors purpose, suitable - // for use in documentation. - Description string - - // HTTPStatusCode provides the http status code that is associated with - // this error condition. - HTTPStatusCode int -} - -// ParseErrorCode returns the value by the string error code. -// `ErrorCodeUnknown` will be returned if the error is not known. -func ParseErrorCode(value string) ErrorCode { - ed, ok := idToDescriptors[value] - if ok { - return ed.Code - } - - return ErrorCodeUnknown -} - -// Errors provides the envelope for multiple errors and a few sugar methods -// for use within the application. -type Errors []error - -var _ error = Errors{} - -func (errs Errors) Error() string { - switch len(errs) { - case 0: - return "" - case 1: - return errs[0].Error() - default: - msg := "errors:\n" - for _, err := range errs { - msg += err.Error() + "\n" - } - return msg - } -} - -// Len returns the current number of errors. -func (errs Errors) Len() int { - return len(errs) -} - -// MarshalJSON converts slice of error, ErrorCode or Error into a -// slice of Error - then serializes -func (errs Errors) MarshalJSON() ([]byte, error) { - var tmpErrs struct { - Errors []Error `json:"errors,omitempty"` - } - - for _, daErr := range errs { - var err Error - - switch daErr := daErr.(type) { - case ErrorCode: - err = daErr.WithDetail(nil) - case Error: - err = daErr - default: - err = ErrorCodeUnknown.WithDetail(daErr) - - } - - // If the Error struct was setup and they forgot to set the - // Message field (meaning its "") then grab it from the ErrCode - msg := err.Message - if msg == "" { - msg = err.Code.Message() - } - - tmpErrs.Errors = append(tmpErrs.Errors, Error{ - Code: err.Code, - Message: msg, - Detail: err.Detail, - }) - } - - return json.Marshal(tmpErrs) -} - -// UnmarshalJSON deserializes []Error and then converts it into slice of -// Error or ErrorCode -func (errs *Errors) UnmarshalJSON(data []byte) error { - var tmpErrs struct { - Errors []Error - } - - if err := json.Unmarshal(data, &tmpErrs); err != nil { - return err - } - - var newErrs Errors - for _, daErr := range tmpErrs.Errors { - // If Message is empty or exactly matches the Code's message string - // then just use the Code, no need for a full Error struct - if daErr.Detail == nil && (daErr.Message == "" || daErr.Message == daErr.Code.Message()) { - // Error's w/o details get converted to ErrorCode - newErrs = append(newErrs, daErr.Code) - } else { - // Error's w/ details are untouched - newErrs = append(newErrs, Error{ - Code: daErr.Code, - Message: daErr.Message, - Detail: daErr.Detail, - }) - } - } - - *errs = newErrs - return nil -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/errdesc.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/errdesc.go deleted file mode 100644 index b2bd4d82bd..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/errdesc.go +++ /dev/null @@ -1,154 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import ( - "fmt" - "net/http" - "sort" - "sync" -) - -var ( - errorCodeToDescriptors = map[ErrorCode]ErrorDescriptor{} - idToDescriptors = map[string]ErrorDescriptor{} - groupToDescriptors = map[string][]ErrorDescriptor{} -) - -var ( - // ErrorCodeUnknown is a generic error that can be used as a last - // resort if there is no situation-specific error message that can be used - ErrorCodeUnknown = Register("errcode", ErrorDescriptor{ - Value: "UNKNOWN", - Message: "unknown error", - Description: `Generic error returned when the error does not have an - API classification.`, - HTTPStatusCode: http.StatusInternalServerError, - }) - - // ErrorCodeUnsupported is returned when an operation is not supported. - ErrorCodeUnsupported = Register("errcode", ErrorDescriptor{ - Value: "UNSUPPORTED", - Message: "The operation is unsupported.", - Description: `The operation was unsupported due to a missing - implementation or invalid set of parameters.`, - HTTPStatusCode: http.StatusMethodNotAllowed, - }) - - // ErrorCodeUnauthorized is returned if a request requires - // authentication. - ErrorCodeUnauthorized = Register("errcode", ErrorDescriptor{ - Value: "UNAUTHORIZED", - Message: "authentication required", - Description: `The access controller was unable to authenticate - the client. Often this will be accompanied by a - Www-Authenticate HTTP response header indicating how to - authenticate.`, - HTTPStatusCode: http.StatusUnauthorized, - }) - - // ErrorCodeDenied is returned if a client does not have sufficient - // permission to perform an action. - ErrorCodeDenied = Register("errcode", ErrorDescriptor{ - Value: "DENIED", - Message: "requested access to the resource is denied", - Description: `The access controller denied access for the - operation on a resource.`, - HTTPStatusCode: http.StatusForbidden, - }) - - // ErrorCodeUnavailable provides a common error to report unavailability - // of a service or endpoint. - ErrorCodeUnavailable = Register("errcode", ErrorDescriptor{ - Value: "UNAVAILABLE", - Message: "service unavailable", - Description: "Returned when a service is not available", - HTTPStatusCode: http.StatusServiceUnavailable, - }) - - // ErrorCodeTooManyRequests is returned if a client attempts too many - // times to contact a service endpoint. - ErrorCodeTooManyRequests = Register("errcode", ErrorDescriptor{ - Value: "TOOMANYREQUESTS", - Message: "too many requests", - Description: `Returned when a client attempts to contact a - service too many times`, - HTTPStatusCode: http.StatusTooManyRequests, - }) -) - -var nextCode = 1000 -var registerLock sync.Mutex - -// Register will make the passed-in error known to the environment and -// return a new ErrorCode -func Register(group string, descriptor ErrorDescriptor) ErrorCode { - registerLock.Lock() - defer registerLock.Unlock() - - descriptor.Code = ErrorCode(nextCode) - - if _, ok := idToDescriptors[descriptor.Value]; ok { - panic(fmt.Sprintf("ErrorValue %q is already registered", descriptor.Value)) - } - if _, ok := errorCodeToDescriptors[descriptor.Code]; ok { - panic(fmt.Sprintf("ErrorCode %v is already registered", descriptor.Code)) - } - - groupToDescriptors[group] = append(groupToDescriptors[group], descriptor) - errorCodeToDescriptors[descriptor.Code] = descriptor - idToDescriptors[descriptor.Value] = descriptor - - nextCode++ - return descriptor.Code -} - -type byValue []ErrorDescriptor - -func (a byValue) Len() int { return len(a) } -func (a byValue) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a byValue) Less(i, j int) bool { return a[i].Value < a[j].Value } - -// GetGroupNames returns the list of Error group names that are registered -func GetGroupNames() []string { - keys := []string{} - - for k := range groupToDescriptors { - keys = append(keys, k) - } - sort.Strings(keys) - return keys -} - -// GetErrorCodeGroup returns the named group of error descriptors -func GetErrorCodeGroup(name string) []ErrorDescriptor { - desc := groupToDescriptors[name] - sort.Sort(byValue(desc)) - return desc -} - -// GetErrorAllDescriptors returns a slice of all ErrorDescriptors that are -// registered, irrespective of what group they're in -func GetErrorAllDescriptors() []ErrorDescriptor { - result := []ErrorDescriptor{} - - for _, group := range GetGroupNames() { - result = append(result, GetErrorCodeGroup(group)...) - } - sort.Sort(byValue(result)) - return result -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher.go deleted file mode 100644 index 9388d8479e..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher.go +++ /dev/null @@ -1,609 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import ( - "bytes" - "compress/flate" - "compress/gzip" - "context" - "errors" - "fmt" - "io" - "net/http" - "net/url" - "strconv" - "strings" - "sync" - - "github.com/containerd/errdefs" - "github.com/containerd/log" - "github.com/klauspost/compress/zstd" - digest "github.com/opencontainers/go-digest" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/remotes" -) - -type bufferPool struct { - pool *sync.Pool -} - -func newbufferPool(bufCap int64) *bufferPool { - pool := &sync.Pool{ - New: func() any { - return bytes.NewBuffer(make([]byte, 0, bufCap)) - }, - } - return &bufferPool{ - pool: pool, - } -} - -func (p *bufferPool) Get() *bytes.Buffer { - buf := p.pool.Get().(*bytes.Buffer) - return buf -} - -func (p *bufferPool) Put(buffer *bytes.Buffer) { - p.pool.Put(buffer) -} - -var ErrClosedPipe = errors.New("bufpipe: read/write on closed pipe") - -// pipe implements an asynchronous buffered pipe designed for high-throughput -// I/O with configurable initial buffer sizes and buffer reuse. It decouples -// read/write operations, allowing writers to proceed without blocking (unless -// the pipe is closed) and readers to wait efficiently for incoming data. -// -// Key Characteristics: -// - Asynchronous Operation: Writers populate buffers independently of read -// timing, enabling continuous data flow without reader-writer synchronization. -// - Dynamic Buffering: Active buffer grows organically to handle large payloads, while -// the initial capacity (bufCap) balances memory pre-allocation and growth overhead. -// - Buffer Recycling: Retrieved from/pushed to a pool to minimize allocations, reducing -// garbage collection pressure in sustained I/O scenarios. -// - Error Semantics: Closes deterministically on first error (read or write), propagating -// errors atomically to both ends while draining buffered data. -// -// Difference with io.Pipe: -// - Unlike io.Pipe's strict synchronization (blocking write until read), this implementation -// allows writers to buffer data ahead of reads, improving throughput for bursty workloads. -// -// Synchronization & Internals: -// - Condition Variable (sync.Cond): Coordinates reader/writer, waking readers on new data -// or closure. Locking is centralized via the condition's mutex. -// - Buffer Lifecycle: Active buffer serves writes until read depletion, after which it's -// recycled to the pool. Pooled buffers retain their capacity across uses. -// - Error Handling: Write errors (werr) permanently fail writes; read errors (rerr) mark -// terminal read state after buffer exhaustion. -// -// Future Considerations: -// - Zero-copy reads/writes to avoid buffer copying overhead. -// - Memory-mapped file backing for multi-gigabyte payloads. -type pipe struct { - cond *sync.Cond // Coordinates read/write signaling via Lock+Wait/Signal - bufPool *bufferPool // Reusable buffers with initial capacity bufCap - buf *bytes.Buffer // Active data buffer (nil when empty/returned to pool) - rerr, werr error // Terminal read/write errors (sticky once set) -} - -type pipeReader struct { - *pipe -} - -type pipeWriter struct { - *pipe -} - -func newPipeWriter(bufPool *bufferPool) (*pipeReader, *pipeWriter) { - p := &pipe{ - cond: sync.NewCond(new(sync.Mutex)), - bufPool: bufPool, - buf: nil, - } - return &pipeReader{ - pipe: p, - }, &pipeWriter{ - pipe: p, - } -} - -// Read implements the standard Read interface: it reads data from the pipe, -// reading from the internal buffer, otherwise blocking until a writer arrives -// or the write end is closed. If the write end is closed with an error, that -// error is returned as err; otherwise err is io.EOF. -func (r *pipeReader) Read(data []byte) (n int, err error) { - r.cond.L.Lock() - defer r.cond.L.Unlock() - - if r.buf == nil { - r.buf = r.bufPool.Get() - } - - for { - n, err = r.buf.Read(data) - // If not closed and no read, wait for writing. - if err == io.EOF && r.rerr == nil && n == 0 { - r.cond.Wait() // Wait for data to be written - continue - } - break - } - if err == io.EOF { - // Put buffer back to pool - r.bufPool.Put(r.buf) - r.buf = nil - return n, r.rerr - } - return n, err -} - -// Close closes the reader; subsequent writes from the write half of the pipe -// will return error ErrClosedPipe. -func (r *pipeReader) Close() error { - return r.CloseWithError(nil) -} - -// CloseWithError closes the reader; subsequent writes to the write half of the -// pipe will return the error err. -func (r *pipeReader) CloseWithError(err error) error { - r.cond.L.Lock() - defer r.cond.L.Unlock() - - if err == nil { - err = ErrClosedPipe - } - r.werr = err - return nil -} - -// Write implements the standard Write interface: it writes data to the internal -// buffer. If the read end is closed with an error, that err is returned as err; -// otherwise err is ErrClosedPipe. -func (w *pipeWriter) Write(data []byte) (int, error) { - w.cond.L.Lock() - defer w.cond.L.Unlock() - - if w.werr != nil { - return 0, w.werr - } - - if w.buf == nil { - w.buf = w.bufPool.Get() - } - - n, err := w.buf.Write(data) - w.cond.Signal() - return n, err -} - -// Close closes the writer; subsequent reads from the read half of the pipe will -// return io.EOF once the internal buffer get empty. -func (w *pipeWriter) Close() error { - return w.CloseWithError(nil) -} - -// Close closes the writer; subsequent reads from the read half of the pipe will -// return err once the internal buffer get empty. -func (w *pipeWriter) CloseWithError(err error) error { - w.cond.L.Lock() - defer w.cond.L.Unlock() - - if err == nil { - err = io.EOF - } - w.rerr = err - w.cond.Broadcast() - return nil -} - -type dockerFetcher struct { - *dockerBase -} - -func (r dockerFetcher) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error) { - ctx = log.WithLogger(ctx, log.G(ctx).WithField("digest", desc.Digest)) - - hosts := r.filterHosts(HostCapabilityPull) - if len(hosts) == 0 { - return nil, fmt.Errorf("no pull hosts: %w", errdefs.ErrNotFound) - } - - ctx, err := ContextWithRepositoryScope(ctx, r.refspec, false) - if err != nil { - return nil, err - } - - return newHTTPReadSeeker(desc.Size, func(offset int64) (io.ReadCloser, error) { - // firstly try fetch via external urls - for _, us := range desc.URLs { - u, err := url.Parse(us) - if err != nil { - log.G(ctx).WithError(err).Debugf("failed to parse %q", us) - continue - } - if u.Scheme != "http" && u.Scheme != "https" { - log.G(ctx).Debug("non-http(s) alternative url is unsupported") - continue - } - ctx = log.WithLogger(ctx, log.G(ctx).WithField("url", u)) - log.G(ctx).Info("request") - - // Try this first, parse it - host := RegistryHost{ - Client: http.DefaultClient, - Host: u.Host, - Scheme: u.Scheme, - Path: u.Path, - Capabilities: HostCapabilityPull, - } - req := r.request(host, http.MethodGet) - // Strip namespace from base - req.path = u.Path - if u.RawQuery != "" { - req.path = req.path + "?" + u.RawQuery - } - - rc, err := r.open(ctx, req, desc.MediaType, offset, false) - if err != nil { - if errdefs.IsNotFound(err) { - continue // try one of the other urls. - } - - return nil, err - } - - return rc, nil - } - - // Try manifests endpoints for manifests types - if images.IsManifestType(desc.MediaType) || images.IsIndexType(desc.MediaType) { - - var firstErr error - for i, host := range r.hosts { - req := r.request(host, http.MethodGet, "manifests", desc.Digest.String()) - if err := req.addNamespace(r.refspec.Hostname()); err != nil { - return nil, err - } - - rc, err := r.open(ctx, req, desc.MediaType, offset, i == len(r.hosts)-1) - if err != nil { - // Store the error for referencing later - if firstErr == nil { - firstErr = err - } - continue // try another host - } - - return rc, nil - } - - return nil, firstErr - } - - // Finally use blobs endpoints - var firstErr error - for i, host := range r.hosts { - req := r.request(host, http.MethodGet, "blobs", desc.Digest.String()) - if err := req.addNamespace(r.refspec.Hostname()); err != nil { - return nil, err - } - - rc, err := r.open(ctx, req, desc.MediaType, offset, i == len(r.hosts)-1) - if err != nil { - // Store the error for referencing later - if firstErr == nil { - firstErr = err - } - continue // try another host - } - - return rc, nil - } - - if errdefs.IsNotFound(firstErr) { - firstErr = fmt.Errorf("could not fetch content descriptor %v (%v) from remote: %w", - desc.Digest, desc.MediaType, errdefs.ErrNotFound, - ) - } - - return nil, firstErr - - }) -} - -func (r dockerFetcher) createGetReq(ctx context.Context, host RegistryHost, lastHost bool, mediatype string, ps ...string) (*request, int64, error) { - headReq := r.request(host, http.MethodHead, ps...) - if err := headReq.addNamespace(r.refspec.Hostname()); err != nil { - return nil, 0, err - } - - if mediatype == "" { - headReq.header.Set("Accept", "*/*") - } else { - headReq.header.Set("Accept", strings.Join([]string{mediatype, `*/*`}, ", ")) - } - - headResp, err := headReq.doWithRetries(ctx, lastHost) - if err != nil { - return nil, 0, err - } - if headResp.Body != nil { - headResp.Body.Close() - } - if headResp.StatusCode > 299 { - return nil, 0, fmt.Errorf("unexpected HEAD status code %v: %s", headReq.String(), headResp.Status) - } - - getReq := r.request(host, http.MethodGet, ps...) - if err := getReq.addNamespace(r.refspec.Hostname()); err != nil { - return nil, 0, err - } - return getReq, headResp.ContentLength, nil -} - -func (r dockerFetcher) FetchByDigest(ctx context.Context, dgst digest.Digest, opts ...remotes.FetchByDigestOpts) (io.ReadCloser, ocispec.Descriptor, error) { - var desc ocispec.Descriptor - ctx = log.WithLogger(ctx, log.G(ctx).WithField("digest", dgst)) - var config remotes.FetchByDigestConfig - for _, o := range opts { - if err := o(ctx, &config); err != nil { - return nil, desc, err - } - } - - hosts := r.filterHosts(HostCapabilityPull) - if len(hosts) == 0 { - return nil, desc, fmt.Errorf("no pull hosts: %w", errdefs.ErrNotFound) - } - - ctx, err := ContextWithRepositoryScope(ctx, r.refspec, false) - if err != nil { - return nil, desc, err - } - - var ( - getReq *request - sz int64 - firstErr error - ) - - for i, host := range r.hosts { - getReq, sz, err = r.createGetReq(ctx, host, i == len(r.hosts)-1, config.Mediatype, "blobs", dgst.String()) - if err == nil { - break - } - // Store the error for referencing later - if firstErr == nil { - firstErr = err - } - } - - if getReq == nil { - // Fall back to the "manifests" endpoint - for i, host := range r.hosts { - getReq, sz, err = r.createGetReq(ctx, host, i == len(r.hosts)-1, config.Mediatype, "manifests", dgst.String()) - if err == nil { - break - } - // Store the error for referencing later - if firstErr == nil { - firstErr = err - } - } - } - - if getReq == nil { - if errdefs.IsNotFound(firstErr) { - firstErr = fmt.Errorf("could not fetch content %v from remote: %w", dgst, errdefs.ErrNotFound) - } - if firstErr == nil { - firstErr = fmt.Errorf("could not fetch content %v from remote: (unknown)", dgst) - } - return nil, desc, firstErr - } - - seeker, err := newHTTPReadSeeker(sz, func(offset int64) (io.ReadCloser, error) { - return r.open(ctx, getReq, config.Mediatype, offset, true) - }) - if err != nil { - return nil, desc, err - } - - desc = ocispec.Descriptor{ - MediaType: "application/octet-stream", - Digest: dgst, - Size: sz, - } - if config.Mediatype != "" { - desc.MediaType = config.Mediatype - } - return seeker, desc, nil -} - -func (r dockerFetcher) open(ctx context.Context, req *request, mediatype string, offset int64, lastHost bool) (_ io.ReadCloser, retErr error) { - const minChunkSize = 512 - - chunkSize := int64(r.performances.ConcurrentLayerFetchBuffer) - parallelism := int64(r.performances.MaxConcurrentDownloads) - if chunkSize < minChunkSize { - parallelism = 1 - } - log.G(ctx).WithField("initial_parallelism", r.performances.MaxConcurrentDownloads). - WithField("parallelism", parallelism). - WithField("chunk_size", chunkSize). - WithField("offset", offset). - Debug("fetching layer") - req.setMediaType(mediatype) - req.header.Set("Accept-Encoding", "zstd;q=1.0, gzip;q=0.8, deflate;q=0.5") - req.setOffset(offset) - - if err := r.Acquire(ctx, 1); err != nil { - return nil, err - } - resp, err := req.doWithRetries(ctx, lastHost, withErrorCheck, withOffsetCheck(offset)) - switch err { - case nil: - // all good - case errContentRangeIgnored: - if parallelism != 1 { - log.G(ctx).WithError(err).Info("remote host ignored content range, forcing parallelism to 1") - parallelism = 1 - } - default: - log.G(ctx).WithError(err).Debug("fetch failed") - r.Release(1) - return nil, err - } - - body := resp.Body - encoding := strings.FieldsFunc(resp.Header.Get("Content-Encoding"), func(r rune) bool { - return r == ' ' || r == '\t' || r == ',' - }) - - remaining, _ := strconv.ParseInt(resp.Header.Get("Content-Length"), 10, 0) - if parallelism > 1 && req.body == nil { - // If we have a content length, we can use multiple requests to fetch - // the content in parallel. This will make download of bigger bodies - // faster, at the cost of parallelism more requests and max - // ~(max_parallelism * goroutine footprint) memory usage. The goroutine - // footprint should be: the goroutine stack + pipe buffer size - numChunks := remaining / chunkSize - if numChunks*chunkSize < remaining { - numChunks++ - } - if numChunks < parallelism { - parallelism = numChunks - } - queue := make(chan int64, parallelism) - ctx, cancelCtx := context.WithCancel(ctx) - done := ctx.Done() - readers, writers := make([]io.Reader, numChunks), make([]*pipeWriter, numChunks) - bufPool := newbufferPool(chunkSize) - for i := range numChunks { - readers[i], writers[i] = newPipeWriter(bufPool) - } - go func() { - for i := range numChunks { - select { - case queue <- i: - case <-done: - return // avoid leaking a goroutine if we exit early. - } - } - close(queue) - }() - r.Release(1) - for range parallelism { - go func() { - for i := range queue { // first in first out - copy := func() error { - if err := r.Acquire(ctx, 1); err != nil { - return err - } - defer r.Release(1) - var body io.ReadCloser - if i == 0 { - body = resp.Body - } else { - reqClone := req.clone() - reqClone.setOffset(offset + i*chunkSize) - nresp, err := reqClone.doWithRetries(ctx, lastHost, withErrorCheck) - if err != nil { - _ = writers[i].CloseWithError(err) - select { - case <-done: - return ctx.Err() - default: - cancelCtx() - } - return err - } - body = nresp.Body - } - _, err := io.Copy(writers[i], io.LimitReader(body, chunkSize)) - _ = body.Close() - _ = writers[i].CloseWithError(err) - if err != nil && err != io.EOF { - cancelCtx() - return err - } - return nil - } - if copy() != nil { - return - } - } - }() - } - body = &fnOnClose{ - BeforeClose: func() { - cancelCtx() - }, - ReadCloser: io.NopCloser(io.MultiReader(readers...)), - } - } else { - body = &fnOnClose{ - BeforeClose: func() { - r.Release(1) - }, - ReadCloser: body, - } - } - for i := len(encoding) - 1; i >= 0; i-- { - algorithm := strings.ToLower(encoding[i]) - switch algorithm { - case "zstd": - r, err := zstd.NewReader(body, - zstd.WithDecoderLowmem(false), - ) - if err != nil { - return nil, err - } - body = r.IOReadCloser() - case "gzip": - body, err = gzip.NewReader(body) - if err != nil { - return nil, err - } - case "deflate": - body = flate.NewReader(body) - case "identity", "": - // no content-encoding applied, use raw body - default: - return nil, errors.New("unsupported Content-Encoding algorithm: " + algorithm) - } - } - - return body, nil -} - -type fnOnClose struct { - BeforeClose func() - io.ReadCloser -} - -// Close calls the BeforeClose function before closing the underlying -// ReadCloser. -func (f *fnOnClose) Close() error { - f.BeforeClose() - return f.ReadCloser.Close() -} - -var _ io.ReadCloser = &fnOnClose{} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/handler.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/handler.go deleted file mode 100644 index 615869a224..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/handler.go +++ /dev/null @@ -1,149 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import ( - "context" - "fmt" - "net/url" - "strings" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/labels" - "github.com/containerd/containerd/v2/pkg/reference" - "github.com/containerd/log" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -// AppendDistributionSourceLabel updates the label of blob with distribution source. -func AppendDistributionSourceLabel(manager content.Manager, ref string) (images.HandlerFunc, error) { - refspec, err := reference.Parse(ref) - if err != nil { - return nil, err - } - - u, err := url.Parse("dummy://" + refspec.Locator) - if err != nil { - return nil, err - } - - source, repo := u.Hostname(), strings.TrimPrefix(u.Path, "/") - return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - info, err := manager.Info(ctx, desc.Digest) - if err != nil { - return nil, err - } - - key := distributionSourceLabelKey(source) - - originLabel := "" - if info.Labels != nil { - originLabel = info.Labels[key] - } - value := appendDistributionSourceLabel(originLabel, repo) - - // The repo name has been limited under 256 and the distribution - // label might hit the limitation of label size, when blob data - // is used as the very, very common layer. - if err := labels.Validate(key, value); err != nil { - log.G(ctx).Warnf("skip to append distribution label: %s", err) - return nil, nil - } - - info = content.Info{ - Digest: desc.Digest, - Labels: map[string]string{ - key: value, - }, - } - _, err = manager.Update(ctx, info, fmt.Sprintf("labels.%s", key)) - return nil, err - }, nil -} - -func appendDistributionSourceLabel(originLabel, repo string) string { - repos := []string{} - if originLabel != "" { - repos = strings.Split(originLabel, ",") - } - repos = append(repos, repo) - - // use empty string to present duplicate items - for i := 1; i < len(repos); i++ { - tmp, j := repos[i], i-1 - for ; j >= 0 && repos[j] >= tmp; j-- { - if repos[j] == tmp { - tmp = "" - } - repos[j+1] = repos[j] - } - repos[j+1] = tmp - } - - i := 0 - for ; i < len(repos) && repos[i] == ""; i++ { - } - - return strings.Join(repos[i:], ",") -} - -func distributionSourceLabelKey(source string) string { - return labels.LabelDistributionSource + "." + source -} - -// selectRepositoryMountCandidate will select the repo which has longest -// common prefix components as the candidate. -func selectRepositoryMountCandidate(refspec reference.Spec, sources map[string]string) string { - u, err := url.Parse("dummy://" + refspec.Locator) - if err != nil { - // NOTE: basically, it won't be error here - return "" - } - - source, target := u.Hostname(), strings.TrimPrefix(u.Path, "/") - repoLabel, ok := sources[distributionSourceLabelKey(source)] - if !ok || repoLabel == "" { - return "" - } - - n, match := 0, "" - components := strings.Split(target, "/") - for _, repo := range strings.Split(repoLabel, ",") { - // the target repo is not a candidate - if repo == target { - continue - } - - if l := commonPrefixComponents(components, repo); l >= n { - n, match = l, repo - } - } - return match -} - -func commonPrefixComponents(components []string, target string) int { - targetComponents := strings.Split(target, "/") - - i := 0 - for ; i < len(components) && i < len(targetComponents); i++ { - if components[i] != targetComponents[i] { - break - } - } - return i -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/httpreadseeker.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/httpreadseeker.go deleted file mode 100644 index 6739e7904e..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/httpreadseeker.go +++ /dev/null @@ -1,178 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import ( - "bytes" - "fmt" - "io" - - "github.com/containerd/errdefs" - "github.com/containerd/log" -) - -const maxRetry = 3 - -type httpReadSeeker struct { - size int64 - offset int64 - rc io.ReadCloser - open func(offset int64) (io.ReadCloser, error) - closed bool - - errsWithNoProgress int -} - -func newHTTPReadSeeker(size int64, open func(offset int64) (io.ReadCloser, error)) (io.ReadCloser, error) { - return &httpReadSeeker{ - size: size, - open: open, - }, nil -} - -func (hrs *httpReadSeeker) Read(p []byte) (n int, err error) { - if hrs.closed { - return 0, io.EOF - } - - rd, err := hrs.reader() - if err != nil { - return 0, err - } - - n, err = rd.Read(p) - hrs.offset += int64(n) - if n > 0 || err == nil { - hrs.errsWithNoProgress = 0 - } - if err == io.ErrUnexpectedEOF { - // connection closed unexpectedly. try reconnecting. - if n == 0 { - hrs.errsWithNoProgress++ - if hrs.errsWithNoProgress > maxRetry { - return // too many retries for this offset with no progress - } - } - if hrs.rc != nil { - if clsErr := hrs.rc.Close(); clsErr != nil { - log.L.WithError(clsErr).Error("httpReadSeeker: failed to close ReadCloser") - } - hrs.rc = nil - } - if _, err2 := hrs.reader(); err2 == nil { - return n, nil - } - } else if err == io.EOF { - // The CRI's imagePullProgressTimeout relies on responseBody.Close to - // update the process monitor's status. If the err is io.EOF, close - // the connection since there is no more available data. - if hrs.rc != nil { - if clsErr := hrs.rc.Close(); clsErr != nil { - log.L.WithError(clsErr).Error("httpReadSeeker: failed to close ReadCloser after io.EOF") - } - hrs.rc = nil - } - } - return -} - -func (hrs *httpReadSeeker) Close() error { - if hrs.closed { - return nil - } - hrs.closed = true - if hrs.rc != nil { - return hrs.rc.Close() - } - - return nil -} - -func (hrs *httpReadSeeker) Seek(offset int64, whence int) (int64, error) { - if hrs.closed { - return 0, fmt.Errorf("Fetcher.Seek: closed: %w", errdefs.ErrUnavailable) - } - - abs := hrs.offset - switch whence { - case io.SeekStart: - abs = offset - case io.SeekCurrent: - abs += offset - case io.SeekEnd: - if hrs.size == -1 { - return 0, fmt.Errorf("Fetcher.Seek: unknown size, cannot seek from end: %w", errdefs.ErrUnavailable) - } - abs = hrs.size + offset - default: - return 0, fmt.Errorf("Fetcher.Seek: invalid whence: %w", errdefs.ErrInvalidArgument) - } - - if abs < 0 { - return 0, fmt.Errorf("Fetcher.Seek: negative offset: %w", errdefs.ErrInvalidArgument) - } - - if abs != hrs.offset { - if hrs.rc != nil { - if err := hrs.rc.Close(); err != nil { - log.L.WithError(err).Error("Fetcher.Seek: failed to close ReadCloser") - } - - hrs.rc = nil - } - - hrs.offset = abs - } - - return hrs.offset, nil -} - -func (hrs *httpReadSeeker) reader() (io.Reader, error) { - if hrs.rc != nil { - return hrs.rc, nil - } - - if hrs.size == -1 || hrs.offset < hrs.size { - // only try to reopen the body request if we are seeking to a value - // less than the actual size. - if hrs.open == nil { - return nil, fmt.Errorf("cannot open: %w", errdefs.ErrNotImplemented) - } - - rc, err := hrs.open(hrs.offset) - if err != nil { - return nil, fmt.Errorf("httpReadSeeker: failed open: %w", err) - } - - if hrs.rc != nil { - if err := hrs.rc.Close(); err != nil { - log.L.WithError(err).Error("httpReadSeeker: failed to close ReadCloser") - } - } - hrs.rc = rc - } else { - // There is an edge case here where offset == size of the content. If - // we seek, we will probably get an error for content that cannot be - // sought (?). In that case, we should err on committing the content, - // as the length is already satisfied but we just return the empty - // reader instead. - - hrs.rc = io.NopCloser(bytes.NewReader([]byte{})) - } - - return hrs.rc, nil -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/pusher.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/pusher.go deleted file mode 100644 index eac7b56c17..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/pusher.go +++ /dev/null @@ -1,565 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import ( - "context" - "errors" - "fmt" - "io" - "net/http" - "net/url" - "path" - "strings" - "sync" - "time" - - "github.com/containerd/errdefs" - "github.com/containerd/log" - digest "github.com/opencontainers/go-digest" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/remotes" - remoteserrors "github.com/containerd/containerd/v2/core/remotes/errors" -) - -type dockerPusher struct { - *dockerBase - object string - - // TODO: namespace tracker - tracker StatusTracker -} - -// Writer implements Ingester API of content store. This allows the client -// to receive ErrUnavailable when there is already an on-going upload. -// Note that the tracker MUST implement StatusTrackLocker interface to avoid -// race condition on StatusTracker. -func (p dockerPusher) Writer(ctx context.Context, opts ...content.WriterOpt) (content.Writer, error) { - var wOpts content.WriterOpts - for _, opt := range opts { - if err := opt(&wOpts); err != nil { - return nil, err - } - } - if wOpts.Ref == "" { - return nil, fmt.Errorf("ref must not be empty: %w", errdefs.ErrInvalidArgument) - } - return p.push(ctx, wOpts.Desc, wOpts.Ref, true) -} - -func (p dockerPusher) Push(ctx context.Context, desc ocispec.Descriptor) (content.Writer, error) { - return p.push(ctx, desc, remotes.MakeRefKey(ctx, desc), false) -} - -func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref string, unavailableOnFail bool) (content.Writer, error) { - if l, ok := p.tracker.(StatusTrackLocker); ok { - l.Lock(ref) - defer l.Unlock(ref) - } - ctx, err := ContextWithRepositoryScope(ctx, p.refspec, true) - if err != nil { - return nil, err - } - status, err := p.tracker.GetStatus(ref) - if err == nil { - if status.Committed && status.Offset == status.Total { - return nil, fmt.Errorf("ref %v: %w", ref, errdefs.ErrAlreadyExists) - } - if unavailableOnFail && status.ErrClosed == nil { - // Another push of this ref is happening elsewhere. The rest of function - // will continue only when `errdefs.IsNotFound(err) == true` (i.e. there - // is no actively-tracked ref already). - return nil, fmt.Errorf("push is on-going: %w", errdefs.ErrUnavailable) - } - // TODO: Handle incomplete status - } else if !errdefs.IsNotFound(err) { - return nil, fmt.Errorf("failed to get status: %w", err) - } - - hosts := p.filterHosts(HostCapabilityPush) - if len(hosts) == 0 { - return nil, fmt.Errorf("no push hosts: %w", errdefs.ErrNotFound) - } - - var ( - isManifest bool - existCheck []string - host = hosts[0] - ) - - if images.IsManifestType(desc.MediaType) || images.IsIndexType(desc.MediaType) { - isManifest = true - existCheck = getManifestPath(p.object, desc.Digest) - } else { - existCheck = []string{"blobs", desc.Digest.String()} - } - - req := p.request(host, http.MethodHead, existCheck...) - req.header.Set("Accept", strings.Join([]string{desc.MediaType, `*/*`}, ", ")) - - log.G(ctx).WithField("url", req.String()).Debugf("checking and pushing to") - - resp, err := req.doWithRetries(ctx, true) - if err != nil { - if !errors.Is(err, ErrInvalidAuthorization) { - return nil, err - } - log.G(ctx).WithError(err).Debugf("Unable to check existence, continuing with push") - } else { - if resp.StatusCode == http.StatusOK { - var exists bool - if isManifest && existCheck[1] != desc.Digest.String() { - dgstHeader := digest.Digest(resp.Header.Get("Docker-Content-Digest")) - if dgstHeader == desc.Digest { - exists = true - } - } else { - exists = true - } - - if exists { - p.tracker.SetStatus(ref, Status{ - Committed: true, - PushStatus: PushStatus{ - Exists: true, - }, - Status: content.Status{ - Ref: ref, - // TODO: Set updated time? - }, - }) - resp.Body.Close() - return nil, fmt.Errorf("content %v on remote: %w", desc.Digest, errdefs.ErrAlreadyExists) - } - } else if resp.StatusCode != http.StatusNotFound { - err := remoteserrors.NewUnexpectedStatusErr(resp) - log.G(ctx).WithField("resp", resp).WithField("body", string(err.(remoteserrors.ErrUnexpectedStatus).Body)).Debug("unexpected response") - resp.Body.Close() - return nil, err - } - resp.Body.Close() - } - - if isManifest { - putPath := getManifestPath(p.object, desc.Digest) - req = p.request(host, http.MethodPut, putPath...) - req.header.Add("Content-Type", desc.MediaType) - } else { - // Start upload request - req = p.request(host, http.MethodPost, "blobs", "uploads/") - - mountedFrom := "" - var resp *http.Response - if fromRepo := selectRepositoryMountCandidate(p.refspec, desc.Annotations); fromRepo != "" { - preq := requestWithMountFrom(req, desc.Digest.String(), fromRepo) - pctx := ContextWithAppendPullRepositoryScope(ctx, fromRepo) - - // NOTE: the fromRepo might be private repo and - // auth service still can grant token without error. - // but the post request will fail because of 401. - // - // for the private repo, we should remove mount-from - // query and send the request again. - resp, err = preq.doWithRetries(pctx, true) - if err != nil { - if !errors.Is(err, ErrInvalidAuthorization) { - return nil, fmt.Errorf("pushing with mount from %s: %w", fromRepo, err) - } - log.G(ctx).Debugf("failed to push with mount from repository %s: %v", fromRepo, err) - } - if resp != nil { - switch resp.StatusCode { - case http.StatusUnauthorized: - log.G(ctx).Debugf("failed to mount from repository %s, not authorized", fromRepo) - - resp.Body.Close() - resp = nil - case http.StatusCreated: - mountedFrom = path.Join(p.refspec.Hostname(), fromRepo) - } - } - } - - if resp == nil { - resp, err = req.doWithRetries(ctx, true) - if err != nil { - if errors.Is(err, ErrInvalidAuthorization) { - return nil, fmt.Errorf("push access denied, repository does not exist or may require authorization: %w", err) - } - return nil, err - } - } - defer resp.Body.Close() - - switch resp.StatusCode { - case http.StatusOK, http.StatusAccepted, http.StatusNoContent: - case http.StatusCreated: - p.tracker.SetStatus(ref, Status{ - Committed: true, - PushStatus: PushStatus{ - MountedFrom: mountedFrom, - }, - Status: content.Status{ - Ref: ref, - Total: desc.Size, - Offset: desc.Size, - }, - }) - return nil, fmt.Errorf("content %v on remote: %w", desc.Digest, errdefs.ErrAlreadyExists) - default: - err := remoteserrors.NewUnexpectedStatusErr(resp) - log.G(ctx).WithField("resp", resp).WithField("body", string(err.(remoteserrors.ErrUnexpectedStatus).Body)).Debug("unexpected response") - return nil, err - } - - var ( - location = resp.Header.Get("Location") - lurl *url.URL - lhost = host - ) - // Support paths without host in location - if strings.HasPrefix(location, "/") { - lurl, err = url.Parse(lhost.Scheme + "://" + lhost.Host + location) - if err != nil { - return nil, fmt.Errorf("unable to parse location %v: %w", location, err) - } - } else { - if !strings.Contains(location, "://") { - location = lhost.Scheme + "://" + location - } - lurl, err = url.Parse(location) - if err != nil { - return nil, fmt.Errorf("unable to parse location %v: %w", location, err) - } - - if lurl.Host != lhost.Host || lhost.Scheme != lurl.Scheme { - lhost.Scheme = lurl.Scheme - lhost.Host = lurl.Host - - // Check if different than what was requested, accounting for fallback in the transport layer - requested := resp.Request.URL - if requested.Host != lhost.Host || requested.Scheme != lhost.Scheme { - // Strip authorizer if change to host or scheme - lhost.Authorizer = nil - log.G(ctx).WithField("host", lhost.Host).WithField("scheme", lhost.Scheme).Debug("upload changed destination, authorizer removed") - } - } - } - q := lurl.Query() - q.Add("digest", desc.Digest.String()) - - req = p.request(lhost, http.MethodPut) - req.header.Set("Content-Type", "application/octet-stream") - req.path = lurl.Path + "?" + q.Encode() - } - p.tracker.SetStatus(ref, Status{ - Status: content.Status{ - Ref: ref, - Total: desc.Size, - Expected: desc.Digest, - StartedAt: time.Now(), - }, - }) - - // TODO: Support chunked upload - - pushw := newPushWriter(p.dockerBase, ref, desc.Digest, p.tracker, isManifest) - - req.body = func() (io.ReadCloser, error) { - pr, pw := io.Pipe() - pushw.setPipe(pw) - return pr, nil - } - req.size = desc.Size - - go func() { - resp, err := req.doWithRetries(ctx, true) - if err != nil { - pushw.setError(err) - return - } - - switch resp.StatusCode { - case http.StatusOK, http.StatusCreated, http.StatusNoContent: - default: - err := remoteserrors.NewUnexpectedStatusErr(resp) - log.G(ctx).WithField("resp", resp).WithField("body", string(err.(remoteserrors.ErrUnexpectedStatus).Body)).Debug("unexpected response") - pushw.setError(err) - return - } - pushw.setResponse(resp) - }() - - return pushw, nil -} - -func getManifestPath(object string, dgst digest.Digest) []string { - if i := strings.IndexByte(object, '@'); i >= 0 { - if object[i+1:] != dgst.String() { - // use digest, not tag - object = "" - } else { - // strip @ for registry path to make tag - object = object[:i] - } - - } - - if object == "" { - return []string{"manifests", dgst.String()} - } - - return []string{"manifests", object} -} - -type pushWriter struct { - base *dockerBase - ref string - - pipe *io.PipeWriter - - done chan struct{} - closeOnce sync.Once - - pipeC chan *io.PipeWriter - respC chan *http.Response - errC chan error - - isManifest bool - - expected digest.Digest - tracker StatusTracker -} - -func newPushWriter(db *dockerBase, ref string, expected digest.Digest, tracker StatusTracker, isManifest bool) *pushWriter { - // Initialize and create response - return &pushWriter{ - base: db, - ref: ref, - expected: expected, - tracker: tracker, - pipeC: make(chan *io.PipeWriter, 1), - respC: make(chan *http.Response, 1), - errC: make(chan error, 1), - done: make(chan struct{}), - isManifest: isManifest, - } -} - -func (pw *pushWriter) setPipe(p *io.PipeWriter) { - select { - case <-pw.done: - case pw.pipeC <- p: - } -} - -func (pw *pushWriter) setError(err error) { - select { - case <-pw.done: - case pw.errC <- err: - } -} - -func (pw *pushWriter) setResponse(resp *http.Response) { - select { - case <-pw.done: - case pw.respC <- resp: - } -} - -func (pw *pushWriter) replacePipe(p *io.PipeWriter) error { - if pw.pipe == nil { - pw.pipe = p - return nil - } - - pw.pipe.CloseWithError(content.ErrReset) - pw.pipe = p - - // If content has already been written, the bytes - // cannot be written again and the caller must reset - status, err := pw.tracker.GetStatus(pw.ref) - if err != nil { - return err - } - status.Offset = 0 - status.UpdatedAt = time.Now() - pw.tracker.SetStatus(pw.ref, status) - return content.ErrReset -} - -func (pw *pushWriter) Write(p []byte) (n int, err error) { - status, err := pw.tracker.GetStatus(pw.ref) - if err != nil { - return n, err - } - - if pw.pipe == nil { - select { - case <-pw.done: - return 0, io.ErrClosedPipe - case p := <-pw.pipeC: - pw.replacePipe(p) - } - } else { - select { - case <-pw.done: - return 0, io.ErrClosedPipe - case p := <-pw.pipeC: - return 0, pw.replacePipe(p) - default: - } - } - - n, err = pw.pipe.Write(p) - if errors.Is(err, io.ErrClosedPipe) { - // if the pipe is closed, we might have the original error on the error - // channel - so we should try and get it - select { - case <-pw.done: - case err = <-pw.errC: - pw.Close() - case p := <-pw.pipeC: - return 0, pw.replacePipe(p) - case resp := <-pw.respC: - pw.setResponse(resp) - } - } - status.Offset += int64(n) - status.UpdatedAt = time.Now() - pw.tracker.SetStatus(pw.ref, status) - return -} - -func (pw *pushWriter) Close() error { - // Ensure pipeC is closed but handle `Close()` being - // called multiple times without panicking - pw.closeOnce.Do(func() { - close(pw.done) - }) - if pw.pipe != nil { - status, err := pw.tracker.GetStatus(pw.ref) - if err == nil && !status.Committed { - // Closing an incomplete writer. Record this as an error so that following write can retry it. - status.ErrClosed = errors.New("closed incomplete writer") - pw.tracker.SetStatus(pw.ref, status) - } - return pw.pipe.Close() - } - return nil -} - -func (pw *pushWriter) Status() (content.Status, error) { - status, err := pw.tracker.GetStatus(pw.ref) - if err != nil { - return content.Status{}, err - } - return status.Status, nil - -} - -func (pw *pushWriter) Digest() digest.Digest { - // TODO: Get rid of this function? - return pw.expected -} - -func (pw *pushWriter) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) error { - // Check whether read has already thrown an error - if pw.pipe != nil { - if _, err := pw.pipe.Write([]byte{}); err != nil && !errors.Is(err, io.ErrClosedPipe) { - return fmt.Errorf("pipe error before commit: %w", err) - } - if err := pw.pipe.Close(); err != nil { - return err - } - } - - // TODO: timeout waiting for response - var resp *http.Response - select { - case <-pw.done: - return io.ErrClosedPipe - case err := <-pw.errC: - pw.Close() - return err - case resp = <-pw.respC: - defer resp.Body.Close() - case p := <-pw.pipeC: - // check whether the pipe has changed in the commit, because sometimes Write - // can complete successfully, but the pipe may have changed. In that case, the - // content needs to be reset. - return pw.replacePipe(p) - } - - // 201 is specified return status, some registries return - // 200, 202 or 204. - switch resp.StatusCode { - case http.StatusOK, http.StatusCreated, http.StatusNoContent, http.StatusAccepted: - default: - return remoteserrors.NewUnexpectedStatusErr(resp) - } - - status, err := pw.tracker.GetStatus(pw.ref) - if err != nil { - return fmt.Errorf("failed to get status: %w", err) - } - - if size > 0 && size != status.Offset { - return fmt.Errorf("unexpected size %d, expected %d", status.Offset, size) - } - - if expected == "" { - expected = status.Expected - } - - actual, err := digest.Parse(resp.Header.Get("Docker-Content-Digest")) - if err != nil { - return fmt.Errorf("invalid content digest in response: %w", err) - } - - if actual != expected { - return fmt.Errorf("got digest %s, expected %s", actual, expected) - } - - status.Committed = true - status.UpdatedAt = time.Now() - pw.tracker.SetStatus(pw.ref, status) - - return nil -} - -func (pw *pushWriter) Truncate(size int64) error { - // TODO: if blob close request and start new request at offset - // TODO: always error on manifest - return errors.New("cannot truncate remote upload") -} - -func requestWithMountFrom(req *request, mount, from string) *request { - creq := *req - - sep := "?" - if strings.Contains(creq.path, sep) { - sep = "&" - } - - creq.path = creq.path + sep + "mount=" + mount + "&from=" + from - - return &creq -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/registry.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/registry.go deleted file mode 100644 index bbae768b15..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/registry.go +++ /dev/null @@ -1,264 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import ( - "crypto/tls" - "errors" - "net" - "net/http" - "time" -) - -// HostCapabilities represent the capabilities of the registry -// host. This also represents the set of operations for which -// the registry host may be trusted to perform. -// -// For example pushing is a capability which should only be -// performed on an upstream source, not a mirror. -// Resolving (the process of converting a name into a digest) -// must be considered a trusted operation and only done by -// a host which is trusted (or more preferably by secure process -// which can prove the provenance of the mapping). A public -// mirror should never be trusted to do a resolve action. -// -// | Registry Type | Pull | Resolve | Push | -// |------------------|------|---------|------| -// | Public Registry | yes | yes | yes | -// | Private Registry | yes | yes | yes | -// | Public Mirror | yes | no | no | -// | Private Mirror | yes | yes | no | -type HostCapabilities uint8 - -const ( - // HostCapabilityPull represents the capability to fetch manifests - // and blobs by digest - HostCapabilityPull HostCapabilities = 1 << iota - - // HostCapabilityResolve represents the capability to fetch manifests - // by name - HostCapabilityResolve - - // HostCapabilityPush represents the capability to push blobs and - // manifests - HostCapabilityPush - - // Reserved for future capabilities (i.e. search, catalog, remove) -) - -// Has checks whether the capabilities list has the provide capability -func (c HostCapabilities) Has(t HostCapabilities) bool { - return c&t == t -} - -// RegistryHost represents a complete configuration for a registry -// host, representing the capabilities, authorizations, connection -// configuration, and location. -type RegistryHost struct { - Client *http.Client - Authorizer Authorizer - Host string - Scheme string - Path string - Capabilities HostCapabilities - Header http.Header -} - -func (h RegistryHost) isProxy(refhost string) bool { - if refhost != h.Host { - if refhost != "docker.io" || h.Host != "registry-1.docker.io" { - return true - } - } - return false -} - -// RegistryHosts fetches the registry hosts for a given namespace, -// provided by the host component of an distribution image reference. -type RegistryHosts func(string) ([]RegistryHost, error) - -// Registries joins multiple registry configuration functions, using the same -// order as provided within the arguments. When an empty registry configuration -// is returned with a nil error, the next function will be called. -// NOTE: This function will not join configurations, as soon as a non-empty -// configuration is returned from a configuration function, it will be returned -// to the caller. -func Registries(registries ...RegistryHosts) RegistryHosts { - return func(host string) ([]RegistryHost, error) { - for _, registry := range registries { - config, err := registry(host) - if err != nil { - return config, err - } - if len(config) > 0 { - return config, nil - } - } - return nil, nil - } -} - -type registryOpts struct { - authorizer Authorizer - plainHTTP func(string) (bool, error) - host func(string) (string, error) - client *http.Client -} - -// RegistryOpt defines a registry default option -type RegistryOpt func(*registryOpts) - -// WithPlainHTTP configures registries to use plaintext http scheme -// for the provided host match function. -func WithPlainHTTP(f func(string) (bool, error)) RegistryOpt { - return func(opts *registryOpts) { - opts.plainHTTP = f - } -} - -// WithAuthorizer configures the default authorizer for a registry -func WithAuthorizer(a Authorizer) RegistryOpt { - return func(opts *registryOpts) { - opts.authorizer = a - } -} - -// WithHostTranslator defines the default translator to use for registry hosts -func WithHostTranslator(h func(string) (string, error)) RegistryOpt { - return func(opts *registryOpts) { - opts.host = h - } -} - -// WithClient configures the default http client for a registry -func WithClient(c *http.Client) RegistryOpt { - return func(opts *registryOpts) { - opts.client = c - } -} - -// ConfigureDefaultRegistries is used to create a default configuration for -// registries. For more advanced configurations or per-domain setups, -// the RegistryHosts interface should be used directly. -// NOTE: This function will always return a non-empty value or error -func ConfigureDefaultRegistries(ropts ...RegistryOpt) RegistryHosts { - var opts registryOpts - for _, opt := range ropts { - opt(&opts) - } - - return func(host string) ([]RegistryHost, error) { - config := RegistryHost{ - Client: opts.client, - Authorizer: opts.authorizer, - Host: host, - Scheme: "https", - Path: "/v2", - Capabilities: HostCapabilityPull | HostCapabilityResolve | HostCapabilityPush, - } - - if config.Client == nil { - config.Client = &http.Client{ - Transport: DefaultHTTPTransport(nil), - } - } - - if opts.plainHTTP != nil { - match, err := opts.plainHTTP(host) - if err != nil { - return nil, err - } - if match { - config.Scheme = "http" - } - } - - if opts.host != nil { - var err error - config.Host, err = opts.host(config.Host) - if err != nil { - return nil, err - } - } else if host == "docker.io" { - config.Host = "registry-1.docker.io" - } - - return []RegistryHost{config}, nil - } -} - -// MatchAllHosts is a host match function which is always true. -func MatchAllHosts(string) (bool, error) { - return true, nil -} - -// MatchLocalhost is a host match function which returns true for -// localhost. -// -// Note: this does not handle matching of ip addresses in octal, -// decimal or hex form. -func MatchLocalhost(host string) (bool, error) { - switch { - case host == "::1": - return true, nil - case host == "[::1]": - return true, nil - } - h, p, err := net.SplitHostPort(host) - - // addrError helps distinguish between errors of form - // "no colon in address" and "too many colons in address". - // The former is fine as the host string need not have a - // port. Latter needs to be handled. - addrError := &net.AddrError{ - Err: "missing port in address", - Addr: host, - } - if err != nil { - if err.Error() != addrError.Error() { - return false, err - } - // host string without any port specified - h = host - } else if len(p) == 0 { - return false, errors.New("invalid host name format") - } - - // use ipv4 dotted decimal for further checking - if h == "localhost" { - h = "127.0.0.1" - } - ip := net.ParseIP(h) - - return ip.IsLoopback(), nil -} - -func DefaultHTTPTransport(defaultTLSConfig *tls.Config) *http.Transport { - return &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - FallbackDelay: 300 * time.Millisecond, - }).DialContext, - MaxIdleConns: 10, - IdleConnTimeout: 30 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - TLSClientConfig: defaultTLSConfig, - ExpectContinueTimeout: 5 * time.Second, - } -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver.go deleted file mode 100644 index 386270ddb6..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver.go +++ /dev/null @@ -1,924 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import ( - "context" - "crypto/tls" - "encoding/json" - "errors" - "fmt" - "io" - "net" - "net/http" - "net/url" - "os" - "path" - "strings" - "sync" - - "github.com/containerd/errdefs" - "github.com/containerd/log" - "github.com/opencontainers/go-digest" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "golang.org/x/sync/semaphore" - - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/remotes" - remoteerrors "github.com/containerd/containerd/v2/core/remotes/errors" - "github.com/containerd/containerd/v2/core/transfer" - "github.com/containerd/containerd/v2/pkg/reference" - "github.com/containerd/containerd/v2/pkg/tracing" - "github.com/containerd/containerd/v2/version" -) - -var ( - // ErrInvalidAuthorization is used when credentials are passed to a server but - // those credentials are rejected. - ErrInvalidAuthorization = errors.New("authorization failed") - - // MaxManifestSize represents the largest size accepted from a registry - // during resolution. Larger manifests may be accepted using a - // resolution method other than the registry. - // - // NOTE: The max supported layers by some runtimes is 128 and individual - // layers will not contribute more than 256 bytes, making a - // reasonable limit for a large image manifests of 32K bytes. - // 4M bytes represents a much larger upper bound for images which may - // contain large annotations or be non-images. A proper manifest - // design puts large metadata in subobjects, as is consistent the - // intent of the manifest design. - MaxManifestSize int64 = 4 * 1048 * 1048 -) - -// Authorizer is used to authorize HTTP requests based on 401 HTTP responses. -// An Authorizer is responsible for caching tokens or credentials used by -// requests. -type Authorizer interface { - // Authorize sets the appropriate `Authorization` header on the given - // request. - // - // If no authorization is found for the request, the request remains - // unmodified. It may also add an `Authorization` header as - // "bearer " - // "basic " - // - // It may return remotes/errors.ErrUnexpectedStatus, which for example, - // can be used by the caller to find out the status code returned by the registry. - Authorize(context.Context, *http.Request) error - - // AddResponses adds a 401 response for the authorizer to consider when - // authorizing requests. The last response should be unauthorized and - // the previous requests are used to consider redirects and retries - // that may have led to the 401. - // - // If response is not handled, returns `ErrNotImplemented` - AddResponses(context.Context, []*http.Response) error -} - -// ResolverOptions are used to configured a new Docker register resolver -type ResolverOptions struct { - // Hosts returns registry host configurations for a namespace. - Hosts RegistryHosts - - // Headers are the HTTP request header fields sent by the resolver - Headers http.Header - - // Tracker is used to track uploads to the registry. This is used - // since the registry does not have upload tracking and the existing - // mechanism for getting blob upload status is expensive. - Tracker StatusTracker - - // Authorizer is used to authorize registry requests - // - // Deprecated: use Hosts. - Authorizer Authorizer - - // Credentials provides username and secret given a host. - // If username is empty but a secret is given, that secret - // is interpreted as a long lived token. - // - // Deprecated: use Hosts. - Credentials func(string) (string, string, error) - - // Host provides the hostname given a namespace. - // - // Deprecated: use Hosts. - Host func(string) (string, error) - - // PlainHTTP specifies to use plain http and not https - // - // Deprecated: use Hosts. - PlainHTTP bool - - // Client is the http client to used when making registry requests - // - // Deprecated: use Hosts. - Client *http.Client -} - -// DefaultHost is the default host function. -func DefaultHost(ns string) (string, error) { - if ns == "docker.io" { - return "registry-1.docker.io", nil - } - return ns, nil -} - -type dockerResolver struct { - hosts RegistryHosts - header http.Header - resolveHeader http.Header - tracker StatusTracker - config transfer.ImageResolverOptions -} - -// NewResolver returns a new resolver to a Docker registry -func NewResolver(options ResolverOptions) remotes.Resolver { - if options.Tracker == nil { - options.Tracker = NewInMemoryTracker() - } - - if options.Headers == nil { - options.Headers = make(http.Header) - } else { - // make a copy of the headers to avoid race due to concurrent map write - options.Headers = options.Headers.Clone() - } - - resolveHeader := http.Header{} - if _, ok := options.Headers["Accept"]; !ok { - // set headers for all the types we support for resolution. - resolveHeader.Set("Accept", strings.Join([]string{ - images.MediaTypeDockerSchema2Manifest, - images.MediaTypeDockerSchema2ManifestList, - ocispec.MediaTypeImageManifest, - ocispec.MediaTypeImageIndex, "*/*", - }, ", ")) - } else { - resolveHeader["Accept"] = options.Headers["Accept"] - delete(options.Headers, "Accept") - } - - if options.Hosts == nil { - opts := []RegistryOpt{} - if options.Host != nil { - opts = append(opts, WithHostTranslator(options.Host)) - } - - if options.Authorizer == nil { - options.Authorizer = NewDockerAuthorizer( - WithAuthClient(options.Client), - WithAuthHeader(options.Headers), - WithAuthCreds(options.Credentials)) - } - opts = append(opts, WithAuthorizer(options.Authorizer)) - - if options.Client != nil { - opts = append(opts, WithClient(options.Client)) - } - if options.PlainHTTP { - opts = append(opts, WithPlainHTTP(MatchAllHosts)) - } else { - opts = append(opts, WithPlainHTTP(MatchLocalhost)) - } - options.Hosts = ConfigureDefaultRegistries(opts...) - } - return &dockerResolver{ - hosts: options.Hosts, - header: options.Headers, - resolveHeader: resolveHeader, - tracker: options.Tracker, - } -} - -func getManifestMediaType(resp *http.Response) string { - // Strip encoding data (manifests should always be ascii JSON) - contentType := resp.Header.Get("Content-Type") - if sp := strings.IndexByte(contentType, ';'); sp != -1 { - contentType = contentType[0:sp] - } - - // As of Apr 30 2019 the registry.access.redhat.com registry does not specify - // the content type of any data but uses schema1 manifests. - if contentType == "text/plain" { - contentType = images.MediaTypeDockerSchema1Manifest - } - return contentType -} - -type countingReader struct { - reader io.Reader - bytesRead int64 -} - -func (r *countingReader) Read(p []byte) (int, error) { - n, err := r.reader.Read(p) - r.bytesRead += int64(n) - return n, err -} - -var _ remotes.ResolverWithOptions = &dockerResolver{} - -func (r *dockerResolver) Resolve(ctx context.Context, ref string) (string, ocispec.Descriptor, error) { - base, err := r.resolveDockerBase(ref) - if err != nil { - return "", ocispec.Descriptor{}, err - } - refspec := base.refspec - if refspec.Object == "" { - return "", ocispec.Descriptor{}, reference.ErrObjectRequired - } - - var ( - paths [][]string - dgst = refspec.Digest() - caps = HostCapabilityPull - ) - - if dgst != "" { - if err := dgst.Validate(); err != nil { - // need to fail here, since we can't actually resolve the invalid - // digest. - return "", ocispec.Descriptor{}, err - } - - // turns out, we have a valid digest, make a url. - paths = append(paths, []string{"manifests", dgst.String()}) - - // fallback to blobs on not found. - paths = append(paths, []string{"blobs", dgst.String()}) - } else { - // Add - paths = append(paths, []string{"manifests", refspec.Object}) - caps |= HostCapabilityResolve - } - - hosts := base.filterHosts(caps) - if len(hosts) == 0 { - return "", ocispec.Descriptor{}, fmt.Errorf("no resolve hosts: %w", errdefs.ErrNotFound) - } - - ctx, err = ContextWithRepositoryScope(ctx, refspec, false) - if err != nil { - return "", ocispec.Descriptor{}, err - } - - var ( - // firstErr is the most relevant error encountered during resolution. - // We use this to determine the error to return, making sure that the - // error created furthest through the resolution process is returned. - firstErr error - firstErrPriority int - ) - - nextHostOrFail := func(i int) string { - if i < len(hosts)-1 { - return "trying next host" - } - return "fetch failed" - } - - for _, u := range paths { - for i, host := range hosts { - ctx := log.WithLogger(ctx, log.G(ctx).WithField("host", host.Host)) - - req := base.request(host, http.MethodHead, u...) - if err := req.addNamespace(base.refspec.Hostname()); err != nil { - return "", ocispec.Descriptor{}, err - } - - for key, value := range r.resolveHeader { - req.header[key] = append(req.header[key], value...) - } - - log.G(ctx).Debug("resolving") - resp, err := req.doWithRetries(ctx, i == len(hosts)-1) - if err != nil { - if errors.Is(err, ErrInvalidAuthorization) { - err = fmt.Errorf("pull access denied, repository does not exist or may require authorization: %w", err) - } - if firstErrPriority < 1 { - firstErr = err - firstErrPriority = 1 - } - log.G(ctx).WithError(err).Info(nextHostOrFail(i)) - continue // try another host - } - resp.Body.Close() // don't care about body contents. - - if resp.StatusCode > 299 { - if resp.StatusCode == http.StatusNotFound { - if firstErrPriority < 2 { - firstErr = fmt.Errorf("%s: %w", ref, errdefs.ErrNotFound) - firstErrPriority = 2 - } - log.G(ctx).Infof("%s after status: %s", nextHostOrFail(i), resp.Status) - continue - } - if resp.StatusCode > 399 { - if firstErrPriority < 3 { - firstErr = remoteerrors.NewUnexpectedStatusErr(resp) - firstErrPriority = 3 - } - log.G(ctx).Infof("%s after status: %s", nextHostOrFail(i), resp.Status) - continue // try another host - } - return "", ocispec.Descriptor{}, remoteerrors.NewUnexpectedStatusErr(resp) - } - size := resp.ContentLength - contentType := getManifestMediaType(resp) - - // if no digest was provided, then only a resolve - // trusted registry was contacted, in this case use - // the digest header (or content from GET) - if dgst == "" { - // this is the only point at which we trust the registry. we use the - // content headers to assemble a descriptor for the name. when this becomes - // more robust, we mostly get this information from a secure trust store. - dgstHeader := digest.Digest(resp.Header.Get("Docker-Content-Digest")) - - if dgstHeader != "" && size != -1 { - if err := dgstHeader.Validate(); err != nil { - return "", ocispec.Descriptor{}, fmt.Errorf("%q in header not a valid digest: %w", dgstHeader, err) - } - dgst = dgstHeader - } - } - if dgst == "" || size == -1 { - log.G(ctx).Debug("no Docker-Content-Digest header, fetching manifest instead") - - req = base.request(host, http.MethodGet, u...) - if err := req.addNamespace(base.refspec.Hostname()); err != nil { - return "", ocispec.Descriptor{}, err - } - - for key, value := range r.resolveHeader { - req.header[key] = append(req.header[key], value...) - } - - resp, err := req.doWithRetries(ctx, true) - if err != nil { - return "", ocispec.Descriptor{}, err - } - - bodyReader := countingReader{reader: resp.Body} - - contentType = getManifestMediaType(resp) - err = func() error { - defer resp.Body.Close() - if dgst != "" { - _, err = io.Copy(io.Discard, &bodyReader) - return err - } - - if contentType == images.MediaTypeDockerSchema1Manifest { - return fmt.Errorf("%w: media type %q is no longer supported since containerd v2.0, please rebuild the image as %q or %q", - errdefs.ErrNotImplemented, images.MediaTypeDockerSchema1Manifest, images.MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest) - } - - dgst, err = digest.FromReader(&bodyReader) - return err - }() - if err != nil { - return "", ocispec.Descriptor{}, err - } - size = bodyReader.bytesRead - } - // Prevent resolving to excessively large manifests - if size > MaxManifestSize { - if firstErrPriority < 4 { - firstErr = fmt.Errorf("rejecting %d byte manifest for %s: %w", size, ref, errdefs.ErrNotFound) - firstErrPriority = 4 - } - continue - } - - desc := ocispec.Descriptor{ - Digest: dgst, - MediaType: contentType, - Size: size, - } - - log.G(ctx).WithField("desc.digest", desc.Digest).Debug("resolved") - return ref, desc, nil - } - } - - // If above loop terminates without return or error, then no registries - // were provided. - if firstErr == nil { - firstErr = fmt.Errorf("%s: %w", ref, errdefs.ErrNotFound) - } - - return "", ocispec.Descriptor{}, firstErr -} - -func (r *dockerResolver) SetOptions(options ...transfer.ImageResolverOption) { - for _, opt := range options { - opt(&r.config) - } -} - -func (r *dockerResolver) Fetcher(ctx context.Context, ref string) (remotes.Fetcher, error) { - base, err := r.resolveDockerBase(ref) - if err != nil { - return nil, err - } - - return dockerFetcher{ - dockerBase: base, - }, nil -} - -func (r *dockerResolver) Pusher(ctx context.Context, ref string) (remotes.Pusher, error) { - base, err := r.resolveDockerBase(ref) - if err != nil { - return nil, err - } - - return dockerPusher{ - dockerBase: base, - object: base.refspec.Object, - tracker: r.tracker, - }, nil -} - -func (r *dockerResolver) resolveDockerBase(ref string) (*dockerBase, error) { - refspec, err := reference.Parse(ref) - if err != nil { - return nil, err - } - - return r.base(refspec) -} - -type dockerBase struct { - refspec reference.Spec - repository string - hosts []RegistryHost - header http.Header - performances transfer.ImageResolverPerformanceSettings - limiter *semaphore.Weighted -} - -func (r *dockerBase) Acquire(ctx context.Context, weight int64) error { - if r.limiter == nil { - return nil - } - return r.limiter.Acquire(ctx, weight) -} - -func (r *dockerBase) Release(weight int64) { - if r.limiter != nil { - r.limiter.Release(weight) - } -} - -func (r *dockerResolver) base(refspec reference.Spec) (*dockerBase, error) { - host := refspec.Hostname() - hosts, err := r.hosts(host) - if err != nil { - return nil, err - } - return &dockerBase{ - refspec: refspec, - repository: strings.TrimPrefix(refspec.Locator, host+"/"), - hosts: hosts, - header: r.header, - performances: r.config.Performances, - limiter: r.config.DownloadLimiter, - }, nil -} - -func (r *dockerBase) filterHosts(caps HostCapabilities) (hosts []RegistryHost) { - for _, host := range r.hosts { - if host.Capabilities.Has(caps) { - hosts = append(hosts, host) - } - } - return -} - -func (r *dockerBase) request(host RegistryHost, method string, ps ...string) *request { - header := r.header.Clone() - if header == nil { - header = http.Header{} - } - - for key, value := range host.Header { - header[key] = append(header[key], value...) - } - - if len(header.Get("User-Agent")) == 0 { - header.Set("User-Agent", "containerd/"+version.Version) - } - - parts := append([]string{"/", host.Path, r.repository}, ps...) - p := path.Join(parts...) - // Join strips trailing slash, re-add ending "/" if included - if len(parts) > 0 && strings.HasSuffix(parts[len(parts)-1], "/") { - p = p + "/" - } - return &request{ - method: method, - path: p, - header: header, - host: host, - } -} - -func (r *request) authorize(ctx context.Context, req *http.Request) error { - // Check if has header for host - if r.host.Authorizer != nil { - if err := r.host.Authorizer.Authorize(ctx, req); err != nil { - return err - } - } - - return nil -} - -func (r *request) addNamespace(ns string) (err error) { - if !r.host.isProxy(ns) { - return nil - } - var q url.Values - // Parse query - if i := strings.IndexByte(r.path, '?'); i > 0 { - r.path = r.path[:i+1] - q, err = url.ParseQuery(r.path[i+1:]) - if err != nil { - return - } - } else { - r.path = r.path + "?" - q = url.Values{} - } - q.Add("ns", ns) - - r.path = r.path + q.Encode() - - return -} - -type request struct { - method string - path string - header http.Header - host RegistryHost - body func() (io.ReadCloser, error) - size int64 -} - -func (r *request) clone() *request { - res := *r - res.header = r.header.Clone() - return &res -} - -func (r *request) do(ctx context.Context) (*http.Response, error) { - u := r.host.Scheme + "://" + r.host.Host + r.path - req, err := http.NewRequestWithContext(ctx, r.method, u, nil) - if err != nil { - return nil, err - } - if r.header == nil { - req.Header = http.Header{} - } else { - req.Header = r.header.Clone() // headers need to be copied to avoid concurrent map access - } - if r.body != nil { - body, err := r.body() - if err != nil { - return nil, err - } - req.Body = body - req.GetBody = r.body - if r.size > 0 { - req.ContentLength = r.size - } - } - - ctx = log.WithLogger(ctx, log.G(ctx).WithField("url", u)) - log.G(ctx).WithFields(requestFields(req)).Debug("do request") - if err := r.authorize(ctx, req); err != nil { - return nil, fmt.Errorf("failed to authorize: %w", err) - } - - client := &http.Client{} - if r.host.Client != nil { - *client = *r.host.Client - } - if client.CheckRedirect == nil { - client.CheckRedirect = func(req *http.Request, via []*http.Request) error { - if len(via) >= 10 { - return errors.New("stopped after 10 redirects") - } - if err := r.authorize(ctx, req); err != nil { - return fmt.Errorf("failed to authorize redirect: %w", err) - } - return nil - } - } - - tracing.UpdateHTTPClient(client, tracing.Name("remotes.docker.resolver", "HTTPRequest")) - - resp, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("failed to do request: %w", err) - } - log.G(ctx).WithFields(responseFields(resp)).Debug("fetch response received") - return resp, nil -} - -type doChecks func(r *request, resp *http.Response) error - -func withErrorCheck(r *request, resp *http.Response) error { - if resp.StatusCode > 299 { - if resp.StatusCode == http.StatusNotFound { - return fmt.Errorf("content at %v not found: %w", r.String(), errdefs.ErrNotFound) - } - var registryErr Errors - if err := json.NewDecoder(resp.Body).Decode(®istryErr); err != nil || registryErr.Len() < 1 { - return fmt.Errorf("unexpected status code %v: %v", r.String(), resp.Status) - } - return fmt.Errorf("unexpected status code %v: %s - Server message: %s", r.String(), resp.Status, registryErr.Error()) - } - return nil -} - -var errContentRangeIgnored = errors.New("content range requests ignored") - -func withOffsetCheck(offset int64) doChecks { - return func(r *request, resp *http.Response) error { - if offset == 0 { - return nil - } - if resp.StatusCode == http.StatusPartialContent { - return nil - } - if cr := resp.Header.Get("Content-Range"); cr != "" { - if !strings.HasPrefix(cr, fmt.Sprintf("bytes %d-", offset)) { - return fmt.Errorf("unhandled content range in response: %v", cr) - } - return nil - } - - // Discard up to offset - // Could use buffer pool here but this case should be rare - n, err := io.Copy(io.Discard, io.LimitReader(resp.Body, offset)) - if err != nil { - return fmt.Errorf("failed to discard to offset: %w", err) - } - if n != offset { - return errors.New("unable to discard to offset") - } - - // content range ignored, we can't do concurrent fetches here. - // return an error to be caught - return errContentRangeIgnored - } -} - -func (r *request) doWithRetries(ctx context.Context, lastHost bool, checks ...doChecks) (resp *http.Response, err error) { - resp, err = r.doWithRetriesInner(ctx, nil, lastHost) - if err != nil { - return nil, err - } - defer func() { - if err != nil && err != errContentRangeIgnored { - resp.Body.Close() - } - }() - for _, check := range checks { - if err := check(r, resp); err != nil { - return resp, err - } - } - - return resp, nil -} - -func (r *request) doWithRetriesInner(ctx context.Context, responses []*http.Response, lastHost bool) (*http.Response, error) { - resp, err := r.do(ctx) - if err != nil { - return nil, err - } - - responses = append(responses, resp) - retry, err := r.retryRequest(ctx, responses, lastHost) - if err != nil { - resp.Body.Close() - return nil, err - } - if retry { - resp.Body.Close() - return r.doWithRetriesInner(ctx, responses, lastHost) - } - return resp, err -} - -func (r *request) retryRequest(ctx context.Context, responses []*http.Response, lastHost bool) (bool, error) { - if len(responses) > 5 { - return false, nil - } - last := responses[len(responses)-1] - switch last.StatusCode { - case http.StatusUnauthorized: - log.G(ctx).WithField("header", last.Header.Get("WWW-Authenticate")).Debug("Unauthorized") - if r.host.Authorizer != nil { - if err := r.host.Authorizer.AddResponses(ctx, responses); err == nil { - return true, nil - } else if !errdefs.IsNotImplemented(err) { - return false, err - } - } - - return false, nil - case http.StatusMethodNotAllowed: - // Support registries which have not properly implemented the HEAD method for - // manifests endpoint - if r.method == http.MethodHead && strings.Contains(r.path, "/manifests/") { - r.method = http.MethodGet - return true, nil - } - case http.StatusRequestTimeout, http.StatusTooManyRequests: - return true, nil - case http.StatusServiceUnavailable, http.StatusGatewayTimeout, http.StatusInternalServerError: - // Do not retry if the same error was seen in the last request - if len(responses) > 1 && responses[len(responses)-2].StatusCode == last.StatusCode { - return false, nil - } - // Only retry if this is the last host that will be attempted - if lastHost { - return true, nil - } - } - - return false, nil -} - -func (r *request) String() string { - return r.host.Scheme + "://" + r.host.Host + r.path -} - -func (r *request) setMediaType(mediatype string) { - if mediatype == "" { - r.header.Set("Accept", "*/*") - } else { - r.header.Set("Accept", strings.Join([]string{mediatype, `*/*`}, ", ")) - } -} - -func (r *request) setOffset(offset int64) { - r.header.Set("Range", fmt.Sprintf("bytes=%d-", offset)) -} - -func requestFields(req *http.Request) log.Fields { - fields := map[string]interface{}{ - "request.method": req.Method, - } - for k, vals := range req.Header { - k = strings.ToLower(k) - if k == "authorization" { - continue - } - for i, v := range vals { - field := "request.header." + k - if i > 0 { - field = fmt.Sprintf("%s.%d", field, i) - } - fields[field] = v - } - } - - return fields -} - -func responseFields(resp *http.Response) log.Fields { - fields := map[string]interface{}{ - "response.status": resp.Status, - } - for k, vals := range resp.Header { - k = strings.ToLower(k) - for i, v := range vals { - field := "response.header." + k - if i > 0 { - field = fmt.Sprintf("%s.%d", field, i) - } - fields[field] = v - } - } - - return fields -} - -// IsLocalhost checks if the registry host is local. -func IsLocalhost(host string) bool { - if h, _, err := net.SplitHostPort(host); err == nil { - host = h - } - - if host == "localhost" { - return true - } - - ip := net.ParseIP(host) - return ip.IsLoopback() -} - -// NewHTTPFallback returns http.RoundTripper which allows fallback from https to -// http for registry endpoints with configurations for both http and TLS, -// such as defaulted localhost endpoints. -func NewHTTPFallback(transport http.RoundTripper) http.RoundTripper { - return &httpFallback{ - super: transport, - } -} - -type httpFallback struct { - super http.RoundTripper - host string - mu sync.Mutex -} - -func (f *httpFallback) RoundTrip(r *http.Request) (*http.Response, error) { - f.mu.Lock() - fallback := f.host == r.URL.Host - f.mu.Unlock() - - // only fall back if the same host had previously fell back - if !fallback { - resp, err := f.super.RoundTrip(r) - if !isTLSError(err) && !isPortError(err, r.URL.Host) { - return resp, err - } - } - - plainHTTPUrl := *r.URL - plainHTTPUrl.Scheme = "http" - - plainHTTPRequest := *r - plainHTTPRequest.URL = &plainHTTPUrl - - if !fallback { - f.mu.Lock() - if f.host != r.URL.Host { - f.host = r.URL.Host - } - f.mu.Unlock() - - // update body on the second attempt - if r.Body != nil && r.GetBody != nil { - body, err := r.GetBody() - if err != nil { - return nil, err - } - plainHTTPRequest.Body = body - } - } - - return f.super.RoundTrip(&plainHTTPRequest) -} - -func isTLSError(err error) bool { - if err == nil { - return false - } - var tlsErr tls.RecordHeaderError - if errors.As(err, &tlsErr) && string(tlsErr.RecordHeader[:]) == "HTTP/" { - return true - } - if strings.Contains(err.Error(), "TLS handshake timeout") { - return true - } - - return false -} - -func isPortError(err error, host string) bool { - if isConnError(err) || os.IsTimeout(err) { - if _, port, _ := net.SplitHostPort(host); port != "" { - // Port is specified, will not retry on different port with scheme change - return false - } - return true - } - - return false -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver_unix.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver_unix.go deleted file mode 100644 index 4ef0e0062a..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver_unix.go +++ /dev/null @@ -1,28 +0,0 @@ -//go:build !windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import ( - "errors" - "syscall" -) - -func isConnError(err error) bool { - return errors.Is(err, syscall.ECONNREFUSED) -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver_windows.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver_windows.go deleted file mode 100644 index 9c98df04bb..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver_windows.go +++ /dev/null @@ -1,30 +0,0 @@ -//go:build windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import ( - "errors" - "syscall" - - "golang.org/x/sys/windows" -) - -func isConnError(err error) bool { - return errors.Is(err, syscall.ECONNREFUSED) || errors.Is(err, windows.WSAECONNREFUSED) -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/scope.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/scope.go deleted file mode 100644 index ed38318631..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/scope.go +++ /dev/null @@ -1,101 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import ( - "context" - "fmt" - "net/url" - "sort" - "strings" - - "github.com/containerd/containerd/v2/pkg/reference" -) - -// RepositoryScope returns a repository scope string such as "repository:foo/bar:pull" -// for "host/foo/bar:baz". -// When push is true, both pull and push are added to the scope. -func RepositoryScope(refspec reference.Spec, push bool) (string, error) { - u, err := url.Parse("dummy://" + refspec.Locator) - if err != nil { - return "", err - } - s := "repository:" + strings.TrimPrefix(u.Path, "/") + ":pull" - if push { - s += ",push" - } - return s, nil -} - -// tokenScopesKey is used for the key for context.WithValue(). -// value: []string (e.g. {"registry:foo/bar:pull"}) -type tokenScopesKey struct{} - -// ContextWithRepositoryScope returns a context with tokenScopesKey{} and the repository scope value. -func ContextWithRepositoryScope(ctx context.Context, refspec reference.Spec, push bool) (context.Context, error) { - s, err := RepositoryScope(refspec, push) - if err != nil { - return nil, err - } - return WithScope(ctx, s), nil -} - -// WithScope appends a custom registry auth scope to the context. -func WithScope(ctx context.Context, scope string) context.Context { - var scopes []string - if v := ctx.Value(tokenScopesKey{}); v != nil { - scopes = v.([]string) - scopes = append(scopes, scope) - } else { - scopes = []string{scope} - } - return context.WithValue(ctx, tokenScopesKey{}, scopes) -} - -// ContextWithAppendPullRepositoryScope is used to append repository pull -// scope into existing scopes indexed by the tokenScopesKey{}. -func ContextWithAppendPullRepositoryScope(ctx context.Context, repo string) context.Context { - return WithScope(ctx, fmt.Sprintf("repository:%s:pull", repo)) -} - -// GetTokenScopes returns deduplicated and sorted scopes from ctx.Value(tokenScopesKey{}) and common scopes. -func GetTokenScopes(ctx context.Context, common []string) []string { - scopes := []string{} - if x := ctx.Value(tokenScopesKey{}); x != nil { - scopes = append(scopes, x.([]string)...) - } - - scopes = append(scopes, common...) - sort.Strings(scopes) - - if len(scopes) == 0 { - return scopes - } - - l := 0 - for idx := 1; idx < len(scopes); idx++ { - // Note: this comparison is unaware of the scope grammar (https://distribution.github.io/distribution/spec/auth/scope/) - // So, "repository:foo/bar:pull,push" != "repository:foo/bar:push,pull", although semantically they are equal. - if scopes[l] == scopes[idx] { - continue - } - - l++ - scopes[l] = scopes[idx] - } - return scopes[:l+1] -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/status.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/status.go deleted file mode 100644 index 9835525ab5..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/status.go +++ /dev/null @@ -1,101 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package docker - -import ( - "fmt" - "sync" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/errdefs" - "github.com/moby/locker" -) - -// Status of a content operation -type Status struct { - content.Status - - Committed bool - - // ErrClosed contains error encountered on close. - ErrClosed error - - // UploadUUID is used by the Docker registry to reference blob uploads - UploadUUID string - - // PushStatus contains status related to push. - PushStatus -} - -type PushStatus struct { - // MountedFrom is the source content was cross-repo mounted from (empty if no cross-repo mount was performed). - MountedFrom string - - // Exists indicates whether content already exists in the repository and wasn't uploaded. - Exists bool -} - -// StatusTracker to track status of operations -type StatusTracker interface { - GetStatus(string) (Status, error) - SetStatus(string, Status) -} - -// StatusTrackLocker to track status of operations with lock -type StatusTrackLocker interface { - StatusTracker - Lock(string) - Unlock(string) -} - -type memoryStatusTracker struct { - statuses map[string]Status - m sync.Mutex - locker *locker.Locker -} - -// NewInMemoryTracker returns a StatusTracker that tracks content status in-memory -func NewInMemoryTracker() StatusTrackLocker { - return &memoryStatusTracker{ - statuses: map[string]Status{}, - locker: locker.New(), - } -} - -func (t *memoryStatusTracker) GetStatus(ref string) (Status, error) { - t.m.Lock() - defer t.m.Unlock() - status, ok := t.statuses[ref] - if !ok { - return Status{}, fmt.Errorf("status for ref %v: %w", ref, errdefs.ErrNotFound) - } - return status, nil -} - -func (t *memoryStatusTracker) SetStatus(ref string, status Status) { - t.m.Lock() - t.statuses[ref] = status - t.m.Unlock() -} - -func (t *memoryStatusTracker) Lock(ref string) { - t.locker.Lock(ref) -} - -func (t *memoryStatusTracker) Unlock(ref string) { - t.locker.Unlock(ref) -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/errors/errors.go b/vendor/github.com/containerd/containerd/v2/core/remotes/errors/errors.go deleted file mode 100644 index f60ff0fc28..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/errors/errors.go +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package errors - -import ( - "fmt" - "io" - "net/http" -) - -var _ error = ErrUnexpectedStatus{} - -// ErrUnexpectedStatus is returned if a registry API request returned with unexpected HTTP status -type ErrUnexpectedStatus struct { - Status string - StatusCode int - Body []byte - RequestURL, RequestMethod string -} - -func (e ErrUnexpectedStatus) Error() string { - return fmt.Sprintf("unexpected status from %s request to %s: %s", e.RequestMethod, e.RequestURL, e.Status) -} - -// NewUnexpectedStatusErr creates an ErrUnexpectedStatus from HTTP response -func NewUnexpectedStatusErr(resp *http.Response) error { - var b []byte - if resp.Body != nil { - b, _ = io.ReadAll(io.LimitReader(resp.Body, 64000)) // 64KB - } - err := ErrUnexpectedStatus{ - Body: b, - Status: resp.Status, - StatusCode: resp.StatusCode, - RequestMethod: resp.Request.Method, - } - if resp.Request.URL != nil { - err.RequestURL = resp.Request.URL.String() - } - return err -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/handlers.go b/vendor/github.com/containerd/containerd/v2/core/remotes/handlers.go deleted file mode 100644 index a3e1ff984a..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/handlers.go +++ /dev/null @@ -1,396 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package remotes - -import ( - "bytes" - "context" - "errors" - "fmt" - "io" - "strings" - "sync" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/labels" - "github.com/containerd/errdefs" - "github.com/containerd/log" - "github.com/containerd/platforms" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "golang.org/x/sync/semaphore" -) - -type refKeyPrefix struct{} - -// WithMediaTypeKeyPrefix adds a custom key prefix for a media type which is used when storing -// data in the content store from the FetchHandler. -// -// Used in `MakeRefKey` to determine what the key prefix should be. -func WithMediaTypeKeyPrefix(ctx context.Context, mediaType, prefix string) context.Context { - var values map[string]string - if v := ctx.Value(refKeyPrefix{}); v != nil { - values = v.(map[string]string) - } else { - values = make(map[string]string) - } - - values[mediaType] = prefix - return context.WithValue(ctx, refKeyPrefix{}, values) -} - -// MakeRefKey returns a unique reference for the descriptor. This reference can be -// used to lookup ongoing processes related to the descriptor. This function -// may look to the context to namespace the reference appropriately. -func MakeRefKey(ctx context.Context, desc ocispec.Descriptor) string { - key := desc.Digest.String() - if desc.Annotations != nil { - if name, ok := desc.Annotations[ocispec.AnnotationRefName]; ok { - key = fmt.Sprintf("%s@%s", name, desc.Digest.String()) - } - } - - if v := ctx.Value(refKeyPrefix{}); v != nil { - values := v.(map[string]string) - if prefix := values[desc.MediaType]; prefix != "" { - return prefix + "-" + key - } - } - - switch { - case images.IsManifestType(desc.MediaType): - return "manifest-" + key - case images.IsIndexType(desc.MediaType): - return "index-" + key - case images.IsLayerType(desc.MediaType): - return "layer-" + key - case images.IsKnownConfig(desc.MediaType): - return "config-" + key - case images.IsAttestationType(desc.MediaType): - return "attestation-" + key - default: - log.G(ctx).Warnf("reference for unknown type: %s", desc.MediaType) - return "unknown-" + key - } -} - -// FetchHandler returns a handler that will fetch all content into the ingester -// discovered in a call to Dispatch. Use with ChildrenHandler to do a full -// recursive fetch. -func FetchHandler(ingester content.Ingester, fetcher Fetcher) images.HandlerFunc { - return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - ctx = log.WithLogger(ctx, log.G(ctx).WithFields(log.Fields{ - "digest": desc.Digest, - "mediatype": desc.MediaType, - "size": desc.Size, - })) - - if desc.MediaType == images.MediaTypeDockerSchema1Manifest { - return nil, fmt.Errorf("%v not supported", desc.MediaType) - } - err := Fetch(ctx, ingester, fetcher, desc) - if errdefs.IsAlreadyExists(err) { - return nil, nil - } - return nil, err - } -} - -// Fetch fetches the given digest into the provided ingester -func Fetch(ctx context.Context, ingester content.Ingester, fetcher Fetcher, desc ocispec.Descriptor) error { - log.G(ctx).Debug("fetch") - - cw, err := content.OpenWriter(ctx, ingester, content.WithRef(MakeRefKey(ctx, desc)), content.WithDescriptor(desc)) - if err != nil { - return err - } - defer cw.Close() - - ws, err := cw.Status() - if err != nil { - return err - } - - if desc.Size == 0 { - // most likely a poorly configured registry/web front end which responded with no - // Content-Length header; unable (not to mention useless) to commit a 0-length entry - // into the content store. Error out here otherwise the error sent back is confusing - return fmt.Errorf("unable to fetch descriptor (%s) which reports content size of zero: %w", desc.Digest, errdefs.ErrInvalidArgument) - } - if ws.Offset == desc.Size { - // If writer is already complete, commit and return - err := cw.Commit(ctx, desc.Size, desc.Digest) - if err != nil && !errdefs.IsAlreadyExists(err) { - return fmt.Errorf("failed commit on ref %q: %w", ws.Ref, err) - } - return err - } - - if desc.Size == int64(len(desc.Data)) { - return content.Copy(ctx, cw, bytes.NewReader(desc.Data), desc.Size, desc.Digest) - } - - rc, err := fetcher.Fetch(ctx, desc) - if err != nil { - return err - } - defer rc.Close() - - return content.Copy(ctx, cw, rc, desc.Size, desc.Digest) -} - -// PushHandler returns a handler that will push all content from the provider -// using a writer from the pusher. -func PushHandler(pusher Pusher, provider content.Provider) images.HandlerFunc { - return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - ctx = log.WithLogger(ctx, log.G(ctx).WithFields(log.Fields{ - "digest": desc.Digest, - "mediatype": desc.MediaType, - "size": desc.Size, - })) - - err := push(ctx, provider, pusher, desc) - return nil, err - } -} - -func push(ctx context.Context, provider content.Provider, pusher Pusher, desc ocispec.Descriptor) error { - log.G(ctx).Debug("push") - - var ( - cw content.Writer - err error - ) - if cs, ok := pusher.(content.Ingester); ok { - cw, err = content.OpenWriter(ctx, cs, content.WithRef(MakeRefKey(ctx, desc)), content.WithDescriptor(desc)) - } else { - cw, err = pusher.Push(ctx, desc) - } - if err != nil { - if !errdefs.IsAlreadyExists(err) { - return err - } - - return nil - } - defer cw.Close() - - ra, err := provider.ReaderAt(ctx, desc) - if err != nil { - return err - } - defer ra.Close() - - rd := io.NewSectionReader(ra, 0, desc.Size) - return content.Copy(ctx, cw, rd, desc.Size, desc.Digest) -} - -// PushContent pushes content specified by the descriptor from the provider. -// -// Base handlers can be provided which will be called before any push specific -// handlers. -// -// If the passed in content.Provider is also a content.InfoProvider (such as -// content.Manager) then this will also annotate the distribution sources using -// labels prefixed with "containerd.io/distribution.source". -func PushContent(ctx context.Context, pusher Pusher, desc ocispec.Descriptor, store content.Provider, limiter *semaphore.Weighted, platform platforms.MatchComparer, wrapper func(h images.Handler) images.Handler) error { - - var m sync.Mutex - manifests := []ocispec.Descriptor{} - indexStack := []ocispec.Descriptor{} - - filterHandler := images.HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - if images.IsManifestType(desc.MediaType) { - m.Lock() - manifests = append(manifests, desc) - m.Unlock() - return nil, images.ErrStopHandler - } else if images.IsIndexType(desc.MediaType) { - m.Lock() - indexStack = append(indexStack, desc) - m.Unlock() - return nil, images.ErrStopHandler - } - return nil, nil - }) - - pushHandler := PushHandler(pusher, store) - - platformFilterhandler := images.FilterPlatforms(images.ChildrenHandler(store), platform) - - var handler images.Handler - if m, ok := store.(content.InfoProvider); ok { - annotateHandler := annotateDistributionSourceHandler(platformFilterhandler, m) - handler = images.Handlers(annotateHandler, filterHandler, pushHandler) - } else { - handler = images.Handlers(platformFilterhandler, filterHandler, pushHandler) - } - - if wrapper != nil { - handler = wrapper(handler) - } - - if err := images.Dispatch(ctx, handler, limiter, desc); err != nil { - return err - } - - if err := images.Dispatch(ctx, pushHandler, limiter, manifests...); err != nil { - return err - } - - // Iterate in reverse order as seen, parent always uploaded after child - for i := len(indexStack) - 1; i >= 0; i-- { - err := images.Dispatch(ctx, pushHandler, limiter, indexStack[i]) - if err != nil { - // TODO(estesp): until we have a more complete method for index push, we need to report - // missing dependencies in an index/manifest list by sensing the "400 Bad Request" - // as a marker for this problem - if errors.Unwrap(err) != nil && strings.Contains(errors.Unwrap(err).Error(), "400 Bad Request") { - return fmt.Errorf("manifest list/index references to blobs and/or manifests are missing in your target registry: %w", err) - } - return err - } - } - - return nil -} - -// SkipNonDistributableBlobs returns a handler that skips blobs that have a media type that is "non-distributeable". -// An example of this kind of content would be a Windows base layer, which is not supposed to be redistributed. -// -// This is based on the media type of the content: -// - application/vnd.oci.image.layer.nondistributable -// - application/vnd.docker.image.rootfs.foreign -func SkipNonDistributableBlobs(f images.HandlerFunc) images.HandlerFunc { - return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - if images.IsNonDistributable(desc.MediaType) { - log.G(ctx).WithField("digest", desc.Digest).WithField("mediatype", desc.MediaType).Debug("Skipping non-distributable blob") - return nil, images.ErrSkipDesc - } - - children, err := f(ctx, desc) - if err != nil { - return nil, err - } - if len(children) == 0 { - return nil, nil - } - - out := make([]ocispec.Descriptor, 0, len(children)) - for _, child := range children { - if !images.IsNonDistributable(child.MediaType) { - out = append(out, child) - } else { - log.G(ctx).WithField("digest", child.Digest).WithField("mediatype", child.MediaType).Debug("Skipping non-distributable blob") - } - } - return out, nil - } -} - -// FilterManifestByPlatformHandler allows Handler to handle non-target -// platform's manifest and configuration data. -func FilterManifestByPlatformHandler(f images.HandlerFunc, m platforms.Matcher) images.HandlerFunc { - return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - children, err := f(ctx, desc) - if err != nil { - return nil, err - } - - // no platform information - if desc.Platform == nil || m == nil { - return children, nil - } - - if images.IsManifestType(desc.MediaType) && !m.Match(*desc.Platform) { - var descs []ocispec.Descriptor - for _, child := range children { - if images.IsConfigType(child.MediaType) { - descs = append(descs, child) - } - } - return descs, nil - } - return children, nil - } -} - -// annotateDistributionSourceHandler add distribution source label into -// annotation of config or blob descriptor. -func annotateDistributionSourceHandler(f images.HandlerFunc, provider content.InfoProvider) images.HandlerFunc { - return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - children, err := f(ctx, desc) - if err != nil { - return nil, err - } - - // Distribution source is only used for config or blob but may be inherited from - // a manifest or manifest list - if !images.IsManifestType(desc.MediaType) && !images.IsIndexType(desc.MediaType) { - return children, nil - } - - parentSourceAnnotations := desc.Annotations - var parentLabels map[string]string - if pi, err := provider.Info(ctx, desc.Digest); err != nil { - if !errdefs.IsNotFound(err) { - return nil, err - } - } else { - parentLabels = pi.Labels - } - - for i := range children { - child := children[i] - - info, err := provider.Info(ctx, child.Digest) - if err != nil { - if !errdefs.IsNotFound(err) { - return nil, err - } - } - copyDistributionSourceLabels(info.Labels, &child) - - // Annotate with parent labels for cross repo mount or fetch. - // Parent sources may apply to all children since most registries - // enforce that children exist before the manifests. - copyDistributionSourceLabels(parentSourceAnnotations, &child) - copyDistributionSourceLabels(parentLabels, &child) - - children[i] = child - } - return children, nil - } -} - -func copyDistributionSourceLabels(from map[string]string, to *ocispec.Descriptor) { - for k, v := range from { - if !strings.HasPrefix(k, labels.LabelDistributionSource+".") { - continue - } - - if to.Annotations == nil { - to.Annotations = make(map[string]string) - } else { - // Only propagate the parent label if the child doesn't already have it. - if _, has := to.Annotations[k]; has { - continue - } - } - to.Annotations[k] = v - } -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/resolver.go b/vendor/github.com/containerd/containerd/v2/core/remotes/resolver.go deleted file mode 100644 index 66a2acdb4a..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/resolver.go +++ /dev/null @@ -1,118 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package remotes - -import ( - "context" - "io" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/transfer" - "github.com/opencontainers/go-digest" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -// Resolver provides remotes based on a locator. -type Resolver interface { - // Resolve attempts to resolve the reference into a name and descriptor. - // - // The argument `ref` should be a scheme-less URI representing the remote. - // Structurally, it has a host and path. The "host" can be used to directly - // reference a specific host or be matched against a specific handler. - // - // The returned name should be used to identify the referenced entity. - // Depending on the remote namespace, this may be immutable or mutable. - // While the name may differ from ref, it should itself be a valid ref. - // - // If the resolution fails, an error will be returned. - Resolve(ctx context.Context, ref string) (name string, desc ocispec.Descriptor, err error) - - // Fetcher returns a new fetcher for the provided reference. - // All content fetched from the returned fetcher will be - // from the namespace referred to by ref. - Fetcher(ctx context.Context, ref string) (Fetcher, error) - - // Pusher returns a new pusher for the provided reference - // The returned Pusher should satisfy content.Ingester and concurrent attempts - // to push the same blob using the Ingester API should result in ErrUnavailable. - Pusher(ctx context.Context, ref string) (Pusher, error) -} - -// ResolverWithOptions is a Resolver that also supports setting options. -type ResolverWithOptions interface { - Resolver - SetOptions(options ...transfer.ImageResolverOption) -} - -// Fetcher fetches content. -// A fetcher implementation may implement the FetcherByDigest interface too. -type Fetcher interface { - // Fetch the resource identified by the descriptor. - Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error) -} - -// FetcherByDigest fetches content by the digest. -type FetcherByDigest interface { - // FetchByDigest fetches the resource identified by the digest. - // - // FetcherByDigest usually returns an incomplete descriptor. - // Typically, the media type is always set to "application/octet-stream", - // and the annotations are unset. - FetchByDigest(ctx context.Context, dgst digest.Digest, opts ...FetchByDigestOpts) (io.ReadCloser, ocispec.Descriptor, error) -} - -// Pusher pushes content -type Pusher interface { - // Push returns a content writer for the given resource identified - // by the descriptor. - Push(ctx context.Context, d ocispec.Descriptor) (content.Writer, error) -} - -// FetcherFunc allows package users to implement a Fetcher with just a -// function. -type FetcherFunc func(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error) - -// Fetch content -func (fn FetcherFunc) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error) { - return fn(ctx, desc) -} - -// PusherFunc allows package users to implement a Pusher with just a -// function. -type PusherFunc func(ctx context.Context, desc ocispec.Descriptor) (content.Writer, error) - -// Push content -func (fn PusherFunc) Push(ctx context.Context, desc ocispec.Descriptor) (content.Writer, error) { - return fn(ctx, desc) -} - -// FetchByDigestConfig provides configuration for fetching content by digest -type FetchByDigestConfig struct { - //Mediatype specifies mediatype header to append for fetch request - Mediatype string -} - -// FetchByDigestOpts allows callers to set options for fetch object -type FetchByDigestOpts func(context.Context, *FetchByDigestConfig) error - -// WithMediaType sets the media type header for fetch request -func WithMediaType(mediatype string) FetchByDigestOpts { - return func(ctx context.Context, cfg *FetchByDigestConfig) error { - cfg.Mediatype = mediatype - return nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/core/sandbox/bridge.go b/vendor/github.com/containerd/containerd/v2/core/sandbox/bridge.go deleted file mode 100644 index 2c2749b00d..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/sandbox/bridge.go +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package sandbox - -import ( - "context" - "fmt" - - "github.com/containerd/ttrpc" - "google.golang.org/grpc" - - api "github.com/containerd/containerd/api/runtime/sandbox/v1" -) - -// NewClient returns a new sandbox client that handles both GRPC and TTRPC clients. -func NewClient(client interface{}) (api.TTRPCSandboxService, error) { - switch c := client.(type) { - case *ttrpc.Client: - return api.NewTTRPCSandboxClient(c), nil - case grpc.ClientConnInterface: - return &grpcBridge{api.NewSandboxClient(c)}, nil - default: - return nil, fmt.Errorf("unsupported client type %T", client) - } -} - -type grpcBridge struct { - client api.SandboxClient -} - -var _ api.TTRPCSandboxService = (*grpcBridge)(nil) - -func (g *grpcBridge) CreateSandbox(ctx context.Context, request *api.CreateSandboxRequest) (*api.CreateSandboxResponse, error) { - return g.client.CreateSandbox(ctx, request) -} - -func (g *grpcBridge) StartSandbox(ctx context.Context, request *api.StartSandboxRequest) (*api.StartSandboxResponse, error) { - return g.client.StartSandbox(ctx, request) -} - -func (g *grpcBridge) Platform(ctx context.Context, request *api.PlatformRequest) (*api.PlatformResponse, error) { - return g.client.Platform(ctx, request) -} - -func (g *grpcBridge) StopSandbox(ctx context.Context, request *api.StopSandboxRequest) (*api.StopSandboxResponse, error) { - return g.client.StopSandbox(ctx, request) -} - -func (g *grpcBridge) WaitSandbox(ctx context.Context, request *api.WaitSandboxRequest) (*api.WaitSandboxResponse, error) { - return g.client.WaitSandbox(ctx, request) -} - -func (g *grpcBridge) SandboxStatus(ctx context.Context, request *api.SandboxStatusRequest) (*api.SandboxStatusResponse, error) { - return g.client.SandboxStatus(ctx, request) -} - -func (g *grpcBridge) PingSandbox(ctx context.Context, request *api.PingRequest) (*api.PingResponse, error) { - return g.client.PingSandbox(ctx, request) -} - -func (g *grpcBridge) ShutdownSandbox(ctx context.Context, request *api.ShutdownSandboxRequest) (*api.ShutdownSandboxResponse, error) { - return g.client.ShutdownSandbox(ctx, request) -} - -func (g *grpcBridge) SandboxMetrics(ctx context.Context, request *api.SandboxMetricsRequest) (*api.SandboxMetricsResponse, error) { - return g.client.SandboxMetrics(ctx, request) -} diff --git a/vendor/github.com/containerd/containerd/v2/core/sandbox/controller.go b/vendor/github.com/containerd/containerd/v2/core/sandbox/controller.go deleted file mode 100644 index 328f8399ac..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/sandbox/controller.go +++ /dev/null @@ -1,143 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package sandbox - -import ( - "context" - "fmt" - "time" - - "github.com/containerd/containerd/api/types" - "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/typeurl/v2" - imagespec "github.com/opencontainers/image-spec/specs-go/v1" -) - -type CreateOptions struct { - Rootfs []mount.Mount - // Options are used to pass arbitrary options to the shim when creating a new sandbox. - // CRI will use this to pass PodSandboxConfig. - // Don't confuse this with Runtime options, which are passed at shim instance start - // to setup global shim configuration. - Options typeurl.Any - NetNSPath string - Annotations map[string]string -} - -type CreateOpt func(*CreateOptions) error - -// WithRootFS is used to create a sandbox with the provided rootfs mount -func WithRootFS(m []mount.Mount) CreateOpt { - return func(co *CreateOptions) error { - co.Rootfs = m - return nil - } -} - -// WithOptions allows passing arbitrary options when creating a new sandbox. -func WithOptions(options any) CreateOpt { - return func(co *CreateOptions) error { - var err error - co.Options, err = typeurl.MarshalAny(options) - if err != nil { - return fmt.Errorf("failed to marshal sandbox options: %w", err) - } - - return nil - } -} - -// WithNetNSPath used to assign network namespace path of a sandbox. -func WithNetNSPath(netNSPath string) CreateOpt { - return func(co *CreateOptions) error { - co.NetNSPath = netNSPath - return nil - } -} - -// WithAnnotations sets the provided annotations for sandbox creation. -func WithAnnotations(annotations map[string]string) CreateOpt { - return func(co *CreateOptions) error { - co.Annotations = annotations - return nil - } -} - -type StopOptions struct { - Timeout *time.Duration -} - -type StopOpt func(*StopOptions) - -func WithTimeout(timeout time.Duration) StopOpt { - return func(so *StopOptions) { - so.Timeout = &timeout - } -} - -// Controller is an interface to manage sandboxes at runtime. -// When running in sandbox mode, shim expected to implement `SandboxService`. -// Shim lifetimes are now managed manually via sandbox API by the containerd's client. -type Controller interface { - // Create is used to initialize sandbox environment. (mounts, any) - Create(ctx context.Context, sandboxInfo Sandbox, opts ...CreateOpt) error - // Start will start previously created sandbox. - Start(ctx context.Context, sandboxID string) (ControllerInstance, error) - // Platform returns target sandbox OS that will be used by Controller. - // containerd will rely on this to generate proper OCI spec. - Platform(_ctx context.Context, _sandboxID string) (imagespec.Platform, error) - // Stop will stop sandbox instance - Stop(ctx context.Context, sandboxID string, opts ...StopOpt) error - // Wait blocks until sandbox process exits. - Wait(ctx context.Context, sandboxID string) (ExitStatus, error) - // Status will query sandbox process status. It is heavier than Ping call and must be used whenever you need to - // gather metadata about current sandbox state (status, uptime, resource use, etc). - Status(ctx context.Context, sandboxID string, verbose bool) (ControllerStatus, error) - // Shutdown deletes and cleans all tasks and sandbox instance. - Shutdown(ctx context.Context, sandboxID string) error - // Metrics queries the sandbox for metrics. - Metrics(ctx context.Context, sandboxID string) (*types.Metric, error) - // Update changes a part of sandbox, such as extensions/annotations/labels/spec of - // Sandbox object, controllers may have to update the running sandbox according to the changes. - Update(ctx context.Context, sandboxID string, sandbox Sandbox, fields ...string) error -} - -type ControllerInstance struct { - SandboxID string - Pid uint32 - CreatedAt time.Time - Address string - Version uint32 - Labels map[string]string -} - -type ExitStatus struct { - ExitStatus uint32 - ExitedAt time.Time -} - -type ControllerStatus struct { - SandboxID string - Pid uint32 - State string - Info map[string]string - CreatedAt time.Time - ExitedAt time.Time - Extra typeurl.Any - Address string - Version uint32 -} diff --git a/vendor/github.com/containerd/containerd/v2/core/sandbox/helpers.go b/vendor/github.com/containerd/containerd/v2/core/sandbox/helpers.go deleted file mode 100644 index e41eb03498..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/sandbox/helpers.go +++ /dev/null @@ -1,69 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package sandbox - -import ( - "github.com/containerd/containerd/api/types" - "github.com/containerd/containerd/v2/pkg/protobuf" - gogo_types "github.com/containerd/containerd/v2/pkg/protobuf/types" - "github.com/containerd/typeurl/v2" -) - -// ToProto will map Sandbox struct to it's protobuf definition -func ToProto(sandbox *Sandbox) *types.Sandbox { - extensions := make(map[string]*gogo_types.Any) - for k, v := range sandbox.Extensions { - extensions[k] = typeurl.MarshalProto(v) - } - return &types.Sandbox{ - SandboxID: sandbox.ID, - Runtime: &types.Sandbox_Runtime{ - Name: sandbox.Runtime.Name, - Options: typeurl.MarshalProto(sandbox.Runtime.Options), - }, - Sandboxer: sandbox.Sandboxer, - Labels: sandbox.Labels, - CreatedAt: protobuf.ToTimestamp(sandbox.CreatedAt), - UpdatedAt: protobuf.ToTimestamp(sandbox.UpdatedAt), - Extensions: extensions, - Spec: typeurl.MarshalProto(sandbox.Spec), - } -} - -// FromProto map protobuf sandbox definition to Sandbox struct -func FromProto(sandboxpb *types.Sandbox) Sandbox { - runtime := RuntimeOpts{ - Name: sandboxpb.Runtime.Name, - Options: sandboxpb.Runtime.Options, - } - - extensions := make(map[string]typeurl.Any) - for k, v := range sandboxpb.Extensions { - extensions[k] = v - } - - return Sandbox{ - ID: sandboxpb.SandboxID, - Labels: sandboxpb.Labels, - Runtime: runtime, - Spec: sandboxpb.Spec, - Sandboxer: sandboxpb.Sandboxer, - CreatedAt: protobuf.FromTimestamp(sandboxpb.CreatedAt), - UpdatedAt: protobuf.FromTimestamp(sandboxpb.UpdatedAt), - Extensions: extensions, - } -} diff --git a/vendor/github.com/containerd/containerd/v2/core/sandbox/proxy/controller.go b/vendor/github.com/containerd/containerd/v2/core/sandbox/proxy/controller.go deleted file mode 100644 index 121785f618..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/sandbox/proxy/controller.go +++ /dev/null @@ -1,222 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package proxy - -import ( - "context" - "time" - - api "github.com/containerd/containerd/api/services/sandbox/v1" - "github.com/containerd/containerd/api/types" - "github.com/containerd/errdefs" - "github.com/containerd/errdefs/pkg/errgrpc" - "github.com/containerd/typeurl/v2" - imagespec "github.com/opencontainers/image-spec/specs-go/v1" - - "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/containerd/v2/core/sandbox" -) - -// remoteSandboxController is a low level GRPC client for containerd's sandbox controller service -type remoteSandboxController struct { - client api.ControllerClient - sandboxerName string -} - -var _ sandbox.Controller = (*remoteSandboxController)(nil) - -// NewSandboxController creates a client for a sandbox controller -func NewSandboxController(client api.ControllerClient, name string) sandbox.Controller { - return &remoteSandboxController{client: client, sandboxerName: name} -} - -func (s *remoteSandboxController) Create(ctx context.Context, sandboxInfo sandbox.Sandbox, opts ...sandbox.CreateOpt) error { - var options sandbox.CreateOptions - for _, opt := range opts { - opt(&options) - } - apiSandbox := sandbox.ToProto(&sandboxInfo) - _, err := s.client.Create(ctx, &api.ControllerCreateRequest{ - SandboxID: sandboxInfo.ID, - Rootfs: mount.ToProto(options.Rootfs), - Options: typeurl.MarshalProto(options.Options), - NetnsPath: options.NetNSPath, - Annotations: options.Annotations, - Sandbox: apiSandbox, - Sandboxer: s.sandboxerName, - }) - if err != nil { - return errgrpc.ToNative(err) - } - - return nil -} - -func (s *remoteSandboxController) Start(ctx context.Context, sandboxID string) (sandbox.ControllerInstance, error) { - resp, err := s.client.Start(ctx, &api.ControllerStartRequest{ - SandboxID: sandboxID, - Sandboxer: s.sandboxerName, - }) - if err != nil { - return sandbox.ControllerInstance{}, errgrpc.ToNative(err) - } - - return sandbox.ControllerInstance{ - SandboxID: sandboxID, - Pid: resp.GetPid(), - CreatedAt: resp.GetCreatedAt().AsTime(), - Labels: resp.GetLabels(), - Address: resp.GetAddress(), - Version: resp.GetVersion(), - }, nil -} - -func (s *remoteSandboxController) Platform(ctx context.Context, sandboxID string) (imagespec.Platform, error) { - resp, err := s.client.Platform(ctx, &api.ControllerPlatformRequest{ - SandboxID: sandboxID, - Sandboxer: s.sandboxerName, - }) - if err != nil { - return imagespec.Platform{}, errgrpc.ToNative(err) - } - - platform := resp.GetPlatform() - return imagespec.Platform{ - Architecture: platform.GetArchitecture(), - OS: platform.GetOS(), - Variant: platform.GetVariant(), - }, nil -} - -func (s *remoteSandboxController) Stop(ctx context.Context, sandboxID string, opts ...sandbox.StopOpt) error { - var soptions sandbox.StopOptions - for _, opt := range opts { - opt(&soptions) - } - req := &api.ControllerStopRequest{ - SandboxID: sandboxID, - Sandboxer: s.sandboxerName, - } - if soptions.Timeout != nil { - req.TimeoutSecs = uint32(soptions.Timeout.Seconds()) - } - _, err := s.client.Stop(ctx, req) - if err != nil { - return errgrpc.ToNative(err) - } - - return nil -} - -func (s *remoteSandboxController) Shutdown(ctx context.Context, sandboxID string) error { - _, err := s.client.Shutdown(ctx, &api.ControllerShutdownRequest{ - SandboxID: sandboxID, - Sandboxer: s.sandboxerName, - }) - if err != nil { - return errgrpc.ToNative(err) - } - - return nil -} - -func (s *remoteSandboxController) Wait(ctx context.Context, sandboxID string) (sandbox.ExitStatus, error) { - // For remote sandbox controllers, the controller process may restart, - // we have to retry if the error indicates that it is the grpc disconnection. - var ( - resp *api.ControllerWaitResponse - err error - retryInterval time.Duration = 128 - ) - for { - resp, err = s.client.Wait(ctx, &api.ControllerWaitRequest{ - SandboxID: sandboxID, - Sandboxer: s.sandboxerName, - }) - if err != nil { - grpcErr := errgrpc.ToNative(err) - if !errdefs.IsUnavailable(grpcErr) { - return sandbox.ExitStatus{}, grpcErr - } - select { - case <-time.After(retryInterval * time.Millisecond): - if retryInterval < 4096 { - retryInterval = retryInterval << 1 - } - continue - case <-ctx.Done(): - return sandbox.ExitStatus{}, grpcErr - } - } - break - } - - return sandbox.ExitStatus{ - ExitStatus: resp.GetExitStatus(), - ExitedAt: resp.GetExitedAt().AsTime(), - }, nil -} - -func (s *remoteSandboxController) Status(ctx context.Context, sandboxID string, verbose bool) (sandbox.ControllerStatus, error) { - resp, err := s.client.Status(ctx, &api.ControllerStatusRequest{ - SandboxID: sandboxID, - Verbose: verbose, - Sandboxer: s.sandboxerName, - }) - if err != nil { - return sandbox.ControllerStatus{}, errgrpc.ToNative(err) - } - return sandbox.ControllerStatus{ - SandboxID: sandboxID, - Pid: resp.GetPid(), - State: resp.GetState(), - Info: resp.GetInfo(), - CreatedAt: resp.GetCreatedAt().AsTime(), - ExitedAt: resp.GetExitedAt().AsTime(), - Extra: resp.GetExtra(), - Address: resp.GetAddress(), - Version: resp.GetVersion(), - }, nil -} - -func (s *remoteSandboxController) Metrics(ctx context.Context, sandboxID string) (*types.Metric, error) { - resp, err := s.client.Metrics(ctx, &api.ControllerMetricsRequest{ - SandboxID: sandboxID, - Sandboxer: s.sandboxerName, - }) - if err != nil { - return nil, errgrpc.ToNative(err) - } - return resp.Metrics, nil -} - -func (s *remoteSandboxController) Update( - ctx context.Context, - sandboxID string, - sb sandbox.Sandbox, - fields ...string) error { - apiSandbox := sandbox.ToProto(&sb) - _, err := s.client.Update(ctx, &api.ControllerUpdateRequest{ - SandboxID: sandboxID, - Sandbox: apiSandbox, - Fields: fields, - }) - if err != nil { - return errgrpc.ToNative(err) - } - return nil -} diff --git a/vendor/github.com/containerd/containerd/v2/core/sandbox/proxy/store.go b/vendor/github.com/containerd/containerd/v2/core/sandbox/proxy/store.go deleted file mode 100644 index 09fdce1087..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/sandbox/proxy/store.go +++ /dev/null @@ -1,96 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package proxy - -import ( - "context" - - api "github.com/containerd/containerd/api/services/sandbox/v1" - "github.com/containerd/errdefs/pkg/errgrpc" - - sb "github.com/containerd/containerd/v2/core/sandbox" -) - -// remoteSandboxStore is a low-level containerd client to manage sandbox environments metadata -type remoteSandboxStore struct { - client api.StoreClient -} - -var _ sb.Store = (*remoteSandboxStore)(nil) - -// NewSandboxStore create a client for a sandbox store -func NewSandboxStore(client api.StoreClient) sb.Store { - return &remoteSandboxStore{client: client} -} - -func (s *remoteSandboxStore) Create(ctx context.Context, sandbox sb.Sandbox) (sb.Sandbox, error) { - resp, err := s.client.Create(ctx, &api.StoreCreateRequest{ - Sandbox: sb.ToProto(&sandbox), - }) - if err != nil { - return sb.Sandbox{}, errgrpc.ToNative(err) - } - - return sb.FromProto(resp.Sandbox), nil -} - -func (s *remoteSandboxStore) Update(ctx context.Context, sandbox sb.Sandbox, fieldpaths ...string) (sb.Sandbox, error) { - resp, err := s.client.Update(ctx, &api.StoreUpdateRequest{ - Sandbox: sb.ToProto(&sandbox), - Fields: fieldpaths, - }) - if err != nil { - return sb.Sandbox{}, errgrpc.ToNative(err) - } - - return sb.FromProto(resp.Sandbox), nil -} - -func (s *remoteSandboxStore) Get(ctx context.Context, id string) (sb.Sandbox, error) { - resp, err := s.client.Get(ctx, &api.StoreGetRequest{ - SandboxID: id, - }) - if err != nil { - return sb.Sandbox{}, errgrpc.ToNative(err) - } - - return sb.FromProto(resp.Sandbox), nil -} - -func (s *remoteSandboxStore) List(ctx context.Context, filters ...string) ([]sb.Sandbox, error) { - resp, err := s.client.List(ctx, &api.StoreListRequest{ - Filters: filters, - }) - if err != nil { - return nil, errgrpc.ToNative(err) - } - - out := make([]sb.Sandbox, len(resp.List)) - for i := range resp.List { - out[i] = sb.FromProto(resp.List[i]) - } - - return out, nil -} - -func (s *remoteSandboxStore) Delete(ctx context.Context, id string) error { - _, err := s.client.Delete(ctx, &api.StoreDeleteRequest{ - SandboxID: id, - }) - - return errgrpc.ToNative(err) -} diff --git a/vendor/github.com/containerd/containerd/v2/core/sandbox/store.go b/vendor/github.com/containerd/containerd/v2/core/sandbox/store.go deleted file mode 100644 index 705e86faca..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/sandbox/store.go +++ /dev/null @@ -1,118 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package sandbox - -import ( - "context" - "fmt" - "time" - - "github.com/containerd/errdefs" - "github.com/containerd/typeurl/v2" -) - -// Sandbox is an object stored in metadata database -type Sandbox struct { - // ID uniquely identifies the sandbox in a namespace - ID string - // Labels provide metadata extension for a sandbox - Labels map[string]string - // Runtime shim to use for this sandbox - Runtime RuntimeOpts - // Spec carries the runtime specification used to implement the sandbox - Spec typeurl.Any - // Sandboxer is the sandbox controller who manages the sandbox - Sandboxer string - // CreatedAt is the time at which the sandbox was created - CreatedAt time.Time - // UpdatedAt is the time at which the sandbox was updated - UpdatedAt time.Time - // Extensions stores client-specified metadata - Extensions map[string]typeurl.Any -} - -// RuntimeOpts holds runtime specific information -type RuntimeOpts struct { - Name string - Options typeurl.Any -} - -// Store is a storage interface for sandbox metadata objects -type Store interface { - // Create a sandbox record in the store - Create(ctx context.Context, sandbox Sandbox) (Sandbox, error) - - // Update the sandbox with the provided sandbox object and fields - Update(ctx context.Context, sandbox Sandbox, fieldpaths ...string) (Sandbox, error) - - // Get sandbox metadata using the id - Get(ctx context.Context, id string) (Sandbox, error) - - // List returns sandboxes that match one or more of the provided filters - List(ctx context.Context, filters ...string) ([]Sandbox, error) - - // Delete a sandbox from metadata store using the id - Delete(ctx context.Context, id string) error -} - -// AddExtension is a helper function to add sandbox metadata extension. -func (s *Sandbox) AddExtension(name string, obj interface{}) error { - if s.Extensions == nil { - s.Extensions = map[string]typeurl.Any{} - } - - out, err := typeurl.MarshalAny(obj) - if err != nil { - return fmt.Errorf("failed to marshal sandbox extension %q: %w", name, err) - } - - s.Extensions[name] = out - return nil -} - -// AddLabel adds a label to sandbox's labels. -func (s *Sandbox) AddLabel(name string, value string) { - if s.Labels == nil { - s.Labels = map[string]string{} - } - - s.Labels[name] = value -} - -// GetExtension retrieves a sandbox extension by name. -func (s *Sandbox) GetExtension(name string, obj interface{}) error { - out, ok := s.Extensions[name] - if !ok { - return errdefs.ErrNotFound - } - - if err := typeurl.UnmarshalTo(out, obj); err != nil { - return fmt.Errorf("failed to unmarshal sandbox extension %q: %w", name, err) - } - - return nil -} - -// GetLabel retrieves a sandbox label by name. -func (s *Sandbox) GetLabel(name string) (string, error) { - out, ok := s.Labels[name] - if !ok { - return "", fmt.Errorf("unable to find label %q in sandbox metadata: %w", name, errdefs.ErrNotFound) - } - - return out, nil -} diff --git a/vendor/github.com/containerd/containerd/v2/core/snapshots/proxy/convert.go b/vendor/github.com/containerd/containerd/v2/core/snapshots/proxy/convert.go deleted file mode 100644 index b987be0abe..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/snapshots/proxy/convert.go +++ /dev/null @@ -1,90 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package proxy - -import ( - snapshotsapi "github.com/containerd/containerd/api/services/snapshots/v1" - "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/pkg/protobuf" -) - -// KindToProto converts from [Kind] to the protobuf definition [snapshots.Kind]. -func KindToProto(kind snapshots.Kind) snapshotsapi.Kind { - switch kind { - case snapshots.KindActive: - return snapshotsapi.Kind_ACTIVE - case snapshots.KindView: - return snapshotsapi.Kind_VIEW - default: - return snapshotsapi.Kind_COMMITTED - } -} - -// KindFromProto converts from the protobuf definition [snapshots.Kind] to -// [Kind]. -func KindFromProto(kind snapshotsapi.Kind) snapshots.Kind { - switch kind { - case snapshotsapi.Kind_ACTIVE: - return snapshots.KindActive - case snapshotsapi.Kind_VIEW: - return snapshots.KindView - default: - return snapshots.KindCommitted - } -} - -// InfoToProto converts from [Info] to the protobuf definition [snapshots.Info]. -func InfoToProto(info snapshots.Info) *snapshotsapi.Info { - return &snapshotsapi.Info{ - Name: info.Name, - Parent: info.Parent, - Kind: KindToProto(info.Kind), - CreatedAt: protobuf.ToTimestamp(info.Created), - UpdatedAt: protobuf.ToTimestamp(info.Updated), - Labels: info.Labels, - } -} - -// InfoFromProto converts from the protobuf definition [snapshots.Info] to -// [Info]. -func InfoFromProto(info *snapshotsapi.Info) snapshots.Info { - return snapshots.Info{ - Name: info.Name, - Parent: info.Parent, - Kind: KindFromProto(info.Kind), - Created: protobuf.FromTimestamp(info.CreatedAt), - Updated: protobuf.FromTimestamp(info.UpdatedAt), - Labels: info.Labels, - } -} - -// UsageFromProto converts from the protobuf definition [snapshots.Usage] to -// [Usage]. -func UsageFromProto(resp *snapshotsapi.UsageResponse) snapshots.Usage { - return snapshots.Usage{ - Inodes: resp.Inodes, - Size: resp.Size, - } -} - -// UsageToProto converts from [Usage] to the protobuf definition [snapshots.Usage]. -func UsageToProto(usage snapshots.Usage) *snapshotsapi.UsageResponse { - return &snapshotsapi.UsageResponse{ - Inodes: usage.Inodes, - Size: usage.Size, - } -} diff --git a/vendor/github.com/containerd/containerd/v2/core/snapshots/proxy/proxy.go b/vendor/github.com/containerd/containerd/v2/core/snapshots/proxy/proxy.go deleted file mode 100644 index 3e4aef983d..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/snapshots/proxy/proxy.go +++ /dev/null @@ -1,192 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package proxy - -import ( - "context" - "io" - - snapshotsapi "github.com/containerd/containerd/api/services/snapshots/v1" - "github.com/containerd/errdefs/pkg/errgrpc" - - "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/containerd/v2/core/snapshots" - protobuftypes "github.com/containerd/containerd/v2/pkg/protobuf/types" -) - -// NewSnapshotter returns a new Snapshotter which communicates over a GRPC -// connection using the containerd snapshot GRPC API. -func NewSnapshotter(client snapshotsapi.SnapshotsClient, snapshotterName string) snapshots.Snapshotter { - return &proxySnapshotter{ - client: client, - snapshotterName: snapshotterName, - } -} - -type proxySnapshotter struct { - client snapshotsapi.SnapshotsClient - snapshotterName string -} - -func (p *proxySnapshotter) Stat(ctx context.Context, key string) (snapshots.Info, error) { - resp, err := p.client.Stat(ctx, - &snapshotsapi.StatSnapshotRequest{ - Snapshotter: p.snapshotterName, - Key: key, - }) - if err != nil { - return snapshots.Info{}, errgrpc.ToNative(err) - } - return InfoFromProto(resp.Info), nil -} - -func (p *proxySnapshotter) Update(ctx context.Context, info snapshots.Info, fieldpaths ...string) (snapshots.Info, error) { - resp, err := p.client.Update(ctx, - &snapshotsapi.UpdateSnapshotRequest{ - Snapshotter: p.snapshotterName, - Info: InfoToProto(info), - UpdateMask: &protobuftypes.FieldMask{ - Paths: fieldpaths, - }, - }) - if err != nil { - return snapshots.Info{}, errgrpc.ToNative(err) - } - return InfoFromProto(resp.Info), nil -} - -func (p *proxySnapshotter) Usage(ctx context.Context, key string) (snapshots.Usage, error) { - resp, err := p.client.Usage(ctx, &snapshotsapi.UsageRequest{ - Snapshotter: p.snapshotterName, - Key: key, - }) - if err != nil { - return snapshots.Usage{}, errgrpc.ToNative(err) - } - return UsageFromProto(resp), nil -} - -func (p *proxySnapshotter) Mounts(ctx context.Context, key string) ([]mount.Mount, error) { - resp, err := p.client.Mounts(ctx, &snapshotsapi.MountsRequest{ - Snapshotter: p.snapshotterName, - Key: key, - }) - if err != nil { - return nil, errgrpc.ToNative(err) - } - return mount.FromProto(resp.Mounts), nil -} - -func (p *proxySnapshotter) Prepare(ctx context.Context, key, parent string, opts ...snapshots.Opt) ([]mount.Mount, error) { - var local snapshots.Info - for _, opt := range opts { - if err := opt(&local); err != nil { - return nil, err - } - } - resp, err := p.client.Prepare(ctx, &snapshotsapi.PrepareSnapshotRequest{ - Snapshotter: p.snapshotterName, - Key: key, - Parent: parent, - Labels: local.Labels, - }) - if err != nil { - return nil, errgrpc.ToNative(err) - } - return mount.FromProto(resp.Mounts), nil -} - -func (p *proxySnapshotter) View(ctx context.Context, key, parent string, opts ...snapshots.Opt) ([]mount.Mount, error) { - var local snapshots.Info - for _, opt := range opts { - if err := opt(&local); err != nil { - return nil, err - } - } - resp, err := p.client.View(ctx, &snapshotsapi.ViewSnapshotRequest{ - Snapshotter: p.snapshotterName, - Key: key, - Parent: parent, - Labels: local.Labels, - }) - if err != nil { - return nil, errgrpc.ToNative(err) - } - return mount.FromProto(resp.Mounts), nil -} - -func (p *proxySnapshotter) Commit(ctx context.Context, name, key string, opts ...snapshots.Opt) error { - var local snapshots.Info - for _, opt := range opts { - if err := opt(&local); err != nil { - return err - } - } - _, err := p.client.Commit(ctx, &snapshotsapi.CommitSnapshotRequest{ - Snapshotter: p.snapshotterName, - Name: name, - Key: key, - Labels: local.Labels, - }) - return errgrpc.ToNative(err) -} - -func (p *proxySnapshotter) Remove(ctx context.Context, key string) error { - _, err := p.client.Remove(ctx, &snapshotsapi.RemoveSnapshotRequest{ - Snapshotter: p.snapshotterName, - Key: key, - }) - return errgrpc.ToNative(err) -} - -func (p *proxySnapshotter) Walk(ctx context.Context, fn snapshots.WalkFunc, fs ...string) error { - sc, err := p.client.List(ctx, &snapshotsapi.ListSnapshotsRequest{ - Snapshotter: p.snapshotterName, - Filters: fs, - }) - if err != nil { - return errgrpc.ToNative(err) - } - for { - resp, err := sc.Recv() - if err != nil { - if err == io.EOF { - return nil - } - return errgrpc.ToNative(err) - } - if resp == nil { - return nil - } - for _, info := range resp.Info { - if err := fn(ctx, InfoFromProto(info)); err != nil { - return err - } - } - } -} - -func (p *proxySnapshotter) Close() error { - return nil -} - -func (p *proxySnapshotter) Cleanup(ctx context.Context) error { - _, err := p.client.Cleanup(ctx, &snapshotsapi.CleanupRequest{ - Snapshotter: p.snapshotterName, - }) - return errgrpc.ToNative(err) -} diff --git a/vendor/github.com/containerd/containerd/v2/core/streaming/proxy/streaming.go b/vendor/github.com/containerd/containerd/v2/core/streaming/proxy/streaming.go deleted file mode 100644 index fa47fc5d6b..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/streaming/proxy/streaming.go +++ /dev/null @@ -1,129 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package proxy - -import ( - "context" - "errors" - "fmt" - "io" - - streamingapi "github.com/containerd/containerd/api/services/streaming/v1" - "github.com/containerd/errdefs" - "github.com/containerd/errdefs/pkg/errgrpc" - "github.com/containerd/ttrpc" - "github.com/containerd/typeurl/v2" - "google.golang.org/grpc" - - "github.com/containerd/containerd/v2/core/streaming" -) - -// NewStreamCreator returns a new stream creator which can communicate over a GRPC -// or TTRPC connection using the containerd streaming API. -func NewStreamCreator(client any) streaming.StreamCreator { - switch c := client.(type) { - case streamingapi.StreamingClient: - return &streamCreator{ - client: convertClient{c}, - } - case grpc.ClientConnInterface: - return &streamCreator{ - client: convertClient{streamingapi.NewStreamingClient(c)}, - } - case streamingapi.TTRPCStreamingClient: - return &streamCreator{ - client: c, - } - case *ttrpc.Client: - return &streamCreator{ - client: streamingapi.NewTTRPCStreamingClient(c), - } - case streaming.StreamCreator: - return c - default: - panic(fmt.Errorf("unsupported stream client %T: %w", client, errdefs.ErrNotImplemented)) - } -} - -type convertClient struct { - streamingapi.StreamingClient -} - -func (c convertClient) Stream(ctx context.Context) (streamingapi.TTRPCStreaming_StreamClient, error) { - return c.StreamingClient.Stream(ctx) -} - -type streamCreator struct { - client streamingapi.TTRPCStreamingClient -} - -func (sc *streamCreator) Create(ctx context.Context, id string) (streaming.Stream, error) { - stream, err := sc.client.Stream(ctx) - if err != nil { - return nil, err - } - - a, err := typeurl.MarshalAny(&streamingapi.StreamInit{ - ID: id, - }) - if err != nil { - return nil, err - } - err = stream.Send(typeurl.MarshalProto(a)) - if err != nil { - if !errors.Is(err, io.EOF) { - err = errgrpc.ToNative(err) - } - return nil, err - } - - // Receive an ack that stream is init and ready - if _, err = stream.Recv(); err != nil { - if !errors.Is(err, io.EOF) { - err = errgrpc.ToNative(err) - } - return nil, err - } - - return &clientStream{ - s: stream, - }, nil -} - -type clientStream struct { - s streamingapi.TTRPCStreaming_StreamClient -} - -func (cs *clientStream) Send(a typeurl.Any) (err error) { - err = cs.s.Send(typeurl.MarshalProto(a)) - if !errors.Is(err, io.EOF) { - err = errgrpc.ToNative(err) - } - return -} - -func (cs *clientStream) Recv() (a typeurl.Any, err error) { - a, err = cs.s.Recv() - if !errors.Is(err, io.EOF) { - err = errgrpc.ToNative(err) - } - return -} - -func (cs *clientStream) Close() error { - return cs.s.CloseSend() -} diff --git a/vendor/github.com/containerd/containerd/v2/core/streaming/streaming.go b/vendor/github.com/containerd/containerd/v2/core/streaming/streaming.go deleted file mode 100644 index 15fc6c3c1b..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/streaming/streaming.go +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package streaming - -import ( - "context" - - "github.com/containerd/typeurl/v2" -) - -type StreamManager interface { - StreamGetter - Register(context.Context, string, Stream) error -} - -type StreamGetter interface { - Get(context.Context, string) (Stream, error) -} - -type StreamCreator interface { - Create(context.Context, string) (Stream, error) -} - -type Stream interface { - // Send sends the object on the stream - Send(typeurl.Any) error - - // Recv receives an object on the stream - Recv() (typeurl.Any, error) - - // Close closes the stream - Close() error -} diff --git a/vendor/github.com/containerd/containerd/v2/core/transfer/proxy/transfer.go b/vendor/github.com/containerd/containerd/v2/core/transfer/proxy/transfer.go deleted file mode 100644 index f314f6fe0a..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/transfer/proxy/transfer.go +++ /dev/null @@ -1,165 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package proxy - -import ( - "context" - "errors" - "fmt" - "io" - - "google.golang.org/grpc" - "google.golang.org/protobuf/types/known/anypb" - "google.golang.org/protobuf/types/known/emptypb" - - transferapi "github.com/containerd/containerd/api/services/transfer/v1" - transfertypes "github.com/containerd/containerd/api/types/transfer" - "github.com/containerd/containerd/v2/core/streaming" - "github.com/containerd/containerd/v2/core/transfer" - tstreaming "github.com/containerd/containerd/v2/core/transfer/streaming" - "github.com/containerd/containerd/v2/pkg/oci" - "github.com/containerd/errdefs" - "github.com/containerd/log" - "github.com/containerd/ttrpc" - "github.com/containerd/typeurl/v2" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -type proxyTransferrer struct { - client transferapi.TTRPCTransferService - streamCreator streaming.StreamCreator -} - -// NewTransferrer returns a new transferrer which can communicate over a GRPC -// or TTRPC connection using the containerd transfer API -func NewTransferrer(client any, sc streaming.StreamCreator) transfer.Transferrer { - switch c := client.(type) { - case transferapi.TransferClient: - return &proxyTransferrer{ - client: convertClient{c}, - streamCreator: sc, - } - case grpc.ClientConnInterface: - return &proxyTransferrer{ - client: convertClient{transferapi.NewTransferClient(c)}, - streamCreator: sc, - } - case transferapi.TTRPCTransferService: - return &proxyTransferrer{ - client: c, - streamCreator: sc, - } - case *ttrpc.Client: - return &proxyTransferrer{ - client: transferapi.NewTTRPCTransferClient(c), - streamCreator: sc, - } - case transfer.Transferrer: - return c - default: - panic(fmt.Errorf("unsupported stream client %T: %w", client, errdefs.ErrNotImplemented)) - } -} - -type convertClient struct { - transferapi.TransferClient -} - -func (c convertClient) Transfer(ctx context.Context, r *transferapi.TransferRequest) (*emptypb.Empty, error) { - return c.TransferClient.Transfer(ctx, r) -} - -func (p *proxyTransferrer) Transfer(ctx context.Context, src interface{}, dst interface{}, opts ...transfer.Opt) error { - o := &transfer.Config{} - for _, opt := range opts { - opt(o) - } - apiOpts := &transferapi.TransferOptions{} - if o.Progress != nil { - sid := tstreaming.GenerateID("progress") - stream, err := p.streamCreator.Create(ctx, sid) - if err != nil { - return err - } - apiOpts.ProgressStream = sid - go func() { - for { - a, err := stream.Recv() - if err != nil { - if !errors.Is(err, io.EOF) { - log.G(ctx).WithError(err).Error("progress stream failed to recv") - } - return - } - i, err := typeurl.UnmarshalAny(a) - if err != nil { - log.G(ctx).WithError(err).Warnf("failed to unmarshal progress object: %v", a.GetTypeUrl()) - } - switch v := i.(type) { - case *transfertypes.Progress: - var descp *ocispec.Descriptor - if v.Desc != nil { - desc := oci.DescriptorFromProto(v.Desc) - descp = &desc - } - o.Progress(transfer.Progress{ - Event: v.Event, - Name: v.Name, - Parents: v.Parents, - Progress: v.Progress, - Total: v.Total, - Desc: descp, - }) - default: - log.G(ctx).Warnf("unhandled progress object %T: %v", i, a.GetTypeUrl()) - } - } - }() - } - asrc, err := p.marshalAny(ctx, src) - if err != nil { - return err - } - adst, err := p.marshalAny(ctx, dst) - if err != nil { - return err - } - req := &transferapi.TransferRequest{ - Source: &anypb.Any{ - TypeUrl: asrc.GetTypeUrl(), - Value: asrc.GetValue(), - }, - Destination: &anypb.Any{ - TypeUrl: adst.GetTypeUrl(), - Value: adst.GetValue(), - }, - Options: apiOpts, - } - _, err = p.client.Transfer(ctx, req) - return err -} -func (p *proxyTransferrer) marshalAny(ctx context.Context, i interface{}) (typeurl.Any, error) { - switch m := i.(type) { - case streamMarshaler: - return m.MarshalAny(ctx, p.streamCreator) - } - return typeurl.MarshalAny(i) -} - -type streamMarshaler interface { - MarshalAny(context.Context, streaming.StreamCreator) (typeurl.Any, error) -} diff --git a/vendor/github.com/containerd/containerd/v2/core/transfer/streaming/reader.go b/vendor/github.com/containerd/containerd/v2/core/transfer/streaming/reader.go deleted file mode 100644 index e989b0d732..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/transfer/streaming/reader.go +++ /dev/null @@ -1,121 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package streaming - -import ( - "context" - "errors" - "fmt" - "io" - - transferapi "github.com/containerd/containerd/api/types/transfer" - "github.com/containerd/containerd/v2/core/streaming" - "github.com/containerd/typeurl/v2" -) - -type readByteStream struct { - ctx context.Context - stream streaming.Stream - window int32 - updated chan struct{} - errCh chan error - remaining []byte -} - -func ReadByteStream(ctx context.Context, stream streaming.Stream) io.ReadCloser { - rbs := &readByteStream{ - ctx: ctx, - stream: stream, - window: 0, - errCh: make(chan error), - updated: make(chan struct{}, 1), - } - go func() { - for { - if rbs.window >= windowSize { - select { - case <-ctx.Done(): - return - case <-rbs.updated: - continue - } - } - update := &transferapi.WindowUpdate{ - Update: windowSize, - } - anyType, err := typeurl.MarshalAny(update) - if err != nil { - rbs.errCh <- err - return - } - if err := stream.Send(anyType); err == nil { - rbs.window += windowSize - } else if !errors.Is(err, io.EOF) { - rbs.errCh <- err - } - } - - }() - return rbs -} - -func (r *readByteStream) Read(p []byte) (n int, err error) { - plen := len(p) - if len(r.remaining) > 0 { - copied := copy(p, r.remaining) - if len(r.remaining) > plen { - r.remaining = r.remaining[plen:] - } else { - r.remaining = nil - } - return copied, nil - } - select { - case <-r.ctx.Done(): - return 0, r.ctx.Err() - case err := <-r.errCh: - return 0, err - default: - } - anyType, err := r.stream.Recv() - if err != nil { - return 0, err - } - i, err := typeurl.UnmarshalAny(anyType) - if err != nil { - return 0, err - } - switch v := i.(type) { - case *transferapi.Data: - n := copy(p, v.Data) - if len(v.Data) > plen { - r.remaining = v.Data[plen:] - } - r.window = r.window - int32(n) - if r.window < windowSize { - r.updated <- struct{}{} - } - return n, nil - default: - return 0, fmt.Errorf("stream received error type %v", v) - } - -} - -func (r *readByteStream) Close() error { - return r.stream.Close() -} diff --git a/vendor/github.com/containerd/containerd/v2/core/transfer/streaming/stream.go b/vendor/github.com/containerd/containerd/v2/core/transfer/streaming/stream.go deleted file mode 100644 index caea29536b..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/transfer/streaming/stream.go +++ /dev/null @@ -1,210 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package streaming - -import ( - "context" - "crypto/rand" - "encoding/base64" - "errors" - "fmt" - "io" - "sync" - "time" - - transferapi "github.com/containerd/containerd/api/types/transfer" - "github.com/containerd/containerd/v2/core/streaming" - "github.com/containerd/log" - "github.com/containerd/typeurl/v2" -) - -const maxRead = 32 * 1024 -const windowSize = 2 * maxRead - -var bufPool = &sync.Pool{ - New: func() interface{} { - buffer := make([]byte, maxRead) - return &buffer - }, -} - -func SendStream(ctx context.Context, r io.Reader, stream streaming.Stream) { - window := make(chan int32) - go func() { - defer close(window) - for { - select { - case <-ctx.Done(): - return - default: - } - - anyType, err := stream.Recv() - if err != nil { - if !errors.Is(err, io.EOF) && !errors.Is(err, context.Canceled) { - log.G(ctx).WithError(err).Error("send stream ended without EOF") - } - return - } - i, err := typeurl.UnmarshalAny(anyType) - if err != nil { - log.G(ctx).WithError(err).Error("failed to unmarshal stream object") - continue - } - switch v := i.(type) { - case *transferapi.WindowUpdate: - select { - case <-ctx.Done(): - return - case window <- v.Update: - } - default: - log.G(ctx).Errorf("unexpected stream object of type %T", i) - } - } - }() - go func() { - defer stream.Close() - - buf := bufPool.Get().(*[]byte) - defer bufPool.Put(buf) - - var remaining int32 - - for { - if remaining > 0 { - // Don't wait for window update since there are remaining - select { - case <-ctx.Done(): - // TODO: Send error message on stream before close to allow remote side to return error - return - case update := <-window: - remaining += update - default: - } - } else { - // Block until window updated - select { - case <-ctx.Done(): - // TODO: Send error message on stream before close to allow remote side to return error - return - case update := <-window: - remaining = update - } - } - var max int32 = maxRead - if max > remaining { - max = remaining - } - b := (*buf)[:max] - n, err := r.Read(b) - if err != nil { - if !errors.Is(err, io.EOF) { - log.G(ctx).WithError(err).Errorf("failed to read stream source") - // TODO: Send error message on stream before close to allow remote side to return error - } - return - } - remaining = remaining - int32(n) - - data := &transferapi.Data{ - Data: b[:n], - } - anyType, err := typeurl.MarshalAny(data) - if err != nil { - log.G(ctx).WithError(err).Errorf("failed to marshal data for send") - // TODO: Send error message on stream before close to allow remote side to return error - return - } - if err := stream.Send(anyType); err != nil { - log.G(ctx).WithError(err).Errorf("send failed") - return - } - } - }() -} - -func ReceiveStream(ctx context.Context, stream streaming.Stream) io.Reader { - r, w := io.Pipe() - go func() { - defer stream.Close() - var window int32 - for { - var werr error - if window < windowSize { - update := &transferapi.WindowUpdate{ - Update: windowSize, - } - anyType, err := typeurl.MarshalAny(update) - if err != nil { - w.CloseWithError(fmt.Errorf("failed to marshal window update: %w", err)) - return - } - // check window update error after recv, stream may be complete - if werr = stream.Send(anyType); werr == nil { - window += windowSize - } else if errors.Is(werr, io.EOF) { - // TODO: Why does send return EOF here - werr = nil - } - } - anyType, err := stream.Recv() - if err != nil { - if errors.Is(err, io.EOF) || errors.Is(err, context.Canceled) { - err = nil - } else { - err = fmt.Errorf("received failed: %w", err) - } - w.CloseWithError(err) - return - } else if werr != nil { - // Try receive before erroring out - w.CloseWithError(fmt.Errorf("failed to send window update: %w", werr)) - return - } - i, err := typeurl.UnmarshalAny(anyType) - if err != nil { - w.CloseWithError(fmt.Errorf("failed to unmarshal received object: %w", err)) - return - } - switch v := i.(type) { - case *transferapi.Data: - n, err := w.Write(v.Data) - if err != nil { - w.CloseWithError(fmt.Errorf("failed to unmarshal received object: %w", err)) - // Close will error out sender - return - } - window = window - int32(n) - // TODO: Handle error case - default: - log.G(ctx).Warnf("Ignoring unknown stream object of type %T", i) - continue - } - } - - }() - - return r -} - -func GenerateID(prefix string) string { - t := time.Now() - var b [3]byte - rand.Read(b[:]) - return fmt.Sprintf("%s-%d-%s", prefix, t.Nanosecond(), base64.URLEncoding.EncodeToString(b[:])) -} diff --git a/vendor/github.com/containerd/containerd/v2/core/transfer/streaming/writer.go b/vendor/github.com/containerd/containerd/v2/core/transfer/streaming/writer.go deleted file mode 100644 index 77e2437dbd..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/transfer/streaming/writer.go +++ /dev/null @@ -1,130 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package streaming - -import ( - "context" - "errors" - "io" - "sync/atomic" - - transferapi "github.com/containerd/containerd/api/types/transfer" - "github.com/containerd/containerd/v2/core/streaming" - "github.com/containerd/log" - "github.com/containerd/typeurl/v2" -) - -func WriteByteStream(ctx context.Context, stream streaming.Stream) io.WriteCloser { - wbs := &writeByteStream{ - ctx: ctx, - stream: stream, - updated: make(chan struct{}, 1), - } - go func() { - for { - select { - case <-ctx.Done(): - return - default: - } - - anyType, err := stream.Recv() - if err != nil { - if !errors.Is(err, io.EOF) && !errors.Is(err, context.Canceled) { - log.G(ctx).WithError(err).Error("send byte stream ended without EOF") - } - return - } - i, err := typeurl.UnmarshalAny(anyType) - if err != nil { - log.G(ctx).WithError(err).Error("failed to unmarshal stream object") - continue - } - switch v := i.(type) { - case *transferapi.WindowUpdate: - wbs.remaining.Add(v.Update) - select { - case <-ctx.Done(): - return - case wbs.updated <- struct{}{}: - default: - // Don't block if no writes are waiting - } - default: - log.G(ctx).Errorf("unexpected stream object of type %T", i) - } - } - }() - - return wbs -} - -type writeByteStream struct { - ctx context.Context - stream streaming.Stream - remaining atomic.Int32 - updated chan struct{} -} - -func (wbs *writeByteStream) Write(p []byte) (n int, err error) { - for len(p) > 0 { - remaining := wbs.remaining.Load() - if remaining == 0 { - // Don't wait for window update since there are remaining - select { - case <-wbs.ctx.Done(): - // TODO: Send error message on stream before close to allow remote side to return error - err = io.ErrShortWrite - return - case <-wbs.updated: - continue - } - } - var max int32 = maxRead - if max > int32(len(p)) { - max = int32(len(p)) - } - if max > remaining { - max = remaining - } - // TODO: continue - // remaining = remaining - int32(n) - - data := &transferapi.Data{ - Data: p[:max], - } - var anyType typeurl.Any - anyType, err = typeurl.MarshalAny(data) - if err != nil { - log.G(wbs.ctx).WithError(err).Errorf("failed to marshal data for send") - // TODO: Send error message on stream before close to allow remote side to return error - return - } - if err = wbs.stream.Send(anyType); err != nil { - log.G(wbs.ctx).WithError(err).Errorf("send failed") - return - } - n += int(max) - p = p[max:] - wbs.remaining.Add(-1 * max) - } - return -} - -func (wbs *writeByteStream) Close() error { - return wbs.stream.Close() -} diff --git a/vendor/github.com/containerd/containerd/v2/core/transfer/transfer.go b/vendor/github.com/containerd/containerd/v2/core/transfer/transfer.go deleted file mode 100644 index cd4a4963aa..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/transfer/transfer.go +++ /dev/null @@ -1,178 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package transfer - -import ( - "context" - "io" - - "golang.org/x/sync/semaphore" - - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/images" -) - -type Transferrer interface { - Transfer(ctx context.Context, source interface{}, destination interface{}, opts ...Opt) error -} - -type ImageResolver interface { - Resolve(ctx context.Context) (name string, desc ocispec.Descriptor, err error) -} - -type ImageResolverOptionSetter interface { - ImageResolver - SetResolverOptions(opts ...ImageResolverOption) -} - -type ImageResolverOption func(*ImageResolverOptions) - -type ImageResolverOptions struct { - DownloadLimiter *semaphore.Weighted - Performances ImageResolverPerformanceSettings -} - -type ImageResolverPerformanceSettings struct { - MaxConcurrentDownloads int - ConcurrentLayerFetchBuffer int -} - -func WithDownloadLimiter(limiter *semaphore.Weighted) ImageResolverOption { - return func(opts *ImageResolverOptions) { - opts.DownloadLimiter = limiter - } -} - -func WithMaxConcurrentDownloads(maxConcurrentDownloads int) ImageResolverOption { - return func(opts *ImageResolverOptions) { - opts.Performances.MaxConcurrentDownloads = maxConcurrentDownloads - } -} - -func WithConcurrentLayerFetchBuffer(ConcurrentLayerFetchBuffer int) ImageResolverOption { - return func(opts *ImageResolverOptions) { - opts.Performances.ConcurrentLayerFetchBuffer = ConcurrentLayerFetchBuffer - } -} - -type ImageFetcher interface { - ImageResolver - - Fetcher(ctx context.Context, ref string) (Fetcher, error) -} - -type ImagePusher interface { - Pusher(context.Context, ocispec.Descriptor) (Pusher, error) -} - -type Fetcher interface { - Fetch(context.Context, ocispec.Descriptor) (io.ReadCloser, error) -} - -type Pusher interface { - Push(context.Context, ocispec.Descriptor) (content.Writer, error) -} - -// ImageFilterer is used to filter out child objects of an image -type ImageFilterer interface { - ImageFilter(images.HandlerFunc, content.Store) images.HandlerFunc -} - -// ImageStorer is a type which is capable of storing images for -// the provided descriptor. The descriptor may be any type of manifest -// including an index with multiple image references. -type ImageStorer interface { - Store(context.Context, ocispec.Descriptor, images.Store) ([]images.Image, error) -} - -// ImageGetter is type which returns an image from an image store -type ImageGetter interface { - Get(context.Context, images.Store) (images.Image, error) -} - -// ImageLookup is a type which returns images from an image store -// based on names or prefixes -type ImageLookup interface { - Lookup(context.Context, images.Store) ([]images.Image, error) -} - -// ImageExporter exports images to a writer -type ImageExporter interface { - Export(context.Context, content.Store, []images.Image) error -} - -// ImageImporter imports an image into a content store -type ImageImporter interface { - Import(context.Context, content.Store) (ocispec.Descriptor, error) -} - -// ImageImportStreamer returns an import streamer based on OCI or -// Docker image tar archives. The stream should be a raw tar stream -// and without compression. -type ImageImportStreamer interface { - ImportStream(context.Context) (io.Reader, string, error) -} - -type ImageExportStreamer interface { - ExportStream(context.Context) (io.WriteCloser, string, error) -} - -type ImageUnpacker interface { - UnpackPlatforms() []UnpackConfiguration -} - -// ImagePlatformsGetter is type which returns configured platforms. -type ImagePlatformsGetter interface { - Platforms() []ocispec.Platform -} - -// UnpackConfiguration specifies the platform and snapshotter to use for resolving -// the unpack Platform, if snapshotter is not specified the platform default will -// be used. -type UnpackConfiguration struct { - Platform ocispec.Platform - Snapshotter string -} - -type ProgressFunc func(Progress) - -type Config struct { - Progress ProgressFunc -} - -type Opt func(*Config) - -func WithProgress(f ProgressFunc) Opt { - return func(opts *Config) { - opts.Progress = f - } -} - -// Progress is used to represent a particular progress event or incremental -// update for the provided named object. The parents represent the names of -// the objects which initiated the progress for the provided named object. -// The name and what object it represents is determined by the implementation. -type Progress struct { - Event string - Name string - Parents []string - Progress int64 - Total int64 - Desc *ocispec.Descriptor // since containerd v2.0 -} diff --git a/vendor/github.com/containerd/containerd/v2/core/unpack/unpacker.go b/vendor/github.com/containerd/containerd/v2/core/unpack/unpacker.go deleted file mode 100644 index a1c49e23b8..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/unpack/unpacker.go +++ /dev/null @@ -1,599 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package unpack - -import ( - "context" - "crypto/rand" - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "strconv" - "sync" - "sync/atomic" - "time" - - "github.com/containerd/errdefs" - "github.com/containerd/log" - "github.com/containerd/platforms" - "github.com/opencontainers/go-digest" - "github.com/opencontainers/image-spec/identity" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "golang.org/x/sync/errgroup" - "golang.org/x/sync/semaphore" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/diff" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/internal/cleanup" - "github.com/containerd/containerd/v2/internal/kmutex" - "github.com/containerd/containerd/v2/pkg/labels" - "github.com/containerd/containerd/v2/pkg/tracing" -) - -const ( - labelSnapshotRef = "containerd.io/snapshot.ref" - unpackSpanPrefix = "pkg.unpack.unpacker" -) - -// Result returns information about the unpacks which were completed. -type Result struct { - Unpacks int -} - -type unpackerConfig struct { - platforms []*Platform - - content content.Store - - limiter *semaphore.Weighted - duplicationSuppressor kmutex.KeyedLocker -} - -// Platform represents a platform-specific unpack configuration which includes -// the platform matcher as well as snapshotter and applier. -type Platform struct { - Platform platforms.Matcher - - SnapshotterKey string - Snapshotter snapshots.Snapshotter - SnapshotOpts []snapshots.Opt - SnapshotterExports map[string]string - - Applier diff.Applier - ApplyOpts []diff.ApplyOpt - - // ConfigType is the supported config type to be considered for unpacking - // Defaults to OCI image config - ConfigType string - - // LayerTypes are the supported types to be considered layers - // Defaults to OCI image layers - LayerTypes []string -} - -type UnpackerOpt func(*unpackerConfig) error - -func WithUnpackPlatform(u Platform) UnpackerOpt { - return UnpackerOpt(func(c *unpackerConfig) error { - if u.Platform == nil { - u.Platform = platforms.All - } - if u.Snapshotter == nil { - return fmt.Errorf("snapshotter must be provided to unpack") - } - if u.SnapshotterKey == "" { - if s, ok := u.Snapshotter.(fmt.Stringer); ok { - u.SnapshotterKey = s.String() - } else { - u.SnapshotterKey = "unknown" - } - } - if u.Applier == nil { - return fmt.Errorf("applier must be provided to unpack") - } - - c.platforms = append(c.platforms, &u) - - return nil - }) -} - -func WithLimiter(l *semaphore.Weighted) UnpackerOpt { - return UnpackerOpt(func(c *unpackerConfig) error { - c.limiter = l - return nil - }) -} - -func WithDuplicationSuppressor(d kmutex.KeyedLocker) UnpackerOpt { - return UnpackerOpt(func(c *unpackerConfig) error { - c.duplicationSuppressor = d - return nil - }) -} - -// Unpacker unpacks images by hooking into the image handler process. -// Unpacks happen in the backgrounds and waited on to complete. -type Unpacker struct { - unpackerConfig - - unpacks atomic.Int32 - ctx context.Context - eg *errgroup.Group -} - -// NewUnpacker creates a new instance of the unpacker which can be used to wrap an -// image handler and unpack in parallel to handling. The unpacker will handle -// calling the block handlers when they are needed by the unpack process. -func NewUnpacker(ctx context.Context, cs content.Store, opts ...UnpackerOpt) (*Unpacker, error) { - eg, ctx := errgroup.WithContext(ctx) - - u := &Unpacker{ - unpackerConfig: unpackerConfig{ - content: cs, - duplicationSuppressor: kmutex.NewNoop(), - }, - ctx: ctx, - eg: eg, - } - for _, opt := range opts { - if err := opt(&u.unpackerConfig); err != nil { - return nil, err - } - } - if len(u.platforms) == 0 { - return nil, fmt.Errorf("no unpack platforms defined: %w", errdefs.ErrInvalidArgument) - } - return u, nil -} - -// Unpack wraps an image handler to filter out blob handling and scheduling them -// during the unpack process. When an image config is encountered, the unpack -// process will be started in a goroutine. -func (u *Unpacker) Unpack(h images.Handler) images.Handler { - var ( - lock sync.Mutex - layers = map[digest.Digest][]ocispec.Descriptor{} - ) - - var layerTypes map[string]bool - var configTypes map[string]bool - for _, p := range u.platforms { - if p.ConfigType != "" { - if configTypes == nil { - configTypes = make(map[string]bool) - } - configTypes[p.ConfigType] = true - } - if len(p.LayerTypes) > 0 { - if layerTypes == nil { - layerTypes = make(map[string]bool) - } - for _, t := range p.LayerTypes { - layerTypes[t] = true - } - } - } - - return images.HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - ctx, span := tracing.StartSpan(ctx, tracing.Name(unpackSpanPrefix, "UnpackHandler")) - defer span.End() - span.SetAttributes( - tracing.Attribute("descriptor.media.type", desc.MediaType), - tracing.Attribute("descriptor.digest", desc.Digest.String())) - unlock, err := u.lockBlobDescriptor(ctx, desc) - if err != nil { - return nil, err - } - children, err := h.Handle(ctx, desc) - unlock() - if err != nil { - return children, err - } - - if images.IsManifestType(desc.MediaType) { - var nonLayers []ocispec.Descriptor - var manifestLayers []ocispec.Descriptor - // Split layers from non-layers, layers will be handled after - // the config - for i, child := range children { - span.SetAttributes( - tracing.Attribute("descriptor.child."+strconv.Itoa(i), []string{child.MediaType, child.Digest.String()}), - ) - if images.IsLayerType(child.MediaType) || layerTypes[child.MediaType] { - manifestLayers = append(manifestLayers, child) - } else { - nonLayers = append(nonLayers, child) - } - } - - lock.Lock() - for _, nl := range nonLayers { - layers[nl.Digest] = manifestLayers - } - lock.Unlock() - - children = nonLayers - } else if images.IsConfigType(desc.MediaType) || configTypes[desc.MediaType] { - lock.Lock() - l := layers[desc.Digest] - lock.Unlock() - if len(l) > 0 { - u.eg.Go(func() error { - return u.unpack(h, desc, l) - }) - } - } - return children, nil - }) -} - -// Wait waits for any ongoing unpack processes to complete then will return -// the result. -func (u *Unpacker) Wait() (Result, error) { - if err := u.eg.Wait(); err != nil { - return Result{}, err - } - return Result{ - Unpacks: int(u.unpacks.Load()), - }, nil -} - -// unpackConfig is a subset of the OCI config for resolving rootfs and platform, -// any config type which supports the platform and rootfs field can be supported. -type unpackConfig struct { - // Platform describes the platform which the image in the manifest runs on. - ocispec.Platform - - // RootFS references the layer content addresses used by the image. - RootFS ocispec.RootFS `json:"rootfs"` -} - -func (u *Unpacker) unpack( - h images.Handler, - config ocispec.Descriptor, - layers []ocispec.Descriptor, -) error { - ctx := u.ctx - ctx, layerSpan := tracing.StartSpan(ctx, tracing.Name(unpackSpanPrefix, "unpack")) - defer layerSpan.End() - unpackStart := time.Now() - p, err := content.ReadBlob(ctx, u.content, config) - if err != nil { - return err - } - - var i unpackConfig - if err := json.Unmarshal(p, &i); err != nil { - return fmt.Errorf("unmarshal image config: %w", err) - } - - diffIDs := i.RootFS.DiffIDs - if len(layers) != len(diffIDs) { - return fmt.Errorf("number of layers and diffIDs don't match: %d != %d", len(layers), len(diffIDs)) - } - - // TODO: Support multiple unpacks rather than just first match - var unpack *Platform - - imgPlatform := platforms.Normalize(i.Platform) - for _, up := range u.platforms { - if up.ConfigType != "" && up.ConfigType != config.MediaType { - continue - } - // "layers" is only supported rootfs value for OCI images - if (up.ConfigType == "" || images.IsConfigType(up.ConfigType)) && i.RootFS.Type != "" && i.RootFS.Type != "layers" { - continue - } - if up.Platform.Match(imgPlatform) { - unpack = up - break - } - } - - if unpack == nil { - log.G(ctx).WithField("image", config.Digest).WithField("platform", platforms.Format(imgPlatform)).Debugf("unpacker does not support platform, only fetching layers") - return u.fetch(ctx, h, layers, nil) - } - - u.unpacks.Add(1) - - var ( - sn = unpack.Snapshotter - a = unpack.Applier - cs = u.content - - fetchOffset int - fetchC []chan struct{} - fetchErr chan error - ) - - // If there is an early return, ensure any ongoing - // fetches get their context cancelled - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - // pre-calculate chain ids for each layer - chainIDs := make([]digest.Digest, len(diffIDs)) - copy(chainIDs, diffIDs) - chainIDs = identity.ChainIDs(chainIDs) - - doUnpackFn := func(i int, desc ocispec.Descriptor) error { - var parent string - if i > 0 { - parent = chainIDs[i-1].String() - } - chainID := chainIDs[i].String() - - unlock, err := u.lockSnChainID(ctx, chainID, unpack.SnapshotterKey) - if err != nil { - return err - } - defer unlock() - - // inherits annotations which are provided as snapshot labels. - snapshotLabels := snapshots.FilterInheritedLabels(desc.Annotations) - if snapshotLabels == nil { - snapshotLabels = make(map[string]string) - } - snapshotLabels[labelSnapshotRef] = chainID - - var ( - key string - mounts []mount.Mount - opts = append(unpack.SnapshotOpts, snapshots.WithLabels(snapshotLabels)) - ) - - for try := 1; try <= 3; try++ { - // Prepare snapshot with from parent, label as root - key = fmt.Sprintf(snapshots.UnpackKeyFormat, uniquePart(), chainID) - mounts, err = sn.Prepare(ctx, key, parent, opts...) - if err != nil { - if errdefs.IsAlreadyExists(err) { - if _, err := sn.Stat(ctx, chainID); err != nil { - if !errdefs.IsNotFound(err) { - return fmt.Errorf("failed to stat snapshot %s: %w", chainID, err) - } - // Try again, this should be rare, log it - log.G(ctx).WithField("key", key).WithField("chainid", chainID).Debug("extraction snapshot already exists, chain id not found") - } else { - // no need to handle, snapshot now found with chain id - return nil - } - } else { - return fmt.Errorf("failed to prepare extraction snapshot %q: %w", key, err) - } - } else { - break - } - } - if err != nil { - return fmt.Errorf("unable to prepare extraction snapshot: %w", err) - } - - // Abort the snapshot if commit does not happen - abort := func(ctx context.Context) { - if err := sn.Remove(ctx, key); err != nil { - log.G(ctx).WithError(err).Errorf("failed to cleanup %q", key) - } - } - - if fetchErr == nil { - fetchErr = make(chan error, 1) - fetchOffset = i - fetchC = make([]chan struct{}, len(layers)-fetchOffset) - for i := range fetchC { - fetchC[i] = make(chan struct{}) - } - - go func(i int) { - err := u.fetch(ctx, h, layers[i:], fetchC) - if err != nil { - fetchErr <- err - } - close(fetchErr) - }(i) - } - - select { - case <-ctx.Done(): - cleanup.Do(ctx, abort) - return ctx.Err() - case err := <-fetchErr: - if err != nil { - cleanup.Do(ctx, abort) - return err - } - case <-fetchC[i-fetchOffset]: - } - - diff, err := a.Apply(ctx, desc, mounts, unpack.ApplyOpts...) - if err != nil { - cleanup.Do(ctx, abort) - return fmt.Errorf("failed to extract layer %s: %w", diffIDs[i], err) - } - if diff.Digest != diffIDs[i] { - cleanup.Do(ctx, abort) - return fmt.Errorf("wrong diff id calculated on extraction %q", diffIDs[i]) - } - - if err = sn.Commit(ctx, chainID, key, opts...); err != nil { - cleanup.Do(ctx, abort) - if errdefs.IsAlreadyExists(err) { - return nil - } - return fmt.Errorf("failed to commit snapshot %s: %w", key, err) - } - - // Set the uncompressed label after the uncompressed - // digest has been verified through apply. - cinfo := content.Info{ - Digest: desc.Digest, - Labels: map[string]string{ - labels.LabelUncompressed: diff.Digest.String(), - }, - } - if _, err := cs.Update(ctx, cinfo, "labels."+labels.LabelUncompressed); err != nil { - return err - } - return nil - } - - for i, desc := range layers { - _, layerSpan := tracing.StartSpan(ctx, tracing.Name(unpackSpanPrefix, "unpackLayer")) - unpackLayerStart := time.Now() - layerSpan.SetAttributes( - tracing.Attribute("layer.media.type", desc.MediaType), - tracing.Attribute("layer.media.size", desc.Size), - tracing.Attribute("layer.media.digest", desc.Digest.String()), - ) - if err := doUnpackFn(i, desc); err != nil { - layerSpan.SetStatus(err) - layerSpan.End() - return err - } - layerSpan.End() - log.G(ctx).WithFields(log.Fields{ - "layer": desc.Digest, - "duration": time.Since(unpackLayerStart), - }).Debug("layer unpacked") - } - - var chainID string - if len(chainIDs) > 0 { - chainID = chainIDs[len(chainIDs)-1].String() - } - cinfo := content.Info{ - Digest: config.Digest, - Labels: map[string]string{ - fmt.Sprintf("containerd.io/gc.ref.snapshot.%s", unpack.SnapshotterKey): chainID, - }, - } - _, err = cs.Update(ctx, cinfo, fmt.Sprintf("labels.containerd.io/gc.ref.snapshot.%s", unpack.SnapshotterKey)) - if err != nil { - return err - } - log.G(ctx).WithFields(log.Fields{ - "config": config.Digest, - "chainID": chainID, - "duration": time.Since(unpackStart), - }).Debug("image unpacked") - - return nil -} - -func (u *Unpacker) fetch(ctx context.Context, h images.Handler, layers []ocispec.Descriptor, done []chan struct{}) error { - eg, ctx2 := errgroup.WithContext(ctx) - for i, desc := range layers { - ctx2, layerSpan := tracing.StartSpan(ctx2, tracing.Name(unpackSpanPrefix, "fetchLayer")) - layerSpan.SetAttributes( - tracing.Attribute("layer.media.type", desc.MediaType), - tracing.Attribute("layer.media.size", desc.Size), - tracing.Attribute("layer.media.digest", desc.Digest.String()), - ) - var ch chan struct{} - if done != nil { - ch = done[i] - } - - if err := u.acquire(ctx); err != nil { - return err - } - - eg.Go(func() error { - defer layerSpan.End() - - unlock, err := u.lockBlobDescriptor(ctx2, desc) - if err != nil { - u.release() - return err - } - - _, err = h.Handle(ctx2, desc) - - unlock() - u.release() - - if err != nil && !errors.Is(err, images.ErrSkipDesc) { - return err - } - if ch != nil { - close(ch) - } - - return nil - }) - } - - return eg.Wait() -} - -func (u *Unpacker) acquire(ctx context.Context) error { - if u.limiter == nil { - return nil - } - return u.limiter.Acquire(ctx, 1) -} - -func (u *Unpacker) release() { - if u.limiter == nil { - return - } - u.limiter.Release(1) -} - -func (u *Unpacker) lockSnChainID(ctx context.Context, chainID, snapshotter string) (func(), error) { - key := u.makeChainIDKeyWithSnapshotter(chainID, snapshotter) - - if err := u.duplicationSuppressor.Lock(ctx, key); err != nil { - return nil, err - } - return func() { - u.duplicationSuppressor.Unlock(key) - }, nil -} - -func (u *Unpacker) lockBlobDescriptor(ctx context.Context, desc ocispec.Descriptor) (func(), error) { - key := u.makeBlobDescriptorKey(desc) - - if err := u.duplicationSuppressor.Lock(ctx, key); err != nil { - return nil, err - } - return func() { - u.duplicationSuppressor.Unlock(key) - }, nil -} - -func (u *Unpacker) makeChainIDKeyWithSnapshotter(chainID, snapshotter string) string { - return fmt.Sprintf("sn://%s/%v", snapshotter, chainID) -} - -func (u *Unpacker) makeBlobDescriptorKey(desc ocispec.Descriptor) string { - return fmt.Sprintf("blob://%v", desc.Digest) -} - -func uniquePart() string { - t := time.Now() - var b [3]byte - // Ignore read failures, just decreases uniqueness - rand.Read(b[:]) - return fmt.Sprintf("%d-%s", t.Nanosecond(), base64.URLEncoding.EncodeToString(b[:])) -} diff --git a/vendor/github.com/containerd/containerd/v2/defaults/defaults.go b/vendor/github.com/containerd/containerd/v2/defaults/defaults.go deleted file mode 100644 index 6f5b122ecf..0000000000 --- a/vendor/github.com/containerd/containerd/v2/defaults/defaults.go +++ /dev/null @@ -1,32 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package defaults - -const ( - // DefaultMaxRecvMsgSize defines the default maximum message size for - // receiving protobufs passed over the GRPC API. - DefaultMaxRecvMsgSize = 16 << 20 - // DefaultMaxSendMsgSize defines the default maximum message size for - // sending protobufs passed over the GRPC API. - DefaultMaxSendMsgSize = 16 << 20 - // DefaultRuntimeNSLabel defines the namespace label to check for the - // default runtime - DefaultRuntimeNSLabel = "containerd.io/defaults/runtime" - // DefaultSnapshotterNSLabel defines the namespace label to check for the - // default snapshotter - DefaultSnapshotterNSLabel = "containerd.io/defaults/snapshotter" -) diff --git a/vendor/github.com/containerd/containerd/v2/defaults/defaults_darwin.go b/vendor/github.com/containerd/containerd/v2/defaults/defaults_darwin.go deleted file mode 100644 index 192abcdde7..0000000000 --- a/vendor/github.com/containerd/containerd/v2/defaults/defaults_darwin.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package defaults - -const ( - // DefaultRuntime would be a multiple of choices, thus empty - DefaultRuntime = "" -) diff --git a/vendor/github.com/containerd/containerd/v2/defaults/defaults_freebsd.go b/vendor/github.com/containerd/containerd/v2/defaults/defaults_freebsd.go deleted file mode 100644 index d74133012a..0000000000 --- a/vendor/github.com/containerd/containerd/v2/defaults/defaults_freebsd.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package defaults - -const ( - // DefaultRuntime is the default freebsd runtime - DefaultRuntime = "wtf.sbk.runj.v1" -) diff --git a/vendor/github.com/containerd/containerd/v2/defaults/defaults_linux.go b/vendor/github.com/containerd/containerd/v2/defaults/defaults_linux.go deleted file mode 100644 index dc1ff0909c..0000000000 --- a/vendor/github.com/containerd/containerd/v2/defaults/defaults_linux.go +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package defaults - -const ( - // DefaultAddress is the default unix socket address - DefaultAddress = "/run/containerd/containerd.sock" - // DefaultDebugAddress is the default unix socket address for pprof data - DefaultDebugAddress = "/run/containerd/debug.sock" - // DefaultFIFODir is the default location used by client-side cio library - // to store FIFOs. - DefaultFIFODir = "/run/containerd/fifo" - // DefaultRuntime is the default linux runtime - DefaultRuntime = "io.containerd.runc.v2" - // DefaultSnapshotter will set the default snapshotter for the platform. - // This will be based on the client compilation target, so take that into - // account when choosing this value. - DefaultSnapshotter = "overlayfs" - // DefaultStateDir is the default location used by containerd to store - // transient data - DefaultStateDir = "/run/containerd" - // DefaultDiffer will set the default differ for the platform. - DefaultDiffer = "walking" -) diff --git a/vendor/github.com/containerd/containerd/v2/defaults/defaults_unix.go b/vendor/github.com/containerd/containerd/v2/defaults/defaults_unix.go deleted file mode 100644 index 41d00b943d..0000000000 --- a/vendor/github.com/containerd/containerd/v2/defaults/defaults_unix.go +++ /dev/null @@ -1,27 +0,0 @@ -//go:build unix - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package defaults - -const ( - // DefaultConfigDir is the default location for config files. - DefaultConfigDir = "/etc/containerd" - // DefaultRootDir is the default location used by containerd to store - // persistent data - DefaultRootDir = "/var/lib/containerd" -) diff --git a/vendor/github.com/containerd/containerd/v2/defaults/defaults_unix_nolinux.go b/vendor/github.com/containerd/containerd/v2/defaults/defaults_unix_nolinux.go deleted file mode 100644 index 8e263eca6c..0000000000 --- a/vendor/github.com/containerd/containerd/v2/defaults/defaults_unix_nolinux.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build unix && !linux - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package defaults - -const ( - // DefaultAddress is the default unix socket address - DefaultAddress = "/var/run/containerd/containerd.sock" - // DefaultDebugAddress is the default unix socket address for pprof data - DefaultDebugAddress = "/var/run/containerd/debug.sock" - // DefaultFIFODir is the default location used by client-side cio library - // to store FIFOs. - DefaultFIFODir = "/var/run/containerd/fifo" - // DefaultSnapshotter will set the default snapshotter for the platform. - // This will be based on the client compilation target, so take that into - // account when choosing this value. - DefaultSnapshotter = "native" - // DefaultStateDir is the default location used by containerd to store - // transient data - DefaultStateDir = "/var/run/containerd" - // DefaultDiffer will set the default differ for the platform. - DefaultDiffer = "walking" -) diff --git a/vendor/github.com/containerd/containerd/v2/defaults/defaults_windows.go b/vendor/github.com/containerd/containerd/v2/defaults/defaults_windows.go deleted file mode 100644 index 9f01c8fb88..0000000000 --- a/vendor/github.com/containerd/containerd/v2/defaults/defaults_windows.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package defaults - -import ( - "os" - "path/filepath" -) - -var ( - // DefaultRootDir is the default location used by containerd to store - // persistent data - DefaultRootDir = filepath.Join(os.Getenv("ProgramData"), "containerd", "root") - // DefaultStateDir is the default location used by containerd to store - // transient data - DefaultStateDir = filepath.Join(os.Getenv("ProgramData"), "containerd", "state") - - // DefaultConfigDir is the default location for config files. - DefaultConfigDir = filepath.Join(os.Getenv("programfiles"), "containerd") -) - -const ( - // DefaultAddress is the default winpipe address - DefaultAddress = `\\.\pipe\containerd-containerd` - // DefaultDebugAddress is the default winpipe address for pprof data - DefaultDebugAddress = `\\.\pipe\containerd-debug` - // DefaultDiffer will set the default differ for the platform. - // This differ should be compatible with the windows snapshotter. - DefaultDiffer = "windows" - // DefaultFIFODir is the default location used by client-side cio library - // to store FIFOs. Unused on Windows. - DefaultFIFODir = "" - // DefaultRuntime is the default windows runtime - DefaultRuntime = "io.containerd.runhcs.v1" - // DefaultSnapshotter will set the default snapshotter for the platform. - // This will be based on the client compilation target, so take that into - // account when choosing this value. - DefaultSnapshotter = "windows" -) diff --git a/vendor/github.com/containerd/containerd/v2/defaults/doc.go b/vendor/github.com/containerd/containerd/v2/defaults/doc.go deleted file mode 100644 index 6da863ce2e..0000000000 --- a/vendor/github.com/containerd/containerd/v2/defaults/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Package defaults provides several common defaults for interacting with -// containerd. These can be used on the client-side or server-side. -package defaults diff --git a/vendor/github.com/containerd/containerd/v2/internal/cleanup/context.go b/vendor/github.com/containerd/containerd/v2/internal/cleanup/context.go deleted file mode 100644 index 62741c4ca0..0000000000 --- a/vendor/github.com/containerd/containerd/v2/internal/cleanup/context.go +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Package providing utilies to help cleanup -package cleanup - -import ( - "context" - "time" -) - -type clearCancel struct { - context.Context -} - -func (cc clearCancel) Deadline() (deadline time.Time, ok bool) { - return -} - -func (cc clearCancel) Done() <-chan struct{} { - return nil -} - -func (cc clearCancel) Err() error { - return nil -} - -// Background creates a new context which clears out the parent errors -func Background(ctx context.Context) context.Context { - return clearCancel{ctx} -} - -// Do runs the provided function with a context in which the -// errors are cleared out and will timeout after 10 seconds. -func Do(ctx context.Context, do func(context.Context)) { - ctx, cancel := context.WithTimeout(clearCancel{ctx}, 10*time.Second) - do(ctx) - cancel() -} diff --git a/vendor/github.com/containerd/containerd/v2/internal/kmutex/kmutex.go b/vendor/github.com/containerd/containerd/v2/internal/kmutex/kmutex.go deleted file mode 100644 index 74846c0577..0000000000 --- a/vendor/github.com/containerd/containerd/v2/internal/kmutex/kmutex.go +++ /dev/null @@ -1,105 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Package kmutex provides synchronization primitives to lock/unlock resource by unique key. -package kmutex - -import ( - "context" - "fmt" - "sync" - - "golang.org/x/sync/semaphore" -) - -// KeyedLocker is the interface for acquiring locks based on string. -type KeyedLocker interface { - Lock(ctx context.Context, key string) error - Unlock(key string) -} - -func New() KeyedLocker { - return newKeyMutex() -} - -func newKeyMutex() *keyMutex { - return &keyMutex{ - locks: make(map[string]*klock), - } -} - -type keyMutex struct { - mu sync.Mutex - - locks map[string]*klock -} - -type klock struct { - *semaphore.Weighted - ref int -} - -func (km *keyMutex) Lock(ctx context.Context, key string) error { - km.mu.Lock() - - l, ok := km.locks[key] - if !ok { - km.locks[key] = &klock{ - Weighted: semaphore.NewWeighted(1), - } - l = km.locks[key] - } - l.ref++ - km.mu.Unlock() - - if err := l.Acquire(ctx, 1); err != nil { - km.mu.Lock() - defer km.mu.Unlock() - - l.ref-- - - if l.ref < 0 { - panic(fmt.Errorf("kmutex: release of unlocked key %v", key)) - } - - if l.ref == 0 { - delete(km.locks, key) - } - return err - } - return nil -} - -func (km *keyMutex) Unlock(key string) { - km.mu.Lock() - defer km.mu.Unlock() - - l, ok := km.locks[key] - if !ok { - panic(fmt.Errorf("kmutex: unlock of unlocked key %v", key)) - } - l.Release(1) - - l.ref-- - - if l.ref < 0 { - panic(fmt.Errorf("kmutex: released of unlocked key %v", key)) - } - - if l.ref == 0 { - delete(km.locks, key) - } -} diff --git a/vendor/github.com/containerd/containerd/v2/internal/kmutex/noop.go b/vendor/github.com/containerd/containerd/v2/internal/kmutex/noop.go deleted file mode 100644 index 66c46f15ad..0000000000 --- a/vendor/github.com/containerd/containerd/v2/internal/kmutex/noop.go +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package kmutex - -import "context" - -func NewNoop() KeyedLocker { - return &noopMutex{} -} - -type noopMutex struct { -} - -func (*noopMutex) Lock(_ context.Context, _ string) error { - return nil -} - -func (*noopMutex) Unlock(_ string) { -} diff --git a/vendor/github.com/containerd/containerd/v2/internal/userns/idmap.go b/vendor/github.com/containerd/containerd/v2/internal/userns/idmap.go deleted file mode 100644 index 71d3bd89d5..0000000000 --- a/vendor/github.com/containerd/containerd/v2/internal/userns/idmap.go +++ /dev/null @@ -1,175 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* - This file is copied and customized based on - https://github.com/moby/moby/blob/master/pkg/idtools/idtools.go -*/ - -package userns - -import ( - "errors" - "fmt" - "strings" - - "github.com/opencontainers/runtime-spec/specs-go" -) - -const invalidID = 1<<32 - 1 - -var invalidUser = User{Uid: invalidID, Gid: invalidID} - -// User is a Uid and Gid pair of a user -// -//nolint:revive -type User struct { - Uid uint32 - Gid uint32 -} - -// IDMap contains the mappings of Uids and Gids. -// -//nolint:revive -type IDMap struct { - UidMap []specs.LinuxIDMapping `json:"UidMap"` - GidMap []specs.LinuxIDMapping `json:"GidMap"` -} - -// RootPair returns the ID pair for the root user -func (i *IDMap) RootPair() (User, error) { - uid, err := toHost(0, i.UidMap) - if err != nil { - return invalidUser, err - } - gid, err := toHost(0, i.GidMap) - if err != nil { - return invalidUser, err - } - return User{Uid: uid, Gid: gid}, nil -} - -// ToHost returns the host user ID pair for the container ID pair. -func (i *IDMap) ToHost(pair User) (User, error) { - var ( - target User - err error - ) - target.Uid, err = toHost(pair.Uid, i.UidMap) - if err != nil { - return invalidUser, err - } - target.Gid, err = toHost(pair.Gid, i.GidMap) - if err != nil { - return invalidUser, err - } - return target, nil -} - -// Marshal serializes the IDMap object into two strings: -// one uidmap list and another one for gidmap list -func (i *IDMap) Marshal() (string, string) { - marshal := func(mappings []specs.LinuxIDMapping) string { - var arr []string - for _, m := range mappings { - arr = append(arr, serializeLinuxIDMapping(m)) - } - return strings.Join(arr, ",") - } - return marshal(i.UidMap), marshal(i.GidMap) -} - -// Unmarshal deserialize the passed uidmap and gidmap strings -// into a IDMap object. Error is returned in case of failure -func (i *IDMap) Unmarshal(uidMap, gidMap string) error { - unmarshal := func(str string, fn func(m specs.LinuxIDMapping)) error { - if len(str) == 0 { - return nil - } - for _, mapping := range strings.Split(str, ",") { - m, err := deserializeLinuxIDMapping(mapping) - if err != nil { - return err - } - fn(m) - } - return nil - } - if err := unmarshal(uidMap, func(m specs.LinuxIDMapping) { - i.UidMap = append(i.UidMap, m) - }); err != nil { - return err - } - return unmarshal(gidMap, func(m specs.LinuxIDMapping) { - i.GidMap = append(i.GidMap, m) - }) -} - -// toHost takes an id mapping and a remapped ID, and translates the -// ID to the mapped host ID. If no map is provided, then the translation -// assumes a 1-to-1 mapping and returns the passed in id # -func toHost(contID uint32, idMap []specs.LinuxIDMapping) (uint32, error) { - if idMap == nil { - return contID, nil - } - for _, m := range idMap { - high, err := safeSum(m.ContainerID, m.Size) - if err != nil { - break - } - if contID >= m.ContainerID && contID < high { - hostID, err := safeSum(m.HostID, contID-m.ContainerID) - if err != nil || hostID == invalidID { - break - } - return hostID, nil - } - } - return invalidID, fmt.Errorf("container ID %d cannot be mapped to a host ID", contID) -} - -// safeSum returns the sum of x and y. or an error if the result overflows -func safeSum(x, y uint32) (uint32, error) { - z := x + y - if z < x || z < y { - return invalidID, errors.New("ID overflow") - } - return z, nil -} - -// serializeLinuxIDMapping marshals a LinuxIDMapping object to string -func serializeLinuxIDMapping(m specs.LinuxIDMapping) string { - return fmt.Sprintf("%d:%d:%d", m.ContainerID, m.HostID, m.Size) -} - -// deserializeLinuxIDMapping unmarshals a string to a LinuxIDMapping object -func deserializeLinuxIDMapping(str string) (specs.LinuxIDMapping, error) { - var ( - hostID, ctrID, length int64 - ) - _, err := fmt.Sscanf(str, "%d:%d:%d", &ctrID, &hostID, &length) - if err != nil { - return specs.LinuxIDMapping{}, fmt.Errorf("input value %s unparsable: %w", str, err) - } - if ctrID < 0 || ctrID >= invalidID || hostID < 0 || hostID >= invalidID || length < 0 || length >= invalidID { - return specs.LinuxIDMapping{}, fmt.Errorf("invalid mapping \"%s\"", str) - } - return specs.LinuxIDMapping{ - ContainerID: uint32(ctrID), - HostID: uint32(hostID), - Size: uint32(length), - }, nil -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/link_default.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/link_default.go deleted file mode 100644 index 84a8997eb5..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/link_default.go +++ /dev/null @@ -1,25 +0,0 @@ -//go:build !freebsd - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package archive - -import "os" - -func link(oldname, newname string) error { - return os.Link(oldname, newname) -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/link_freebsd.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/link_freebsd.go deleted file mode 100644 index 28251e4709..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/link_freebsd.go +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package archive - -import ( - "os" - - "github.com/containerd/containerd/v2/pkg/sys" - "golang.org/x/sys/unix" -) - -func link(oldname, newname string) error { - e := sys.IgnoringEINTR(func() error { - return unix.Linkat(unix.AT_FDCWD, oldname, unix.AT_FDCWD, newname, 0) - }) - if e != nil { - return &os.LinkError{Op: "link", Old: oldname, New: newname, Err: e} - } - return nil -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/tar.go deleted file mode 100644 index d4cb42213e..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar.go +++ /dev/null @@ -1,817 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package archive - -import ( - "archive/tar" - "context" - "errors" - "fmt" - "io" - "os" - "path/filepath" - "strings" - "sync" - "syscall" - "time" - - "github.com/moby/sys/userns" - - "github.com/containerd/containerd/v2/pkg/archive/tarheader" - "github.com/containerd/containerd/v2/pkg/epoch" - "github.com/containerd/continuity/fs" - "github.com/containerd/log" -) - -var bufPool = &sync.Pool{ - New: func() interface{} { - buffer := make([]byte, 32*1024) - return &buffer - }, -} - -var errInvalidArchive = errors.New("invalid archive") - -// Diff returns a tar stream of the computed filesystem -// difference between the provided directories. -// -// Produces a tar using OCI style file markers for deletions. Deleted -// files will be prepended with the prefix ".wh.". This style is -// based off AUFS whiteouts. -// See https://github.com/opencontainers/image-spec/blob/main/layer.md -func Diff(ctx context.Context, a, b string, opts ...WriteDiffOpt) io.ReadCloser { - r, w := io.Pipe() - - go func() { - err := WriteDiff(ctx, w, a, b, opts...) - if err != nil { - log.G(ctx).WithError(err).Debugf("write diff failed") - } - if err = w.CloseWithError(err); err != nil { - log.G(ctx).WithError(err).Debugf("closing tar pipe failed") - } - }() - - return r -} - -// WriteDiff writes a tar stream of the computed difference between the -// provided paths. -// -// Produces a tar using OCI style file markers for deletions. Deleted -// files will be prepended with the prefix ".wh.". This style is -// based off AUFS whiteouts. -// See https://github.com/opencontainers/image-spec/blob/main/layer.md -func WriteDiff(ctx context.Context, w io.Writer, a, b string, opts ...WriteDiffOpt) error { - var options WriteDiffOptions - for _, opt := range opts { - if err := opt(&options); err != nil { - return fmt.Errorf("failed to apply option: %w", err) - } - } - if tm := epoch.FromContext(ctx); tm != nil && options.SourceDateEpoch == nil { - options.SourceDateEpoch = tm - } - - if options.writeDiffFunc == nil { - options.writeDiffFunc = writeDiffNaive - } - - return options.writeDiffFunc(ctx, w, a, b, options) -} - -// writeDiffNaive writes a tar stream of the computed difference between the -// provided directories on disk. -// -// Produces a tar using OCI style file markers for deletions. Deleted -// files will be prepended with the prefix ".wh.". This style is -// based off AUFS whiteouts. -// See https://github.com/opencontainers/image-spec/blob/main/layer.md -func writeDiffNaive(ctx context.Context, w io.Writer, a, b string, o WriteDiffOptions) error { - var opts []ChangeWriterOpt - if o.SourceDateEpoch != nil { - opts = append(opts, WithModTimeUpperBound(*o.SourceDateEpoch)) - // Since containerd v2.0, the whiteout timestamps are set to zero (1970-01-01), - // not to the source date epoch - } - cw := NewChangeWriter(w, b, opts...) - err := fs.Changes(ctx, a, b, cw.HandleChange) - if err != nil { - return fmt.Errorf("failed to create diff tar stream: %w", err) - } - return cw.Close() -} - -const ( - // whiteoutPrefix prefix means file is a whiteout. If this is followed by a - // filename this means that file has been removed from the base layer. - // See https://github.com/opencontainers/image-spec/blob/main/layer.md#whiteouts - whiteoutPrefix = ".wh." - - // whiteoutMetaPrefix prefix means whiteout has a special meaning and is not - // for removing an actual file. Normally these files are excluded from exported - // archives. - whiteoutMetaPrefix = whiteoutPrefix + whiteoutPrefix - - // whiteoutOpaqueDir file means directory has been made opaque - meaning - // readdir calls to this directory do not follow to lower layers. - whiteoutOpaqueDir = whiteoutMetaPrefix + ".opq" - - paxSchilyXattr = "SCHILY.xattr." - - userXattrPrefix = "user." -) - -// Apply applies a tar stream of an OCI style diff tar. -// See https://github.com/opencontainers/image-spec/blob/main/layer.md#applying-changesets -func Apply(ctx context.Context, root string, r io.Reader, opts ...ApplyOpt) (int64, error) { - root = filepath.Clean(root) - - var options ApplyOptions - for _, opt := range opts { - if err := opt(&options); err != nil { - return 0, fmt.Errorf("failed to apply option: %w", err) - } - } - if options.Filter == nil { - options.Filter = all - } - if options.applyFunc == nil { - options.applyFunc = applyNaive - } - - return options.applyFunc(ctx, root, r, options) -} - -// applyNaive applies a tar stream of an OCI style diff tar to a directory -// applying each file as either a whole file or whiteout. -// See https://github.com/opencontainers/image-spec/blob/main/layer.md#applying-changesets -func applyNaive(ctx context.Context, root string, r io.Reader, options ApplyOptions) (size int64, err error) { - var ( - dirs []*tar.Header - - tr = tar.NewReader(r) - - // Used for handling opaque directory markers which - // may occur out of order - unpackedPaths = make(map[string]struct{}) - - convertWhiteout = options.ConvertWhiteout - ) - - if convertWhiteout == nil { - // handle whiteouts by removing the target files - convertWhiteout = func(hdr *tar.Header, path string) (bool, error) { - base := filepath.Base(path) - dir := filepath.Dir(path) - if base == whiteoutOpaqueDir { - _, err := os.Lstat(dir) - if err != nil { - return false, err - } - err = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { - if err != nil { - if os.IsNotExist(err) { - err = nil // parent was deleted - } - return err - } - if path == dir { - return nil - } - if _, exists := unpackedPaths[path]; !exists { - err := os.RemoveAll(path) - return err - } - return nil - }) - return false, err - } - - if strings.HasPrefix(base, whiteoutPrefix) { - originalBase := base[len(whiteoutPrefix):] - originalPath := filepath.Join(dir, originalBase) - - return false, os.RemoveAll(originalPath) - } - - return true, nil - } - } - - // Iterate through the files in the archive. - for { - select { - case <-ctx.Done(): - return 0, ctx.Err() - default: - } - - hdr, err := tr.Next() - if err == io.EOF { - // end of tar archive - break - } - if err != nil { - return 0, err - } - - size += hdr.Size - - // Normalize name, for safety and for a simple is-root check - hdr.Name = filepath.Clean(hdr.Name) - - accept, err := options.Filter(hdr) - if err != nil { - return 0, err - } - if !accept { - continue - } - - if skipFile(hdr) { - log.G(ctx).Warnf("file %q ignored: archive may not be supported on system", hdr.Name) - continue - } - - // Split name and resolve symlinks for root directory. - ppath, base := filepath.Split(hdr.Name) - ppath, err = fs.RootPath(root, ppath) - if err != nil { - return 0, fmt.Errorf("failed to get root path: %w", err) - } - - // Join to root before joining to parent path to ensure relative links are - // already resolved based on the root before adding to parent. - path := filepath.Join(ppath, filepath.Join("/", base)) - if path == root { - log.G(ctx).Debugf("file %q ignored: resolved to root", hdr.Name) - continue - } - - // If file is not directly under root, ensure parent directory - // exists or is created. - if ppath != root { - parentPath := ppath - if base == "" { - parentPath = filepath.Dir(path) - } - if err := mkparent(ctx, parentPath, root, options.Parents); err != nil { - return 0, err - } - } - - // Naive whiteout convert function which handles whiteout files by - // removing the target files. - if err := validateWhiteout(path); err != nil { - return 0, err - } - writeFile, err := convertWhiteout(hdr, path) - if err != nil { - return 0, fmt.Errorf("failed to convert whiteout file %q: %w", hdr.Name, err) - } - if !writeFile { - continue - } - // If path exits we almost always just want to remove and replace it. - // The only exception is when it is a directory *and* the file from - // the layer is also a directory. Then we want to merge them (i.e. - // just apply the metadata from the layer). - if fi, err := os.Lstat(path); err == nil { - if !(fi.IsDir() && hdr.Typeflag == tar.TypeDir) { - if err := os.RemoveAll(path); err != nil { - return 0, err - } - } - } - - srcData := io.Reader(tr) - srcHdr := hdr - - if err := createTarFile(ctx, path, root, srcHdr, srcData, options.NoSameOwner); err != nil { - return 0, err - } - - // Directory mtimes must be handled at the end to avoid further - // file creation in them to modify the directory mtime - if hdr.Typeflag == tar.TypeDir { - dirs = append(dirs, hdr) - } - unpackedPaths[path] = struct{}{} - } - - for _, hdr := range dirs { - path, err := fs.RootPath(root, hdr.Name) - if err != nil { - return 0, err - } - if err := chtimes(path, boundTime(latestTime(hdr.AccessTime, hdr.ModTime)), boundTime(hdr.ModTime)); err != nil { - return 0, err - } - } - - return size, nil -} - -func createTarFile(ctx context.Context, path, extractDir string, hdr *tar.Header, reader io.Reader, noSameOwner bool) error { - // hdr.Mode is in linux format, which we can use for syscalls, - // but for os.Foo() calls we need the mode converted to os.FileMode, - // so use hdrInfo.Mode() (they differ for e.g. setuid bits) - hdrInfo := hdr.FileInfo() - - switch hdr.Typeflag { - case tar.TypeDir: - // Create directory unless it exists as a directory already. - // In that case we just want to merge the two - if fi, err := os.Lstat(path); !(err == nil && fi.IsDir()) { - if err := mkdir(path, hdrInfo.Mode()); err != nil { - return err - } - } - - //nolint:staticcheck // TypeRegA is deprecated but we may still receive an external tar with TypeRegA - case tar.TypeReg, tar.TypeRegA: - file, err := openFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, hdrInfo.Mode()) - if err != nil { - return err - } - - _, err = copyBuffered(ctx, file, reader) - if err1 := file.Close(); err == nil { - err = err1 - } - if err != nil { - return err - } - - case tar.TypeBlock, tar.TypeChar: - // Handle this is an OS-specific way - if err := handleTarTypeBlockCharFifo(hdr, path); err != nil { - return err - } - - case tar.TypeFifo: - // Handle this is an OS-specific way - if err := handleTarTypeBlockCharFifo(hdr, path); err != nil { - return err - } - - case tar.TypeLink: - targetPath, err := hardlinkRootPath(extractDir, hdr.Linkname) - if err != nil { - return err - } - - if err := link(targetPath, path); err != nil { - return err - } - - case tar.TypeSymlink: - if err := os.Symlink(hdr.Linkname, path); err != nil { - return err - } - - case tar.TypeXGlobalHeader: - log.G(ctx).Debug("PAX Global Extended Headers found and ignored") - return nil - - default: - return fmt.Errorf("unhandled tar header type %d", hdr.Typeflag) - } - - if !noSameOwner { - if err := os.Lchown(path, hdr.Uid, hdr.Gid); err != nil { - err = fmt.Errorf("failed to Lchown %q for UID %d, GID %d: %w", path, hdr.Uid, hdr.Gid, err) - if errors.Is(err, syscall.EINVAL) && userns.RunningInUserNS() { - err = fmt.Errorf("%w (Hint: try increasing the number of subordinate IDs in /etc/subuid and /etc/subgid)", err) - } - return err - } - } - - for key, value := range hdr.PAXRecords { - if strings.HasPrefix(key, paxSchilyXattr) { - key = key[len(paxSchilyXattr):] - if err := setxattr(path, key, value); err != nil { - if errors.Is(err, syscall.EPERM) && strings.HasPrefix(key, userXattrPrefix) { - // In the user.* namespace, only regular files and directories can have extended attributes. - // See https://man7.org/linux/man-pages/man7/xattr.7.html for details. - if fi, err := os.Lstat(path); err == nil && (!fi.Mode().IsRegular() && !fi.Mode().IsDir()) { - log.G(ctx).WithError(err).Warnf("ignored xattr %s in archive", key) - continue - } - } - if errors.Is(err, syscall.ENOTSUP) { - log.G(ctx).WithError(err).Warnf("ignored xattr %s in archive", key) - continue - } - return fmt.Errorf("failed to setxattr %q for key %q: %w", path, key, err) - } - } - } - - // call lchmod after lchown since lchown can modify the file mode - if err := lchmod(path, hdrInfo.Mode()); err != nil { - return err - } - - return chtimes(path, boundTime(latestTime(hdr.AccessTime, hdr.ModTime)), boundTime(hdr.ModTime)) -} - -func mkparent(ctx context.Context, path, root string, parents []string) error { - if dir, err := os.Lstat(path); err == nil { - if dir.IsDir() { - return nil - } - return &os.PathError{ - Op: "mkparent", - Path: path, - Err: syscall.ENOTDIR, - } - } else if !os.IsNotExist(err) { - return err - } - - i := len(path) - for i > len(root) && !os.IsPathSeparator(path[i-1]) { - i-- - } - - if i > len(root)+1 { - if err := mkparent(ctx, path[:i-1], root, parents); err != nil { - return err - } - } - - if err := mkdir(path, 0755); err != nil { - // Check that still doesn't exist - dir, err1 := os.Lstat(path) - if err1 == nil && dir.IsDir() { - return nil - } - return err - } - - for _, p := range parents { - ppath, err := fs.RootPath(p, path[len(root):]) - if err != nil { - return err - } - - dir, err := os.Lstat(ppath) - if err == nil { - if !dir.IsDir() { - // Replaced, do not copy attributes - break - } - if err := copyDirInfo(dir, path); err != nil { - return err - } - return copyUpXAttrs(path, ppath) - } else if !os.IsNotExist(err) { - return err - } - } - - log.G(ctx).Debugf("parent directory %q not found: default permissions(0755) used", path) - - return nil -} - -// ChangeWriter provides tar stream from filesystem change information. -// The privided tar stream is styled as an OCI layer. Change information -// (add/modify/delete/unmodified) for each file needs to be passed to this -// writer through HandleChange method. -// -// This should be used combining with continuity's diff computing functionality -// (e.g. `fs.Change` of github.com/containerd/continuity/fs). -// -// See also https://github.com/opencontainers/image-spec/blob/main/layer.md for details -// about OCI layers -type ChangeWriter struct { - tw *tar.Writer - source string - modTimeUpperBound *time.Time - inodeSrc map[uint64]string - inodeRefs map[uint64][]string - addedDirs map[string]struct{} -} - -// ChangeWriterOpt can be specified in NewChangeWriter. -type ChangeWriterOpt func(cw *ChangeWriter) - -// WithModTimeUpperBound sets the mod time upper bound. -func WithModTimeUpperBound(tm time.Time) ChangeWriterOpt { - return func(cw *ChangeWriter) { - cw.modTimeUpperBound = &tm - } -} - -// NewChangeWriter returns ChangeWriter that writes tar stream of the source directory -// to the privided writer. Change information (add/modify/delete/unmodified) for each -// file needs to be passed through HandleChange method. -func NewChangeWriter(w io.Writer, source string, opts ...ChangeWriterOpt) *ChangeWriter { - cw := &ChangeWriter{ - tw: tar.NewWriter(w), - source: source, - inodeSrc: map[uint64]string{}, - inodeRefs: map[uint64][]string{}, - addedDirs: map[string]struct{}{}, - } - for _, o := range opts { - o(cw) - } - return cw -} - -// HandleChange receives filesystem change information and reflect that information to -// the result tar stream. This function implements `fs.ChangeFunc` of continuity -// (github.com/containerd/continuity/fs) and should be used with that package. -func (cw *ChangeWriter) HandleChange(k fs.ChangeKind, p string, f os.FileInfo, err error) error { - if err != nil { - return err - } - if k == fs.ChangeKindDelete { - whiteOutDir := filepath.Dir(p) - whiteOutBase := filepath.Base(p) - whiteOut := filepath.Join(whiteOutDir, whiteoutPrefix+whiteOutBase) - // Since containerd v2.0, the whiteout timestamps are set to zero (1970-01-01), - // not to the source date epoch. - whiteOutT := time.Unix(0, 0).UTC() - hdr := &tar.Header{ - Typeflag: tar.TypeReg, - Name: whiteOut[1:], - Size: 0, - ModTime: whiteOutT, - AccessTime: whiteOutT, - ChangeTime: whiteOutT, - } - if err := cw.includeParents(hdr); err != nil { - return err - } - if err := cw.tw.WriteHeader(hdr); err != nil { - return fmt.Errorf("failed to write whiteout header: %w", err) - } - } else { - var ( - link string - err error - source = filepath.Join(cw.source, p) - ) - - switch { - case f.Mode()&os.ModeSocket != 0: - return nil // ignore sockets - case f.Mode()&os.ModeSymlink != 0: - if link, err = os.Readlink(source); err != nil { - return err - } - } - - // Use FileInfoHeaderNoLookups to avoid propagating user names and group names from the host - hdr, err := tarheader.FileInfoHeaderNoLookups(f, link) - if err != nil { - return err - } - - hdr.Mode = int64(chmodTarEntry(os.FileMode(hdr.Mode))) - - // truncate timestamp for compatibility. without PAX stdlib rounds timestamps instead - hdr.Format = tar.FormatPAX - if cw.modTimeUpperBound != nil && hdr.ModTime.After(*cw.modTimeUpperBound) { - hdr.ModTime = *cw.modTimeUpperBound - } - hdr.ModTime = hdr.ModTime.Truncate(time.Second) - hdr.AccessTime = time.Time{} - hdr.ChangeTime = time.Time{} - - name := p - if strings.HasPrefix(name, string(filepath.Separator)) { - name, err = filepath.Rel(string(filepath.Separator), name) - if err != nil { - return fmt.Errorf("failed to make path relative: %w", err) - } - } - // Canonicalize to POSIX-style paths using forward slashes. Directory - // entries must end with a slash. - name = filepath.ToSlash(name) - if f.IsDir() && !strings.HasSuffix(name, "/") { - name += "/" - } - hdr.Name = name - - if err := setHeaderForSpecialDevice(hdr, name, f); err != nil { - return fmt.Errorf("failed to set device headers: %w", err) - } - - // additionalLinks stores file names which must be linked to - // this file when this file is added - var additionalLinks []string - inode, isHardlink := fs.GetLinkInfo(f) - if isHardlink { - // If the inode has a source, always link to it - if source, ok := cw.inodeSrc[inode]; ok { - hdr.Typeflag = tar.TypeLink - hdr.Linkname = source - hdr.Size = 0 - } else { - if k == fs.ChangeKindUnmodified { - cw.inodeRefs[inode] = append(cw.inodeRefs[inode], name) - return nil - } - cw.inodeSrc[inode] = name - additionalLinks = cw.inodeRefs[inode] - delete(cw.inodeRefs, inode) - } - } else if k == fs.ChangeKindUnmodified { - // Nothing to write to diff - return nil - } - - if capability, err := getxattr(source, "security.capability"); err != nil { - return fmt.Errorf("failed to get capabilities xattr: %w", err) - } else if len(capability) > 0 { - if hdr.PAXRecords == nil { - hdr.PAXRecords = map[string]string{} - } - hdr.PAXRecords[paxSchilyXattr+"security.capability"] = string(capability) - } - - if err := cw.includeParents(hdr); err != nil { - return err - } - if err := cw.tw.WriteHeader(hdr); err != nil { - return fmt.Errorf("failed to write file header: %w", err) - } - - if hdr.Typeflag == tar.TypeReg && hdr.Size > 0 { - file, err := open(source) - if err != nil { - return fmt.Errorf("failed to open path: %v: %w", source, err) - } - defer file.Close() - - n, err := copyBuffered(context.TODO(), cw.tw, file) - if err != nil { - return fmt.Errorf("failed to copy: %v: %w", source, err) - } - if n != hdr.Size { - return errors.New("short write copying file") - } - } - - if additionalLinks != nil { - source = hdr.Name - for _, extra := range additionalLinks { - hdr.Name = extra - hdr.Typeflag = tar.TypeLink - hdr.Linkname = source - hdr.Size = 0 - - if err := cw.includeParents(hdr); err != nil { - return err - } - if err := cw.tw.WriteHeader(hdr); err != nil { - return fmt.Errorf("failed to write file header: %w", err) - } - } - } - } - return nil -} - -// Close closes this writer. -func (cw *ChangeWriter) Close() error { - if err := cw.tw.Close(); err != nil { - return fmt.Errorf("failed to close tar writer: %w", err) - } - return nil -} - -func (cw *ChangeWriter) includeParents(hdr *tar.Header) error { - if cw.addedDirs == nil { - return nil - } - name := strings.TrimRight(hdr.Name, "/") - fname := filepath.Join(cw.source, name) - parent := filepath.Dir(name) - pname := filepath.Join(cw.source, parent) - - // Do not include root directory as parent - if fname != cw.source && pname != cw.source { - _, ok := cw.addedDirs[parent] - if !ok { - cw.addedDirs[parent] = struct{}{} - fi, err := os.Stat(pname) - if err != nil { - return err - } - if err := cw.HandleChange(fs.ChangeKindModify, parent, fi, nil); err != nil { - return err - } - } - } - if hdr.Typeflag == tar.TypeDir { - cw.addedDirs[name] = struct{}{} - } - return nil -} - -func copyBuffered(ctx context.Context, dst io.Writer, src io.Reader) (written int64, err error) { - buf := bufPool.Get().(*[]byte) - defer bufPool.Put(buf) - - for { - select { - case <-ctx.Done(): - err = ctx.Err() - return - default: - } - - nr, er := src.Read(*buf) - if nr > 0 { - nw, ew := dst.Write((*buf)[0:nr]) - if nw > 0 { - written += int64(nw) - } - if ew != nil { - err = ew - break - } - if nr != nw { - err = io.ErrShortWrite - break - } - } - if er != nil { - if er != io.EOF { - err = er - } - break - } - } - return written, err - -} - -// hardlinkRootPath returns target linkname, evaluating and bounding any -// symlink to the parent directory. -// -// NOTE: Allow hardlink to the softlink, not the real one. For example, -// -// touch /tmp/zzz -// ln -s /tmp/zzz /tmp/xxx -// ln /tmp/xxx /tmp/yyy -// -// /tmp/yyy should be softlink which be same of /tmp/xxx, not /tmp/zzz. -func hardlinkRootPath(root, linkname string) (string, error) { - ppath, base := filepath.Split(linkname) - ppath, err := fs.RootPath(root, ppath) - if err != nil { - return "", err - } - - targetPath := filepath.Join(ppath, base) - if !strings.HasPrefix(targetPath, root) { - targetPath = root - } - return targetPath, nil -} - -func validateWhiteout(path string) error { - base := filepath.Base(path) - dir := filepath.Dir(path) - - if base == whiteoutOpaqueDir { - return nil - } - - if strings.HasPrefix(base, whiteoutPrefix) { - originalBase := base[len(whiteoutPrefix):] - originalPath := filepath.Join(dir, originalBase) - - // Ensure originalPath is under dir - if dir[len(dir)-1] != filepath.Separator { - dir += string(filepath.Separator) - } - if !strings.HasPrefix(originalPath, dir) { - return fmt.Errorf("invalid whiteout name: %v: %w", base, errInvalidArchive) - } - } - return nil -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_freebsd.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_freebsd.go deleted file mode 100644 index fb5abff0ec..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_freebsd.go +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package archive - -import ( - "os" - - "golang.org/x/sys/unix" -) - -// mknod wraps unix.Mknod. FreeBSD's unix.Mknod signature is different from -// other Unix and Unix-like operating systems. -func mknod(path string, mode uint32, dev uint64) error { - return unix.Mknod(path, mode, dev) -} - -// lsetxattrCreate wraps unix.Lsetxattr with FreeBSD-specific flags and errors -func lsetxattrCreate(link string, attr string, data []byte) error { - err := unix.Lsetxattr(link, attr, data, 0) - if err == unix.ENOTSUP || err == unix.EEXIST { - return nil - } - return err -} - -func lchmod(path string, mode os.FileMode) error { - err := unix.Fchmodat(unix.AT_FDCWD, path, uint32(mode), unix.AT_SYMLINK_NOFOLLOW) - if err != nil { - err = &os.PathError{Op: "lchmod", Path: path, Err: err} - } - return err -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_mostunix.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_mostunix.go deleted file mode 100644 index ca5e602a03..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_mostunix.go +++ /dev/null @@ -1,55 +0,0 @@ -//go:build !windows && !freebsd - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package archive - -import ( - "os" - - "golang.org/x/sys/unix" -) - -// mknod wraps Unix.Mknod and casts dev to int -func mknod(path string, mode uint32, dev uint64) error { - return unix.Mknod(path, mode, int(dev)) -} - -// lsetxattrCreate wraps unix.Lsetxattr, passes the unix.XATTR_CREATE flag on -// supported operating systems,and ignores appropriate errors -func lsetxattrCreate(link string, attr string, data []byte) error { - err := unix.Lsetxattr(link, attr, data, unix.XATTR_CREATE) - if err == unix.ENOTSUP || err == unix.ENODATA || err == unix.EEXIST { - return nil - } - return err -} - -// lchmod checks for symlink and changes the mode if not a symlink -func lchmod(path string, mode os.FileMode) error { - fi, err := os.Lstat(path) - if err != nil { - return err - } - - if fi.Mode()&os.ModeSymlink == 0 { - if err := os.Chmod(path, mode); err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_opts.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_opts.go deleted file mode 100644 index ac3a03c8d4..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_opts.go +++ /dev/null @@ -1,111 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package archive - -import ( - "archive/tar" - "context" - "io" - "time" -) - -// ApplyOptions provides additional options for an Apply operation -type ApplyOptions struct { - Filter Filter // Filter tar headers - ConvertWhiteout ConvertWhiteout // Convert whiteout files - Parents []string // Parent directories to handle inherited attributes without CoW - NoSameOwner bool // NoSameOwner will not attempt to preserve the owner specified in the tar archive. - - applyFunc func(context.Context, string, io.Reader, ApplyOptions) (int64, error) -} - -// ApplyOpt allows setting mutable archive apply properties on creation -type ApplyOpt func(options *ApplyOptions) error - -// Filter specific files from the archive -type Filter func(*tar.Header) (bool, error) - -// ConvertWhiteout converts whiteout files from the archive -type ConvertWhiteout func(*tar.Header, string) (bool, error) - -// all allows all files -func all(_ *tar.Header) (bool, error) { - return true, nil -} - -// WithFilter uses the filter to select which files are to be extracted. -func WithFilter(f Filter) ApplyOpt { - return func(options *ApplyOptions) error { - options.Filter = f - return nil - } -} - -// WithConvertWhiteout uses the convert function to convert the whiteout files. -func WithConvertWhiteout(c ConvertWhiteout) ApplyOpt { - return func(options *ApplyOptions) error { - options.ConvertWhiteout = c - return nil - } -} - -// WithNoSameOwner is same as '--no-same-owner` in 'tar' command. -// It'll skip attempt to preserve the owner specified in the tar archive. -func WithNoSameOwner() ApplyOpt { - return func(options *ApplyOptions) error { - options.NoSameOwner = true - return nil - } -} - -// WithParents provides parent directories for resolving inherited attributes -// directory from the filesystem. -// Inherited attributes are searched from first to last, making the first -// element in the list the most immediate parent directory. -// NOTE: When applying to a filesystem which supports CoW, file attributes -// should be inherited by the filesystem. -func WithParents(p []string) ApplyOpt { - return func(options *ApplyOptions) error { - options.Parents = p - return nil - } -} - -// WriteDiffOptions provides additional options for a WriteDiff operation -type WriteDiffOptions struct { - ParentLayers []string // Windows needs the full list of parent layers - - writeDiffFunc func(context.Context, io.Writer, string, string, WriteDiffOptions) error - - // SourceDateEpoch specifies the following timestamps to provide control for reproducibility. - // - The upper bound timestamp of the diff contents - // - The timestamp of the whiteouts - // - // See also https://reproducible-builds.org/docs/source-date-epoch/ . - SourceDateEpoch *time.Time -} - -// WriteDiffOpt allows setting mutable archive write properties on creation -type WriteDiffOpt func(options *WriteDiffOptions) error - -// WithSourceDateEpoch specifies the SOURCE_DATE_EPOCH without touching the env vars. -func WithSourceDateEpoch(tm *time.Time) WriteDiffOpt { - return func(options *WriteDiffOptions) error { - options.SourceDateEpoch = tm - return nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_opts_linux.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_opts_linux.go deleted file mode 100644 index e400dd40ec..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_opts_linux.go +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package archive - -import ( - "archive/tar" - "os" - "path/filepath" - "strings" - - "golang.org/x/sys/unix" -) - -// OverlayConvertWhiteout converts whiteout files for overlay. -func OverlayConvertWhiteout(hdr *tar.Header, path string) (bool, error) { - base := filepath.Base(path) - dir := filepath.Dir(path) - - // if a directory is marked as opaque, we need to translate that to overlay - if base == whiteoutOpaqueDir { - // don't write the file itself - return false, unix.Setxattr(dir, "trusted.overlay.opaque", []byte{'y'}, 0) - } - - // if a file was deleted and we are using overlay, we need to create a character device - if strings.HasPrefix(base, whiteoutPrefix) { - originalBase := base[len(whiteoutPrefix):] - originalPath := filepath.Join(dir, originalBase) - - if err := unix.Mknod(originalPath, unix.S_IFCHR, 0); err != nil { - return false, err - } - // don't write the file itself - return false, os.Chown(originalPath, hdr.Uid, hdr.Gid) - } - - return true, nil -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_opts_windows.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_opts_windows.go deleted file mode 100644 index 567a3c3520..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_opts_windows.go +++ /dev/null @@ -1,79 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package archive - -import ( - "context" - "io" - - "github.com/Microsoft/go-winio" - "github.com/Microsoft/hcsshim/pkg/ociwclayer" -) - -// applyWindowsLayer applies a tar stream of an OCI style diff tar of a Windows layer -// See https://github.com/opencontainers/image-spec/blob/main/layer.md#applying-changesets -func applyWindowsLayer(ctx context.Context, root string, r io.Reader, options ApplyOptions) (size int64, err error) { - // It seems that in certain situations, like having the containerd root and state on a file system hosted on a - // mounted VHDX, we need SeSecurityPrivilege when opening a file with winio.ACCESS_SYSTEM_SECURITY. This happens - // in the base layer writer in hcsshim when adding a new file. - err = winio.RunWithPrivileges([]string{winio.SeSecurityPrivilege}, func() error { - var innerErr error - size, innerErr = ociwclayer.ImportLayerFromTar(ctx, r, root, options.Parents) - return innerErr - }) - return -} - -// AsWindowsContainerLayer indicates that the tar stream to apply is that of -// a Windows Container Layer. The caller must be holding SeBackupPrivilege and -// SeRestorePrivilege. -func AsWindowsContainerLayer() ApplyOpt { - return func(options *ApplyOptions) error { - options.applyFunc = applyWindowsLayer - return nil - } -} - -// writeDiffWindowsLayers writes a tar stream of the computed difference between the -// provided Windows layers -// -// Produces a tar using OCI style file markers for deletions. Deleted -// files will be prepended with the prefix ".wh.". This style is -// based off AUFS whiteouts. -// See https://github.com/opencontainers/image-spec/blob/main/layer.md -func writeDiffWindowsLayers(ctx context.Context, w io.Writer, _, layer string, options WriteDiffOptions) error { - return ociwclayer.ExportLayerToTar(ctx, w, layer, options.ParentLayers) -} - -// AsWindowsContainerLayerPair indicates that the paths to diff are a pair of -// Windows Container Layers. The caller must be holding SeBackupPrivilege. -func AsWindowsContainerLayerPair() WriteDiffOpt { - return func(options *WriteDiffOptions) error { - options.writeDiffFunc = writeDiffWindowsLayers - return nil - } -} - -// WithParentLayers provides the Windows Container Layers that are the parents -// of the target (right-hand, "upper") layer, if any. The source (left-hand, "lower") -// layer passed to WriteDiff should be "" in this case. -func WithParentLayers(p []string) WriteDiffOpt { - return func(options *WriteDiffOptions) error { - options.ParentLayers = p - return nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_unix.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_unix.go deleted file mode 100644 index fa61100609..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_unix.go +++ /dev/null @@ -1,203 +0,0 @@ -//go:build !windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package archive - -import ( - "archive/tar" - "errors" - "fmt" - "os" - "runtime" - "strings" - "syscall" - - "github.com/moby/sys/userns" - "golang.org/x/sys/unix" - - "github.com/containerd/continuity/fs" - "github.com/containerd/continuity/sysx" -) - -func chmodTarEntry(perm os.FileMode) os.FileMode { - return perm -} - -func setHeaderForSpecialDevice(hdr *tar.Header, name string, fi os.FileInfo) error { - // Devmajor and Devminor are only needed for special devices. - - // In FreeBSD, RDev for regular files is -1 (unless overridden by FS): - // https://cgit.freebsd.org/src/tree/sys/kern/vfs_default.c?h=stable/13#n1531 - // (NODEV is -1: https://cgit.freebsd.org/src/tree/sys/sys/param.h?h=stable/13#n241). - - // ZFS in particular does not override the default: - // https://cgit.freebsd.org/src/tree/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c?h=stable/13#n2027 - - // Since `Stat_t.Rdev` is uint64, the cast turns -1 into (2^64 - 1). - // Such large values cannot be encoded in a tar header. - if runtime.GOOS == "freebsd" && hdr.Typeflag != tar.TypeBlock && hdr.Typeflag != tar.TypeChar { - return nil - } - s, ok := fi.Sys().(*syscall.Stat_t) - if !ok { - return errors.New("unsupported stat type") - } - - rdev := uint64(s.Rdev) //nolint:nolintlint,unconvert // rdev is int32 on darwin/bsd, int64 on linux/solaris - - // Currently go does not fill in the major/minors - if s.Mode&syscall.S_IFBLK != 0 || - s.Mode&syscall.S_IFCHR != 0 { - hdr.Devmajor = int64(unix.Major(rdev)) - hdr.Devminor = int64(unix.Minor(rdev)) - } - - return nil -} - -func open(p string) (*os.File, error) { - return os.Open(p) -} - -func openFile(name string, flag int, perm os.FileMode) (*os.File, error) { - f, err := os.OpenFile(name, flag, perm) - if err != nil { - return nil, err - } - // Call chmod to avoid permission mask - if err := os.Chmod(name, perm); err != nil { - f.Close() - return nil, err - } - return f, err -} - -func mkdir(path string, perm os.FileMode) error { - if err := os.Mkdir(path, perm); err != nil { - return err - } - // Only final created directory gets explicit permission - // call to avoid permission mask - return os.Chmod(path, perm) -} - -func skipFile(hdr *tar.Header) bool { - switch hdr.Typeflag { - case tar.TypeBlock, tar.TypeChar: - // cannot create a device if running in user namespace - return userns.RunningInUserNS() - default: - return false - } -} - -// handleTarTypeBlockCharFifo is an OS-specific helper function used by -// createTarFile to handle the following types of header: Block; Char; Fifo. -// This function must not be called for Block and Char when running in userns. -// (skipFile() should return true for them.) -func handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error { - mode := uint32(hdr.Mode & 07777) - switch hdr.Typeflag { - case tar.TypeBlock: - mode |= unix.S_IFBLK - case tar.TypeChar: - mode |= unix.S_IFCHR - case tar.TypeFifo: - mode |= unix.S_IFIFO - } - - return mknod(path, mode, unix.Mkdev(uint32(hdr.Devmajor), uint32(hdr.Devminor))) -} - -func getxattr(path, attr string) ([]byte, error) { - b, err := sysx.LGetxattr(path, attr) - if err == unix.ENOTSUP || err == sysx.ENODATA { - return nil, nil - } - return b, err -} - -func setxattr(path, key, value string) error { - // Do not set trusted attributes - if strings.HasPrefix(key, "trusted.") { - return fmt.Errorf("admin attributes from archive not supported: %w", unix.ENOTSUP) - } - return unix.Lsetxattr(path, key, []byte(value), 0) -} - -func copyDirInfo(fi os.FileInfo, path string) error { - st := fi.Sys().(*syscall.Stat_t) - if err := os.Lchown(path, int(st.Uid), int(st.Gid)); err != nil { - if os.IsPermission(err) { - // Normally if uid/gid are the same this would be a no-op, but some - // filesystems may still return EPERM... for instance NFS does this. - // In such a case, this is not an error. - if dstStat, err2 := os.Lstat(path); err2 == nil { - st2 := dstStat.Sys().(*syscall.Stat_t) - if st.Uid == st2.Uid && st.Gid == st2.Gid { - err = nil - } - } - } - if err != nil { - return fmt.Errorf("failed to chown %s: %w", path, err) - } - } - - if err := os.Chmod(path, fi.Mode()); err != nil { - return fmt.Errorf("failed to chmod %s: %w", path, err) - } - - timespec := []unix.Timespec{ - unix.NsecToTimespec(syscall.TimespecToNsec(fs.StatAtime(st))), - unix.NsecToTimespec(syscall.TimespecToNsec(fs.StatMtime(st))), - } - if err := unix.UtimesNanoAt(unix.AT_FDCWD, path, timespec, unix.AT_SYMLINK_NOFOLLOW); err != nil { - return fmt.Errorf("failed to utime %s: %w", path, err) - } - - return nil -} - -func copyUpXAttrs(dst, src string) error { - xattrKeys, err := sysx.LListxattr(src) - if err != nil { - if err == unix.ENOTSUP || err == sysx.ENODATA { - return nil - } - return fmt.Errorf("failed to list xattrs on %s: %w", src, err) - } - for _, xattr := range xattrKeys { - // Do not copy up trusted attributes - if strings.HasPrefix(xattr, "trusted.") { - continue - } - data, err := sysx.LGetxattr(src, xattr) - if err != nil { - if err == unix.ENOTSUP || err == sysx.ENODATA { - continue - } - return fmt.Errorf("failed to get xattr %q on %s: %w", xattr, src, err) - } - if err := lsetxattrCreate(dst, xattr, data); err != nil { - return fmt.Errorf("failed to set xattr %q on %s: %w", xattr, dst, err) - } - } - - return nil -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_windows.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_windows.go deleted file mode 100644 index dc8f64ee41..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_windows.go +++ /dev/null @@ -1,107 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package archive - -import ( - "archive/tar" - "errors" - "fmt" - "os" - "strings" - - "github.com/moby/sys/sequential" -) - -// chmodTarEntry is used to adjust the file permissions used in tar header based -// on the platform the archival is done. -func chmodTarEntry(perm os.FileMode) os.FileMode { - perm &= 0755 - // Add the x bit: make everything +x from windows - perm |= 0111 - - return perm -} - -func setHeaderForSpecialDevice(*tar.Header, string, os.FileInfo) error { - // do nothing. no notion of Rdev, Inode, Nlink in stat on Windows - return nil -} - -func open(p string) (*os.File, error) { - // We use sequential file access to avoid depleting the standby list on - // Windows. - return sequential.Open(p) -} - -func openFile(name string, flag int, perm os.FileMode) (*os.File, error) { - // Source is regular file. We use sequential file access to avoid depleting - // the standby list on Windows. - return sequential.OpenFile(name, flag, perm) -} - -func mkdir(path string, perm os.FileMode) error { - return os.Mkdir(path, perm) -} - -func skipFile(hdr *tar.Header) bool { - // Windows does not support filenames with colons in them. Ignore - // these files. This is not a problem though (although it might - // appear that it is). Let's suppose a client is running docker pull. - // The daemon it points to is Windows. Would it make sense for the - // client to be doing a docker pull Ubuntu for example (which has files - // with colons in the name under /usr/share/man/man3)? No, absolutely - // not as it would really only make sense that they were pulling a - // Windows image. However, for development, it is necessary to be able - // to pull Linux images which are in the repository. - // - // TODO Windows. Once the registry is aware of what images are Windows- - // specific or Linux-specific, this warning should be changed to an error - // to cater for the situation where someone does manage to upload a Linux - // image but have it tagged as Windows inadvertently. - return strings.Contains(hdr.Name, ":") -} - -// handleTarTypeBlockCharFifo is an OS-specific helper function used by -// createTarFile to handle the following types of header: Block; Char; Fifo -func handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error { - return nil -} - -func lchmod(path string, mode os.FileMode) error { - return nil -} - -func getxattr(path, attr string) ([]byte, error) { - return nil, nil -} - -func setxattr(path, key, value string) error { - // Return not support error, do not wrap underlying not supported - // since xattrs should not exist in windows diff archives - return errors.New("xattrs not supported on Windows") -} - -func copyDirInfo(fi os.FileInfo, path string) error { - if err := os.Chmod(path, fi.Mode()); err != nil { - return fmt.Errorf("failed to chmod %s: %w", path, err) - } - return nil -} - -func copyUpXAttrs(dst, src string) error { - return nil -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/tarheader/tarheader.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/tarheader/tarheader.go deleted file mode 100644 index 2f93842c19..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/tarheader/tarheader.go +++ /dev/null @@ -1,82 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* - Portions from https://github.com/moby/moby/blob/v23.0.1/pkg/archive/archive.go#L419-L464 - Copyright (C) Docker/Moby authors. - Licensed under the Apache License, Version 2.0 - NOTICE: https://github.com/moby/moby/blob/v23.0.1/NOTICE -*/ - -package tarheader - -import ( - "archive/tar" - "os" -) - -// nosysFileInfo hides the system-dependent info of the wrapped FileInfo to -// prevent tar.FileInfoHeader from introspecting it and potentially calling into -// glibc. -// -// From https://github.com/moby/moby/blob/v23.0.1/pkg/archive/archive.go#L419-L434 . -type nosysFileInfo struct { - os.FileInfo -} - -func (fi nosysFileInfo) Sys() interface{} { - // A Sys value of type *tar.Header is safe as it is system-independent. - // The tar.FileInfoHeader function copies the fields into the returned - // header without performing any OS lookups. - if sys, ok := fi.FileInfo.Sys().(*tar.Header); ok { - return sys - } - return nil -} - -// sysStat, if non-nil, populates hdr from system-dependent fields of fi. -// -// From https://github.com/moby/moby/blob/v23.0.1/pkg/archive/archive.go#L436-L437 . -var sysStat func(fi os.FileInfo, hdr *tar.Header) error - -// FileInfoHeaderNoLookups creates a partially-populated tar.Header from fi. -// -// Compared to the archive/tar.FileInfoHeader function, this function is safe to -// call from a chrooted process as it does not populate fields which would -// require operating system lookups. It behaves identically to -// tar.FileInfoHeader when fi is a FileInfo value returned from -// tar.Header.FileInfo(). -// -// When fi is a FileInfo for a native file, such as returned from os.Stat() and -// os.Lstat(), the returned Header value differs from one returned from -// tar.FileInfoHeader in the following ways. The Uname and Gname fields are not -// set as OS lookups would be required to populate them. The AccessTime and -// ChangeTime fields are not currently set (not yet implemented) although that -// is subject to change. Callers which require the AccessTime or ChangeTime -// fields to be zeroed should explicitly zero them out in the returned Header -// value to avoid any compatibility issues in the future. -// -// From https://github.com/moby/moby/blob/v23.0.1/pkg/archive/archive.go#L439-L464 . -func FileInfoHeaderNoLookups(fi os.FileInfo, link string) (*tar.Header, error) { - hdr, err := tar.FileInfoHeader(nosysFileInfo{fi}, link) - if err != nil { - return nil, err - } - if sysStat != nil { - return hdr, sysStat(fi, hdr) - } - return hdr, nil -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/tarheader/tarheader_unix.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/tarheader/tarheader_unix.go deleted file mode 100644 index e9e2ea3745..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/tarheader/tarheader_unix.go +++ /dev/null @@ -1,75 +0,0 @@ -//go:build !windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* - Portions from https://github.com/moby/moby/blob/v23.0.1/pkg/archive/archive_unix.go#L52-L70 - Copyright (C) Docker/Moby authors. - Licensed under the Apache License, Version 2.0 - NOTICE: https://github.com/moby/moby/blob/v23.0.1/NOTICE -*/ - -package tarheader - -import ( - "archive/tar" - "os" - "runtime" - "syscall" - - "golang.org/x/sys/unix" -) - -func init() { - sysStat = statUnix -} - -// statUnix populates hdr from system-dependent fields of fi without performing -// any OS lookups. -// From https://github.com/moby/moby/blob/2cccb1f02c83aaacef3c15fa43f3b64d57f315f8/pkg/archive/archive_unix.go#L46-L76 -func statUnix(fi os.FileInfo, hdr *tar.Header) error { - s, ok := fi.Sys().(*syscall.Stat_t) - if !ok { - return nil - } - - hdr.Uid = int(s.Uid) - hdr.Gid = int(s.Gid) - - // Devmajor and Devminor are only needed for special devices. - - // In FreeBSD, RDev for regular files is -1 (unless overridden by FS): - // https://cgit.freebsd.org/src/tree/sys/kern/vfs_default.c?h=stable/13#n1531 - // (NODEV is -1: https://cgit.freebsd.org/src/tree/sys/sys/param.h?h=stable/13#n241). - - // ZFS in particular does not override the default: - // https://cgit.freebsd.org/src/tree/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c?h=stable/13#n2027 - - // Since `Stat_t.Rdev` is uint64, the cast turns -1 into (2^64 - 1). - // Such large values cannot be encoded in a tar header. - if runtime.GOOS == "freebsd" && hdr.Typeflag != tar.TypeBlock && hdr.Typeflag != tar.TypeChar { - return nil - } - - if s.Mode&unix.S_IFBLK != 0 || - s.Mode&unix.S_IFCHR != 0 { - hdr.Devmajor = int64(unix.Major(uint64(s.Rdev))) - hdr.Devminor = int64(unix.Minor(uint64(s.Rdev))) - } - - return nil -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/time.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/time.go deleted file mode 100644 index 16651a4d05..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/time.go +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package archive - -import ( - "syscall" - "time" - "unsafe" -) - -var ( - minTime = time.Unix(0, 0) - maxTime time.Time -) - -func init() { - if unsafe.Sizeof(syscall.Timespec{}.Nsec) == 8 { - // This is a 64 bit timespec - // os.Chtimes limits time to the following - maxTime = time.Unix(0, 1<<63-1) - } else { - // This is a 32 bit timespec - maxTime = time.Unix(1<<31-1, 0) - } -} - -func boundTime(t time.Time) time.Time { - if t.Before(minTime) || t.After(maxTime) { - return minTime - } - - return t -} - -func latestTime(t1, t2 time.Time) time.Time { - if t1.Before(t2) { - return t2 - } - return t1 -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/time_unix.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/time_unix.go deleted file mode 100644 index b5a10d528f..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/time_unix.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build !windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package archive - -import ( - "fmt" - "time" - - "golang.org/x/sys/unix" -) - -func chtimes(path string, atime, mtime time.Time) error { - var utimes [2]unix.Timespec - utimes[0] = unix.NsecToTimespec(atime.UnixNano()) - utimes[1] = unix.NsecToTimespec(mtime.UnixNano()) - - if err := unix.UtimesNanoAt(unix.AT_FDCWD, path, utimes[0:], unix.AT_SYMLINK_NOFOLLOW); err != nil { - return fmt.Errorf("failed call to UtimesNanoAt for %s: %w", path, err) - } - - return nil -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/time_windows.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/time_windows.go deleted file mode 100644 index d906a3e5e7..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/time_windows.go +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package archive - -import ( - "time" - - "golang.org/x/sys/windows" -) - -// chtimes will set the create time on a file using the given modtime. -// This requires calling SetFileTime and explicitly including the create time. -func chtimes(path string, atime, mtime time.Time) error { - pathp, err := windows.UTF16PtrFromString(path) - if err != nil { - return err - } - h, err := windows.CreateFile(pathp, - windows.FILE_WRITE_ATTRIBUTES, windows.FILE_SHARE_WRITE, nil, - windows.OPEN_EXISTING, windows.FILE_FLAG_BACKUP_SEMANTICS, 0) - if err != nil { - return err - } - defer windows.Close(h) - c := windows.NsecToFiletime(mtime.UnixNano()) - return windows.SetFileTime(h, &c, nil, nil) -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/cio/io.go b/vendor/github.com/containerd/containerd/v2/pkg/cio/io.go deleted file mode 100644 index 9e982cb0a9..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/cio/io.go +++ /dev/null @@ -1,356 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package cio - -import ( - "context" - "fmt" - "io" - "net/url" - "os" - "path/filepath" - "strings" - "sync" - - "github.com/containerd/containerd/v2/defaults" -) - -var bufPool = sync.Pool{ - New: func() interface{} { - buffer := make([]byte, 32<<10) - return &buffer - }, -} - -// Config holds the IO configurations. -type Config struct { - // Terminal is true if one has been allocated - Terminal bool - // Stdin path - Stdin string - // Stdout path - Stdout string - // Stderr path - Stderr string -} - -// IO holds the io information for a task or process -type IO interface { - // Config returns the IO configuration. - Config() Config - // Cancel aborts all current io operations. - Cancel() - // Wait blocks until all io copy operations have completed. - Wait() - // Close cleans up all open io resources. Cancel() is always called before - // Close() - Close() error -} - -// Creator creates new IO sets for a task -type Creator func(id string) (IO, error) - -// Attach allows callers to reattach to running tasks -// -// There should only be one reader for a task's IO set -// because fifo's can only be read from one reader or the output -// will be sent only to the first reads -type Attach func(*FIFOSet) (IO, error) - -// FIFOSet is a set of file paths to FIFOs for a task's standard IO streams, -// Although it supports streaming io other than FIFOs, -// we do not change the name "FIFOSet" because it is referenced in too many codes. -type FIFOSet struct { - Config - close func() error -} - -// Close the FIFOSet -func (f *FIFOSet) Close() error { - if f != nil && f.close != nil { - return f.close() - } - return nil -} - -// NewFIFOSet returns a new FIFOSet from a Config and a close function -func NewFIFOSet(config Config, close func() error) *FIFOSet { - return &FIFOSet{Config: config, close: close} -} - -// Streams used to configure a Creator or Attach -type Streams struct { - Stdin io.Reader - Stdout io.Writer - Stderr io.Writer - Terminal bool - FIFODir string -} - -// Opt customize options for creating a Creator or Attach -type Opt func(*Streams) - -// WithStdio sets stream options to the standard input/output streams -func WithStdio(opt *Streams) { - WithStreams(os.Stdin, os.Stdout, os.Stderr)(opt) -} - -// WithTerminal sets the terminal option -func WithTerminal(opt *Streams) { - opt.Terminal = true -} - -// WithStreams sets the stream options to the specified Reader and Writers -func WithStreams(stdin io.Reader, stdout, stderr io.Writer) Opt { - return func(opt *Streams) { - opt.Stdin = stdin - opt.Stdout = stdout - opt.Stderr = stderr - } -} - -// WithFIFODir sets the fifo directory. -// e.g. "/run/containerd/fifo", "/run/users/1001/containerd/fifo" -func WithFIFODir(dir string) Opt { - return func(opt *Streams) { - opt.FIFODir = dir - } -} - -// NewCreator returns an IO creator from the options -func NewCreator(opts ...Opt) Creator { - streams := &Streams{} - for _, opt := range opts { - opt(streams) - } - if streams.FIFODir == "" { - streams.FIFODir = defaults.DefaultFIFODir - } - return func(id string) (IO, error) { - fifos, err := NewFIFOSetInDir(streams.FIFODir, id, streams.Terminal) - if err != nil { - return nil, err - } - if streams.Stdin == nil { - fifos.Stdin = "" - } - if streams.Stdout == nil { - fifos.Stdout = "" - } - if streams.Stderr == nil { - fifos.Stderr = "" - } - return copyIO(fifos, streams) - } -} - -// NewAttach attaches the existing io for a task to the provided io.Reader/Writers -func NewAttach(opts ...Opt) Attach { - streams := &Streams{} - for _, opt := range opts { - opt(streams) - } - return func(fifos *FIFOSet) (IO, error) { - if fifos == nil { - return nil, fmt.Errorf("cannot attach, missing fifos") - } - if streams.Stdin == nil { - fifos.Stdin = "" - } - if streams.Stdout == nil { - fifos.Stdout = "" - } - if streams.Stderr == nil { - fifos.Stderr = "" - } - return copyIO(fifos, streams) - } -} - -// NullIO redirects the container's IO into /dev/null -func NullIO(_ string) (IO, error) { - return &cio{}, nil -} - -// cio is a basic container IO implementation. -type cio struct { - config Config - wg *sync.WaitGroup - closers []io.Closer - cancel context.CancelFunc -} - -func (c *cio) Config() Config { - return c.config -} - -func (c *cio) Wait() { - if c.wg != nil { - c.wg.Wait() - } -} - -func (c *cio) Close() error { - var lastErr error - for _, closer := range c.closers { - if closer == nil { - continue - } - if err := closer.Close(); err != nil { - lastErr = err - } - } - return lastErr -} - -func (c *cio) Cancel() { - if c.cancel != nil { - c.cancel() - } -} - -type pipes struct { - Stdin io.WriteCloser - Stdout io.ReadCloser - Stderr io.ReadCloser -} - -// DirectIO allows task IO to be handled externally by the caller -type DirectIO struct { - pipes - cio -} - -var ( - _ IO = &DirectIO{} - _ IO = &logURI{} -) - -// LogURI provides the raw logging URI -func LogURI(uri *url.URL) Creator { - return func(_ string) (IO, error) { - return &logURI{ - config: Config{ - Stdout: uri.String(), - Stderr: uri.String(), - }, - }, nil - } -} - -// BinaryIO forwards container STDOUT|STDERR directly to a logging binary -func BinaryIO(binary string, args map[string]string) Creator { - return func(_ string) (IO, error) { - uri, err := LogURIGenerator("binary", binary, args) - if err != nil { - return nil, err - } - - res := uri.String() - return &logURI{ - config: Config{ - Stdout: res, - Stderr: res, - }, - }, nil - } -} - -// LogFile creates a file on disk that logs the task's STDOUT,STDERR. -// If the log file already exists, the logs will be appended to the file. -func LogFile(path string) Creator { - return func(_ string) (IO, error) { - uri, err := LogURIGenerator("file", path, nil) - if err != nil { - return nil, err - } - - res := uri.String() - return &logURI{ - config: Config{ - Stdout: res, - Stderr: res, - }, - }, nil - } -} - -// LogURIGenerator is the helper to generate log uri with specific scheme. -func LogURIGenerator(scheme string, path string, args map[string]string) (*url.URL, error) { - path = filepath.Clean(path) - if !filepath.IsAbs(path) { - return nil, fmt.Errorf("%q must be absolute", path) - } - - // Without adding / here, C:\foo\bar.txt will become file://C:/foo/bar.txt - // which is invalid. The path must have three slashes. - // - // https://learn.microsoft.com/en-us/archive/blogs/ie/file-uris-in-windows - // > In the case of a local Windows file path, there is no hostname, - // > and thus another slash and the path immediately follow. - p := filepath.ToSlash(path) - if !strings.HasPrefix(path, "/") { - p = "/" + p - } - uri := &url.URL{Scheme: scheme, Path: p} - - if len(args) == 0 { - return uri, nil - } - - q := uri.Query() - for k, v := range args { - q.Set(k, v) - } - uri.RawQuery = q.Encode() - return uri, nil -} - -type logURI struct { - config Config -} - -func (l *logURI) Config() Config { - return l.config -} - -func (l *logURI) Cancel() { - -} - -func (l *logURI) Wait() { - -} - -func (l *logURI) Close() error { - return nil -} - -// Load the io for a container but do not attach -// -// Allows io to be loaded on the task for deletion without -// starting copy routines -func Load(set *FIFOSet) (IO, error) { - return &cio{ - config: set.Config, - closers: []io.Closer{set}, - }, nil -} - -func (p *pipes) closers() []io.Closer { - return []io.Closer{p.Stdin, p.Stdout, p.Stderr} -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/cio/io_unix.go b/vendor/github.com/containerd/containerd/v2/pkg/cio/io_unix.go deleted file mode 100644 index 7038883cec..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/cio/io_unix.go +++ /dev/null @@ -1,195 +0,0 @@ -//go:build !windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package cio - -import ( - "context" - "fmt" - "io" - "net/url" - "os" - "path/filepath" - "sync" - "syscall" - - "github.com/containerd/fifo" -) - -// NewFIFOSetInDir returns a new FIFOSet with paths in a temporary directory under root -func NewFIFOSetInDir(root, id string, terminal bool) (*FIFOSet, error) { - if root != "" { - if err := os.MkdirAll(root, 0700); err != nil { - return nil, err - } - } - dir, err := os.MkdirTemp(root, "") - if err != nil { - return nil, err - } - closer := func() error { - return os.RemoveAll(dir) - } - return NewFIFOSet(Config{ - Stdin: filepath.Join(dir, id+"-stdin"), - Stdout: filepath.Join(dir, id+"-stdout"), - Stderr: filepath.Join(dir, id+"-stderr"), - Terminal: terminal, - }, closer), nil -} - -func copyIO(fifos *FIFOSet, ioset *Streams) (*cio, error) { - var ctx, cancel = context.WithCancel(context.Background()) - pipes, err := openFifos(ctx, fifos) - if err != nil { - cancel() - return nil, err - } - - if fifos.Stdin != "" { - go func() { - p := bufPool.Get().(*[]byte) - defer bufPool.Put(p) - - io.CopyBuffer(pipes.Stdin, ioset.Stdin, *p) - pipes.Stdin.Close() - }() - } - - var wg = &sync.WaitGroup{} - if fifos.Stdout != "" { - wg.Add(1) - go func() { - p := bufPool.Get().(*[]byte) - defer bufPool.Put(p) - - io.CopyBuffer(ioset.Stdout, pipes.Stdout, *p) - pipes.Stdout.Close() - wg.Done() - }() - } - - if !fifos.Terminal && fifos.Stderr != "" { - wg.Add(1) - go func() { - p := bufPool.Get().(*[]byte) - defer bufPool.Put(p) - - io.CopyBuffer(ioset.Stderr, pipes.Stderr, *p) - pipes.Stderr.Close() - wg.Done() - }() - } - return &cio{ - config: fifos.Config, - wg: wg, - closers: append(pipes.closers(), fifos), - cancel: func() { - cancel() - for _, c := range pipes.closers() { - if c != nil { - c.Close() - } - } - }, - }, nil -} - -func openFifos(ctx context.Context, fifos *FIFOSet) (f pipes, retErr error) { - defer func() { - if retErr != nil { - fifos.Close() - } - }() - - if fifos.Stdin != "" { - if f.Stdin, retErr = fifo.OpenFifo(ctx, fifos.Stdin, syscall.O_WRONLY|syscall.O_CREAT|syscall.O_NONBLOCK, 0700); retErr != nil { - return f, fmt.Errorf("failed to open stdin fifo: %w", retErr) - } - defer func() { - if retErr != nil && f.Stdin != nil { - f.Stdin.Close() - } - }() - } - if fifos.Stdout != "" { - if f.Stdout, retErr = fifo.OpenFifo(ctx, fifos.Stdout, syscall.O_RDONLY|syscall.O_CREAT|syscall.O_NONBLOCK, 0700); retErr != nil { - return f, fmt.Errorf("failed to open stdout fifo: %w", retErr) - } - defer func() { - if retErr != nil && f.Stdout != nil { - f.Stdout.Close() - } - }() - } - if !fifos.Terminal && fifos.Stderr != "" { - if f.Stderr, retErr = fifo.OpenFifo(ctx, fifos.Stderr, syscall.O_RDONLY|syscall.O_CREAT|syscall.O_NONBLOCK, 0700); retErr != nil { - return f, fmt.Errorf("failed to open stderr fifo: %w", retErr) - } - } - return f, nil -} - -// NewDirectIO returns an IO implementation that exposes the IO streams as io.ReadCloser -// and io.WriteCloser. -func NewDirectIO(ctx context.Context, fifos *FIFOSet) (*DirectIO, error) { - ctx, cancel := context.WithCancel(ctx) - pipes, err := openFifos(ctx, fifos) - return &DirectIO{ - pipes: pipes, - cio: cio{ - config: fifos.Config, - closers: append(pipes.closers(), fifos), - cancel: cancel, - }, - }, err -} - -// TerminalLogURI provides the raw logging URI -// as well as sets the terminal option to true. -func TerminalLogURI(uri *url.URL) Creator { - return func(_ string) (IO, error) { - return &logURI{ - config: Config{ - Stdout: uri.String(), - Stderr: uri.String(), - Terminal: true, - }, - }, nil - } -} - -// TerminalBinaryIO forwards container STDOUT|STDERR directly to a logging binary -// It also sets the terminal option to true -func TerminalBinaryIO(binary string, args map[string]string) Creator { - return func(_ string) (IO, error) { - uri, err := LogURIGenerator("binary", binary, args) - if err != nil { - return nil, err - } - - res := uri.String() - return &logURI{ - config: Config{ - Stdout: res, - Stderr: res, - Terminal: true, - }, - }, nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/cio/io_windows.go b/vendor/github.com/containerd/containerd/v2/pkg/cio/io_windows.go deleted file mode 100644 index d67c4b30b3..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/cio/io_windows.go +++ /dev/null @@ -1,197 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package cio - -import ( - "context" - "fmt" - "io" - "net/url" - - winio "github.com/Microsoft/go-winio" - "github.com/containerd/log" -) - -const pipeRoot = `\\.\pipe` - -// NewFIFOSetInDir returns a new set of fifos for the task -func NewFIFOSetInDir(_, id string, terminal bool) (*FIFOSet, error) { - stderrPipe := "" - if !terminal { - stderrPipe = fmt.Sprintf(`%s\ctr-%s-stderr`, pipeRoot, id) - } - return NewFIFOSet(Config{ - Terminal: terminal, - Stdin: fmt.Sprintf(`%s\ctr-%s-stdin`, pipeRoot, id), - Stdout: fmt.Sprintf(`%s\ctr-%s-stdout`, pipeRoot, id), - Stderr: stderrPipe, - }, nil), nil -} - -func copyIO(fifos *FIFOSet, ioset *Streams) (_ *cio, retErr error) { - cios := &cio{config: fifos.Config} - - defer func() { - if retErr != nil { - _ = cios.Close() - } - }() - - if fifos.Stdin != "" { - l, err := winio.ListenPipe(fifos.Stdin, nil) - if err != nil { - return nil, fmt.Errorf("failed to create stdin pipe %s: %w", fifos.Stdin, err) - } - cios.closers = append(cios.closers, l) - - go func() { - c, err := l.Accept() - if err != nil { - log.L.WithError(err).Errorf("failed to accept stdin connection on %s", fifos.Stdin) - return - } - - p := bufPool.Get().(*[]byte) - defer bufPool.Put(p) - - io.CopyBuffer(c, ioset.Stdin, *p) - c.Close() - l.Close() - }() - } - - if fifos.Stdout != "" { - l, err := winio.ListenPipe(fifos.Stdout, nil) - if err != nil { - return nil, fmt.Errorf("failed to create stdout pipe %s: %w", fifos.Stdout, err) - } - cios.closers = append(cios.closers, l) - - go func() { - c, err := l.Accept() - if err != nil { - log.L.WithError(err).Errorf("failed to accept stdout connection on %s", fifos.Stdout) - return - } - - p := bufPool.Get().(*[]byte) - defer bufPool.Put(p) - - io.CopyBuffer(ioset.Stdout, c, *p) - c.Close() - l.Close() - }() - } - - if fifos.Stderr != "" { - l, err := winio.ListenPipe(fifos.Stderr, nil) - if err != nil { - return nil, fmt.Errorf("failed to create stderr pipe %s: %w", fifos.Stderr, err) - } - cios.closers = append(cios.closers, l) - - go func() { - c, err := l.Accept() - if err != nil { - log.L.WithError(err).Errorf("failed to accept stderr connection on %s", fifos.Stderr) - return - } - - p := bufPool.Get().(*[]byte) - defer bufPool.Put(p) - - io.CopyBuffer(ioset.Stderr, c, *p) - c.Close() - l.Close() - }() - } - - return cios, nil -} - -// NewDirectIO returns an IO implementation that exposes the IO streams as io.ReadCloser -// and io.WriteCloser. -func NewDirectIO(stdin io.WriteCloser, stdout, stderr io.ReadCloser, terminal bool) *DirectIO { - return &DirectIO{ - pipes: pipes{ - Stdin: stdin, - Stdout: stdout, - Stderr: stderr, - }, - cio: cio{ - config: Config{Terminal: terminal}, - }, - } -} - -// NewDirectIOFromFIFOSet returns an IO implementation that exposes the IO streams as io.ReadCloser -// and io.WriteCloser. -func NewDirectIOFromFIFOSet(ctx context.Context, stdin io.WriteCloser, stdout, stderr io.ReadCloser, fifos *FIFOSet) *DirectIO { - _, cancel := context.WithCancel(ctx) - pipes := pipes{ - Stdin: stdin, - Stdout: stdout, - Stderr: stderr, - } - return &DirectIO{ - pipes: pipes, - cio: cio{ - config: fifos.Config, - closers: append(pipes.closers(), fifos), - cancel: cancel, - }, - } -} - -// TerminalLogURI provides the raw logging URI -// as well as sets the terminal option to true. -func TerminalLogURI(uri *url.URL) Creator { - return func(_ string) (IO, error) { - return &logURI{ - config: Config{ - Terminal: true, - Stdout: uri.String(), - - // Windows HCSShim requires that stderr is an empty string when using terminal. - // https://github.com/microsoft/hcsshim/blob/200feabd854da69f615a598ed6a1263ce9531676/cmd/containerd-shim-runhcs-v1/service_internal.go#L127 - Stderr: "", - }, - }, nil - } -} - -// TerminalBinaryIO forwards container STDOUT|STDERR directly to a logging binary -// It also sets the terminal option to true -func TerminalBinaryIO(binary string, args map[string]string) Creator { - return func(_ string) (IO, error) { - uri, err := LogURIGenerator("binary", binary, args) - if err != nil { - return nil, err - } - - return &logURI{ - config: Config{ - Terminal: true, - Stdout: uri.String(), - - // Windows HCSShim requires that stderr is an empty string when using terminal. - // https://github.com/microsoft/hcsshim/blob/200feabd854da69f615a598ed6a1263ce9531676/cmd/containerd-shim-runhcs-v1/service_internal.go#L127 - Stderr: "", - }, - }, nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/dialer/dialer.go b/vendor/github.com/containerd/containerd/v2/pkg/dialer/dialer.go deleted file mode 100644 index 125edf6922..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/dialer/dialer.go +++ /dev/null @@ -1,74 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package dialer - -import ( - "context" - "fmt" - "net" - "time" -) - -type dialResult struct { - c net.Conn - err error -} - -// ContextDialer returns a GRPC net.Conn connected to the provided address -func ContextDialer(ctx context.Context, address string) (net.Conn, error) { - if deadline, ok := ctx.Deadline(); ok { - return timeoutDialer(address, time.Until(deadline)) - } - return timeoutDialer(address, 0) -} - -func timeoutDialer(address string, timeout time.Duration) (net.Conn, error) { - var ( - stopC = make(chan struct{}) - synC = make(chan *dialResult) - ) - go func() { - defer close(synC) - for { - select { - case <-stopC: - return - default: - c, err := dialer(address, timeout) - if isNoent(err) { - <-time.After(10 * time.Millisecond) - continue - } - synC <- &dialResult{c, err} - return - } - } - }() - select { - case dr := <-synC: - return dr.c, dr.err - case <-time.After(timeout): - close(stopC) - go func() { - dr := <-synC - if dr != nil && dr.c != nil { - dr.c.Close() - } - }() - return nil, fmt.Errorf("dial %s: timeout", address) - } -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/dialer/dialer_unix.go b/vendor/github.com/containerd/containerd/v2/pkg/dialer/dialer_unix.go deleted file mode 100644 index 1c58d16b6e..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/dialer/dialer_unix.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build !windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package dialer - -import ( - "errors" - "fmt" - "net" - "strings" - "syscall" - "time" -) - -// DialAddress returns the address with unix:// prepended to the -// provided address -func DialAddress(address string) string { - return fmt.Sprintf("unix://%s", address) -} - -func isNoent(err error) bool { - return errors.Is(err, syscall.ENOENT) -} - -func dialer(address string, timeout time.Duration) (net.Conn, error) { - address = strings.TrimPrefix(address, "unix://") - return net.DialTimeout("unix", address, timeout) -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/dialer/dialer_windows.go b/vendor/github.com/containerd/containerd/v2/pkg/dialer/dialer_windows.go deleted file mode 100644 index cf74cc0d82..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/dialer/dialer_windows.go +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package dialer - -import ( - "fmt" - "net" - "os" - "path/filepath" - "strings" - "time" - - winio "github.com/Microsoft/go-winio" -) - -func isNoent(err error) bool { - return os.IsNotExist(err) -} - -func dialer(address string, timeout time.Duration) (net.Conn, error) { - address = strings.TrimPrefix(filepath.ToSlash(address), "npipe://") - return winio.DialPipe(address, &timeout) -} - -// DialAddress returns the dial address with npipe:// prepended to the -// provided address -func DialAddress(address string) string { - address = filepath.ToSlash(address) - if !strings.HasPrefix(address, "npipe://") { - address = fmt.Sprintf("npipe://%s", address) - } - return address -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/epoch/context.go b/vendor/github.com/containerd/containerd/v2/pkg/epoch/context.go deleted file mode 100644 index fd16f95196..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/epoch/context.go +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package epoch - -import ( - "context" - "time" -) - -type ( - epochKey struct{} -) - -// WithSourceDateEpoch associates the context with the epoch. -func WithSourceDateEpoch(ctx context.Context, tm *time.Time) context.Context { - return context.WithValue(ctx, epochKey{}, tm) -} - -// FromContext returns the epoch associated with the context. -// FromContext does not fall back to read the SOURCE_DATE_EPOCH env var. -func FromContext(ctx context.Context) *time.Time { - v := ctx.Value(epochKey{}) - if v == nil { - return nil - } - return v.(*time.Time) -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/epoch/epoch.go b/vendor/github.com/containerd/containerd/v2/pkg/epoch/epoch.go deleted file mode 100644 index 2b6718fa62..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/epoch/epoch.go +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Package epoch provides SOURCE_DATE_EPOCH utilities. -package epoch - -import ( - "fmt" - "os" - "strconv" - "time" -) - -// SourceDateEpochEnv is the SOURCE_DATE_EPOCH env var. -// See https://reproducible-builds.org/docs/source-date-epoch/ -const SourceDateEpochEnv = "SOURCE_DATE_EPOCH" - -// SourceDateEpoch returns the SOURCE_DATE_EPOCH env var as *time.Time. -// If the env var is not set, SourceDateEpoch returns nil without an error. -func SourceDateEpoch() (*time.Time, error) { - v, ok := os.LookupEnv(SourceDateEpochEnv) - if !ok || v == "" { - return nil, nil // not an error - } - t, err := ParseSourceDateEpoch(v) - if err != nil { - return nil, fmt.Errorf("invalid %s value: %w", SourceDateEpochEnv, err) - } - return t, nil -} - -// ParseSourceDateEpoch parses the given source date epoch, as *time.Time. -// It returns an error if sourceDateEpoch is empty or not well-formatted. -func ParseSourceDateEpoch(sourceDateEpoch string) (*time.Time, error) { - if sourceDateEpoch == "" { - return nil, fmt.Errorf("value is empty") - } - i64, err := strconv.ParseInt(sourceDateEpoch, 10, 64) - if err != nil { - return nil, fmt.Errorf("invalid value: %w", err) - } - unix := time.Unix(i64, 0).UTC() - return &unix, nil -} - -// SetSourceDateEpoch sets the SOURCE_DATE_EPOCH env var. -func SetSourceDateEpoch(tm time.Time) { - _ = os.Setenv(SourceDateEpochEnv, fmt.Sprintf("%d", tm.Unix())) -} - -// UnsetSourceDateEpoch unsets the SOURCE_DATE_EPOCH env var. -func UnsetSourceDateEpoch() { - _ = os.Unsetenv(SourceDateEpochEnv) -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/protobuf/compare.go b/vendor/github.com/containerd/containerd/v2/pkg/protobuf/compare.go deleted file mode 100644 index 602a4bcac5..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/protobuf/compare.go +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package protobuf - -import ( - "github.com/google/go-cmp/cmp" - "google.golang.org/protobuf/proto" -) - -var Compare = cmp.FilterValues( - func(x, y interface{}) bool { - _, xok := x.(proto.Message) - _, yok := y.(proto.Message) - return xok && yok - }, - cmp.Comparer(func(x, y interface{}) bool { - vx, ok := x.(proto.Message) - if !ok { - return false - } - vy, ok := y.(proto.Message) - if !ok { - return false - } - return proto.Equal(vx, vy) - }), -) diff --git a/vendor/github.com/containerd/containerd/v2/pkg/protobuf/proto/proto.go b/vendor/github.com/containerd/containerd/v2/pkg/protobuf/proto/proto.go deleted file mode 100644 index 36902b1aa5..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/protobuf/proto/proto.go +++ /dev/null @@ -1,30 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Package proto provides convenient aliases that make google.golang.org/protobuf migration easier. -package proto - -import ( - google "google.golang.org/protobuf/proto" -) - -func Marshal(input google.Message) ([]byte, error) { - return google.Marshal(input) -} - -func Unmarshal(input []byte, output google.Message) error { - return google.Unmarshal(input, output) -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/protobuf/timestamp.go b/vendor/github.com/containerd/containerd/v2/pkg/protobuf/timestamp.go deleted file mode 100644 index 0615f823b0..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/protobuf/timestamp.go +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package protobuf - -import ( - "time" - - "google.golang.org/protobuf/types/known/timestamppb" -) - -// Once we migrate off from gogo/protobuf, we can use the function below, which don't return any errors. -// https://github.com/protocolbuffers/protobuf-go/blob/v1.28.0/types/known/timestamppb/timestamp.pb.go#L200-L208 - -// ToTimestamp creates protobuf's Timestamp from time.Time. -func ToTimestamp(from time.Time) *timestamppb.Timestamp { - return timestamppb.New(from) -} - -// FromTimestamp creates time.Time from protobuf's Timestamp. -func FromTimestamp(from *timestamppb.Timestamp) time.Time { - return from.AsTime() -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/protobuf/types/types.go b/vendor/github.com/containerd/containerd/v2/pkg/protobuf/types/types.go deleted file mode 100644 index dd0b0299b6..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/protobuf/types/types.go +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Package types provides convenient aliases that make google.golang.org/protobuf migration easier. -package types - -import ( - "google.golang.org/protobuf/types/known/anypb" - "google.golang.org/protobuf/types/known/emptypb" - field_mask "google.golang.org/protobuf/types/known/fieldmaskpb" -) - -type Empty = emptypb.Empty -type Any = anypb.Any -type FieldMask = field_mask.FieldMask diff --git a/vendor/github.com/containerd/containerd/v2/pkg/reference/reference.go b/vendor/github.com/containerd/containerd/v2/pkg/reference/reference.go deleted file mode 100644 index 55c7b6fb52..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/reference/reference.go +++ /dev/null @@ -1,156 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package reference - -import ( - "errors" - "net/url" - "path" - "strings" - - "github.com/containerd/containerd/v2/internal/lazyregexp" - digest "github.com/opencontainers/go-digest" -) - -var ( - // ErrInvalid is returned when there is an invalid reference - ErrInvalid = errors.New("invalid reference") - // ErrObjectRequired is returned when the object is required - ErrObjectRequired = errors.New("object required") - // ErrHostnameRequired is returned when the hostname is required - ErrHostnameRequired = errors.New("hostname required") -) - -// Spec defines the main components of a reference specification. -// -// A reference specification is a schema-less URI parsed into common -// components. The two main components, locator and object, are required to be -// supported by remotes. It represents a superset of the naming define in -// docker's reference schema. It aims to be compatible but not prescriptive. -// -// While the interpretation of the components, locator and object, are up to -// the remote, we define a few common parts, accessible via helper methods. -// -// The first is the hostname, which is part of the locator. This doesn't need -// to map to a physical resource, but it must parse as a hostname. We refer to -// this as the namespace. -// -// The other component made accessible by helper method is the digest. This is -// part of the object identifier, always prefixed with an '@'. If present, the -// remote may use the digest portion directly or resolve it against a prefix. -// If the object does not include the `@` symbol, the return value for `Digest` -// will be empty. -type Spec struct { - // Locator is the host and path portion of the specification. The host - // portion may refer to an actual host or just a namespace of related - // images. - // - // Typically, the locator may used to resolve the remote to fetch specific - // resources. - Locator string - - // Object contains the identifier for the remote resource. Classically, - // this is a tag but can refer to anything in a remote. By convention, any - // portion that may be a partial or whole digest will be preceded by an - // `@`. Anything preceding the `@` will be referred to as the "tag". - // - // In practice, we will see this broken down into the following formats: - // - // 1. - // 2. @ - // 3. @ - // - // We define the tag to be anything except '@' and ':'. may - // be a full valid digest or shortened version, possibly with elided - // algorithm. - Object string -} - -var splitRe = lazyregexp.New(`[:@]`) - -// Parse parses the string into a structured ref. -func Parse(s string) (Spec, error) { - if strings.Contains(s, "://") { - return Spec{}, ErrInvalid - } - - u, err := url.Parse("dummy://" + s) - if err != nil { - return Spec{}, err - } - - if u.Scheme != "dummy" { - return Spec{}, ErrInvalid - } - - if u.Host == "" { - return Spec{}, ErrHostnameRequired - } - - var object string - - if idx := splitRe.FindStringIndex(u.Path); idx != nil { - // This allows us to retain the @ to signify digests or shortened digests in - // the object. - object = u.Path[idx[0]:] - if object[:1] == ":" { - object = object[1:] - } - u.Path = u.Path[:idx[0]] - } - - return Spec{ - Locator: path.Join(u.Host, u.Path), - Object: object, - }, nil -} - -// Hostname returns the hostname portion of the locator. -// -// Remotes are not required to directly access the resources at this host. This -// method is provided for convenience. -func (r Spec) Hostname() string { - i := strings.Index(r.Locator, "/") - - if i < 0 { - return r.Locator - } - return r.Locator[:i] -} - -// Digest returns the digest portion of the reference spec. This may be a -// partial or invalid digest, which may be used to lookup a complete digest. -func (r Spec) Digest() digest.Digest { - i := strings.Index(r.Object, "@") - - if i < 0 { - return "" - } - return digest.Digest(r.Object[i+1:]) -} - -// String returns the normalized string for the ref. -func (r Spec) String() string { - if r.Object == "" { - return r.Locator - } - if r.Object[:1] == "@" { - return r.Locator + r.Object - } - - return r.Locator + ":" + r.Object -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/rootfs/apply.go b/vendor/github.com/containerd/containerd/v2/pkg/rootfs/apply.go deleted file mode 100644 index 2955d549f4..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/rootfs/apply.go +++ /dev/null @@ -1,186 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package rootfs - -import ( - "context" - "crypto/rand" - "encoding/base64" - "fmt" - "time" - - "github.com/containerd/containerd/v2/core/diff" - "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/errdefs" - "github.com/containerd/log" - "github.com/opencontainers/go-digest" - "github.com/opencontainers/image-spec/identity" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -// Layer represents the descriptors for a layer diff. These descriptions -// include the descriptor for the uncompressed tar diff as well as a blob -// used to transport that tar. The blob descriptor may or may not describe -// a compressed object. -type Layer struct { - Diff ocispec.Descriptor - Blob ocispec.Descriptor -} - -// ApplyLayers applies all the layers using the given snapshotter and applier. -// The returned result is a chain id digest representing all the applied layers. -// Layers are applied in order they are given, making the first layer the -// bottom-most layer in the layer chain. -func ApplyLayers(ctx context.Context, layers []Layer, sn snapshots.Snapshotter, a diff.Applier) (digest.Digest, error) { - return ApplyLayersWithOpts(ctx, layers, sn, a, nil) -} - -// ApplyLayersWithOpts applies all the layers using the given snapshotter, applier, and apply opts. -// The returned result is a chain id digest representing all the applied layers. -// Layers are applied in order they are given, making the first layer the -// bottom-most layer in the layer chain. -func ApplyLayersWithOpts(ctx context.Context, layers []Layer, sn snapshots.Snapshotter, a diff.Applier, applyOpts []diff.ApplyOpt) (digest.Digest, error) { - chain := make([]digest.Digest, len(layers)) - for i, layer := range layers { - chain[i] = layer.Diff.Digest - } - chainID := identity.ChainID(chain) - - // Just stat top layer, remaining layers will have their existence checked - // on prepare. Calling prepare on upper layers first guarantees that upper - // layers are not removed while calling stat on lower layers - _, err := sn.Stat(ctx, chainID.String()) - if err != nil { - if !errdefs.IsNotFound(err) { - return "", fmt.Errorf("failed to stat snapshot %s: %w", chainID, err) - } - - if err := applyLayers(ctx, layers, chain, sn, a, nil, applyOpts); err != nil && !errdefs.IsAlreadyExists(err) { - return "", err - } - } - - return chainID, nil -} - -// ApplyLayer applies a single layer on top of the given provided layer chain, -// using the provided snapshotter and applier. If the layer was unpacked true -// is returned, if the layer already exists false is returned. -func ApplyLayer(ctx context.Context, layer Layer, chain []digest.Digest, sn snapshots.Snapshotter, a diff.Applier, opts ...snapshots.Opt) (bool, error) { - return ApplyLayerWithOpts(ctx, layer, chain, sn, a, opts, nil) -} - -// ApplyLayerWithOpts applies a single layer on top of the given provided layer chain, -// using the provided snapshotter, applier, and apply opts. If the layer was unpacked true -// is returned, if the layer already exists false is returned. -func ApplyLayerWithOpts(ctx context.Context, layer Layer, chain []digest.Digest, sn snapshots.Snapshotter, a diff.Applier, opts []snapshots.Opt, applyOpts []diff.ApplyOpt) (bool, error) { - var ( - chainID = identity.ChainID(append(chain, layer.Diff.Digest)).String() - applied bool - ) - if _, err := sn.Stat(ctx, chainID); err != nil { - if !errdefs.IsNotFound(err) { - return false, fmt.Errorf("failed to stat snapshot %s: %w", chainID, err) - } - - if err := applyLayers(ctx, []Layer{layer}, append(chain, layer.Diff.Digest), sn, a, opts, applyOpts); err != nil { - if !errdefs.IsAlreadyExists(err) { - return false, err - } - } else { - applied = true - } - } - return applied, nil - -} - -func applyLayers(ctx context.Context, layers []Layer, chain []digest.Digest, sn snapshots.Snapshotter, a diff.Applier, opts []snapshots.Opt, applyOpts []diff.ApplyOpt) error { - var ( - parent = identity.ChainID(chain[:len(chain)-1]) - chainID = identity.ChainID(chain) - layer = layers[len(layers)-1] - diff ocispec.Descriptor - key string - mounts []mount.Mount - err error - ) - - for { - key = fmt.Sprintf(snapshots.UnpackKeyFormat, uniquePart(), chainID) - - // Prepare snapshot with from parent, label as root - mounts, err = sn.Prepare(ctx, key, parent.String(), opts...) - if err != nil { - if errdefs.IsNotFound(err) && len(layers) > 1 { - if err := applyLayers(ctx, layers[:len(layers)-1], chain[:len(chain)-1], sn, a, opts, applyOpts); err != nil { - if !errdefs.IsAlreadyExists(err) { - return err - } - } - // Do no try applying layers again - layers = nil - continue - } else if errdefs.IsAlreadyExists(err) { - // Try a different key - continue - } - - // Already exists should have the caller retry - return fmt.Errorf("failed to prepare extraction snapshot %q: %w", key, err) - - } - break - } - defer func() { - if err != nil { - if !errdefs.IsAlreadyExists(err) { - log.G(ctx).WithError(err).WithField("key", key).Infof("apply failure, attempting cleanup") - } - - if rerr := sn.Remove(ctx, key); rerr != nil { - log.G(ctx).WithError(rerr).WithField("key", key).Warnf("extraction snapshot removal failed") - } - } - }() - - diff, err = a.Apply(ctx, layer.Blob, mounts, applyOpts...) - if err != nil { - err = fmt.Errorf("failed to extract layer %s: %w", layer.Diff.Digest, err) - return err - } - if diff.Digest != layer.Diff.Digest { - err = fmt.Errorf("wrong diff id calculated on extraction %q", diff.Digest) - return err - } - - if err = sn.Commit(ctx, chainID.String(), key, opts...); err != nil { - err = fmt.Errorf("failed to commit snapshot %s: %w", key, err) - return err - } - - return nil -} - -func uniquePart() string { - t := time.Now() - var b [3]byte - // Ignore read failures, just decreases uniqueness - rand.Read(b[:]) - return fmt.Sprintf("%d-%s", t.Nanosecond(), base64.URLEncoding.EncodeToString(b[:])) -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/rootfs/diff.go b/vendor/github.com/containerd/containerd/v2/pkg/rootfs/diff.go deleted file mode 100644 index 8659670bf9..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/rootfs/diff.go +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package rootfs - -import ( - "context" - "fmt" - - "github.com/containerd/containerd/v2/core/diff" - "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/internal/cleanup" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -// CreateDiff creates a layer diff for the given snapshot identifier from the -// parent of the snapshot. A content ref is provided to track the progress of -// the content creation and the provided snapshotter and mount differ are used -// for calculating the diff. The descriptor for the layer diff is returned. -func CreateDiff(ctx context.Context, snapshotID string, sn snapshots.Snapshotter, d diff.Comparer, opts ...diff.Opt) (ocispec.Descriptor, error) { - info, err := sn.Stat(ctx, snapshotID) - if err != nil { - return ocispec.Descriptor{}, err - } - - lowerKey := fmt.Sprintf("%s-parent-view-%s", info.Parent, uniquePart()) - lower, err := sn.View(ctx, lowerKey, info.Parent) - if err != nil { - return ocispec.Descriptor{}, err - } - defer cleanup.Do(ctx, func(ctx context.Context) { - sn.Remove(ctx, lowerKey) - }) - - var upper []mount.Mount - if info.Kind == snapshots.KindActive { - upper, err = sn.Mounts(ctx, snapshotID) - if err != nil { - return ocispec.Descriptor{}, err - } - } else { - upperKey := fmt.Sprintf("%s-view-%s", snapshotID, uniquePart()) - upper, err = sn.View(ctx, upperKey, snapshotID) - if err != nil { - return ocispec.Descriptor{}, err - } - defer cleanup.Do(ctx, func(ctx context.Context) { - sn.Remove(ctx, upperKey) - }) - } - - return d.Compare(ctx, lower, upper, opts...) -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/rootfs/init.go b/vendor/github.com/containerd/containerd/v2/pkg/rootfs/init.go deleted file mode 100644 index a2bd4c5d98..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/rootfs/init.go +++ /dev/null @@ -1,116 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package rootfs - -import ( - "context" - "errors" - "fmt" - "os" - - "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/log" - digest "github.com/opencontainers/go-digest" -) - -var ( - initializers = map[string]initializerFunc{} -) - -type initializerFunc func(string) error - -// Mounter handles mount and unmount -type Mounter interface { - Mount(target string, mounts ...mount.Mount) error - Unmount(target string) error -} - -// InitRootFS initializes the snapshot for use as a rootfs -func InitRootFS(ctx context.Context, name string, parent digest.Digest, readonly bool, snapshotter snapshots.Snapshotter, mounter Mounter) ([]mount.Mount, error) { - _, err := snapshotter.Stat(ctx, name) - if err == nil { - return nil, errors.New("rootfs already exists") - } - // TODO: ensure not exist error once added to snapshot package - - parentS := parent.String() - - initName := defaultInitializer - initFn := initializers[initName] - if initFn != nil { - parentS, err = createInitLayer(ctx, parentS, initName, initFn, snapshotter, mounter) - if err != nil { - return nil, err - } - } - - if readonly { - return snapshotter.View(ctx, name, parentS) - } - - return snapshotter.Prepare(ctx, name, parentS) -} - -func createInitLayer(ctx context.Context, parent, initName string, initFn func(string) error, snapshotter snapshots.Snapshotter, mounter Mounter) (_ string, retErr error) { - initS := fmt.Sprintf("%s %s", parent, initName) - if _, err := snapshotter.Stat(ctx, initS); err == nil { - return initS, nil - } - // TODO: ensure not exist error once added to snapshot package - - // Create tempdir - td, err := os.MkdirTemp(os.Getenv("XDG_RUNTIME_DIR"), "create-init-") - if err != nil { - return "", err - } - defer os.RemoveAll(td) - - mounts, err := snapshotter.Prepare(ctx, td, parent) - if err != nil { - return "", err - } - - defer func() { - if retErr != nil { - if rerr := snapshotter.Remove(ctx, td); rerr != nil { - log.G(ctx).Errorf("Failed to remove snapshot %s: %v", td, rerr) - } - } - }() - - if err = mounter.Mount(td, mounts...); err != nil { - return "", err - } - - if err = initFn(td); err != nil { - if merr := mounter.Unmount(td); merr != nil { - log.G(ctx).Errorf("Failed to unmount %s: %v", td, merr) - } - return "", err - } - - if err = mounter.Unmount(td); err != nil { - return "", err - } - - if err := snapshotter.Commit(ctx, initS, td); err != nil { - return "", err - } - - return initS, nil -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/rootfs/init_linux.go b/vendor/github.com/containerd/containerd/v2/pkg/rootfs/init_linux.go deleted file mode 100644 index 84dc56522d..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/rootfs/init_linux.go +++ /dev/null @@ -1,130 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package rootfs - -import ( - "os" - "path/filepath" - "syscall" -) - -const ( - defaultInitializer = "linux-init" -) - -func init() { - initializers[defaultInitializer] = initFS -} - -func createDirectory(name string, uid, gid int) initializerFunc { - return func(root string) error { - dname := filepath.Join(root, name) - st, err := os.Stat(dname) - if err != nil && !os.IsNotExist(err) { - return err - } else if err == nil { - if st.IsDir() { - stat := st.Sys().(*syscall.Stat_t) - if int(stat.Gid) == gid && int(stat.Uid) == uid { - return nil - } - } else { - if err := os.Remove(dname); err != nil { - return err - } - if err := os.Mkdir(dname, 0755); err != nil { - return err - } - } - } else { - if err := os.Mkdir(dname, 0755); err != nil { - return err - } - } - - return os.Chown(dname, uid, gid) - } -} - -func touchFile(name string, uid, gid int) initializerFunc { - return func(root string) error { - fname := filepath.Join(root, name) - - st, err := os.Stat(fname) - if err != nil && !os.IsNotExist(err) { - return err - } else if err == nil { - stat := st.Sys().(*syscall.Stat_t) - if int(stat.Gid) == gid && int(stat.Uid) == uid { - return nil - } - return os.Chown(fname, uid, gid) - } - - f, err := os.OpenFile(fname, os.O_CREATE, 0644) - if err != nil { - return err - } - defer f.Close() - - return f.Chown(uid, gid) - } -} - -func symlink(oldname, newname string) initializerFunc { - return func(root string) error { - linkName := filepath.Join(root, newname) - if _, err := os.Stat(linkName); err != nil && !os.IsNotExist(err) { - return err - } else if err == nil { - return nil - } - return os.Symlink(oldname, linkName) - } -} - -func initFS(root string) error { - st, err := os.Stat(root) - if err != nil { - return err - } - stat := st.Sys().(*syscall.Stat_t) - uid := int(stat.Uid) - gid := int(stat.Gid) - - initFuncs := []initializerFunc{ - createDirectory("/dev", uid, gid), - createDirectory("/dev/pts", uid, gid), - createDirectory("/dev/shm", uid, gid), - touchFile("/dev/console", uid, gid), - createDirectory("/proc", uid, gid), - createDirectory("/sys", uid, gid), - createDirectory("/etc", uid, gid), - touchFile("/etc/resolv.conf", uid, gid), - touchFile("/etc/hosts", uid, gid), - touchFile("/etc/hostname", uid, gid), - symlink("/proc/mounts", "/etc/mtab"), - } - - for _, fn := range initFuncs { - if err := fn(root); err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/rootfs/init_other.go b/vendor/github.com/containerd/containerd/v2/pkg/rootfs/init_other.go deleted file mode 100644 index 049cff2880..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/rootfs/init_other.go +++ /dev/null @@ -1,23 +0,0 @@ -//go:build !linux - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package rootfs - -const ( - defaultInitializer = "" -) diff --git a/vendor/github.com/containerd/containerd/v2/pkg/tracing/helpers.go b/vendor/github.com/containerd/containerd/v2/pkg/tracing/helpers.go deleted file mode 100644 index ab1278ef1f..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/tracing/helpers.go +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package tracing - -import ( - "encoding/json" - "fmt" - - "go.opentelemetry.io/otel/attribute" -) - -func keyValue(k string, v any) attribute.KeyValue { - if v == nil { - return attribute.String(k, "") - } - - switch typed := v.(type) { - case bool: - return attribute.Bool(k, typed) - case []bool: - return attribute.BoolSlice(k, typed) - case int: - return attribute.Int(k, typed) - case []int: - return attribute.IntSlice(k, typed) - case int8: - return attribute.Int(k, int(typed)) - case []int8: - ls := make([]int, 0, len(typed)) - for _, i := range typed { - ls = append(ls, int(i)) - } - return attribute.IntSlice(k, ls) - case int16: - return attribute.Int(k, int(typed)) - case []int16: - ls := make([]int, 0, len(typed)) - for _, i := range typed { - ls = append(ls, int(i)) - } - return attribute.IntSlice(k, ls) - case int32: - return attribute.Int64(k, int64(typed)) - case []int32: - ls := make([]int64, 0, len(typed)) - for _, i := range typed { - ls = append(ls, int64(i)) - } - return attribute.Int64Slice(k, ls) - case int64: - return attribute.Int64(k, typed) - case []int64: - return attribute.Int64Slice(k, typed) - case float64: - return attribute.Float64(k, typed) - case []float64: - return attribute.Float64Slice(k, typed) - case string: - return attribute.String(k, typed) - case []string: - return attribute.StringSlice(k, typed) - } - - if stringer, ok := v.(fmt.Stringer); ok { - return attribute.String(k, stringer.String()) - } - if b, err := json.Marshal(v); b != nil && err == nil { - return attribute.String(k, string(b)) - } - return attribute.String(k, fmt.Sprintf("%v", v)) -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/tracing/log.go b/vendor/github.com/containerd/containerd/v2/pkg/tracing/log.go deleted file mode 100644 index 3af24a294a..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/tracing/log.go +++ /dev/null @@ -1,82 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package tracing - -import ( - "github.com/containerd/log" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/trace" -) - -// allLevels is the equivalent to [logrus.AllLevels]. -// -// [logrus.AllLevels]: https://github.com/sirupsen/logrus/blob/v1.9.3/logrus.go#L80-L89 -var allLevels = []log.Level{ - log.PanicLevel, - log.FatalLevel, - log.ErrorLevel, - log.WarnLevel, - log.InfoLevel, - log.DebugLevel, - log.TraceLevel, -} - -// NewLogrusHook creates a new logrus hook -func NewLogrusHook() *LogrusHook { - return &LogrusHook{} -} - -// LogrusHook is a [logrus.Hook] which adds logrus events to active spans. -// If the span is not recording or the span context is invalid, the hook -// is a no-op. -// -// [logrus.Hook]: https://github.com/sirupsen/logrus/blob/v1.9.3/hooks.go#L3-L11 -type LogrusHook struct{} - -// Levels returns the logrus levels that this hook is interested in. -func (h *LogrusHook) Levels() []log.Level { - return allLevels -} - -// Fire is called when a log event occurs. -func (h *LogrusHook) Fire(entry *log.Entry) error { - span := trace.SpanFromContext(entry.Context) - if span == nil { - return nil - } - - if !span.IsRecording() || !span.SpanContext().IsValid() { - return nil - } - - span.AddEvent( - entry.Message, - trace.WithAttributes(logrusDataToAttrs(entry.Data)...), - trace.WithAttributes(attribute.String("level", entry.Level.String())), - trace.WithTimestamp(entry.Time), - ) - - return nil -} - -func logrusDataToAttrs(data map[string]any) []attribute.KeyValue { - attrs := make([]attribute.KeyValue, 0, len(data)) - for k, v := range data { - attrs = append(attrs, keyValue(k, v)) - } - return attrs -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/tracing/tracing.go b/vendor/github.com/containerd/containerd/v2/pkg/tracing/tracing.go deleted file mode 100644 index 48d760feb8..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/tracing/tracing.go +++ /dev/null @@ -1,132 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package tracing - -import ( - "context" - "net/http" - "strings" - - "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/codes" - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" - "go.opentelemetry.io/otel/trace" -) - -// StartConfig defines configuration for a new span object. -type StartConfig struct { - spanOpts []trace.SpanStartOption -} - -type SpanOpt func(config *StartConfig) - -// WithAttribute appends attributes to a new created span. -func WithAttribute(k string, v interface{}) SpanOpt { - return func(config *StartConfig) { - config.spanOpts = append(config.spanOpts, - trace.WithAttributes(Attribute(k, v))) - } -} - -// UpdateHTTPClient updates the http client with the necessary otel transport -func UpdateHTTPClient(client *http.Client, name string) { - client.Transport = otelhttp.NewTransport( - client.Transport, - otelhttp.WithSpanNameFormatter(func(operation string, r *http.Request) string { - return name - }), - ) -} - -// StartSpan starts child span in a context. -func StartSpan(ctx context.Context, opName string, opts ...SpanOpt) (context.Context, *Span) { - config := StartConfig{} - for _, fn := range opts { - fn(&config) - } - tracer := otel.Tracer("") - if parent := trace.SpanFromContext(ctx); parent != nil && parent.SpanContext().IsValid() { - tracer = parent.TracerProvider().Tracer("") - } - ctx, span := tracer.Start(ctx, opName, config.spanOpts...) - return ctx, &Span{otelSpan: span} -} - -// SpanFromContext returns the current Span from the context. -func SpanFromContext(ctx context.Context) *Span { - return &Span{ - otelSpan: trace.SpanFromContext(ctx), - } -} - -// Span is wrapper around otel trace.Span. -// Span is the individual component of a trace. It represents a -// single named and timed operation of a workflow that is traced. -type Span struct { - otelSpan trace.Span -} - -// End completes the span. -func (s *Span) End() { - s.otelSpan.End() -} - -// AddEvent adds an event with provided name and options. -func (s *Span) AddEvent(name string, attributes ...attribute.KeyValue) { - s.otelSpan.AddEvent(name, trace.WithAttributes(attributes...)) -} - -// RecordError will record err as an exception span event for this span -func (s *Span) RecordError(err error, options ...trace.EventOption) { - s.otelSpan.RecordError(err, options...) -} - -// SetStatus sets the status of the current span. -// If an error is encountered, it records the error and sets span status to Error. -func (s *Span) SetStatus(err error) { - if err != nil { - s.otelSpan.RecordError(err) - s.otelSpan.SetStatus(codes.Error, err.Error()) - } else { - s.otelSpan.SetStatus(codes.Ok, "") - } -} - -// SetAttributes sets kv as attributes of the span. -func (s *Span) SetAttributes(kv ...attribute.KeyValue) { - s.otelSpan.SetAttributes(kv...) -} - -const spanDelimiter = "." - -// Name sets the span name by joining a list of strings in dot separated format. -func Name(names ...string) string { - return strings.Join(names, spanDelimiter) -} - -// Attribute takes a key value pair and returns attribute.KeyValue type. -func Attribute(k string, v any) attribute.KeyValue { - return keyValue(k, v) -} - -// HTTPStatusCodeAttributes generates attributes of the HTTP namespace as specified by the OpenTelemetry -// specification for a span. -func HTTPStatusCodeAttributes(code int) []attribute.KeyValue { - return []attribute.KeyValue{semconv.HTTPStatusCodeKey.Int(code)} -} diff --git a/vendor/github.com/containerd/containerd/v2/plugins/services/services.go b/vendor/github.com/containerd/containerd/v2/plugins/services/services.go deleted file mode 100644 index 7c794de2ab..0000000000 --- a/vendor/github.com/containerd/containerd/v2/plugins/services/services.go +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package services - -const ( - // ContentService is id of content service. - ContentService = "content-service" - // SnapshotsService is id of snapshots service. - SnapshotsService = "snapshots-service" - // SandboxControllersService is id of snapshots service. - SandboxControllersService = "sandboxes-service" - // ImagesService is id of images service. - ImagesService = "images-service" - // ContainersService is id of containers service. - ContainersService = "containers-service" - // TasksService is id of tasks service. - TasksService = "tasks-service" - // NamespacesService is id of namespaces service. - NamespacesService = "namespaces-service" - // DiffService is id of diff service. - DiffService = "diff-service" - // IntrospectionService is the id of introspection service - IntrospectionService = "introspection-service" - // StreamingService is the id of the streaming service - StreamingService = "streaming-service" -) diff --git a/vendor/github.com/containerd/containerd/v2/plugins/types.go b/vendor/github.com/containerd/containerd/v2/plugins/types.go deleted file mode 100644 index aaf8c536b1..0000000000 --- a/vendor/github.com/containerd/containerd/v2/plugins/types.go +++ /dev/null @@ -1,105 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// plugins package stores all the plugin types used by containerd internally. -// -// External plugins should copy from these types and avoid importing this -// package. -package plugins - -import "github.com/containerd/plugin" - -const ( - // InternalPlugin implements an internal plugin to containerd - InternalPlugin plugin.Type = "io.containerd.internal.v1" - // RuntimePlugin implements a runtime - RuntimePlugin plugin.Type = "io.containerd.runtime.v1" - // RuntimePluginV2 implements a runtime v2 - RuntimePluginV2 plugin.Type = "io.containerd.runtime.v2" - // ServicePlugin implements an internal service - ServicePlugin plugin.Type = "io.containerd.service.v1" - // GRPCPlugin implements a grpc service - GRPCPlugin plugin.Type = "io.containerd.grpc.v1" - // TTRPCPlugin implements a ttrpc shim service - TTRPCPlugin plugin.Type = "io.containerd.ttrpc.v1" - // SnapshotPlugin implements a snapshotter - SnapshotPlugin plugin.Type = "io.containerd.snapshotter.v1" - // TaskMonitorPlugin implements a task monitor - TaskMonitorPlugin plugin.Type = "io.containerd.monitor.task.v1" - // TaskMonitorPlugin implements a container monitor - ContainerMonitorPlugin plugin.Type = "io.containerd.monitor.container.v1" - // DiffPlugin implements a differ - DiffPlugin plugin.Type = "io.containerd.differ.v1" - // MetadataPlugin implements a metadata store - MetadataPlugin plugin.Type = "io.containerd.metadata.v1" - // ContentPlugin implements a content store - ContentPlugin plugin.Type = "io.containerd.content.v1" - // GCPlugin implements garbage collection policy - GCPlugin plugin.Type = "io.containerd.gc.v1" - // EventPlugin implements event handling - EventPlugin plugin.Type = "io.containerd.event.v1" - // LeasePlugin implements lease manager - LeasePlugin plugin.Type = "io.containerd.lease.v1" - // StreamingPlugin implements a stream manager - StreamingPlugin plugin.Type = "io.containerd.streaming.v1" - // TracingProcessorPlugin implements an open telemetry span processor - TracingProcessorPlugin plugin.Type = "io.containerd.tracing.processor.v1" - // NRIApiPlugin implements the NRI adaptation interface for containerd. - NRIApiPlugin plugin.Type = "io.containerd.nri.v1" - // TransferPlugin implements a transfer service - TransferPlugin plugin.Type = "io.containerd.transfer.v1" - // SandboxStorePlugin implements a sandbox store - SandboxStorePlugin plugin.Type = "io.containerd.sandbox.store.v1" - // PodSandboxPlugin is a special sandbox controller which use pause container as a sandbox. - PodSandboxPlugin plugin.Type = "io.containerd.podsandbox.controller.v1" - // SandboxControllerPlugin implements a sandbox controller - SandboxControllerPlugin plugin.Type = "io.containerd.sandbox.controller.v1" - // ImageVerifierPlugin implements an image verifier service - ImageVerifierPlugin plugin.Type = "io.containerd.image-verifier.v1" - // WarningPlugin implements a warning service - WarningPlugin plugin.Type = "io.containerd.warning.v1" - // CRIServicePlugin implements a cri service - CRIServicePlugin plugin.Type = "io.containerd.cri.v1" - // ShimPlugin implements a shim service - ShimPlugin plugin.Type = "io.containerd.shim.v1" - // HTTPHandler implements an http handler - HTTPHandler plugin.Type = "io.containerd.http.v1" -) - -const ( - // RuntimeRuncV2 is the runc runtime that supports multiple containers per shim - RuntimeRuncV2 = "io.containerd.runc.v2" - - // RuntimeRunhcsV1 is the runtime type for runhcs. - RuntimeRunhcsV1 = "io.containerd.runhcs.v1" - - DeprecationsPlugin = "deprecations" -) - -const ( - // PropertyRootDir sets the root directory property for a plugin - PropertyRootDir = "io.containerd.plugin.root" - // PropertyStateDir sets the state directory property for a plugin - PropertyStateDir = "io.containerd.plugin.state" - // PropertyGRPCAddress is the grpc address used for client connections to containerd - PropertyGRPCAddress = "io.containerd.plugin.grpc.address" - // PropertyTTRPCAddress is the ttrpc address used for client connections to containerd - PropertyTTRPCAddress = "io.containerd.plugin.ttrpc.address" -) - -const ( - SnapshotterRootDir = "root" -) diff --git a/vendor/github.com/containerd/containerd/v2/version/version.go b/vendor/github.com/containerd/containerd/v2/version/version.go deleted file mode 100644 index a1f3ae4fb7..0000000000 --- a/vendor/github.com/containerd/containerd/v2/version/version.go +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package version - -import "runtime" - -var ( - Name = "containerd" - // Package is filled at linking time - Package = "github.com/containerd/containerd/v2" - - // Version holds the complete version number. Filled in at linking time. - Version = "2.1.1+unknown" - - // Revision is filled with the VCS (e.g. git) revision being used to build - // the program at linking time. - Revision = "" - - // GoVersion is Go tree's version. - GoVersion = runtime.Version() -) - -// ConfigVersion is the current highest supported configuration version. -// This version is used by the main configuration as well as all plugins. -// Any configuration less than this version which has structural changes -// should migrate the configuration structures used by this version. -const ConfigVersion = 3 diff --git a/vendor/github.com/containerd/errdefs/pkg/errhttp/http.go b/vendor/github.com/containerd/errdefs/pkg/errhttp/http.go new file mode 100644 index 0000000000..d7cd2b8c1c --- /dev/null +++ b/vendor/github.com/containerd/errdefs/pkg/errhttp/http.go @@ -0,0 +1,96 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package errhttp provides utility functions for translating errors to +// and from a HTTP context. +// +// The functions ToHTTP and ToNative can be used to map server-side and +// client-side errors to the correct types. +package errhttp + +import ( + "errors" + "net/http" + + "github.com/containerd/errdefs" + "github.com/containerd/errdefs/pkg/internal/cause" +) + +// ToHTTP returns the best status code for the given error +func ToHTTP(err error) int { + switch { + case errdefs.IsNotFound(err): + return http.StatusNotFound + case errdefs.IsInvalidArgument(err): + return http.StatusBadRequest + case errdefs.IsConflict(err): + return http.StatusConflict + case errdefs.IsNotModified(err): + return http.StatusNotModified + case errdefs.IsFailedPrecondition(err): + return http.StatusPreconditionFailed + case errdefs.IsUnauthorized(err): + return http.StatusUnauthorized + case errdefs.IsPermissionDenied(err): + return http.StatusForbidden + case errdefs.IsResourceExhausted(err): + return http.StatusTooManyRequests + case errdefs.IsInternal(err): + return http.StatusInternalServerError + case errdefs.IsNotImplemented(err): + return http.StatusNotImplemented + case errdefs.IsUnavailable(err): + return http.StatusServiceUnavailable + case errdefs.IsUnknown(err): + var unexpected cause.ErrUnexpectedStatus + if errors.As(err, &unexpected) && unexpected.Status >= 200 && unexpected.Status < 600 { + return unexpected.Status + } + return http.StatusInternalServerError + default: + return http.StatusInternalServerError + } +} + +// ToNative returns the error best matching the HTTP status code +func ToNative(statusCode int) error { + switch statusCode { + case http.StatusNotFound: + return errdefs.ErrNotFound + case http.StatusBadRequest: + return errdefs.ErrInvalidArgument + case http.StatusConflict: + return errdefs.ErrConflict + case http.StatusPreconditionFailed: + return errdefs.ErrFailedPrecondition + case http.StatusUnauthorized: + return errdefs.ErrUnauthenticated + case http.StatusForbidden: + return errdefs.ErrPermissionDenied + case http.StatusNotModified: + return errdefs.ErrNotModified + case http.StatusTooManyRequests: + return errdefs.ErrResourceExhausted + case http.StatusInternalServerError: + return errdefs.ErrInternal + case http.StatusNotImplemented: + return errdefs.ErrNotImplemented + case http.StatusServiceUnavailable: + return errdefs.ErrUnavailable + default: + return cause.ErrUnexpectedStatus{Status: statusCode} + } +} diff --git a/vendor/github.com/containerd/fifo/.gitattributes b/vendor/github.com/containerd/fifo/.gitattributes deleted file mode 100644 index d207b1802b..0000000000 --- a/vendor/github.com/containerd/fifo/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.go text eol=lf diff --git a/vendor/github.com/containerd/fifo/.gitignore b/vendor/github.com/containerd/fifo/.gitignore deleted file mode 100644 index 7f7bd6ac8c..0000000000 --- a/vendor/github.com/containerd/fifo/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -coverage.txt -vendor/ diff --git a/vendor/github.com/containerd/fifo/.golangci.yml b/vendor/github.com/containerd/fifo/.golangci.yml deleted file mode 100644 index c124d3ea67..0000000000 --- a/vendor/github.com/containerd/fifo/.golangci.yml +++ /dev/null @@ -1,36 +0,0 @@ -linters: - enable: - - exportloopref # Checks for pointers to enclosing loop variables - - gofmt - - goimports - - gosec - - ineffassign - - misspell - - nolintlint - - revive - - staticcheck - - tenv # Detects using os.Setenv instead of t.Setenv since Go 1.17 - - unconvert - - unused - - vet - - dupword # Checks for duplicate words in the source code - disable: - - errcheck - -linters-settings: - gosec: - # The following issues surfaced when `gosec` linter - # was enabled. They are temporarily excluded to unblock - # the existing workflow, but still to be addressed by - # future works. - excludes: - - G204 - - G305 - - G306 - - G402 - - G404 - -run: - timeout: 3m - skip-dirs: - - vendor diff --git a/vendor/github.com/containerd/fifo/LICENSE b/vendor/github.com/containerd/fifo/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/vendor/github.com/containerd/fifo/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/containerd/fifo/Makefile b/vendor/github.com/containerd/fifo/Makefile deleted file mode 100644 index 40c5046a9f..0000000000 --- a/vendor/github.com/containerd/fifo/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright The containerd Authors. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -.PHONY: check test deps - -test: deps - go test -v -race ./... - -deps: - go mod vendor - -check: - GOGC=75 golangci-lint run diff --git a/vendor/github.com/containerd/fifo/errors.go b/vendor/github.com/containerd/fifo/errors.go deleted file mode 100644 index 50f73b2dc0..0000000000 --- a/vendor/github.com/containerd/fifo/errors.go +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package fifo - -import "errors" - -var ( - ErrClosed = errors.New("fifo closed") - ErrCtrlClosed = errors.New("control of closed fifo") - ErrRdFrmWRONLY = errors.New("reading from write-only fifo") - ErrReadClosed = errors.New("reading from a closed fifo") - ErrWrToRDONLY = errors.New("writing to read-only fifo") - ErrWriteClosed = errors.New("writing to a closed fifo") -) diff --git a/vendor/github.com/containerd/fifo/fifo.go b/vendor/github.com/containerd/fifo/fifo.go deleted file mode 100644 index 173bce960b..0000000000 --- a/vendor/github.com/containerd/fifo/fifo.go +++ /dev/null @@ -1,268 +0,0 @@ -//go:build !windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package fifo - -import ( - "context" - "fmt" - "io" - "os" - "runtime" - "sync" - "syscall" - - "golang.org/x/sys/unix" -) - -type fifo struct { - flag int - opened chan struct{} - closed chan struct{} - closing chan struct{} - err error - file *os.File - closingOnce sync.Once // close has been called - closedOnce sync.Once // fifo is closed - handle *handle -} - -var leakCheckWg *sync.WaitGroup - -// OpenFifoDup2 is same as OpenFifo, but additionally creates a copy of the FIFO file descriptor with dup2 syscall. -func OpenFifoDup2(ctx context.Context, fn string, flag int, perm os.FileMode, fd int) (io.ReadWriteCloser, error) { - f, err := openFifo(ctx, fn, flag, perm) - if err != nil { - return nil, fmt.Errorf("fifo error: %w", err) - } - - if err := unix.Dup2(int(f.file.Fd()), fd); err != nil { - _ = f.Close() - return nil, fmt.Errorf("dup2 error: %w", err) - } - - return f, nil -} - -// OpenFifo opens a fifo. Returns io.ReadWriteCloser. -// Context can be used to cancel this function until open(2) has not returned. -// Accepted flags: -// - syscall.O_CREAT - create new fifo if one doesn't exist -// - syscall.O_RDONLY - open fifo only from reader side -// - syscall.O_WRONLY - open fifo only from writer side -// - syscall.O_RDWR - open fifo from both sides, never block on syscall level -// - syscall.O_NONBLOCK - return io.ReadWriteCloser even if other side of the -// fifo isn't open. read/write will be connected after the actual fifo is -// open or after fifo is closed. -func OpenFifo(ctx context.Context, fn string, flag int, perm os.FileMode) (io.ReadWriteCloser, error) { - fifo, err := openFifo(ctx, fn, flag, perm) - if fifo == nil { - // Do not return a non-nil ReadWriteCloser((*fifo)(nil)) value - // as that can confuse callers. - return nil, err - } - return fifo, err -} - -func openFifo(ctx context.Context, fn string, flag int, perm os.FileMode) (*fifo, error) { - if _, err := os.Stat(fn); err != nil { - if os.IsNotExist(err) && flag&syscall.O_CREAT != 0 { - if err := syscall.Mkfifo(fn, uint32(perm&os.ModePerm)); err != nil && !os.IsExist(err) { - return nil, fmt.Errorf("error creating fifo %v: %w", fn, err) - } - } else { - return nil, err - } - } - - block := flag&syscall.O_NONBLOCK == 0 || flag&syscall.O_RDWR != 0 - - flag &= ^syscall.O_CREAT - flag &= ^syscall.O_NONBLOCK - - h, err := getHandle(fn) - if err != nil { - return nil, err - } - - f := &fifo{ - handle: h, - flag: flag, - opened: make(chan struct{}), - closed: make(chan struct{}), - closing: make(chan struct{}), - } - - wg := leakCheckWg - if wg != nil { - wg.Add(2) - } - - go func() { - if wg != nil { - defer wg.Done() - } - select { - case <-ctx.Done(): - select { - case <-f.opened: - default: - f.Close() - } - case <-f.opened: - case <-f.closed: - } - }() - go func() { - if wg != nil { - defer wg.Done() - } - var file *os.File - fn, err := h.Path() - if err == nil { - file, err = os.OpenFile(fn, flag, 0) - } - select { - case <-f.closing: - if err == nil { - select { - case <-ctx.Done(): - err = ctx.Err() - default: - err = fmt.Errorf("fifo %v was closed before opening", h.Name()) - } - if file != nil { - file.Close() - } - } - default: - } - if err != nil { - f.closedOnce.Do(func() { - f.err = err - close(f.closed) - }) - return - } - f.file = file - close(f.opened) - }() - if block { - select { - case <-f.opened: - case <-f.closed: - return nil, f.err - } - } - return f, nil -} - -// Read from a fifo to a byte array. -func (f *fifo) Read(b []byte) (int, error) { - if f.flag&syscall.O_WRONLY > 0 { - return 0, ErrRdFrmWRONLY - } - select { - case <-f.opened: - return f.file.Read(b) - default: - } - select { - case <-f.opened: - return f.file.Read(b) - case <-f.closed: - return 0, ErrReadClosed - } -} - -// Write from byte array to a fifo. -func (f *fifo) Write(b []byte) (int, error) { - if f.flag&(syscall.O_WRONLY|syscall.O_RDWR) == 0 { - return 0, ErrWrToRDONLY - } - select { - case <-f.opened: - return f.file.Write(b) - default: - } - select { - case <-f.opened: - return f.file.Write(b) - case <-f.closed: - return 0, ErrWriteClosed - } -} - -// Close the fifo. Next reads/writes will error. This method can also be used -// before open(2) has returned and fifo was never opened. -func (f *fifo) Close() (retErr error) { - for { - if f == nil { - return - } - - select { - case <-f.closed: - f.handle.Close() - return - default: - select { - case <-f.opened: - f.closedOnce.Do(func() { - retErr = f.file.Close() - f.err = retErr - close(f.closed) - }) - default: - if f.flag&syscall.O_RDWR != 0 { - runtime.Gosched() - break - } - f.closingOnce.Do(func() { - close(f.closing) - }) - reverseMode := syscall.O_WRONLY - if f.flag&syscall.O_WRONLY > 0 { - reverseMode = syscall.O_RDONLY - } - fn, err := f.handle.Path() - // if Close() is called concurrently(shouldn't) it may cause error - // because handle is closed - select { - case <-f.closed: - default: - if err != nil { - // Path has become invalid. We will leak a goroutine. - // This case should not happen in linux. - f.closedOnce.Do(func() { - f.err = err - close(f.closed) - }) - <-f.closed - break - } - f, err := os.OpenFile(fn, reverseMode|syscall.O_NONBLOCK, 0) - if err == nil { - f.Close() - } - runtime.Gosched() - } - } - } - } -} diff --git a/vendor/github.com/containerd/fifo/handle_linux.go b/vendor/github.com/containerd/fifo/handle_linux.go deleted file mode 100644 index 9710ccaa93..0000000000 --- a/vendor/github.com/containerd/fifo/handle_linux.go +++ /dev/null @@ -1,98 +0,0 @@ -//go:build linux - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package fifo - -import ( - "fmt" - "os" - "sync" - "syscall" -) - -//nolint:revive -const O_PATH = 010000000 - -type handle struct { - f *os.File - fd uintptr - dev uint64 - ino uint64 - closeOnce sync.Once - name string -} - -func getHandle(fn string) (*handle, error) { - f, err := os.OpenFile(fn, O_PATH, 0) - if err != nil { - return nil, fmt.Errorf("failed to open %v with O_PATH: %w", fn, err) - } - - var ( - stat syscall.Stat_t - fd = f.Fd() - ) - if err := syscall.Fstat(int(fd), &stat); err != nil { - f.Close() - return nil, fmt.Errorf("failed to stat handle %v: %w", fd, err) - } - - h := &handle{ - f: f, - name: fn, - //nolint:unconvert - dev: uint64(stat.Dev), - ino: stat.Ino, - fd: fd, - } - - // check /proc just in case - if _, err := os.Stat(h.procPath()); err != nil { - f.Close() - return nil, fmt.Errorf("couldn't stat %v: %w", h.procPath(), err) - } - - return h, nil -} - -func (h *handle) procPath() string { - return fmt.Sprintf("/proc/self/fd/%d", h.fd) -} - -func (h *handle) Name() string { - return h.name -} - -func (h *handle) Path() (string, error) { - var stat syscall.Stat_t - if err := syscall.Stat(h.procPath(), &stat); err != nil { - return "", fmt.Errorf("path %v could not be statted: %w", h.procPath(), err) - } - //nolint:unconvert - if uint64(stat.Dev) != h.dev || stat.Ino != h.ino { - return "", fmt.Errorf("failed to verify handle %v/%v %v/%v", stat.Dev, h.dev, stat.Ino, h.ino) - } - return h.procPath(), nil -} - -func (h *handle) Close() error { - h.closeOnce.Do(func() { - h.f.Close() - }) - return nil -} diff --git a/vendor/github.com/containerd/fifo/handle_nolinux.go b/vendor/github.com/containerd/fifo/handle_nolinux.go deleted file mode 100644 index f6863cf32a..0000000000 --- a/vendor/github.com/containerd/fifo/handle_nolinux.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:build !linux && !windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package fifo - -import ( - "fmt" - "syscall" -) - -type handle struct { - fn string - dev uint64 - ino uint64 -} - -func getHandle(fn string) (*handle, error) { - var stat syscall.Stat_t - if err := syscall.Stat(fn, &stat); err != nil { - return nil, fmt.Errorf("failed to stat %v: %w", fn, err) - } - - h := &handle{ - fn: fn, - dev: uint64(stat.Dev), //nolint:unconvert,nolintlint - ino: uint64(stat.Ino), //nolint:unconvert,nolintlint - } - - return h, nil -} - -func (h *handle) Path() (string, error) { - var stat syscall.Stat_t - if err := syscall.Stat(h.fn, &stat); err != nil { - return "", fmt.Errorf("path %v could not be statted: %w", h.fn, err) - } - if uint64(stat.Dev) != h.dev || uint64(stat.Ino) != h.ino { //nolint:unconvert,nolintlint - return "", fmt.Errorf("failed to verify handle %v/%v %v/%v for %v", stat.Dev, h.dev, stat.Ino, h.ino, h.fn) - } - return h.fn, nil -} - -func (h *handle) Name() string { - return h.fn -} - -func (h *handle) Close() error { - return nil -} diff --git a/vendor/github.com/containerd/fifo/raw.go b/vendor/github.com/containerd/fifo/raw.go deleted file mode 100644 index 9f18f76d2c..0000000000 --- a/vendor/github.com/containerd/fifo/raw.go +++ /dev/null @@ -1,114 +0,0 @@ -//go:build !windows - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package fifo - -import ( - "syscall" -) - -// SyscallConn provides raw access to the fifo's underlying filedescrptor. -// See syscall.Conn for guarantees provided by this interface. -func (f *fifo) SyscallConn() (syscall.RawConn, error) { - // deterministic check for closed - select { - case <-f.closed: - return nil, ErrClosed - default: - } - - select { - case <-f.closed: - return nil, ErrClosed - case <-f.opened: - return f.file.SyscallConn() - default: - } - - // Not opened and not closed, this means open is non-blocking AND it's not open yet - // Use rawConn to deal with non-blocking open. - rc := &rawConn{f: f, ready: make(chan struct{})} - go func() { - select { - case <-f.closed: - return - case <-f.opened: - rc.raw, rc.err = f.file.SyscallConn() - close(rc.ready) - } - }() - - return rc, nil -} - -type rawConn struct { - f *fifo - ready chan struct{} - raw syscall.RawConn - err error -} - -func (r *rawConn) Control(f func(fd uintptr)) error { - select { - case <-r.f.closed: - return ErrCtrlClosed - case <-r.ready: - } - - if r.err != nil { - return r.err - } - - return r.raw.Control(f) -} - -func (r *rawConn) Read(f func(fd uintptr) (done bool)) error { - if r.f.flag&syscall.O_WRONLY > 0 { - return ErrRdFrmWRONLY - } - - select { - case <-r.f.closed: - return ErrReadClosed - case <-r.ready: - } - - if r.err != nil { - return r.err - } - - return r.raw.Read(f) -} - -func (r *rawConn) Write(f func(fd uintptr) (done bool)) error { - if r.f.flag&(syscall.O_WRONLY|syscall.O_RDWR) == 0 { - return ErrWrToRDONLY - } - - select { - case <-r.f.closed: - return ErrWriteClosed - case <-r.ready: - } - - if r.err != nil { - return r.err - } - - return r.raw.Write(f) -} diff --git a/vendor/github.com/containerd/fifo/readme.md b/vendor/github.com/containerd/fifo/readme.md deleted file mode 100644 index ad4727dfe5..0000000000 --- a/vendor/github.com/containerd/fifo/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -### fifo - -[![PkgGoDev](https://pkg.go.dev/badge/github.com/containerd/fifo)](https://pkg.go.dev/github.com/containerd/fifo) -[![Build Status](https://github.com/containerd/fifo/workflows/CI/badge.svg)](https://github.com/containerd/fifo/actions?query=workflow%3ACI) -[![codecov](https://codecov.io/gh/containerd/fifo/branch/master/graph/badge.svg)](https://codecov.io/gh/containerd/fifo) -[![Go Report Card](https://goreportcard.com/badge/github.com/containerd/fifo)](https://goreportcard.com/report/github.com/containerd/fifo) - -Go package for handling fifos in a sane way. - -``` -// OpenFifo opens a fifo. Returns io.ReadWriteCloser. -// Context can be used to cancel this function until open(2) has not returned. -// Accepted flags: -// - syscall.O_CREAT - create new fifo if one doesn't exist -// - syscall.O_RDONLY - open fifo only from reader side -// - syscall.O_WRONLY - open fifo only from writer side -// - syscall.O_RDWR - open fifo from both sides, never block on syscall level -// - syscall.O_NONBLOCK - return io.ReadWriteCloser even if other side of the -// fifo isn't open. read/write will be connected after the actual fifo is -// open or after fifo is closed. -func OpenFifo(ctx context.Context, fn string, flag int, perm os.FileMode) (io.ReadWriteCloser, error) - - -// Read from a fifo to a byte array. -func (f *fifo) Read(b []byte) (int, error) - - -// Write from byte array to a fifo. -func (f *fifo) Write(b []byte) (int, error) - - -// Close the fifo. Next reads/writes will error. This method can also be used -// before open(2) has returned and fifo was never opened. -func (f *fifo) Close() error -``` - -## Project details - -The fifo is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). -As a containerd sub-project, you will find the: - - * [Project governance](https://github.com/containerd/project/blob/master/GOVERNANCE.md), - * [Maintainers](https://github.com/containerd/project/blob/master/MAINTAINERS), - * and [Contributing guidelines](https://github.com/containerd/project/blob/master/CONTRIBUTING.md) - -information in our [`containerd/project`](https://github.com/containerd/project) repository. diff --git a/vendor/github.com/containerd/fifo/utils.go b/vendor/github.com/containerd/fifo/utils.go deleted file mode 100644 index bbdf790154..0000000000 --- a/vendor/github.com/containerd/fifo/utils.go +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package fifo - -import "os" - -// IsFifo checks if a file is a (named pipe) fifo -// if the file does not exist then it returns false -func IsFifo(path string) (bool, error) { - stat, err := os.Stat(path) - if err != nil { - if os.IsNotExist(err) { - return false, nil - } - return false, err - } - if stat.Mode()&os.ModeNamedPipe == os.ModeNamedPipe { - return true, nil - } - return false, nil -} diff --git a/vendor/github.com/containerd/plugin/.golangci.yml b/vendor/github.com/containerd/plugin/.golangci.yml deleted file mode 100644 index d574fe11d7..0000000000 --- a/vendor/github.com/containerd/plugin/.golangci.yml +++ /dev/null @@ -1,32 +0,0 @@ -linters: - enable: - - copyloopvar - - gofmt - - goimports - - gosec - - ineffassign - - misspell - - nolintlint - - revive - - staticcheck - - tenv # Detects using os.Setenv instead of t.Setenv since Go 1.17 - - unconvert - - unused - - govet - - dupword # Checks for duplicate words in the source code - disable: - - errcheck - -run: - timeout: 5m - -issues: - exclude-dirs: - - api - - cluster - - design - - docs - - docs/man - - releases - - reports - - test # e2e scripts diff --git a/vendor/github.com/containerd/plugin/LICENSE b/vendor/github.com/containerd/plugin/LICENSE deleted file mode 100644 index 584149b6ee..0000000000 --- a/vendor/github.com/containerd/plugin/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright The containerd Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - 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. diff --git a/vendor/github.com/containerd/plugin/README.md b/vendor/github.com/containerd/plugin/README.md deleted file mode 100644 index eb1684f68a..0000000000 --- a/vendor/github.com/containerd/plugin/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# plugin - -A Go package providing a common plugin interface across containerd repositories. - -This package is intended to be imported by the main containerd repository as well as plugin implementations. -By sharing a common implementations, plugins can register themselves without needing to import the main containerd repository. -This plugin is intended to provide an interface and common functionality, but is not intended to define plugin types used by containerd. -Plugins should copy plugin type strings to avoid creating unintended depdenencies. - -## Project details - -**plugin** is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). -As a containerd sub-project, you will find the: - * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md), - * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS), - * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md) - -information in our [`containerd/project`](https://github.com/containerd/project) repository. - diff --git a/vendor/github.com/containerd/plugin/context.go b/vendor/github.com/containerd/plugin/context.go deleted file mode 100644 index 3b985ab75e..0000000000 --- a/vendor/github.com/containerd/plugin/context.go +++ /dev/null @@ -1,199 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package plugin - -import ( - "context" - "fmt" - - imagespec "github.com/opencontainers/image-spec/specs-go/v1" -) - -// InitContext is used for plugin initialization -type InitContext struct { - Context context.Context - Properties map[string]string - Config interface{} - RegisterReadiness func() func() - - // Meta is metadata plugins can fill in at init - Meta *Meta - - plugins *Set -} - -// NewContext returns a new plugin InitContext -func NewContext(ctx context.Context, plugins *Set, properties map[string]string) *InitContext { - if properties == nil { - properties = map[string]string{} - } - return &InitContext{ - Context: ctx, - Properties: properties, - Meta: &Meta{ - Exports: map[string]string{}, - }, - plugins: plugins, - } -} - -// Meta contains information gathered from the registration and initialization -// process. -type Meta struct { - Platforms []imagespec.Platform // platforms supported by plugin - Exports map[string]string // values exported by plugin - Capabilities []string // feature switches for plugin -} - -// Plugin represents an initialized plugin, used with an init context. -type Plugin struct { - Registration Registration // registration, as initialized - Config interface{} // config, as initialized - Meta Meta - - instance interface{} - err error // will be set if there was an error initializing the plugin -} - -// Err returns the errors during initialization. -// returns nil if no error was encountered -func (p *Plugin) Err() error { - return p.err -} - -// Instance returns the instance and any initialization error of the plugin -func (p *Plugin) Instance() (interface{}, error) { - return p.instance, p.err -} - -// Set defines a plugin collection, used with InitContext. -// -// This maintains ordering and unique indexing over the set. -// -// After iteratively instantiating plugins, this set should represent, the -// ordered, initialization set of plugins for a containerd instance. -type Set struct { - ordered []*Plugin // order of initialization - byTypeAndID map[Type]map[string]*Plugin -} - -// NewPluginSet returns an initialized plugin set -func NewPluginSet() *Set { - return &Set{ - byTypeAndID: make(map[Type]map[string]*Plugin), - } -} - -// Add a plugin to the set -func (ps *Set) Add(p *Plugin) error { - if byID, typeok := ps.byTypeAndID[p.Registration.Type]; !typeok { - ps.byTypeAndID[p.Registration.Type] = map[string]*Plugin{ - p.Registration.ID: p, - } - } else if _, idok := byID[p.Registration.ID]; !idok { - byID[p.Registration.ID] = p - } else { - return fmt.Errorf("plugin add failed for %s: %w", p.Registration.URI(), ErrPluginInitialized) - } - - ps.ordered = append(ps.ordered, p) - return nil -} - -// Get returns the plugin with the given type and id -func (ps *Set) Get(t Type, id string) *Plugin { - p, ok := ps.byTypeAndID[t] - if !ok { - return nil - } - return p[id] -} - -// GetAll returns all initialized plugins -func (ps *Set) GetAll() []*Plugin { - return ps.ordered -} - -// GetSingle returns a plugin instance of the given type when only a single instance -// of that type is expected. Throws an ErrPluginNotFound if no plugin is found and -// ErrPluginMultipleInstances when multiple instances are found. -// Since plugins are not ordered, if multiple instances is suported then -// GetByType should be used. If only one is expected, then to switch plugins, -// disable or remove the unused plugins of the same type. -func (i *InitContext) GetSingle(t Type) (interface{}, error) { - var ( - found bool - instance interface{} - ) - for _, v := range i.plugins.byTypeAndID[t] { - i, err := v.Instance() - if err != nil { - if IsSkipPlugin(err) { - continue - } - return i, err - } - if found { - return nil, fmt.Errorf("multiple plugins registered for %s: %w", t, ErrPluginMultipleInstances) - } - instance = i - found = true - } - if !found { - return nil, fmt.Errorf("no plugins registered for %s: %w", t, ErrPluginNotFound) - } - return instance, nil -} - -// Plugins returns plugin set -func (i *InitContext) Plugins() *Set { - return i.plugins -} - -// GetAll plugins in the set -func (i *InitContext) GetAll() []*Plugin { - return i.plugins.GetAll() -} - -// GetByID returns the plugin of the given type and ID -func (i *InitContext) GetByID(t Type, id string) (interface{}, error) { - p := i.plugins.Get(t, id) - if p == nil { - return nil, fmt.Errorf("no plugins registered for %s.%s: %w", t, id, ErrPluginNotFound) - } - return p.Instance() -} - -// GetByType returns all plugins with the specific type. -func (i *InitContext) GetByType(t Type) (map[string]interface{}, error) { - pi := map[string]interface{}{} - for id, p := range i.plugins.byTypeAndID[t] { - i, err := p.Instance() - if err != nil { - if IsSkipPlugin(err) { - continue - } - return nil, err - } - pi[id] = i - } - if len(pi) == 0 { - return nil, fmt.Errorf("no plugins registered for %s: %w", t, ErrPluginNotFound) - } - - return pi, nil -} diff --git a/vendor/github.com/containerd/plugin/plugin.go b/vendor/github.com/containerd/plugin/plugin.go deleted file mode 100644 index f7899e184f..0000000000 --- a/vendor/github.com/containerd/plugin/plugin.go +++ /dev/null @@ -1,178 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package plugin - -import ( - "context" - "errors" - "fmt" -) - -var ( - // ErrNoType is returned when no type is specified - ErrNoType = errors.New("plugin: no type") - // ErrNoPluginID is returned when no id is specified - ErrNoPluginID = errors.New("plugin: no id") - // ErrIDRegistered is returned when a duplicate id is already registered - ErrIDRegistered = errors.New("plugin: id already registered") - // ErrSkipPlugin is used when a plugin is not initialized and should not be loaded, - // this allows the plugin loader differentiate between a plugin which is configured - // not to load and one that fails to load. - ErrSkipPlugin = errors.New("skip plugin") - // ErrPluginInitialized is used when a plugin is already initialized - ErrPluginInitialized = errors.New("plugin: already initialized") - // ErrPluginNotFound is used when a plugin is looked up but not found - ErrPluginNotFound = errors.New("plugin: not found") - // ErrPluginMultipleInstances is used when a plugin is expected a single instance but has multiple - ErrPluginMultipleInstances = errors.New("plugin: multiple instances") - - // ErrInvalidRequires will be thrown if the requirements for a plugin are - // defined in an invalid manner. - ErrInvalidRequires = errors.New("invalid requires") -) - -// IsSkipPlugin returns true if the error is skipping the plugin -func IsSkipPlugin(err error) bool { - return errors.Is(err, ErrSkipPlugin) -} - -// Type is the type of the plugin -type Type string - -func (t Type) String() string { return string(t) } - -// Registration contains information for registering a plugin -type Registration struct { - // Type of the plugin - Type Type - // ID of the plugin - ID string - // Config specific to the plugin - Config interface{} - // Requires is a list of plugins that the registered plugin requires to be available - Requires []Type - - // InitFn is called when initializing a plugin. The registration and - // context are passed in. The init function may modify the registration to - // add exports, capabilities and platform support declarations. - InitFn func(*InitContext) (interface{}, error) - - // ConfigMigration allows a plugin to migrate configurations from an older - // version to handle plugin renames or moving of features from one plugin - // to another in a later version. - // The configuration map is keyed off the plugin name and the value - // is the configuration for that objects, with the structure defined - // for the plugin. No validation is done on the value before performing - // the migration. - ConfigMigration func(context.Context, int, map[string]interface{}) error -} - -// Init the registered plugin -func (r Registration) Init(ic *InitContext) *Plugin { - p, err := r.InitFn(ic) - return &Plugin{ - Registration: r, - Config: ic.Config, - Meta: *ic.Meta, - instance: p, - err: err, - } -} - -// URI returns the full plugin URI -func (r *Registration) URI() string { - return r.Type.String() + "." + r.ID -} - -// DisableFilter filters out disabled plugins -type DisableFilter func(r *Registration) bool - -// Registry is list of registrations which can be registered to and -// produce a filtered and ordered output. -// The Registry itself is immutable and the list will be copied -// and appeneded to a new registry when new items are registered. -type Registry []*Registration - -// Graph computes the ordered list of registrations based on their dependencies, -// filtering out any plugins which match the provided filter. -func (registry Registry) Graph(filter DisableFilter) []Registration { - disabled := map[*Registration]bool{} - for _, r := range registry { - if filter(r) { - disabled[r] = true - } - } - - ordered := make([]Registration, 0, len(registry)-len(disabled)) - added := map[*Registration]bool{} - for _, r := range registry { - if disabled[r] { - continue - } - children(r, registry, added, disabled, &ordered) - if !added[r] { - ordered = append(ordered, *r) - added[r] = true - } - } - return ordered -} - -func children(reg *Registration, registry []*Registration, added, disabled map[*Registration]bool, ordered *[]Registration) { - for _, t := range reg.Requires { - for _, r := range registry { - if !disabled[r] && r.URI() != reg.URI() && (t == "*" || r.Type == t) { - children(r, registry, added, disabled, ordered) - if !added[r] { - *ordered = append(*ordered, *r) - added[r] = true - } - } - } - } -} - -// Register adds the registration to a Registry and returns the -// updated Registry, panicking if registration could not succeed. -func (registry Registry) Register(r *Registration) Registry { - if r.Type == "" { - panic(ErrNoType) - } - if r.ID == "" { - panic(ErrNoPluginID) - } - if err := checkUnique(registry, r); err != nil { - panic(err) - } - - for _, requires := range r.Requires { - if requires == "*" && len(r.Requires) != 1 { - panic(ErrInvalidRequires) - } - } - - return append(registry, r) -} - -func checkUnique(registry Registry, r *Registration) error { - for _, registered := range registry { - if r.URI() == registered.URI() { - return fmt.Errorf("%s: %w", r.URI(), ErrIDRegistered) - } - } - return nil -} diff --git a/vendor/github.com/docker/docker/AUTHORS b/vendor/github.com/docker/docker/AUTHORS index a2e972e36c..c7c649471c 100644 --- a/vendor/github.com/docker/docker/AUTHORS +++ b/vendor/github.com/docker/docker/AUTHORS @@ -2,6 +2,7 @@ # This file lists all contributors to the repository. # See hack/generate-authors.sh to make modifications. +17neverends 7sunarni <710720732@qq.com> Aanand Prasad Aarni Koskela @@ -189,6 +190,7 @@ Anes Hasicic Angel Velazquez Anil Belur Anil Madhavapeddy +Anirudh Aithal Ankit Jain Ankush Agarwal Anonmily @@ -227,7 +229,7 @@ Arun Gupta Asad Saeeduddin Asbjørn Enge Ashly Mathew -Austin Vazquez +Austin Vazquez averagehuman Avi Das Avi Kivity @@ -377,6 +379,7 @@ Chen Qiu Cheng-mean Liu Chengfei Shang Chengguang Xu +Chengyu Zhu Chentianze Chenyang Yan chenyuzhu @@ -1209,6 +1212,7 @@ K. Heller Kai Blin Kai Qiang Wu (Kennan) Kaijie Chen +Kaita Nakamura Kamil Domański Kamjar Gerami Kanstantsin Shautsou @@ -1485,6 +1489,7 @@ Matthias Kühnle Matthias Rampke Matthieu Fronton Matthieu Hauglustaine +Matthieu MOREL Mattias Jernberg Mauricio Garavaglia mauriyouth @@ -1874,6 +1879,7 @@ Robert Obryk Robert Schneider Robert Shade Robert Stern +Robert Sturla Robert Terhaar Robert Wallis Robert Wang diff --git a/vendor/github.com/docker/docker/api/common.go b/vendor/github.com/docker/docker/api/common.go index d75c43d7c1..c375c68f2a 100644 --- a/vendor/github.com/docker/docker/api/common.go +++ b/vendor/github.com/docker/docker/api/common.go @@ -3,7 +3,7 @@ package api // import "github.com/docker/docker/api" // Common constants for daemon and client. const ( // DefaultVersion of the current REST API. - DefaultVersion = "1.49" + DefaultVersion = "1.50" // MinSupportedAPIVersion is the minimum API version that can be supported // by the API server, specified as "major.minor". Note that the daemon diff --git a/vendor/github.com/docker/docker/api/swagger.yaml b/vendor/github.com/docker/docker/api/swagger.yaml index 1183aaf2b5..619b4470eb 100644 --- a/vendor/github.com/docker/docker/api/swagger.yaml +++ b/vendor/github.com/docker/docker/api/swagger.yaml @@ -19,10 +19,10 @@ produces: consumes: - "application/json" - "text/plain" -basePath: "/v1.49" +basePath: "/v1.50" info: title: "Docker Engine API" - version: "1.49" + version: "1.50" x-logo: url: "https://docs.docker.com/assets/images/logo-docker-main.png" description: | @@ -55,8 +55,8 @@ info: the URL is not supported by the daemon, a HTTP `400 Bad Request` error message is returned. - If you omit the version-prefix, the current version of the API (v1.49) is used. - For example, calling `/info` is the same as calling `/v1.49/info`. Using the + If you omit the version-prefix, the current version of the API (v1.50) is used. + For example, calling `/info` is the same as calling `/v1.50/info`. Using the API without a version-prefix is deprecated and will be removed in a future release. Engine releases in the near future should support this version of the API, @@ -1428,63 +1428,10 @@ definitions: when starting a container from the image. type: "object" properties: - Hostname: - description: | - The hostname to use for the container, as a valid RFC 1123 hostname. - -


- - > **Deprecated**: this field is not part of the image specification and is - > always empty. It must not be used, and will be removed in API v1.48. - type: "string" - example: "" - Domainname: - description: | - The domain name to use for the container. - -


- - > **Deprecated**: this field is not part of the image specification and is - > always empty. It must not be used, and will be removed in API v1.48. - type: "string" - example: "" User: description: "The user that commands are run as inside the container." type: "string" example: "web:web" - AttachStdin: - description: | - Whether to attach to `stdin`. - -


- - > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. - type: "boolean" - default: false - example: false - AttachStdout: - description: | - Whether to attach to `stdout`. - -


- - > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. - type: "boolean" - default: false - example: false - AttachStderr: - description: | - Whether to attach to `stderr`. - -


- - > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. - type: "boolean" - default: false - example: false ExposedPorts: description: | An object mapping ports to an empty object in the form: @@ -1501,39 +1448,6 @@ definitions: "80/tcp": {}, "443/tcp": {} } - Tty: - description: | - Attach standard streams to a TTY, including `stdin` if it is not closed. - -


- - > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. - type: "boolean" - default: false - example: false - OpenStdin: - description: | - Open `stdin` - -


- - > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. - type: "boolean" - default: false - example: false - StdinOnce: - description: | - Close `stdin` after one attached client disconnects. - -


- - > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. - type: "boolean" - default: false - example: false Env: description: | A list of environment variables to set inside the container in the @@ -1559,18 +1473,6 @@ definitions: default: false example: false x-nullable: true - Image: - description: | - The name (or reference) of the image to use when creating the container, - or which was used when the container was created. - -


- - > **Deprecated**: this field is not part of the image specification and is - > always empty. It must not be used, and will be removed in API v1.48. - type: "string" - default: "" - example: "" Volumes: description: | An object mapping mount point paths inside the container to empty @@ -1599,30 +1501,6 @@ definitions: items: type: "string" example: [] - NetworkDisabled: - description: | - Disable networking for the container. - -


- - > **Deprecated**: this field is not part of the image specification and is - > always omitted. It must not be used, and will be removed in API v1.48. - type: "boolean" - default: false - example: false - x-nullable: true - MacAddress: - description: | - MAC address of the container. - -


- - > **Deprecated**: this field is not part of the image specification and is - > always omitted. It must not be used, and will be removed in API v1.48. - type: "string" - default: "" - example: "" - x-nullable: true OnBuild: description: | `ONBUILD` metadata that were defined in the image's `Dockerfile`. @@ -1645,17 +1523,6 @@ definitions: type: "string" example: "SIGTERM" x-nullable: true - StopTimeout: - description: | - Timeout to stop a container in seconds. - -


- - > **Deprecated**: this field is not part of the image specification and is - > always omitted. It must not be used, and will be removed in API v1.48. - type: "integer" - default: 10 - x-nullable: true Shell: description: | Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. @@ -1666,19 +1533,11 @@ definitions: example: ["/bin/sh", "-c"] # FIXME(thaJeztah): temporarily using a full example to remove some "omitempty" fields. Remove once the fields are removed. example: - "Hostname": "" - "Domainname": "" "User": "web:web" - "AttachStdin": false - "AttachStdout": false - "AttachStderr": false "ExposedPorts": { "80/tcp": {}, "443/tcp": {} } - "Tty": false - "OpenStdin": false - "StdinOnce": false "Env": ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"] "Cmd": ["/bin/sh"] "Healthcheck": { @@ -1690,7 +1549,6 @@ definitions: "StartInterval": 0 } "ArgsEscaped": true - "Image": "" "Volumes": { "/app/data": {}, "/app/config": {} @@ -2956,6 +2814,23 @@ definitions: progressDetail: $ref: "#/definitions/ProgressDetail" + DeviceInfo: + type: "object" + description: | + DeviceInfo represents a device that can be used by a container. + properties: + Source: + type: "string" + example: "cdi" + description: | + The origin device driver. + ID: + type: "string" + example: "vendor.com/gpu=0" + description: | + The unique identifier for the device within its source driver. + For CDI devices, this would be an FQDN like "vendor.com/gpu=0". + ErrorDetail: type: "object" properties: @@ -6858,6 +6733,15 @@ definitions: example: "24" FirewallBackend: $ref: "#/definitions/FirewallInfo" + DiscoveredDevices: + description: | + List of devices discovered by device drivers. + + Each device includes information about its source driver, kind, name, + and additional driver-specific attributes. + type: "array" + items: + $ref: "#/definitions/DeviceInfo" Warnings: description: | List of warnings / informational messages about missing features, or @@ -9934,6 +9818,18 @@ paths: description: "Do not delete untagged parent images" type: "boolean" default: false + - name: "platforms" + in: "query" + description: | + Select platform-specific content to delete. + Multiple values are accepted. + Each platform is a OCI platform encoded as a JSON string. + type: "array" + items: + # This should be OCIPlatform + # but $ref is not supported for array in query in Swagger 2.0 + # $ref: "#/definitions/OCIPlatform" + type: "string" tags: ["Image"] /images/search: get: diff --git a/vendor/github.com/docker/docker/api/types/backend/backend.go b/vendor/github.com/docker/docker/api/types/backend/backend.go index 4982bce366..9682ff6941 100644 --- a/vendor/github.com/docker/docker/api/types/backend/backend.go +++ b/vendor/github.com/docker/docker/api/types/backend/backend.go @@ -160,7 +160,7 @@ type ImageInspectOpts struct { type CommitConfig struct { Author string Comment string - Config *container.Config + Config *container.Config // TODO(thaJeztah); change this to [dockerspec.DockerOCIImageConfig] ContainerConfig *container.Config ContainerID string ContainerMountLabel string diff --git a/vendor/github.com/docker/docker/api/types/backend/build.go b/vendor/github.com/docker/docker/api/types/backend/build.go index 91715d0b91..41d7d64165 100644 --- a/vendor/github.com/docker/docker/api/types/backend/build.go +++ b/vendor/github.com/docker/docker/api/types/backend/build.go @@ -3,7 +3,7 @@ package backend // import "github.com/docker/docker/api/types/backend" import ( "io" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/registry" "github.com/docker/docker/pkg/streamformatter" ocispec "github.com/opencontainers/image-spec/specs-go/v1" @@ -34,7 +34,7 @@ type ProgressWriter struct { type BuildConfig struct { Source io.ReadCloser ProgressWriter ProgressWriter - Options *types.ImageBuildOptions + Options *build.ImageBuildOptions } // GetImageAndLayerOptions are the options supported by GetImageAndReleasableLayer diff --git a/vendor/github.com/docker/docker/api/types/build/build.go b/vendor/github.com/docker/docker/api/types/build/build.go new file mode 100644 index 0000000000..c43a0e21ea --- /dev/null +++ b/vendor/github.com/docker/docker/api/types/build/build.go @@ -0,0 +1,91 @@ +package build + +import ( + "io" + + "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/registry" +) + +// BuilderVersion sets the version of underlying builder to use +type BuilderVersion string + +const ( + // BuilderV1 is the first generation builder in docker daemon + BuilderV1 BuilderVersion = "1" + // BuilderBuildKit is builder based on moby/buildkit project + BuilderBuildKit BuilderVersion = "2" +) + +// Result contains the image id of a successful build. +type Result struct { + ID string +} + +// ImageBuildOptions holds the information +// necessary to build images. +type ImageBuildOptions struct { + Tags []string + SuppressOutput bool + RemoteContext string + NoCache bool + Remove bool + ForceRemove bool + PullParent bool + Isolation container.Isolation + CPUSetCPUs string + CPUSetMems string + CPUShares int64 + CPUQuota int64 + CPUPeriod int64 + Memory int64 + MemorySwap int64 + CgroupParent string + NetworkMode string + ShmSize int64 + Dockerfile string + Ulimits []*container.Ulimit + // BuildArgs needs to be a *string instead of just a string so that + // we can tell the difference between "" (empty string) and no value + // at all (nil). See the parsing of buildArgs in + // api/server/router/build/build_routes.go for even more info. + BuildArgs map[string]*string + AuthConfigs map[string]registry.AuthConfig + Context io.Reader + Labels map[string]string + // squash the resulting image's layers to the parent + // preserves the original image and creates a new one from the parent with all + // the changes applied to a single layer + Squash bool + // CacheFrom specifies images that are used for matching cache. Images + // specified here do not need to have a valid parent chain to match cache. + CacheFrom []string + SecurityOpt []string + ExtraHosts []string // List of extra hosts + Target string + SessionID string + Platform string + // Version specifies the version of the underlying builder to use + Version BuilderVersion + // BuildID is an optional identifier that can be passed together with the + // build request. The same identifier can be used to gracefully cancel the + // build with the cancel request. + BuildID string + // Outputs defines configurations for exporting build results. Only supported + // in BuildKit mode + Outputs []ImageBuildOutput +} + +// ImageBuildOutput defines configuration for exporting a build result +type ImageBuildOutput struct { + Type string + Attrs map[string]string +} + +// ImageBuildResponse holds information +// returned by a server after building +// an image. +type ImageBuildResponse struct { + Body io.ReadCloser + OSType string +} diff --git a/vendor/github.com/docker/docker/api/types/build/cache.go b/vendor/github.com/docker/docker/api/types/build/cache.go new file mode 100644 index 0000000000..42c8404573 --- /dev/null +++ b/vendor/github.com/docker/docker/api/types/build/cache.go @@ -0,0 +1,52 @@ +package build + +import ( + "time" + + "github.com/docker/docker/api/types/filters" +) + +// CacheRecord contains information about a build cache record. +type CacheRecord struct { + // ID is the unique ID of the build cache record. + ID string + // Parent is the ID of the parent build cache record. + // + // Deprecated: deprecated in API v1.42 and up, as it was deprecated in BuildKit; use Parents instead. + Parent string `json:"Parent,omitempty"` + // Parents is the list of parent build cache record IDs. + Parents []string `json:" Parents,omitempty"` + // Type is the cache record type. + Type string + // Description is a description of the build-step that produced the build cache. + Description string + // InUse indicates if the build cache is in use. + InUse bool + // Shared indicates if the build cache is shared. + Shared bool + // Size is the amount of disk space used by the build cache (in bytes). + Size int64 + // CreatedAt is the date and time at which the build cache was created. + CreatedAt time.Time + // LastUsedAt is the date and time at which the build cache was last used. + LastUsedAt *time.Time + UsageCount int +} + +// CachePruneOptions hold parameters to prune the build cache. +type CachePruneOptions struct { + All bool + ReservedSpace int64 + MaxUsedSpace int64 + MinFreeSpace int64 + Filters filters.Args + + KeepStorage int64 // Deprecated: deprecated in API 1.48. +} + +// CachePruneReport contains the response for Engine API: +// POST "/build/prune" +type CachePruneReport struct { + CachesDeleted []string + SpaceReclaimed uint64 +} diff --git a/vendor/github.com/docker/docker/api/types/build/disk_usage.go b/vendor/github.com/docker/docker/api/types/build/disk_usage.go new file mode 100644 index 0000000000..e969b6d615 --- /dev/null +++ b/vendor/github.com/docker/docker/api/types/build/disk_usage.go @@ -0,0 +1,8 @@ +package build + +// CacheDiskUsage contains disk usage for the build cache. +type CacheDiskUsage struct { + TotalSize int64 + Reclaimable int64 + Items []*CacheRecord +} diff --git a/vendor/github.com/docker/docker/api/types/client.go b/vendor/github.com/docker/docker/api/types/client.go index dce8260f32..a3704edd34 100644 --- a/vendor/github.com/docker/docker/api/types/client.go +++ b/vendor/github.com/docker/docker/api/types/client.go @@ -3,12 +3,7 @@ package types // import "github.com/docker/docker/api/types" import ( "bufio" "context" - "io" "net" - - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/registry" ) // NewHijackedResponse initializes a [HijackedResponse] type. @@ -51,165 +46,6 @@ func (h *HijackedResponse) CloseWrite() error { return nil } -// ImageBuildOptions holds the information -// necessary to build images. -type ImageBuildOptions struct { - Tags []string - SuppressOutput bool - RemoteContext string - NoCache bool - Remove bool - ForceRemove bool - PullParent bool - Isolation container.Isolation - CPUSetCPUs string - CPUSetMems string - CPUShares int64 - CPUQuota int64 - CPUPeriod int64 - Memory int64 - MemorySwap int64 - CgroupParent string - NetworkMode string - ShmSize int64 - Dockerfile string - Ulimits []*container.Ulimit - // BuildArgs needs to be a *string instead of just a string so that - // we can tell the difference between "" (empty string) and no value - // at all (nil). See the parsing of buildArgs in - // api/server/router/build/build_routes.go for even more info. - BuildArgs map[string]*string - AuthConfigs map[string]registry.AuthConfig - Context io.Reader - Labels map[string]string - // squash the resulting image's layers to the parent - // preserves the original image and creates a new one from the parent with all - // the changes applied to a single layer - Squash bool - // CacheFrom specifies images that are used for matching cache. Images - // specified here do not need to have a valid parent chain to match cache. - CacheFrom []string - SecurityOpt []string - ExtraHosts []string // List of extra hosts - Target string - SessionID string - Platform string - // Version specifies the version of the underlying builder to use - Version BuilderVersion - // BuildID is an optional identifier that can be passed together with the - // build request. The same identifier can be used to gracefully cancel the - // build with the cancel request. - BuildID string - // Outputs defines configurations for exporting build results. Only supported - // in BuildKit mode - Outputs []ImageBuildOutput -} - -// ImageBuildOutput defines configuration for exporting a build result -type ImageBuildOutput struct { - Type string - Attrs map[string]string -} - -// BuilderVersion sets the version of underlying builder to use -type BuilderVersion string - -const ( - // BuilderV1 is the first generation builder in docker daemon - BuilderV1 BuilderVersion = "1" - // BuilderBuildKit is builder based on moby/buildkit project - BuilderBuildKit BuilderVersion = "2" -) - -// ImageBuildResponse holds information -// returned by a server after building -// an image. -type ImageBuildResponse struct { - Body io.ReadCloser - OSType string -} - -// NodeListOptions holds parameters to list nodes with. -type NodeListOptions struct { - Filters filters.Args -} - -// NodeRemoveOptions holds parameters to remove nodes with. -type NodeRemoveOptions struct { - Force bool -} - -// ServiceCreateOptions contains the options to use when creating a service. -type ServiceCreateOptions struct { - // EncodedRegistryAuth is the encoded registry authorization credentials to - // use when updating the service. - // - // This field follows the format of the X-Registry-Auth header. - EncodedRegistryAuth string - - // QueryRegistry indicates whether the service update requires - // contacting a registry. A registry may be contacted to retrieve - // the image digest and manifest, which in turn can be used to update - // platform or other information about the service. - QueryRegistry bool -} - -// Values for RegistryAuthFrom in ServiceUpdateOptions -const ( - RegistryAuthFromSpec = "spec" - RegistryAuthFromPreviousSpec = "previous-spec" -) - -// ServiceUpdateOptions contains the options to be used for updating services. -type ServiceUpdateOptions struct { - // EncodedRegistryAuth is the encoded registry authorization credentials to - // use when updating the service. - // - // This field follows the format of the X-Registry-Auth header. - EncodedRegistryAuth string - - // TODO(stevvooe): Consider moving the version parameter of ServiceUpdate - // into this field. While it does open API users up to racy writes, most - // users may not need that level of consistency in practice. - - // RegistryAuthFrom specifies where to find the registry authorization - // credentials if they are not given in EncodedRegistryAuth. Valid - // values are "spec" and "previous-spec". - RegistryAuthFrom string - - // Rollback indicates whether a server-side rollback should be - // performed. When this is set, the provided spec will be ignored. - // The valid values are "previous" and "none". An empty value is the - // same as "none". - Rollback string - - // QueryRegistry indicates whether the service update requires - // contacting a registry. A registry may be contacted to retrieve - // the image digest and manifest, which in turn can be used to update - // platform or other information about the service. - QueryRegistry bool -} - -// ServiceListOptions holds parameters to list services with. -type ServiceListOptions struct { - Filters filters.Args - - // Status indicates whether the server should include the service task - // count of running and desired tasks. - Status bool -} - -// ServiceInspectOptions holds parameters related to the "service inspect" -// operation. -type ServiceInspectOptions struct { - InsertDefaults bool -} - -// TaskListOptions holds parameters to list tasks with. -type TaskListOptions struct { - Filters filters.Args -} - // PluginRemoveOptions holds parameters to remove plugins. type PluginRemoveOptions struct { Force bool @@ -243,13 +79,6 @@ type PluginInstallOptions struct { Args []string } -// SwarmUnlockKeyResponse contains the response for Engine API: -// GET /swarm/unlockkey -type SwarmUnlockKeyResponse struct { - // UnlockKey is the unlock key in ASCII-armored format. - UnlockKey string -} - // PluginCreateOptions hold all options to plugin create. type PluginCreateOptions struct { RepoName string diff --git a/vendor/github.com/docker/docker/api/types/container/container.go b/vendor/github.com/docker/docker/api/types/container/container.go index 65fabbf425..a191ca8bdb 100644 --- a/vendor/github.com/docker/docker/api/types/container/container.go +++ b/vendor/github.com/docker/docker/api/types/container/container.go @@ -104,7 +104,7 @@ type MountPoint struct { // State stores container's running state // it's part of ContainerJSONBase and returned by "inspect" command type State struct { - Status string // String representation of the container state. Can be one of "created", "running", "paused", "restarting", "removing", "exited", or "dead" + Status ContainerState // String representation of the container state. Can be one of "created", "running", "paused", "restarting", "removing", "exited", or "dead" Running bool Paused bool Restarting bool @@ -132,7 +132,7 @@ type Summary struct { SizeRw int64 `json:",omitempty"` SizeRootFs int64 `json:",omitempty"` Labels map[string]string - State string + State ContainerState Status string HostConfig struct { NetworkMode string `json:",omitempty"` diff --git a/vendor/github.com/docker/docker/api/types/container/disk_usage.go b/vendor/github.com/docker/docker/api/types/container/disk_usage.go new file mode 100644 index 0000000000..05b6cbe9c7 --- /dev/null +++ b/vendor/github.com/docker/docker/api/types/container/disk_usage.go @@ -0,0 +1,8 @@ +package container + +// DiskUsage contains disk usage for containers. +type DiskUsage struct { + TotalSize int64 + Reclaimable int64 + Items []*Summary +} diff --git a/vendor/github.com/docker/docker/api/types/container/health.go b/vendor/github.com/docker/docker/api/types/container/health.go index 93663746f6..96e91cc8d8 100644 --- a/vendor/github.com/docker/docker/api/types/container/health.go +++ b/vendor/github.com/docker/docker/api/types/container/health.go @@ -1,18 +1,27 @@ package container -import "time" +import ( + "fmt" + "strings" + "time" +) + +// HealthStatus is a string representation of the container's health. +// +// It currently is an alias for string, but may become a distinct type in future. +type HealthStatus = string // Health states const ( - NoHealthcheck = "none" // Indicates there is no healthcheck - Starting = "starting" // Starting indicates that the container is not yet ready - Healthy = "healthy" // Healthy indicates that the container is running correctly - Unhealthy = "unhealthy" // Unhealthy indicates that the container has a problem + NoHealthcheck HealthStatus = "none" // Indicates there is no healthcheck + Starting HealthStatus = "starting" // Starting indicates that the container is not yet ready + Healthy HealthStatus = "healthy" // Healthy indicates that the container is running correctly + Unhealthy HealthStatus = "unhealthy" // Unhealthy indicates that the container has a problem ) // Health stores information about the container's healthcheck results type Health struct { - Status string // Status is one of [Starting], [Healthy] or [Unhealthy]. + Status HealthStatus // Status is one of [Starting], [Healthy] or [Unhealthy]. FailingStreak int // FailingStreak is the number of consecutive failures Log []*HealthcheckResult // Log contains the last few results (oldest first) } @@ -24,3 +33,18 @@ type HealthcheckResult struct { ExitCode int // ExitCode meanings: 0=healthy, 1=unhealthy, 2=reserved (considered unhealthy), else=error running probe Output string // Output from last check } + +var validHealths = []string{ + NoHealthcheck, Starting, Healthy, Unhealthy, +} + +// ValidateHealthStatus checks if the provided string is a valid +// container [HealthStatus]. +func ValidateHealthStatus(s HealthStatus) error { + switch s { + case NoHealthcheck, Starting, Healthy, Unhealthy: + return nil + default: + return errInvalidParameter{error: fmt.Errorf("invalid value for health (%s): must be one of %s", s, strings.Join(validHealths, ", "))} + } +} diff --git a/vendor/github.com/docker/docker/api/types/container/hostconfig.go b/vendor/github.com/docker/docker/api/types/container/hostconfig.go index 83198305e7..87ca82683f 100644 --- a/vendor/github.com/docker/docker/api/types/container/hostconfig.go +++ b/vendor/github.com/docker/docker/api/types/container/hostconfig.go @@ -145,7 +145,7 @@ func (n NetworkMode) IsDefault() bool { // IsPrivate indicates whether container uses its private network stack. func (n NetworkMode) IsPrivate() bool { - return !(n.IsHost() || n.IsContainer()) + return !n.IsHost() && !n.IsContainer() } // IsContainer indicates whether container uses a container network stack. @@ -230,7 +230,7 @@ type PidMode string // IsPrivate indicates whether the container uses its own new pid namespace. func (n PidMode) IsPrivate() bool { - return !(n.IsHost() || n.IsContainer()) + return !n.IsHost() && !n.IsContainer() } // IsHost indicates whether the container uses the host's pid namespace. diff --git a/vendor/github.com/docker/docker/api/types/container/state.go b/vendor/github.com/docker/docker/api/types/container/state.go new file mode 100644 index 0000000000..78d5c4fe85 --- /dev/null +++ b/vendor/github.com/docker/docker/api/types/container/state.go @@ -0,0 +1,64 @@ +package container + +import ( + "fmt" + "strings" +) + +// ContainerState is a string representation of the container's current state. +// +// It currently is an alias for string, but may become a distinct type in the future. +type ContainerState = string + +const ( + StateCreated ContainerState = "created" // StateCreated indicates the container is created, but not (yet) started. + StateRunning ContainerState = "running" // StateRunning indicates that the container is running. + StatePaused ContainerState = "paused" // StatePaused indicates that the container's current state is paused. + StateRestarting ContainerState = "restarting" // StateRestarting indicates that the container is currently restarting. + StateRemoving ContainerState = "removing" // StateRemoving indicates that the container is being removed. + StateExited ContainerState = "exited" // StateExited indicates that the container exited. + StateDead ContainerState = "dead" // StateDead indicates that the container failed to be deleted. Containers in this state are attempted to be cleaned up when the daemon restarts. +) + +var validStates = []ContainerState{ + StateCreated, StateRunning, StatePaused, StateRestarting, StateRemoving, StateExited, StateDead, +} + +// ValidateContainerState checks if the provided string is a valid +// container [ContainerState]. +func ValidateContainerState(s ContainerState) error { + switch s { + case StateCreated, StateRunning, StatePaused, StateRestarting, StateRemoving, StateExited, StateDead: + return nil + default: + return errInvalidParameter{error: fmt.Errorf("invalid value for state (%s): must be one of %s", s, strings.Join(validStates, ", "))} + } +} + +// StateStatus is used to return container wait results. +// Implements exec.ExitCode interface. +// This type is needed as State include a sync.Mutex field which make +// copying it unsafe. +type StateStatus struct { + exitCode int + err error +} + +// ExitCode returns current exitcode for the state. +func (s StateStatus) ExitCode() int { + return s.exitCode +} + +// Err returns current error for the state. Returns nil if the container had +// exited on its own. +func (s StateStatus) Err() error { + return s.err +} + +// NewStateStatus returns a new StateStatus with the given exit code and error. +func NewStateStatus(exitCode int, err error) StateStatus { + return StateStatus{ + exitCode: exitCode, + err: err, + } +} diff --git a/vendor/github.com/docker/docker/api/types/image/disk_usage.go b/vendor/github.com/docker/docker/api/types/image/disk_usage.go new file mode 100644 index 0000000000..b29d925cac --- /dev/null +++ b/vendor/github.com/docker/docker/api/types/image/disk_usage.go @@ -0,0 +1,8 @@ +package image + +// DiskUsage contains disk usage for images. +type DiskUsage struct { + TotalSize int64 + Reclaimable int64 + Items []*Summary +} diff --git a/vendor/github.com/docker/docker/api/types/image/image_inspect.go b/vendor/github.com/docker/docker/api/types/image/image_inspect.go index 40d1f97a31..3bdb474287 100644 --- a/vendor/github.com/docker/docker/api/types/image/image_inspect.go +++ b/vendor/github.com/docker/docker/api/types/image/image_inspect.go @@ -3,6 +3,7 @@ package image import ( "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/storage" + dockerspec "github.com/moby/docker-image-spec/specs-go/v1" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) @@ -84,7 +85,7 @@ type InspectResponse struct { // Author is the name of the author that was specified when committing the // image, or as specified through MAINTAINER (deprecated) in the Dockerfile. Author string - Config *container.Config + Config *dockerspec.DockerOCIImageConfig // Architecture is the hardware CPU architecture that the image runs on. Architecture string diff --git a/vendor/github.com/docker/docker/api/types/image/opts.go b/vendor/github.com/docker/docker/api/types/image/opts.go index 57800e0d47..fd038557c0 100644 --- a/vendor/github.com/docker/docker/api/types/image/opts.go +++ b/vendor/github.com/docker/docker/api/types/image/opts.go @@ -83,6 +83,7 @@ type ListOptions struct { // RemoveOptions holds parameters to remove images. type RemoveOptions struct { + Platforms []ocispec.Platform Force bool PruneChildren bool } diff --git a/vendor/github.com/docker/docker/api/types/plugins/logdriver/entry.pb.go b/vendor/github.com/docker/docker/api/types/plugins/logdriver/entry.pb.go deleted file mode 100644 index 167d1d5f88..0000000000 --- a/vendor/github.com/docker/docker/api/types/plugins/logdriver/entry.pb.go +++ /dev/null @@ -1,755 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: entry.proto - -package logdriver - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type LogEntry struct { - Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` - TimeNano int64 `protobuf:"varint,2,opt,name=time_nano,json=timeNano,proto3" json:"time_nano,omitempty"` - Line []byte `protobuf:"bytes,3,opt,name=line,proto3" json:"line,omitempty"` - Partial bool `protobuf:"varint,4,opt,name=partial,proto3" json:"partial,omitempty"` - PartialLogMetadata *PartialLogEntryMetadata `protobuf:"bytes,5,opt,name=partial_log_metadata,json=partialLogMetadata,proto3" json:"partial_log_metadata,omitempty"` -} - -func (m *LogEntry) Reset() { *m = LogEntry{} } -func (m *LogEntry) String() string { return proto.CompactTextString(m) } -func (*LogEntry) ProtoMessage() {} -func (*LogEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_daa6c5b6c627940f, []int{0} -} -func (m *LogEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LogEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LogEntry.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LogEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_LogEntry.Merge(m, src) -} -func (m *LogEntry) XXX_Size() int { - return m.Size() -} -func (m *LogEntry) XXX_DiscardUnknown() { - xxx_messageInfo_LogEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_LogEntry proto.InternalMessageInfo - -func (m *LogEntry) GetSource() string { - if m != nil { - return m.Source - } - return "" -} - -func (m *LogEntry) GetTimeNano() int64 { - if m != nil { - return m.TimeNano - } - return 0 -} - -func (m *LogEntry) GetLine() []byte { - if m != nil { - return m.Line - } - return nil -} - -func (m *LogEntry) GetPartial() bool { - if m != nil { - return m.Partial - } - return false -} - -func (m *LogEntry) GetPartialLogMetadata() *PartialLogEntryMetadata { - if m != nil { - return m.PartialLogMetadata - } - return nil -} - -type PartialLogEntryMetadata struct { - Last bool `protobuf:"varint,1,opt,name=last,proto3" json:"last,omitempty"` - Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - Ordinal int32 `protobuf:"varint,3,opt,name=ordinal,proto3" json:"ordinal,omitempty"` -} - -func (m *PartialLogEntryMetadata) Reset() { *m = PartialLogEntryMetadata{} } -func (m *PartialLogEntryMetadata) String() string { return proto.CompactTextString(m) } -func (*PartialLogEntryMetadata) ProtoMessage() {} -func (*PartialLogEntryMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_daa6c5b6c627940f, []int{1} -} -func (m *PartialLogEntryMetadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PartialLogEntryMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PartialLogEntryMetadata.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PartialLogEntryMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_PartialLogEntryMetadata.Merge(m, src) -} -func (m *PartialLogEntryMetadata) XXX_Size() int { - return m.Size() -} -func (m *PartialLogEntryMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_PartialLogEntryMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_PartialLogEntryMetadata proto.InternalMessageInfo - -func (m *PartialLogEntryMetadata) GetLast() bool { - if m != nil { - return m.Last - } - return false -} - -func (m *PartialLogEntryMetadata) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *PartialLogEntryMetadata) GetOrdinal() int32 { - if m != nil { - return m.Ordinal - } - return 0 -} - -func init() { - proto.RegisterType((*LogEntry)(nil), "LogEntry") - proto.RegisterType((*PartialLogEntryMetadata)(nil), "PartialLogEntryMetadata") -} - -func init() { proto.RegisterFile("entry.proto", fileDescriptor_daa6c5b6c627940f) } - -var fileDescriptor_daa6c5b6c627940f = []byte{ - // 250 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xbd, 0x4a, 0x04, 0x31, - 0x14, 0x85, 0xe7, 0xce, 0xfe, 0x38, 0x73, 0x57, 0x2c, 0x82, 0x68, 0x40, 0x08, 0x61, 0xab, 0x54, - 0x5b, 0xe8, 0x1b, 0x08, 0x36, 0xa2, 0x22, 0x69, 0x2c, 0x87, 0xab, 0x13, 0x96, 0xc0, 0x6c, 0x32, - 0x64, 0x63, 0xe1, 0x5b, 0xf8, 0x3a, 0xbe, 0x81, 0xe5, 0x96, 0x96, 0x32, 0xf3, 0x22, 0x32, 0x71, - 0xc6, 0xce, 0xee, 0x9c, 0xf3, 0xa5, 0xf8, 0x72, 0x71, 0x65, 0x5c, 0x0c, 0x6f, 0x9b, 0x36, 0xf8, - 0xe8, 0xd7, 0x1f, 0x80, 0xc5, 0x9d, 0xdf, 0xde, 0x0c, 0x13, 0x3b, 0xc3, 0xe5, 0xde, 0xbf, 0x86, - 0x17, 0xc3, 0x41, 0x82, 0x2a, 0xf5, 0xd8, 0xd8, 0x05, 0x96, 0xd1, 0xee, 0x4c, 0xe5, 0xc8, 0x79, - 0x9e, 0x4b, 0x50, 0x33, 0x5d, 0x0c, 0xc3, 0x03, 0x39, 0xcf, 0x18, 0xce, 0x1b, 0xeb, 0x0c, 0x9f, - 0x49, 0x50, 0xc7, 0x3a, 0x65, 0xc6, 0xf1, 0xa8, 0xa5, 0x10, 0x2d, 0x35, 0x7c, 0x2e, 0x41, 0x15, - 0x7a, 0xaa, 0xec, 0x16, 0x4f, 0xc7, 0x58, 0x35, 0x7e, 0x5b, 0xed, 0x4c, 0xa4, 0x9a, 0x22, 0xf1, - 0x85, 0x04, 0xb5, 0xba, 0xe4, 0x9b, 0xc7, 0x5f, 0x38, 0x29, 0xdd, 0x8f, 0x5c, 0xb3, 0xf6, 0x0f, - 0x4c, 0xdb, 0xfa, 0x09, 0xcf, 0xff, 0x79, 0x9e, 0xa4, 0x68, 0x1f, 0xd3, 0x3f, 0x0a, 0x9d, 0x32, - 0x3b, 0xc1, 0xdc, 0xd6, 0x49, 0xbf, 0xd4, 0xb9, 0xad, 0x07, 0x49, 0x1f, 0x6a, 0xeb, 0xa8, 0x49, - 0xee, 0x0b, 0x3d, 0xd5, 0x6b, 0xfe, 0xd9, 0x09, 0x38, 0x74, 0x02, 0xbe, 0x3b, 0x01, 0xef, 0xbd, - 0xc8, 0x0e, 0xbd, 0xc8, 0xbe, 0x7a, 0x91, 0x3d, 0x2f, 0xd3, 0xd5, 0xae, 0x7e, 0x02, 0x00, 0x00, - 0xff, 0xff, 0xbb, 0x82, 0x62, 0xd5, 0x44, 0x01, 0x00, 0x00, -} - -func (m *LogEntry) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LogEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LogEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PartialLogMetadata != nil { - { - size, err := m.PartialLogMetadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.Partial { - i-- - if m.Partial { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if len(m.Line) > 0 { - i -= len(m.Line) - copy(dAtA[i:], m.Line) - i = encodeVarintEntry(dAtA, i, uint64(len(m.Line))) - i-- - dAtA[i] = 0x1a - } - if m.TimeNano != 0 { - i = encodeVarintEntry(dAtA, i, uint64(m.TimeNano)) - i-- - dAtA[i] = 0x10 - } - if len(m.Source) > 0 { - i -= len(m.Source) - copy(dAtA[i:], m.Source) - i = encodeVarintEntry(dAtA, i, uint64(len(m.Source))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PartialLogEntryMetadata) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PartialLogEntryMetadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PartialLogEntryMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Ordinal != 0 { - i = encodeVarintEntry(dAtA, i, uint64(m.Ordinal)) - i-- - dAtA[i] = 0x18 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintEntry(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0x12 - } - if m.Last { - i-- - if m.Last { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintEntry(dAtA []byte, offset int, v uint64) int { - offset -= sovEntry(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *LogEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Source) - if l > 0 { - n += 1 + l + sovEntry(uint64(l)) - } - if m.TimeNano != 0 { - n += 1 + sovEntry(uint64(m.TimeNano)) - } - l = len(m.Line) - if l > 0 { - n += 1 + l + sovEntry(uint64(l)) - } - if m.Partial { - n += 2 - } - if m.PartialLogMetadata != nil { - l = m.PartialLogMetadata.Size() - n += 1 + l + sovEntry(uint64(l)) - } - return n -} - -func (m *PartialLogEntryMetadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Last { - n += 2 - } - l = len(m.Id) - if l > 0 { - n += 1 + l + sovEntry(uint64(l)) - } - if m.Ordinal != 0 { - n += 1 + sovEntry(uint64(m.Ordinal)) - } - return n -} - -func sovEntry(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEntry(x uint64) (n int) { - return sovEntry(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *LogEntry) Unmarshal(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 ErrIntOverflowEntry - } - 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: LogEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LogEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Source = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeNano", wireType) - } - m.TimeNano = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimeNano |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Line", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthEntry - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Line = append(m.Line[:0], dAtA[iNdEx:postIndex]...) - if m.Line == nil { - m.Line = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Partial", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Partial = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialLogMetadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEntry - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PartialLogMetadata == nil { - m.PartialLogMetadata = &PartialLogEntryMetadata{} - } - if err := m.PartialLogMetadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEntry(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEntry - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PartialLogEntryMetadata) Unmarshal(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 ErrIntOverflowEntry - } - 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: PartialLogEntryMetadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PartialLogEntryMetadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Last", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Last = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Ordinal", wireType) - } - m.Ordinal = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Ordinal |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEntry(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEntry - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEntry(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEntry - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEntry - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEntry - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthEntry - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEntry - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEntry - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEntry = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEntry = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEntry = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/docker/docker/api/types/plugins/logdriver/entry.proto b/vendor/github.com/docker/docker/api/types/plugins/logdriver/entry.proto deleted file mode 100644 index 75be3d6416..0000000000 --- a/vendor/github.com/docker/docker/api/types/plugins/logdriver/entry.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -message LogEntry { - string source = 1; - int64 time_nano = 2; - bytes line = 3; - bool partial = 4; - PartialLogEntryMetadata partial_log_metadata = 5; -} - -message PartialLogEntryMetadata { - bool last = 1; - string id = 2; - int32 ordinal = 3; -} - diff --git a/vendor/github.com/docker/docker/api/types/plugins/logdriver/gen.go b/vendor/github.com/docker/docker/api/types/plugins/logdriver/gen.go deleted file mode 100644 index 04d39c2f95..0000000000 --- a/vendor/github.com/docker/docker/api/types/plugins/logdriver/gen.go +++ /dev/null @@ -1,3 +0,0 @@ -//go:generate protoc --gogofaster_out=import_path=github.com/docker/docker/api/types/plugins/logdriver:. entry.proto - -package logdriver // import "github.com/docker/docker/api/types/plugins/logdriver" diff --git a/vendor/github.com/docker/docker/api/types/plugins/logdriver/io.go b/vendor/github.com/docker/docker/api/types/plugins/logdriver/io.go deleted file mode 100644 index 9081b3b45f..0000000000 --- a/vendor/github.com/docker/docker/api/types/plugins/logdriver/io.go +++ /dev/null @@ -1,87 +0,0 @@ -package logdriver // import "github.com/docker/docker/api/types/plugins/logdriver" - -import ( - "encoding/binary" - "io" -) - -const binaryEncodeLen = 4 - -// LogEntryEncoder encodes a LogEntry to a protobuf stream -// The stream should look like: -// -// [uint32 binary encoded message size][protobuf message] -// -// To decode an entry, read the first 4 bytes to get the size of the entry, -// then read `size` bytes from the stream. -type LogEntryEncoder interface { - Encode(*LogEntry) error -} - -// NewLogEntryEncoder creates a protobuf stream encoder for log entries. -// This is used to write out log entries to a stream. -func NewLogEntryEncoder(w io.Writer) LogEntryEncoder { - return &logEntryEncoder{ - w: w, - buf: make([]byte, 1024), - } -} - -type logEntryEncoder struct { - buf []byte - w io.Writer -} - -func (e *logEntryEncoder) Encode(l *LogEntry) error { - n := l.Size() - - total := n + binaryEncodeLen - if total > len(e.buf) { - e.buf = make([]byte, total) - } - binary.BigEndian.PutUint32(e.buf, uint32(n)) - - if _, err := l.MarshalTo(e.buf[binaryEncodeLen:]); err != nil { - return err - } - _, err := e.w.Write(e.buf[:total]) - return err -} - -// LogEntryDecoder decodes log entries from a stream -// It is expected that the wire format is as defined by LogEntryEncoder. -type LogEntryDecoder interface { - Decode(*LogEntry) error -} - -// NewLogEntryDecoder creates a new stream decoder for log entries -func NewLogEntryDecoder(r io.Reader) LogEntryDecoder { - return &logEntryDecoder{ - lenBuf: make([]byte, binaryEncodeLen), - buf: make([]byte, 1024), - r: r, - } -} - -type logEntryDecoder struct { - r io.Reader - lenBuf []byte - buf []byte -} - -func (d *logEntryDecoder) Decode(l *LogEntry) error { - _, err := io.ReadFull(d.r, d.lenBuf) - if err != nil { - return err - } - - size := int(binary.BigEndian.Uint32(d.lenBuf)) - if len(d.buf) < size { - d.buf = make([]byte, size) - } - - if _, err := io.ReadFull(d.r, d.buf[:size]); err != nil { - return err - } - return l.Unmarshal(d.buf[:size]) -} diff --git a/vendor/github.com/docker/docker/api/types/swarm/config.go b/vendor/github.com/docker/docker/api/types/swarm/config.go index f9a65187ff..bdec82ffbd 100644 --- a/vendor/github.com/docker/docker/api/types/swarm/config.go +++ b/vendor/github.com/docker/docker/api/types/swarm/config.go @@ -1,6 +1,10 @@ package swarm // import "github.com/docker/docker/api/types/swarm" -import "os" +import ( + "os" + + "github.com/docker/docker/api/types/filters" +) // Config represents a config. type Config struct { @@ -44,3 +48,15 @@ type ConfigReference struct { ConfigID string ConfigName string } + +// ConfigCreateResponse contains the information returned to a client +// on the creation of a new config. +type ConfigCreateResponse struct { + // ID is the id of the created config. + ID string +} + +// ConfigListOptions holds parameters to list configs +type ConfigListOptions struct { + Filters filters.Args +} diff --git a/vendor/github.com/docker/docker/api/types/swarm/node.go b/vendor/github.com/docker/docker/api/types/swarm/node.go index bb98d5eedc..f175b1b2c6 100644 --- a/vendor/github.com/docker/docker/api/types/swarm/node.go +++ b/vendor/github.com/docker/docker/api/types/swarm/node.go @@ -1,4 +1,5 @@ package swarm // import "github.com/docker/docker/api/types/swarm" +import "github.com/docker/docker/api/types/filters" // Node represents a node. type Node struct { @@ -137,3 +138,13 @@ const ( type Topology struct { Segments map[string]string `json:",omitempty"` } + +// NodeListOptions holds parameters to list nodes with. +type NodeListOptions struct { + Filters filters.Args +} + +// NodeRemoveOptions holds parameters to remove nodes with. +type NodeRemoveOptions struct { + Force bool +} diff --git a/vendor/github.com/docker/docker/api/types/swarm/secret.go b/vendor/github.com/docker/docker/api/types/swarm/secret.go index aeb5bb54ad..248cffab8e 100644 --- a/vendor/github.com/docker/docker/api/types/swarm/secret.go +++ b/vendor/github.com/docker/docker/api/types/swarm/secret.go @@ -1,6 +1,10 @@ package swarm // import "github.com/docker/docker/api/types/swarm" -import "os" +import ( + "os" + + "github.com/docker/docker/api/types/filters" +) // Secret represents a secret. type Secret struct { @@ -48,3 +52,15 @@ type SecretReference struct { SecretID string SecretName string } + +// SecretCreateResponse contains the information returned to a client +// on the creation of a new secret. +type SecretCreateResponse struct { + // ID is the id of the created secret. + ID string +} + +// SecretListOptions holds parameters to list secrets +type SecretListOptions struct { + Filters filters.Args +} diff --git a/vendor/github.com/docker/docker/api/types/swarm/service.go b/vendor/github.com/docker/docker/api/types/swarm/service.go index 5b6d5ec120..1d0a9a47bc 100644 --- a/vendor/github.com/docker/docker/api/types/swarm/service.go +++ b/vendor/github.com/docker/docker/api/types/swarm/service.go @@ -1,6 +1,10 @@ package swarm // import "github.com/docker/docker/api/types/swarm" -import "time" +import ( + "time" + + "github.com/docker/docker/api/types/filters" +) // Service represents a service. type Service struct { @@ -200,3 +204,69 @@ type JobStatus struct { // Swarm manager. LastExecution time.Time `json:",omitempty"` } + +// ServiceCreateOptions contains the options to use when creating a service. +type ServiceCreateOptions struct { + // EncodedRegistryAuth is the encoded registry authorization credentials to + // use when updating the service. + // + // This field follows the format of the X-Registry-Auth header. + EncodedRegistryAuth string + + // QueryRegistry indicates whether the service update requires + // contacting a registry. A registry may be contacted to retrieve + // the image digest and manifest, which in turn can be used to update + // platform or other information about the service. + QueryRegistry bool +} + +// Values for RegistryAuthFrom in ServiceUpdateOptions +const ( + RegistryAuthFromSpec = "spec" + RegistryAuthFromPreviousSpec = "previous-spec" +) + +// ServiceUpdateOptions contains the options to be used for updating services. +type ServiceUpdateOptions struct { + // EncodedRegistryAuth is the encoded registry authorization credentials to + // use when updating the service. + // + // This field follows the format of the X-Registry-Auth header. + EncodedRegistryAuth string + + // TODO(stevvooe): Consider moving the version parameter of ServiceUpdate + // into this field. While it does open API users up to racy writes, most + // users may not need that level of consistency in practice. + + // RegistryAuthFrom specifies where to find the registry authorization + // credentials if they are not given in EncodedRegistryAuth. Valid + // values are "spec" and "previous-spec". + RegistryAuthFrom string + + // Rollback indicates whether a server-side rollback should be + // performed. When this is set, the provided spec will be ignored. + // The valid values are "previous" and "none". An empty value is the + // same as "none". + Rollback string + + // QueryRegistry indicates whether the service update requires + // contacting a registry. A registry may be contacted to retrieve + // the image digest and manifest, which in turn can be used to update + // platform or other information about the service. + QueryRegistry bool +} + +// ServiceListOptions holds parameters to list services with. +type ServiceListOptions struct { + Filters filters.Args + + // Status indicates whether the server should include the service task + // count of running and desired tasks. + Status bool +} + +// ServiceInspectOptions holds parameters related to the "service inspect" +// operation. +type ServiceInspectOptions struct { + InsertDefaults bool +} diff --git a/vendor/github.com/docker/docker/api/types/swarm/swarm.go b/vendor/github.com/docker/docker/api/types/swarm/swarm.go index 1b4be6fffb..2711c9eac5 100644 --- a/vendor/github.com/docker/docker/api/types/swarm/swarm.go +++ b/vendor/github.com/docker/docker/api/types/swarm/swarm.go @@ -235,3 +235,10 @@ type UpdateFlags struct { RotateManagerToken bool RotateManagerUnlockKey bool } + +// UnlockKeyResponse contains the response for Engine API: +// GET /swarm/unlockkey +type UnlockKeyResponse struct { + // UnlockKey is the unlock key in ASCII-armored format. + UnlockKey string +} diff --git a/vendor/github.com/docker/docker/api/types/swarm/task.go b/vendor/github.com/docker/docker/api/types/swarm/task.go index ad3eeca0b7..722d1ceb62 100644 --- a/vendor/github.com/docker/docker/api/types/swarm/task.go +++ b/vendor/github.com/docker/docker/api/types/swarm/task.go @@ -3,6 +3,7 @@ package swarm // import "github.com/docker/docker/api/types/swarm" import ( "time" + "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/swarm/runtime" ) @@ -223,3 +224,8 @@ type VolumeAttachment struct { // in the ContainerSpec, that this volume fulfills. Target string `json:",omitempty"` } + +// TaskListOptions holds parameters to list tasks with. +type TaskListOptions struct { + Filters filters.Args +} diff --git a/vendor/github.com/docker/docker/api/types/system/disk_usage.go b/vendor/github.com/docker/docker/api/types/system/disk_usage.go new file mode 100644 index 0000000000..99078cf196 --- /dev/null +++ b/vendor/github.com/docker/docker/api/types/system/disk_usage.go @@ -0,0 +1,17 @@ +package system + +import ( + "github.com/docker/docker/api/types/build" + "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/image" + "github.com/docker/docker/api/types/volume" +) + +// DiskUsage contains response of Engine API for API 1.49 and greater: +// GET "/system/df" +type DiskUsage struct { + Images *image.DiskUsage + Containers *container.DiskUsage + Volumes *volume.DiskUsage + BuildCache *build.CacheDiskUsage +} diff --git a/vendor/github.com/docker/docker/api/types/system/info.go b/vendor/github.com/docker/docker/api/types/system/info.go index 27173d4630..047639ed91 100644 --- a/vendor/github.com/docker/docker/api/types/system/info.go +++ b/vendor/github.com/docker/docker/api/types/system/info.go @@ -29,8 +29,6 @@ type Info struct { CPUSet bool PidsLimit bool IPv4Forwarding bool - BridgeNfIptables bool `json:"BridgeNfIptables"` // Deprecated: netfilter module is now loaded on-demand and no longer during daemon startup, making this field obsolete. This field is always false and will be removed in the next release. - BridgeNfIP6tables bool `json:"BridgeNfIp6tables"` // Deprecated: netfilter module is now loaded on-demand and no longer during daemon startup, making this field obsolete. This field is always false and will be removed in the next release. Debug bool NFd int OomKillDisable bool @@ -75,6 +73,7 @@ type Info struct { DefaultAddressPools []NetworkAddressPool `json:",omitempty"` FirewallBackend *FirewallInfo `json:"FirewallBackend,omitempty"` CDISpecDirs []string + DiscoveredDevices []DeviceInfo `json:",omitempty"` Containerd *ContainerdInfo `json:",omitempty"` @@ -160,3 +159,12 @@ type FirewallInfo struct { // Info is a list of label/value pairs, containing information related to the firewall. Info [][2]string `json:"Info,omitempty"` } + +// DeviceInfo represents a discoverable device from a device driver. +type DeviceInfo struct { + // Source indicates the origin device driver. + Source string `json:"Source"` + // ID is the unique identifier for the device. + // Example: CDI FQDN like "vendor.com/gpu=0", or other driver-specific device ID + ID string `json:"ID"` +} diff --git a/vendor/github.com/docker/docker/api/types/time/timestamp.go b/vendor/github.com/docker/docker/api/types/time/timestamp.go index cab5c32e3f..edd1d6ecb2 100644 --- a/vendor/github.com/docker/docker/api/types/time/timestamp.go +++ b/vendor/github.com/docker/docker/api/types/time/timestamp.go @@ -30,7 +30,7 @@ func GetTimestamp(value string, reference time.Time) (string, error) { var format string // if the string has a Z or a + or three dashes use parse otherwise use parseinlocation - parseInLocation := !(strings.ContainsAny(value, "zZ+") || strings.Count(value, "-") == 3) + parseInLocation := !strings.ContainsAny(value, "zZ+") && strings.Count(value, "-") != 3 if strings.Contains(value, ".") { if parseInLocation { @@ -105,23 +105,23 @@ func GetTimestamp(value string, reference time.Time) (string, error) { // since := time.Unix(seconds, nanoseconds) // // returns seconds as defaultSeconds if value == "" -func ParseTimestamps(value string, defaultSeconds int64) (seconds int64, nanoseconds int64, err error) { +func ParseTimestamps(value string, defaultSeconds int64) (seconds int64, nanoseconds int64, _ error) { if value == "" { return defaultSeconds, 0, nil } return parseTimestamp(value) } -func parseTimestamp(value string) (sec int64, nsec int64, err error) { +func parseTimestamp(value string) (seconds int64, nanoseconds int64, _ error) { s, n, ok := strings.Cut(value, ".") - sec, err = strconv.ParseInt(s, 10, 64) + sec, err := strconv.ParseInt(s, 10, 64) if err != nil { return sec, 0, err } if !ok { return sec, 0, nil } - nsec, err = strconv.ParseInt(n, 10, 64) + nsec, err := strconv.ParseInt(n, 10, 64) if err != nil { return sec, nsec, err } diff --git a/vendor/github.com/docker/docker/api/types/types.go b/vendor/github.com/docker/docker/api/types/types.go index 82ae339c31..443cf82a93 100644 --- a/vendor/github.com/docker/docker/api/types/types.go +++ b/vendor/github.com/docker/docker/api/types/types.go @@ -1,10 +1,8 @@ package types // import "github.com/docker/docker/api/types" import ( - "time" - + "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/image" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/api/types/volume" @@ -24,7 +22,7 @@ type Ping struct { APIVersion string OSType string Experimental bool - BuilderVersion BuilderVersion + BuilderVersion build.BuilderVersion // SwarmStatus provides information about the current swarm status of the // engine, obtained from the "Swarm" header in the API response. @@ -91,41 +89,10 @@ type DiskUsage struct { Images []*image.Summary Containers []*container.Summary Volumes []*volume.Volume - BuildCache []*BuildCache + BuildCache []*build.CacheRecord BuilderSize int64 `json:",omitempty"` // Deprecated: deprecated in API 1.38, and no longer used since API 1.40. } -// BuildCachePruneReport contains the response for Engine API: -// POST "/build/prune" -type BuildCachePruneReport struct { - CachesDeleted []string - SpaceReclaimed uint64 -} - -// SecretCreateResponse contains the information returned to a client -// on the creation of a new secret. -type SecretCreateResponse struct { - // ID is the id of the created secret. - ID string -} - -// SecretListOptions holds parameters to list secrets -type SecretListOptions struct { - Filters filters.Args -} - -// ConfigCreateResponse contains the information returned to a client -// on the creation of a new config. -type ConfigCreateResponse struct { - // ID is the id of the created config. - ID string -} - -// ConfigListOptions holds parameters to list configs -type ConfigListOptions struct { - Filters filters.Args -} - // PushResult contains the tag, manifest digest, and manifest size from the // push. It's used to signal this information to the trust code in the client // so it can sign the manifest if necessary. @@ -134,46 +101,3 @@ type PushResult struct { Digest string Size int } - -// BuildResult contains the image id of a successful build -type BuildResult struct { - ID string -} - -// BuildCache contains information about a build cache record. -type BuildCache struct { - // ID is the unique ID of the build cache record. - ID string - // Parent is the ID of the parent build cache record. - // - // Deprecated: deprecated in API v1.42 and up, as it was deprecated in BuildKit; use Parents instead. - Parent string `json:"Parent,omitempty"` - // Parents is the list of parent build cache record IDs. - Parents []string `json:" Parents,omitempty"` - // Type is the cache record type. - Type string - // Description is a description of the build-step that produced the build cache. - Description string - // InUse indicates if the build cache is in use. - InUse bool - // Shared indicates if the build cache is shared. - Shared bool - // Size is the amount of disk space used by the build cache (in bytes). - Size int64 - // CreatedAt is the date and time at which the build cache was created. - CreatedAt time.Time - // LastUsedAt is the date and time at which the build cache was last used. - LastUsedAt *time.Time - UsageCount int -} - -// BuildCachePruneOptions hold parameters to prune the build cache -type BuildCachePruneOptions struct { - All bool - ReservedSpace int64 - MaxUsedSpace int64 - MinFreeSpace int64 - Filters filters.Args - - KeepStorage int64 // Deprecated: deprecated in API 1.48. -} diff --git a/vendor/github.com/docker/docker/api/types/types_deprecated.go b/vendor/github.com/docker/docker/api/types/types_deprecated.go index 93e4336adc..8456a45607 100644 --- a/vendor/github.com/docker/docker/api/types/types_deprecated.go +++ b/vendor/github.com/docker/docker/api/types/types_deprecated.go @@ -3,10 +3,12 @@ package types import ( "context" + "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/common" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/image" "github.com/docker/docker/api/types/storage" + "github.com/docker/docker/api/types/swarm" ) // IDResponse Response to an API call that returns just an Id. @@ -113,3 +115,127 @@ type ImageInspect = image.InspectResponse // // Deprecated: moved to [github.com/docker/docker/api/types/registry.RequestAuthConfig]. type RequestPrivilegeFunc func(context.Context) (string, error) + +// SecretCreateResponse contains the information returned to a client +// on the creation of a new secret. +// +// Deprecated: use [swarm.SecretCreateResponse]. +type SecretCreateResponse = swarm.SecretCreateResponse + +// SecretListOptions holds parameters to list secrets +// +// Deprecated: use [swarm.SecretListOptions]. +type SecretListOptions = swarm.SecretListOptions + +// ConfigCreateResponse contains the information returned to a client +// on the creation of a new config. +// +// Deprecated: use [swarm.ConfigCreateResponse]. +type ConfigCreateResponse = swarm.ConfigCreateResponse + +// ConfigListOptions holds parameters to list configs +// +// Deprecated: use [swarm.ConfigListOptions]. +type ConfigListOptions = swarm.ConfigListOptions + +// NodeListOptions holds parameters to list nodes with. +// +// Deprecated: use [swarm.NodeListOptions]. +type NodeListOptions = swarm.NodeListOptions + +// NodeRemoveOptions holds parameters to remove nodes with. +// +// Deprecated: use [swarm.NodeRemoveOptions]. +type NodeRemoveOptions = swarm.NodeRemoveOptions + +// TaskListOptions holds parameters to list tasks with. +// +// Deprecated: use [swarm.TaskListOptions]. +type TaskListOptions = swarm.TaskListOptions + +// ServiceCreateOptions contains the options to use when creating a service. +// +// Deprecated: use [swarm.ServiceCreateOptions]. +type ServiceCreateOptions = swarm.ServiceCreateOptions + +// ServiceUpdateOptions contains the options to be used for updating services. +// +// Deprecated: use [swarm.ServiceCreateOptions]. +type ServiceUpdateOptions = swarm.ServiceUpdateOptions + +const ( + RegistryAuthFromSpec = swarm.RegistryAuthFromSpec // Deprecated: use [swarm.RegistryAuthFromSpec]. + RegistryAuthFromPreviousSpec = swarm.RegistryAuthFromPreviousSpec // Deprecated: use [swarm.RegistryAuthFromPreviousSpec]. +) + +// ServiceListOptions holds parameters to list services with. +// +// Deprecated: use [swarm.ServiceListOptions]. +type ServiceListOptions = swarm.ServiceListOptions + +// ServiceInspectOptions holds parameters related to the "service inspect" +// operation. +// +// Deprecated: use [swarm.ServiceInspectOptions]. +type ServiceInspectOptions = swarm.ServiceInspectOptions + +// SwarmUnlockKeyResponse contains the response for Engine API: +// GET /swarm/unlockkey +// +// Deprecated: use [swarm.UnlockKeyResponse]. +type SwarmUnlockKeyResponse = swarm.UnlockKeyResponse + +// BuildCache contains information about a build cache record. +// +// Deprecated: deprecated in API 1.49. Use [build.CacheRecord] instead. +type BuildCache = build.CacheRecord + +// BuildCachePruneOptions hold parameters to prune the build cache +// +// Deprecated: use [build.CachePruneOptions]. +type BuildCachePruneOptions = build.CachePruneOptions + +// BuildCachePruneReport contains the response for Engine API: +// POST "/build/prune" +// +// Deprecated: use [build.CachePruneReport]. +type BuildCachePruneReport = build.CachePruneReport + +// BuildResult contains the image id of a successful build/ +// +// Deprecated: use [build.Result]. +type BuildResult = build.Result + +// ImageBuildOptions holds the information +// necessary to build images. +// +// Deprecated: use [build.ImageBuildOptions]. +type ImageBuildOptions = build.ImageBuildOptions + +// ImageBuildOutput defines configuration for exporting a build result +// +// Deprecated: use [build.ImageBuildOutput]. +type ImageBuildOutput = build.ImageBuildOutput + +// ImageBuildResponse holds information +// returned by a server after building +// an image. +// +// Deprecated: use [build.ImageBuildResponse]. +type ImageBuildResponse = build.ImageBuildResponse + +// BuilderVersion sets the version of underlying builder to use +// +// Deprecated: use [build.BuilderVersion]. +type BuilderVersion = build.BuilderVersion + +const ( + // BuilderV1 is the first generation builder in docker daemon + // + // Deprecated: use [build.BuilderV1]. + BuilderV1 = build.BuilderV1 + // BuilderBuildKit is builder based on moby/buildkit project + // + // Deprecated: use [build.BuilderBuildKit]. + BuilderBuildKit = build.BuilderBuildKit +) diff --git a/vendor/github.com/docker/docker/api/types/volume/disk_usage.go b/vendor/github.com/docker/docker/api/types/volume/disk_usage.go new file mode 100644 index 0000000000..3d716c6e00 --- /dev/null +++ b/vendor/github.com/docker/docker/api/types/volume/disk_usage.go @@ -0,0 +1,8 @@ +package volume + +// DiskUsage contains disk usage for volumes. +type DiskUsage struct { + TotalSize int64 + Reclaimable int64 + Items []*Volume +} diff --git a/vendor/github.com/docker/docker/builder/builder.go b/vendor/github.com/docker/docker/builder/builder.go index dff93cfac7..8c1247b23c 100644 --- a/vendor/github.com/docker/docker/builder/builder.go +++ b/vendor/github.com/docker/docker/builder/builder.go @@ -10,7 +10,6 @@ import ( "github.com/docker/docker/api/types/backend" "github.com/docker/docker/api/types/container" - containerpkg "github.com/docker/docker/container" "github.com/docker/docker/image" "github.com/docker/docker/layer" "github.com/opencontainers/go-digest" @@ -66,7 +65,7 @@ type ExecBackend interface { // ContainerStart starts a new container ContainerStart(ctx context.Context, containerID string, checkpoint string, checkpointDir string) error // ContainerWait stops processing until the given container is stopped. - ContainerWait(ctx context.Context, name string, condition containerpkg.WaitCondition) (<-chan containerpkg.StateStatus, error) + ContainerWait(ctx context.Context, name string, condition container.WaitCondition) (<-chan container.StateStatus, error) } // Result is the output produced by a Builder diff --git a/vendor/github.com/docker/docker/builder/dockerfile/builder.go b/vendor/github.com/docker/docker/builder/dockerfile/builder.go index 6c0661d95c..f4439bb4d4 100644 --- a/vendor/github.com/docker/docker/builder/dockerfile/builder.go +++ b/vendor/github.com/docker/docker/builder/dockerfile/builder.go @@ -10,8 +10,8 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/backend" + "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/container" "github.com/docker/docker/builder" "github.com/docker/docker/builder/remotecontext" @@ -99,7 +99,7 @@ func (bm *BuildManager) Build(ctx context.Context, config backend.BuildConfig) ( // builderOptions are the dependencies required by the builder type builderOptions struct { - Options *types.ImageBuildOptions + Options *build.ImageBuildOptions Backend builder.Backend ProgressWriter backend.ProgressWriter PathCache pathCache @@ -109,7 +109,7 @@ type builderOptions struct { // Builder is a Dockerfile builder // It implements the builder.Backend interface. type Builder struct { - options *types.ImageBuildOptions + options *build.ImageBuildOptions Stdout io.Writer Stderr io.Writer @@ -131,7 +131,7 @@ type Builder struct { func newBuilder(ctx context.Context, options builderOptions) (*Builder, error) { config := options.Options if config == nil { - config = new(types.ImageBuildOptions) + config = new(build.ImageBuildOptions) } imgProber, err := newImageProber(ctx, options.Backend, config.CacheFrom, config.NoCache) @@ -222,7 +222,7 @@ func emitImageID(aux *streamformatter.AuxFormatter, state *dispatchState) error if aux == nil || state.imageID == "" { return nil } - return aux.Emit("", types.BuildResult{ID: state.imageID}) + return aux.Emit("", build.Result{ID: state.imageID}) } func processMetaArg(meta instructions.ArgCommand, shlex *shell.Lex, args *BuildArgs) error { @@ -331,7 +331,7 @@ func BuildFromConfig(ctx context.Context, config *container.Config, changes []st } b, err := newBuilder(ctx, builderOptions{ - Options: &types.ImageBuildOptions{NoCache: true}, + Options: &build.ImageBuildOptions{NoCache: true}, }) if err != nil { return nil, err diff --git a/vendor/github.com/docker/docker/builder/dockerfile/containerbackend.go b/vendor/github.com/docker/docker/builder/dockerfile/containerbackend.go index c81923cbc6..11e6404f74 100644 --- a/vendor/github.com/docker/docker/builder/dockerfile/containerbackend.go +++ b/vendor/github.com/docker/docker/builder/dockerfile/containerbackend.go @@ -5,12 +5,11 @@ import ( "fmt" "io" + cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/docker/docker/api/types/backend" "github.com/docker/docker/api/types/container" "github.com/docker/docker/builder" - containerpkg "github.com/docker/docker/container" - "github.com/docker/docker/errdefs" "github.com/docker/docker/pkg/stringid" "github.com/pkg/errors" ) @@ -44,7 +43,7 @@ func (c *containerManager) Create(ctx context.Context, runConfig *container.Conf var errCancelled = errors.New("build cancelled") // Run a container by ID -func (c *containerManager) Run(ctx context.Context, cID string, stdout, stderr io.Writer) (err error) { +func (c *containerManager) Run(ctx context.Context, cID string, stdout, stderr io.Writer) error { attached := make(chan struct{}) errCh := make(chan error, 1) go func() { @@ -62,7 +61,7 @@ func (c *containerManager) Run(ctx context.Context, cID string, stdout, stderr i select { case <-ctx.Done(): log.G(ctx).Debugln("Build cancelled, removing container:", cID) - err = c.backend.ContainerRm(cID, &backend.ContainerRmConfig{ForceRemove: true, RemoveVolume: true}) + err := c.backend.ContainerRm(cID, &backend.ContainerRmConfig{ForceRemove: true, RemoveVolume: true}) if err != nil { _, _ = fmt.Fprintf(stdout, "Removing container %s: %v\n", stringid.TruncateID(cID), err) } @@ -85,7 +84,7 @@ func (c *containerManager) Run(ctx context.Context, cID string, stdout, stderr i return err } - waitC, err := c.backend.ContainerWait(ctx, cID, containerpkg.WaitConditionNotRunning) + waitC, err := c.backend.ContainerWait(ctx, cID, container.WaitConditionNotRunning) if err != nil { close(finished) logCancellationError(cancelErrCh, fmt.Sprintf("unable to begin ContainerWait: %s", err)) @@ -94,8 +93,7 @@ func (c *containerManager) Run(ctx context.Context, cID string, stdout, stderr i if status := <-waitC; status.ExitCode() != 0 { close(finished) - logCancellationError(cancelErrCh, - fmt.Sprintf("a non-zero code from ContainerWait: %d", status.ExitCode())) + logCancellationError(cancelErrCh, fmt.Sprintf("a non-zero code from ContainerWait: %d", status.ExitCode())) return &statusCodeError{code: status.ExitCode(), err: status.Err()} } @@ -128,7 +126,7 @@ func (e *statusCodeError) StatusCode() int { // RemoveAll containers managed by this container manager func (c *containerManager) RemoveAll(stdout io.Writer) { for containerID := range c.tmpContainers { - if err := c.backend.ContainerRm(containerID, &backend.ContainerRmConfig{ForceRemove: true, RemoveVolume: true}); err != nil && !errdefs.IsNotFound(err) { + if err := c.backend.ContainerRm(containerID, &backend.ContainerRmConfig{ForceRemove: true, RemoveVolume: true}); err != nil && !cerrdefs.IsNotFound(err) { _, _ = fmt.Fprintf(stdout, "Removing intermediate container %s: %v\n", stringid.TruncateID(containerID), err) continue } diff --git a/vendor/github.com/docker/docker/builder/dockerfile/copy.go b/vendor/github.com/docker/docker/builder/dockerfile/copy.go index 51d01ebab3..cf6abc0c85 100644 --- a/vendor/github.com/docker/docker/builder/dockerfile/copy.go +++ b/vendor/github.com/docker/docker/builder/dockerfile/copy.go @@ -251,7 +251,7 @@ func (o *copier) copyWithWildcards(origPath string) ([]copyInfo, error) { if err != nil { return err } - rel, err := remotecontext.Rel(root, path) + rel, err := filepath.Rel(root, path) if err != nil { return err } @@ -309,7 +309,7 @@ func walkSource(source builder.Source, origPath string) ([]string, error) { if err != nil { return err } - rel, err := remotecontext.Rel(source.Root(), path) + rel, err := filepath.Rel(source.Root(), path) if err != nil { return err } diff --git a/vendor/github.com/docker/docker/builder/dockerfile/copy_unix.go b/vendor/github.com/docker/docker/builder/dockerfile/copy_unix.go index b538f9eb6c..7d96caae65 100644 --- a/vendor/github.com/docker/docker/builder/dockerfile/copy_unix.go +++ b/vendor/github.com/docker/docker/builder/dockerfile/copy_unix.go @@ -60,9 +60,10 @@ func normalizeDest(workingDir, requested string) (string, error) { func containsWildcards(name string) bool { for i := 0; i < len(name); i++ { ch := name[i] - if ch == '\\' { + switch ch { + case '\\': i++ - } else if ch == '*' || ch == '?' || ch == '[' { + case '*', '?', '[': return true } } diff --git a/vendor/github.com/docker/docker/builder/dockerfile/evaluator.go b/vendor/github.com/docker/docker/builder/dockerfile/evaluator.go index cc23bf0a52..30678c882d 100644 --- a/vendor/github.com/docker/docker/builder/dockerfile/evaluator.go +++ b/vendor/github.com/docker/docker/builder/dockerfile/evaluator.go @@ -35,7 +35,7 @@ import ( "github.com/pkg/errors" ) -func dispatch(ctx context.Context, d dispatchRequest, cmd instructions.Command) (err error) { +func dispatch(ctx context.Context, d dispatchRequest, cmd instructions.Command) (retErr error) { if c, ok := cmd.(instructions.PlatformSpecific); ok { err := c.CheckPlatform(d.state.operatingSystem) if err != nil { @@ -60,7 +60,7 @@ func dispatch(ctx context.Context, d dispatchRequest, cmd instructions.Command) d.builder.containerManager.RemoveAll(d.builder.Stdout) return } - if d.builder.options.Remove && err == nil { + if d.builder.options.Remove && retErr == nil { d.builder.containerManager.RemoveAll(d.builder.Stdout) return } diff --git a/vendor/github.com/docker/docker/builder/dockerfile/internals.go b/vendor/github.com/docker/docker/builder/dockerfile/internals.go index 7d33b3c05f..bc8af8deb9 100644 --- a/vendor/github.com/docker/docker/builder/dockerfile/internals.go +++ b/vendor/github.com/docker/docker/builder/dockerfile/internals.go @@ -12,8 +12,8 @@ import ( "github.com/containerd/log" "github.com/containerd/platforms" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/backend" + "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/network" "github.com/docker/docker/builder" @@ -323,7 +323,7 @@ func copyStringSlice(orig []string) []string { // getShell is a helper function which gets the right shell for prefixing the // shell-form of RUN, ENTRYPOINT and CMD instructions func getShell(c *container.Config, os string) []string { - if 0 == len(c.Shell) { + if len(c.Shell) == 0 { return append([]string{}, defaultShellForOS(os)[:]...) } return append([]string{}, c.Shell[:]...) @@ -364,7 +364,7 @@ func (b *Builder) create(ctx context.Context, runConfig *container.Config) (stri return ctr.ID, nil } -func hostConfigFromOptions(options *types.ImageBuildOptions) *container.HostConfig { +func hostConfigFromOptions(options *build.ImageBuildOptions) *container.HostConfig { resources := container.Resources{ CgroupParent: options.CgroupParent, CPUShares: options.CPUShares, diff --git a/vendor/github.com/docker/docker/builder/remotecontext/archive.go b/vendor/github.com/docker/docker/builder/remotecontext/archive.go index 073d8dde12..33fb118732 100644 --- a/vendor/github.com/docker/docker/builder/remotecontext/archive.go +++ b/vendor/github.com/docker/docker/builder/remotecontext/archive.go @@ -118,9 +118,9 @@ func (c *archiveContext) Hash(path string) (string, error) { return path, nil // backwards compat TODO: see if really needed } -func normalize(path string, root string) (cleanPath, fullPath string, err error) { +func normalize(path string, root string) (cleanPath, fullPath string, _ error) { cleanPath = filepath.Clean(string(filepath.Separator) + path)[1:] - fullPath, err = symlink.FollowSymlinkInScope(filepath.Join(root, path), root) + fullPath, err := symlink.FollowSymlinkInScope(filepath.Join(root, path), root) if err != nil { return "", "", errors.Wrapf(err, "forbidden path outside the build context: %s (%s)", path, cleanPath) } diff --git a/vendor/github.com/docker/docker/builder/remotecontext/git.go b/vendor/github.com/docker/docker/builder/remotecontext/git.go index 9b24cd168a..a497ad5e51 100644 --- a/vendor/github.com/docker/docker/builder/remotecontext/git.go +++ b/vendor/github.com/docker/docker/builder/remotecontext/git.go @@ -23,13 +23,21 @@ func MakeGitContext(gitURL string) (builder.Source, error) { } defer func() { - err := c.Close() - if err != nil { - log.G(context.TODO()).WithField("action", "MakeGitContext").WithField("module", "builder").WithField("url", gitURL).WithError(err).Error("error while closing git context") + if err := c.Close(); err != nil { + log.G(context.TODO()).WithFields(log.Fields{ + "error": err, + "action": "MakeGitContext", + "module": "builder", + "url": gitURL, + }).Error("error while closing git context") } - err = os.RemoveAll(root) - if err != nil { - log.G(context.TODO()).WithField("action", "MakeGitContext").WithField("module", "builder").WithField("url", gitURL).WithError(err).Error("error while removing path and children of root") + if err := os.RemoveAll(root); err != nil { + log.G(context.TODO()).WithFields(log.Fields{ + "error": err, + "action": "MakeGitContext", + "module": "builder", + "url": gitURL, + }).Error("error while removing path and children of root") } }() return FromArchive(c) diff --git a/vendor/github.com/docker/docker/builder/remotecontext/git/gitutils.go b/vendor/github.com/docker/docker/builder/remotecontext/git/gitutils.go index 4270e86ef5..d23ebe3375 100644 --- a/vendor/github.com/docker/docker/builder/remotecontext/git/gitutils.go +++ b/vendor/github.com/docker/docker/builder/remotecontext/git/gitutils.go @@ -46,7 +46,7 @@ func Clone(remoteURL string, opts ...CloneOption) (string, error) { return repo.clone() } -func (repo gitRepo) clone() (checkoutDir string, err error) { +func (repo gitRepo) clone() (checkoutDir string, retErr error) { fetch := fetchArgs(repo.remote, repo.ref) root, err := os.MkdirTemp("", "docker-build-git") @@ -55,8 +55,8 @@ func (repo gitRepo) clone() (checkoutDir string, err error) { } defer func() { - if err != nil { - os.RemoveAll(root) + if retErr != nil { + _ = os.RemoveAll(root) } }() diff --git a/vendor/github.com/docker/docker/builder/remotecontext/lazycontext.go b/vendor/github.com/docker/docker/builder/remotecontext/lazycontext.go index d7234d6656..9ee5201b50 100644 --- a/vendor/github.com/docker/docker/builder/remotecontext/lazycontext.go +++ b/vendor/github.com/docker/docker/builder/remotecontext/lazycontext.go @@ -4,8 +4,6 @@ import ( "encoding/hex" "os" "path/filepath" - "runtime" - "strings" "github.com/docker/docker/builder" "github.com/docker/docker/pkg/pools" @@ -41,7 +39,7 @@ func (c *lazySource) Hash(path string) (string, error) { return "", err } - relPath, err := Rel(c.root, fullPath) + relPath, err := filepath.Rel(c.root, fullPath) if err != nil { return "", errors.WithStack(convertPathError(err, cleanPath)) } @@ -85,19 +83,9 @@ func (c *lazySource) prepareHash(relPath string, fi os.FileInfo) (string, error) return sum, nil } -// Rel makes a path relative to base path. Same as `filepath.Rel` but can also -// handle UUID paths in windows. +// Rel is an alias for [filepath.Rel]. +// +// Deprecated: use [filepath.Rel] instead; this function is no longer used and will be removed in the next release. func Rel(basepath string, targpath string) (string, error) { - // filepath.Rel can't handle UUID paths in windows - if runtime.GOOS == "windows" { - pfx := basepath + `\` - if strings.HasPrefix(targpath, pfx) { - p := strings.TrimPrefix(targpath, pfx) - if p == "" { - p = "." - } - return p, nil - } - } return filepath.Rel(basepath, targpath) } diff --git a/vendor/github.com/docker/docker/builder/remotecontext/remote.go b/vendor/github.com/docker/docker/builder/remotecontext/remote.go index 039592d9f1..ae3423a179 100644 --- a/vendor/github.com/docker/docker/builder/remotecontext/remote.go +++ b/vendor/github.com/docker/docker/builder/remotecontext/remote.go @@ -43,22 +43,22 @@ func downloadRemote(remoteURL string) (string, io.ReadCloser, error) { // GetWithStatusError does an http.Get() and returns an error if the // status code is 4xx or 5xx. -func GetWithStatusError(address string) (resp *http.Response, err error) { - resp, err = http.Get(address) // #nosec G107 -- ignore G107: Potential HTTP request made with variable url +func GetWithStatusError(address string) (*http.Response, error) { + resp, err := http.Get(address) // #nosec G107 -- ignore G107: Potential HTTP request made with variable url if err != nil { - if uerr, ok := err.(*url.Error); ok { - if derr, ok := uerr.Err.(*net.DNSError); ok && !derr.IsTimeout { + if uErr, ok := err.(*url.Error); ok { + if dErr, ok := uErr.Err.(*net.DNSError); ok && !dErr.IsTimeout { return nil, errdefs.NotFound(err) } } return nil, errdefs.System(err) } - if resp.StatusCode < 400 { + if resp.StatusCode < http.StatusBadRequest { return resp, nil } msg := fmt.Sprintf("failed to GET %s with status %s", address, resp.Status) body, err := io.ReadAll(resp.Body) - resp.Body.Close() + _ = resp.Body.Close() if err != nil { return nil, errdefs.System(errors.New(msg + ": error reading body")) } @@ -73,8 +73,9 @@ func GetWithStatusError(address string) (resp *http.Response, err error) { return nil, errdefs.Unauthorized(errors.New(msg)) case http.StatusForbidden: return nil, errdefs.Forbidden(errors.New(msg)) + default: + return nil, errdefs.Unknown(errors.New(msg)) } - return nil, errdefs.Unknown(errors.New(msg)) } // inspectResponse looks into the http response data at r to determine whether its diff --git a/vendor/github.com/docker/docker/client/build_prune.go b/vendor/github.com/docker/docker/client/build_prune.go index 92b47d1838..db8fad55d3 100644 --- a/vendor/github.com/docker/docker/client/build_prune.go +++ b/vendor/github.com/docker/docker/client/build_prune.go @@ -6,13 +6,13 @@ import ( "net/url" "strconv" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/filters" "github.com/pkg/errors" ) // BuildCachePrune requests the daemon to delete unused cache data -func (cli *Client) BuildCachePrune(ctx context.Context, opts types.BuildCachePruneOptions) (*types.BuildCachePruneReport, error) { +func (cli *Client) BuildCachePrune(ctx context.Context, opts build.CachePruneOptions) (*build.CachePruneReport, error) { if err := cli.NewVersionError(ctx, "1.31", "build prune"); err != nil { return nil, err } @@ -47,7 +47,7 @@ func (cli *Client) BuildCachePrune(ctx context.Context, opts types.BuildCachePru return nil, err } - report := types.BuildCachePruneReport{} + report := build.CachePruneReport{} if err := json.NewDecoder(resp.Body).Decode(&report); err != nil { return nil, errors.Wrap(err, "error retrieving disk usage") } diff --git a/vendor/github.com/docker/docker/client/client_interfaces.go b/vendor/github.com/docker/docker/client/client_interfaces.go index f70d8ffa01..fe4b1af9b0 100644 --- a/vendor/github.com/docker/docker/client/client_interfaces.go +++ b/vendor/github.com/docker/docker/client/client_interfaces.go @@ -7,6 +7,7 @@ import ( "net/http" "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/events" "github.com/docker/docker/api/types/filters" @@ -109,8 +110,8 @@ type DistributionAPIClient interface { // ImageAPIClient defines API client methods for the images type ImageAPIClient interface { - ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) - BuildCachePrune(ctx context.Context, opts types.BuildCachePruneOptions) (*types.BuildCachePruneReport, error) + ImageBuild(ctx context.Context, context io.Reader, options build.ImageBuildOptions) (build.ImageBuildResponse, error) + BuildCachePrune(ctx context.Context, opts build.CachePruneOptions) (*build.CachePruneReport, error) BuildCancel(ctx context.Context, id string) error ImageCreate(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error) ImageImport(ctx context.Context, source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) @@ -154,8 +155,8 @@ type NetworkAPIClient interface { // NodeAPIClient defines API client methods for the nodes type NodeAPIClient interface { NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error) - NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error) - NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error + NodeList(ctx context.Context, options swarm.NodeListOptions) ([]swarm.Node, error) + NodeRemove(ctx context.Context, nodeID string, options swarm.NodeRemoveOptions) error NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error } @@ -175,22 +176,22 @@ type PluginAPIClient interface { // ServiceAPIClient defines API client methods for the services type ServiceAPIClient interface { - ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (swarm.ServiceCreateResponse, error) - ServiceInspectWithRaw(ctx context.Context, serviceID string, options types.ServiceInspectOptions) (swarm.Service, []byte, error) - ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) + ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options swarm.ServiceCreateOptions) (swarm.ServiceCreateResponse, error) + ServiceInspectWithRaw(ctx context.Context, serviceID string, options swarm.ServiceInspectOptions) (swarm.Service, []byte, error) + ServiceList(ctx context.Context, options swarm.ServiceListOptions) ([]swarm.Service, error) ServiceRemove(ctx context.Context, serviceID string) error - ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error) + ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options swarm.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error) ServiceLogs(ctx context.Context, serviceID string, options container.LogsOptions) (io.ReadCloser, error) TaskLogs(ctx context.Context, taskID string, options container.LogsOptions) (io.ReadCloser, error) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) - TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) + TaskList(ctx context.Context, options swarm.TaskListOptions) ([]swarm.Task, error) } // SwarmAPIClient defines API client methods for the swarm type SwarmAPIClient interface { SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error - SwarmGetUnlockKey(ctx context.Context) (types.SwarmUnlockKeyResponse, error) + SwarmGetUnlockKey(ctx context.Context) (swarm.UnlockKeyResponse, error) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error SwarmLeave(ctx context.Context, force bool) error SwarmInspect(ctx context.Context) (swarm.Swarm, error) @@ -219,8 +220,8 @@ type VolumeAPIClient interface { // SecretAPIClient defines API client methods for secrets type SecretAPIClient interface { - SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) - SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error) + SecretList(ctx context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) + SecretCreate(ctx context.Context, secret swarm.SecretSpec) (swarm.SecretCreateResponse, error) SecretRemove(ctx context.Context, id string) error SecretInspectWithRaw(ctx context.Context, name string) (swarm.Secret, []byte, error) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error @@ -228,8 +229,8 @@ type SecretAPIClient interface { // ConfigAPIClient defines API client methods for configs type ConfigAPIClient interface { - ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error) - ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (types.ConfigCreateResponse, error) + ConfigList(ctx context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error) + ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (swarm.ConfigCreateResponse, error) ConfigRemove(ctx context.Context, id string) error ConfigInspectWithRaw(ctx context.Context, name string) (swarm.Config, []byte, error) ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error diff --git a/vendor/github.com/docker/docker/client/config_create.go b/vendor/github.com/docker/docker/client/config_create.go index c7ea6d2eba..1fbfc21f92 100644 --- a/vendor/github.com/docker/docker/client/config_create.go +++ b/vendor/github.com/docker/docker/client/config_create.go @@ -4,13 +4,12 @@ import ( "context" "encoding/json" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" ) // ConfigCreate creates a new config. -func (cli *Client) ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (types.ConfigCreateResponse, error) { - var response types.ConfigCreateResponse +func (cli *Client) ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (swarm.ConfigCreateResponse, error) { + var response swarm.ConfigCreateResponse if err := cli.NewVersionError(ctx, "1.30", "config create"); err != nil { return response, err } diff --git a/vendor/github.com/docker/docker/client/config_list.go b/vendor/github.com/docker/docker/client/config_list.go index 7e4a8ea567..67779e98aa 100644 --- a/vendor/github.com/docker/docker/client/config_list.go +++ b/vendor/github.com/docker/docker/client/config_list.go @@ -5,13 +5,12 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/swarm" ) // ConfigList returns the list of configs. -func (cli *Client) ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error) { +func (cli *Client) ConfigList(ctx context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error) { if err := cli.NewVersionError(ctx, "1.30", "config list"); err != nil { return nil, err } diff --git a/vendor/github.com/docker/docker/client/errors.go b/vendor/github.com/docker/docker/client/errors.go index 609f92ce66..7bd8593147 100644 --- a/vendor/github.com/docker/docker/client/errors.go +++ b/vendor/github.com/docker/docker/client/errors.go @@ -4,9 +4,11 @@ import ( "context" "errors" "fmt" + "net/http" + cerrdefs "github.com/containerd/errdefs" + "github.com/containerd/errdefs/pkg/errhttp" "github.com/docker/docker/api/types/versions" - "github.com/docker/docker/errdefs" ) // errConnectionFailed implements an error returned when connection failed. @@ -48,9 +50,11 @@ func connectionFailed(host string) error { } // IsErrNotFound returns true if the error is a NotFound error, which is returned -// by the API when some object is not found. It is an alias for [errdefs.IsNotFound]. +// by the API when some object is not found. It is an alias for [cerrdefs.IsNotFound]. +// +// Deprecated: use [cerrdefs.IsNotFound] instead. func IsErrNotFound(err error) bool { - return errdefs.IsNotFound(err) + return cerrdefs.IsNotFound(err) } type objectNotFoundError struct { @@ -83,3 +87,43 @@ func (cli *Client) NewVersionError(ctx context.Context, APIrequired, feature str } return nil } + +type httpError struct { + err error + errdef error +} + +func (e *httpError) Error() string { + return e.err.Error() +} + +func (e *httpError) Unwrap() error { + return e.err +} + +func (e *httpError) Is(target error) bool { + return errors.Is(e.errdef, target) +} + +// httpErrorFromStatusCode creates an errdef error, based on the provided HTTP status-code +func httpErrorFromStatusCode(err error, statusCode int) error { + if err == nil { + return nil + } + base := errhttp.ToNative(statusCode) + if base != nil { + return &httpError{err: err, errdef: base} + } + + switch { + case statusCode >= http.StatusOK && statusCode < http.StatusBadRequest: + // it's a client error + return err + case statusCode >= http.StatusBadRequest && statusCode < http.StatusInternalServerError: + return &httpError{err: err, errdef: cerrdefs.ErrInvalidArgument} + case statusCode >= http.StatusInternalServerError && statusCode < 600: + return &httpError{err: err, errdef: cerrdefs.ErrInternal} + default: + return &httpError{err: err, errdef: cerrdefs.ErrUnknown} + } +} diff --git a/vendor/github.com/docker/docker/client/image_build.go b/vendor/github.com/docker/docker/client/image_build.go index 6e2a40687b..28b74a3f1a 100644 --- a/vendor/github.com/docker/docker/client/image_build.go +++ b/vendor/github.com/docker/docker/client/image_build.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/network" ) @@ -18,15 +18,15 @@ import ( // ImageBuild sends a request to the daemon to build images. // The Body in the response implements an io.ReadCloser and it's up to the caller to // close it. -func (cli *Client) ImageBuild(ctx context.Context, buildContext io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) { +func (cli *Client) ImageBuild(ctx context.Context, buildContext io.Reader, options build.ImageBuildOptions) (build.ImageBuildResponse, error) { query, err := cli.imageBuildOptionsToQuery(ctx, options) if err != nil { - return types.ImageBuildResponse{}, err + return build.ImageBuildResponse{}, err } buf, err := json.Marshal(options.AuthConfigs) if err != nil { - return types.ImageBuildResponse{}, err + return build.ImageBuildResponse{}, err } headers := http.Header{} @@ -35,16 +35,16 @@ func (cli *Client) ImageBuild(ctx context.Context, buildContext io.Reader, optio resp, err := cli.postRaw(ctx, "/build", query, buildContext, headers) if err != nil { - return types.ImageBuildResponse{}, err + return build.ImageBuildResponse{}, err } - return types.ImageBuildResponse{ + return build.ImageBuildResponse{ Body: resp.Body, OSType: getDockerOS(resp.Header.Get("Server")), }, nil } -func (cli *Client) imageBuildOptionsToQuery(ctx context.Context, options types.ImageBuildOptions) (url.Values, error) { +func (cli *Client) imageBuildOptionsToQuery(ctx context.Context, options build.ImageBuildOptions) (url.Values, error) { query := url.Values{} if len(options.Tags) > 0 { query["t"] = options.Tags diff --git a/vendor/github.com/docker/docker/client/image_pull.go b/vendor/github.com/docker/docker/client/image_pull.go index f5fe85dd47..ae8c807f77 100644 --- a/vendor/github.com/docker/docker/client/image_pull.go +++ b/vendor/github.com/docker/docker/client/image_pull.go @@ -6,9 +6,9 @@ import ( "net/url" "strings" + cerrdefs "github.com/containerd/errdefs" "github.com/distribution/reference" "github.com/docker/docker/api/types/image" - "github.com/docker/docker/errdefs" ) // ImagePull requests the docker host to pull an image from a remote registry. @@ -35,7 +35,7 @@ func (cli *Client) ImagePull(ctx context.Context, refStr string, options image.P } resp, err := cli.tryImageCreate(ctx, query, options.RegistryAuth) - if errdefs.IsUnauthorized(err) && options.PrivilegeFunc != nil { + if cerrdefs.IsUnauthorized(err) && options.PrivilegeFunc != nil { newAuthHeader, privilegeErr := options.PrivilegeFunc(ctx) if privilegeErr != nil { return nil, privilegeErr diff --git a/vendor/github.com/docker/docker/client/image_push.go b/vendor/github.com/docker/docker/client/image_push.go index 1a343f43f1..5210304403 100644 --- a/vendor/github.com/docker/docker/client/image_push.go +++ b/vendor/github.com/docker/docker/client/image_push.go @@ -9,10 +9,10 @@ import ( "net/http" "net/url" + cerrdefs "github.com/containerd/errdefs" "github.com/distribution/reference" "github.com/docker/docker/api/types/image" "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/errdefs" ) // ImagePush requests the docker host to push an image to a remote registry. @@ -52,7 +52,7 @@ func (cli *Client) ImagePush(ctx context.Context, image string, options image.Pu } resp, err := cli.tryImagePush(ctx, ref.Name(), query, options.RegistryAuth) - if errdefs.IsUnauthorized(err) && options.PrivilegeFunc != nil { + if cerrdefs.IsUnauthorized(err) && options.PrivilegeFunc != nil { newAuthHeader, privilegeErr := options.PrivilegeFunc(ctx) if privilegeErr != nil { return nil, privilegeErr diff --git a/vendor/github.com/docker/docker/client/image_remove.go b/vendor/github.com/docker/docker/client/image_remove.go index b0c87ca09c..0d769139b8 100644 --- a/vendor/github.com/docker/docker/client/image_remove.go +++ b/vendor/github.com/docker/docker/client/image_remove.go @@ -19,6 +19,14 @@ func (cli *Client) ImageRemove(ctx context.Context, imageID string, options imag query.Set("noprune", "1") } + if len(options.Platforms) > 0 { + p, err := encodePlatforms(options.Platforms...) + if err != nil { + return nil, err + } + query["platforms"] = p + } + resp, err := cli.delete(ctx, "/images/"+imageID, query, nil) defer ensureReaderClosed(resp) if err != nil { diff --git a/vendor/github.com/docker/docker/client/image_search.go b/vendor/github.com/docker/docker/client/image_search.go index 0a7b5ec226..f3aab43a80 100644 --- a/vendor/github.com/docker/docker/client/image_search.go +++ b/vendor/github.com/docker/docker/client/image_search.go @@ -7,9 +7,9 @@ import ( "net/url" "strconv" + cerrdefs "github.com/containerd/errdefs" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/errdefs" ) // ImageSearch makes the docker host search by a term in a remote registry. @@ -32,7 +32,7 @@ func (cli *Client) ImageSearch(ctx context.Context, term string, options registr resp, err := cli.tryImageSearch(ctx, query, options.RegistryAuth) defer ensureReaderClosed(resp) - if errdefs.IsUnauthorized(err) && options.PrivilegeFunc != nil { + if cerrdefs.IsUnauthorized(err) && options.PrivilegeFunc != nil { newAuthHeader, privilegeErr := options.PrivilegeFunc(ctx) if privilegeErr != nil { return results, privilegeErr diff --git a/vendor/github.com/docker/docker/client/node_list.go b/vendor/github.com/docker/docker/client/node_list.go index 2534f4aee1..429eec2443 100644 --- a/vendor/github.com/docker/docker/client/node_list.go +++ b/vendor/github.com/docker/docker/client/node_list.go @@ -5,13 +5,12 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/swarm" ) // NodeList returns the list of nodes. -func (cli *Client) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error) { +func (cli *Client) NodeList(ctx context.Context, options swarm.NodeListOptions) ([]swarm.Node, error) { query := url.Values{} if options.Filters.Len() > 0 { diff --git a/vendor/github.com/docker/docker/client/node_remove.go b/vendor/github.com/docker/docker/client/node_remove.go index 81f8fed6b5..07d8e65364 100644 --- a/vendor/github.com/docker/docker/client/node_remove.go +++ b/vendor/github.com/docker/docker/client/node_remove.go @@ -4,11 +4,11 @@ import ( "context" "net/url" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/swarm" ) // NodeRemove removes a Node. -func (cli *Client) NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error { +func (cli *Client) NodeRemove(ctx context.Context, nodeID string, options swarm.NodeRemoveOptions) error { nodeID, err := trimID("node", nodeID) if err != nil { return err diff --git a/vendor/github.com/docker/docker/client/ping.go b/vendor/github.com/docker/docker/client/ping.go index c7645e56d6..2ffa5945f4 100644 --- a/vendor/github.com/docker/docker/client/ping.go +++ b/vendor/github.com/docker/docker/client/ping.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/swarm" ) @@ -67,7 +68,7 @@ func parsePingResponse(cli *Client, resp *http.Response) (types.Ping, error) { ping.Experimental = true } if bv := resp.Header.Get("Builder-Version"); bv != "" { - ping.BuilderVersion = types.BuilderVersion(bv) + ping.BuilderVersion = build.BuilderVersion(bv) } if si := resp.Header.Get("Swarm"); si != "" { state, role, _ := strings.Cut(si, "/") diff --git a/vendor/github.com/docker/docker/client/plugin_install.go b/vendor/github.com/docker/docker/client/plugin_install.go index b04dcf9a10..8553961ba6 100644 --- a/vendor/github.com/docker/docker/client/plugin_install.go +++ b/vendor/github.com/docker/docker/client/plugin_install.go @@ -7,15 +7,15 @@ import ( "net/http" "net/url" + cerrdefs "github.com/containerd/errdefs" "github.com/distribution/reference" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/errdefs" "github.com/pkg/errors" ) // PluginInstall installs a plugin -func (cli *Client) PluginInstall(ctx context.Context, name string, options types.PluginInstallOptions) (rc io.ReadCloser, err error) { +func (cli *Client) PluginInstall(ctx context.Context, name string, options types.PluginInstallOptions) (_ io.ReadCloser, retErr error) { query := url.Values{} if _, err := reference.ParseNormalizedNamed(options.RemoteRef); err != nil { return nil, errors.Wrap(err, "invalid remote reference") @@ -45,7 +45,7 @@ func (cli *Client) PluginInstall(ctx context.Context, name string, options types return } defer func() { - if err != nil { + if retErr != nil { delResp, _ := cli.delete(ctx, "/plugins/"+name, nil, nil) ensureReaderClosed(delResp) } @@ -82,7 +82,7 @@ func (cli *Client) tryPluginPull(ctx context.Context, query url.Values, privileg func (cli *Client) checkPluginPermissions(ctx context.Context, query url.Values, options types.PluginInstallOptions) (types.PluginPrivileges, error) { resp, err := cli.tryPluginPrivileges(ctx, query, options.RegistryAuth) - if errdefs.IsUnauthorized(err) && options.PrivilegeFunc != nil { + if cerrdefs.IsUnauthorized(err) && options.PrivilegeFunc != nil { // todo: do inspect before to check existing name before checking privileges newAuthHeader, privilegeErr := options.PrivilegeFunc(ctx) if privilegeErr != nil { diff --git a/vendor/github.com/docker/docker/client/request.go b/vendor/github.com/docker/docker/client/request.go index 4cc64350bd..d9074a736c 100644 --- a/vendor/github.com/docker/docker/client/request.go +++ b/vendor/github.com/docker/docker/client/request.go @@ -15,7 +15,6 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/versions" - "github.com/docker/docker/errdefs" "github.com/pkg/errors" ) @@ -116,10 +115,8 @@ func (cli *Client) sendRequest(ctx context.Context, method, path string, query u resp, err := cli.doRequest(req) switch { - case errors.Is(err, context.Canceled): - return nil, errdefs.Cancelled(err) - case errors.Is(err, context.DeadlineExceeded): - return nil, errdefs.Deadline(err) + case errors.Is(err, context.Canceled), errors.Is(err, context.DeadlineExceeded): + return nil, err case err == nil: return resp, cli.checkResponseErr(resp) default: @@ -195,11 +192,11 @@ func (cli *Client) checkResponseErr(serverResp *http.Response) (retErr error) { if serverResp == nil { return nil } - if serverResp.StatusCode >= 200 && serverResp.StatusCode < 400 { + if serverResp.StatusCode >= http.StatusOK && serverResp.StatusCode < http.StatusBadRequest { return nil } defer func() { - retErr = errdefs.FromStatusCode(retErr, serverResp.StatusCode) + retErr = httpErrorFromStatusCode(retErr, serverResp.StatusCode) }() var body []byte diff --git a/vendor/github.com/docker/docker/client/secret_create.go b/vendor/github.com/docker/docker/client/secret_create.go index bbd1191877..aee051b902 100644 --- a/vendor/github.com/docker/docker/client/secret_create.go +++ b/vendor/github.com/docker/docker/client/secret_create.go @@ -4,22 +4,21 @@ import ( "context" "encoding/json" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" ) // SecretCreate creates a new secret. -func (cli *Client) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error) { +func (cli *Client) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (swarm.SecretCreateResponse, error) { if err := cli.NewVersionError(ctx, "1.25", "secret create"); err != nil { - return types.SecretCreateResponse{}, err + return swarm.SecretCreateResponse{}, err } resp, err := cli.post(ctx, "/secrets/create", nil, secret, nil) defer ensureReaderClosed(resp) if err != nil { - return types.SecretCreateResponse{}, err + return swarm.SecretCreateResponse{}, err } - var response types.SecretCreateResponse + var response swarm.SecretCreateResponse err = json.NewDecoder(resp.Body).Decode(&response) return response, err } diff --git a/vendor/github.com/docker/docker/client/secret_list.go b/vendor/github.com/docker/docker/client/secret_list.go index e3b7dbdb9e..b158d99ed9 100644 --- a/vendor/github.com/docker/docker/client/secret_list.go +++ b/vendor/github.com/docker/docker/client/secret_list.go @@ -5,13 +5,12 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/swarm" ) // SecretList returns the list of secrets. -func (cli *Client) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { +func (cli *Client) SecretList(ctx context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { if err := cli.NewVersionError(ctx, "1.25", "secret list"); err != nil { return nil, err } diff --git a/vendor/github.com/docker/docker/client/service_create.go b/vendor/github.com/docker/docker/client/service_create.go index 54c03b1389..6b9932ae2e 100644 --- a/vendor/github.com/docker/docker/client/service_create.go +++ b/vendor/github.com/docker/docker/client/service_create.go @@ -8,7 +8,6 @@ import ( "strings" "github.com/distribution/reference" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/registry" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/api/types/versions" @@ -17,7 +16,7 @@ import ( ) // ServiceCreate creates a new service. -func (cli *Client) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (swarm.ServiceCreateResponse, error) { +func (cli *Client) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options swarm.ServiceCreateOptions) (swarm.ServiceCreateResponse, error) { var response swarm.ServiceCreateResponse // Make sure we negotiated (if the client is configured to do so), diff --git a/vendor/github.com/docker/docker/client/service_inspect.go b/vendor/github.com/docker/docker/client/service_inspect.go index 77b4402d37..892e9004fe 100644 --- a/vendor/github.com/docker/docker/client/service_inspect.go +++ b/vendor/github.com/docker/docker/client/service_inspect.go @@ -8,12 +8,11 @@ import ( "io" "net/url" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" ) // ServiceInspectWithRaw returns the service information and the raw data. -func (cli *Client) ServiceInspectWithRaw(ctx context.Context, serviceID string, opts types.ServiceInspectOptions) (swarm.Service, []byte, error) { +func (cli *Client) ServiceInspectWithRaw(ctx context.Context, serviceID string, opts swarm.ServiceInspectOptions) (swarm.Service, []byte, error) { serviceID, err := trimID("service", serviceID) if err != nil { return swarm.Service{}, nil, err diff --git a/vendor/github.com/docker/docker/client/service_list.go b/vendor/github.com/docker/docker/client/service_list.go index f589a8423a..019873bb6d 100644 --- a/vendor/github.com/docker/docker/client/service_list.go +++ b/vendor/github.com/docker/docker/client/service_list.go @@ -5,13 +5,12 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/swarm" ) // ServiceList returns the list of services. -func (cli *Client) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) { +func (cli *Client) ServiceList(ctx context.Context, options swarm.ServiceListOptions) ([]swarm.Service, error) { query := url.Values{} if options.Filters.Len() > 0 { diff --git a/vendor/github.com/docker/docker/client/service_update.go b/vendor/github.com/docker/docker/client/service_update.go index ecb98f4684..e0c1a26648 100644 --- a/vendor/github.com/docker/docker/client/service_update.go +++ b/vendor/github.com/docker/docker/client/service_update.go @@ -6,7 +6,6 @@ import ( "net/http" "net/url" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/registry" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/api/types/versions" @@ -15,7 +14,7 @@ import ( // ServiceUpdate updates a Service. The version number is required to avoid conflicting writes. // It should be the value as set *before* the update. You can find this value in the Meta field // of swarm.Service, which can be found using ServiceInspectWithRaw. -func (cli *Client) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error) { +func (cli *Client) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options swarm.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error) { serviceID, err := trimID("service", serviceID) if err != nil { return swarm.ServiceUpdateResponse{}, err diff --git a/vendor/github.com/docker/docker/client/swarm_get_unlock_key.go b/vendor/github.com/docker/docker/client/swarm_get_unlock_key.go index 271fc08c95..6e30daf615 100644 --- a/vendor/github.com/docker/docker/client/swarm_get_unlock_key.go +++ b/vendor/github.com/docker/docker/client/swarm_get_unlock_key.go @@ -4,18 +4,18 @@ import ( "context" "encoding/json" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/swarm" ) // SwarmGetUnlockKey retrieves the swarm's unlock key. -func (cli *Client) SwarmGetUnlockKey(ctx context.Context) (types.SwarmUnlockKeyResponse, error) { +func (cli *Client) SwarmGetUnlockKey(ctx context.Context) (swarm.UnlockKeyResponse, error) { resp, err := cli.get(ctx, "/swarm/unlockkey", nil, nil) defer ensureReaderClosed(resp) if err != nil { - return types.SwarmUnlockKeyResponse{}, err + return swarm.UnlockKeyResponse{}, err } - var response types.SwarmUnlockKeyResponse + var response swarm.UnlockKeyResponse err = json.NewDecoder(resp.Body).Decode(&response) return response, err } diff --git a/vendor/github.com/docker/docker/client/task_list.go b/vendor/github.com/docker/docker/client/task_list.go index aba7f61e65..5d540c3832 100644 --- a/vendor/github.com/docker/docker/client/task_list.go +++ b/vendor/github.com/docker/docker/client/task_list.go @@ -5,13 +5,12 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/swarm" ) // TaskList returns the list of tasks. -func (cli *Client) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) { +func (cli *Client) TaskList(ctx context.Context, options swarm.TaskListOptions) ([]swarm.Task, error) { query := url.Values{} if options.Filters.Len() > 0 { diff --git a/vendor/github.com/docker/docker/client/utils.go b/vendor/github.com/docker/docker/client/utils.go index 925d4d8d38..27f2b9884b 100644 --- a/vendor/github.com/docker/docker/client/utils.go +++ b/vendor/github.com/docker/docker/client/utils.go @@ -6,8 +6,8 @@ import ( "net/url" "strings" + cerrdefs "github.com/containerd/errdefs" "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/errdefs" "github.com/docker/docker/internal/lazyregexp" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) @@ -90,7 +90,7 @@ func encodePlatforms(platform ...ocispec.Platform) ([]string, error) { func encodePlatform(platform *ocispec.Platform) (string, error) { p, err := json.Marshal(platform) if err != nil { - return "", errdefs.InvalidParameter(fmt.Errorf("invalid platform: %v", err)) + return "", fmt.Errorf("%w: invalid platform: %v", cerrdefs.ErrInvalidArgument, err) } return string(p), nil } diff --git a/vendor/github.com/docker/docker/container/archive_windows.go b/vendor/github.com/docker/docker/container/archive_windows.go deleted file mode 100644 index 5f9a71feb6..0000000000 --- a/vendor/github.com/docker/docker/container/archive_windows.go +++ /dev/null @@ -1,82 +0,0 @@ -package container // import "github.com/docker/docker/container" - -import ( - "os" - "path/filepath" - - containertypes "github.com/docker/docker/api/types/container" - "github.com/moby/go-archive" - "github.com/pkg/errors" -) - -// ResolvePath resolves the given path in the container to a resource on the -// host. Returns a resolved path (absolute path to the resource on the host), -// the absolute path to the resource relative to the container's rootfs, and -// an error if the path points to outside the container's rootfs. -func (container *Container) ResolvePath(path string) (resolvedPath, absPath string, err error) { - if container.BaseFS == "" { - return "", "", errors.New("ResolvePath: BaseFS of container " + container.ID + " is unexpectedly empty") - } - // Check if a drive letter supplied, it must be the system drive. No-op except on Windows - path, err = archive.CheckSystemDriveAndRemoveDriveLetter(path) - if err != nil { - return "", "", err - } - - // Consider the given path as an absolute path in the container. - absPath = archive.PreserveTrailingDotOrSeparator(filepath.Join(string(filepath.Separator), path), path) - - // Split the absPath into its Directory and Base components. We will - // resolve the dir in the scope of the container then append the base. - dirPath, basePath := filepath.Split(absPath) - - resolvedDirPath, err := container.GetResourcePath(dirPath) - if err != nil { - return "", "", err - } - - // resolvedDirPath will have been cleaned (no trailing path separators) so - // we can manually join it with the base path element. - resolvedPath = resolvedDirPath + string(filepath.Separator) + basePath - return resolvedPath, absPath, nil -} - -// StatPath is the unexported version of StatPath. Locks and mounts should -// be acquired before calling this method and the given path should be fully -// resolved to a path on the host corresponding to the given absolute path -// inside the container. -func (container *Container) StatPath(resolvedPath, absPath string) (stat *containertypes.PathStat, err error) { - if container.BaseFS == "" { - return nil, errors.New("StatPath: BaseFS of container " + container.ID + " is unexpectedly empty") - } - - lstat, err := os.Lstat(resolvedPath) - if err != nil { - return nil, err - } - - var linkTarget string - if lstat.Mode()&os.ModeSymlink != 0 { - // Fully evaluate the symlink in the scope of the container rootfs. - hostPath, err := container.GetResourcePath(absPath) - if err != nil { - return nil, err - } - - linkTarget, err = filepath.Rel(container.BaseFS, hostPath) - if err != nil { - return nil, err - } - - // Make it an absolute path. - linkTarget = filepath.Join(string(filepath.Separator), linkTarget) - } - - return &containertypes.PathStat{ - Name: filepath.Base(absPath), - Size: lstat.Size(), - Mode: lstat.Mode(), - Mtime: lstat.ModTime(), - LinkTarget: linkTarget, - }, nil -} diff --git a/vendor/github.com/docker/docker/container/attach_context.go b/vendor/github.com/docker/docker/container/attach_context.go deleted file mode 100644 index 9dd8e9da41..0000000000 --- a/vendor/github.com/docker/docker/container/attach_context.go +++ /dev/null @@ -1,35 +0,0 @@ -package container - -import ( - "context" - "sync" -) - -// attachContext is the context used for attach calls. -type attachContext struct { - mu sync.Mutex - ctx context.Context - cancelFunc context.CancelFunc -} - -// init returns the context for attach calls. It creates a new context -// if no context is created yet. -func (ac *attachContext) init() context.Context { - ac.mu.Lock() - defer ac.mu.Unlock() - if ac.ctx == nil { - ac.ctx, ac.cancelFunc = context.WithCancel(context.Background()) - } - return ac.ctx -} - -// cancelFunc cancels the attachContext. All attach calls should detach -// after this call. -func (ac *attachContext) cancel() { - ac.mu.Lock() - if ac.ctx != nil { - ac.cancelFunc() - ac.ctx = nil - } - ac.mu.Unlock() -} diff --git a/vendor/github.com/docker/docker/container/container.go b/vendor/github.com/docker/docker/container/container.go deleted file mode 100644 index 3fae1f09bb..0000000000 --- a/vendor/github.com/docker/docker/container/container.go +++ /dev/null @@ -1,866 +0,0 @@ -package container // import "github.com/docker/docker/container" - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - "os" - "path/filepath" - "runtime" - "strings" - "syscall" - "time" - - "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/log" - "github.com/containerd/platforms" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - mounttypes "github.com/docker/docker/api/types/mount" - swarmtypes "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/container/stream" - "github.com/docker/docker/daemon/logger" - "github.com/docker/docker/daemon/logger/jsonfilelog" - "github.com/docker/docker/daemon/logger/local" - "github.com/docker/docker/daemon/logger/loggerutils/cache" - "github.com/docker/docker/daemon/network" - "github.com/docker/docker/errdefs" - "github.com/docker/docker/image" - libcontainerdtypes "github.com/docker/docker/libcontainerd/types" - "github.com/docker/docker/oci" - "github.com/docker/docker/restartmanager" - "github.com/docker/docker/volume" - volumemounts "github.com/docker/docker/volume/mounts" - "github.com/docker/go-units" - agentexec "github.com/moby/swarmkit/v2/agent/exec" - "github.com/moby/sys/atomicwriter" - "github.com/moby/sys/signal" - "github.com/moby/sys/symlink" - "github.com/moby/sys/user" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/trace" -) - -const ( - configFileName = "config.v2.json" - hostConfigFileName = "hostconfig.json" - - // defaultStopSignal is the default syscall signal used to stop a container. - defaultStopSignal = syscall.SIGTERM -) - -// ExitStatus provides exit reasons for a container. -type ExitStatus struct { - // The exit code with which the container exited. - ExitCode int - - // Time at which the container died - ExitedAt time.Time -} - -// Container holds the structure defining a container object. -type Container struct { - StreamConfig *stream.Config - // We embed [State] here so that Container supports states directly, - // but marshal it as a struct in JSON. - // - // State also provides a [sync.Mutex] which is used as lock for both - // the Container and State. - *State `json:"State"` - Root string `json:"-"` // Path to the "home" of the container, including metadata. - BaseFS string `json:"-"` // Path to the graphdriver mountpoint - RWLayer RWLayer `json:"-"` - ID string - Created time.Time - Managed bool - Path string - Args []string - Config *containertypes.Config - ImageID image.ID `json:"Image"` - ImageManifest *ocispec.Descriptor - NetworkSettings *network.Settings - LogPath string - Name string - Driver string - - // Deprecated: use [ImagePlatform.OS] instead. - // TODO: Remove, see https://github.com/moby/moby/issues/48892 - OS string - - ImagePlatform ocispec.Platform - - RestartCount int - HasBeenStartedBefore bool - HasBeenManuallyStopped bool // used for unless-stopped restart policy - HasBeenManuallyRestarted bool `json:"-"` // used to distinguish restart caused by restart policy from the manual one - MountPoints map[string]*volumemounts.MountPoint - HostConfig *containertypes.HostConfig `json:"-"` // do not serialize the host config in the json, otherwise we'll make the container unportable - ExecCommands *ExecStore `json:"-"` - DependencyStore agentexec.DependencyGetter `json:"-"` - SecretReferences []*swarmtypes.SecretReference - ConfigReferences []*swarmtypes.ConfigReference - // logDriver for closing - LogDriver logger.Logger `json:"-"` - LogCopier *logger.Copier `json:"-"` - restartManager *restartmanager.RestartManager - attachContext *attachContext - - // Fields here are specific to Unix platforms - SecurityOptions - HostnamePath string - HostsPath string - ShmPath string - ResolvConfPath string - - // Fields here are specific to Windows - NetworkSharedContainerID string `json:"-"` - SharedEndpointList []string `json:"-"` - LocalLogCacheMeta localLogCacheMeta `json:",omitempty"` -} - -type SecurityOptions struct { - // MountLabel contains the options for the "mount" command. - MountLabel string - ProcessLabel string - AppArmorProfile string - SeccompProfile string - NoNewPrivileges bool - WritableCgroups *bool -} - -type localLogCacheMeta struct { - HaveNotifyEnabled bool -} - -// NewBaseContainer creates a new container with its -// basic configuration. -func NewBaseContainer(id, root string) *Container { - return &Container{ - ID: id, - State: NewState(), - ExecCommands: NewExecStore(), - Root: root, - MountPoints: make(map[string]*volumemounts.MountPoint), - StreamConfig: stream.NewConfig(), - attachContext: &attachContext{}, - } -} - -// FromDisk loads the container configuration stored in the host. -func (container *Container) FromDisk() error { - pth, err := container.ConfigPath() - if err != nil { - return err - } - - jsonSource, err := os.Open(pth) - if err != nil { - return err - } - defer jsonSource.Close() - - dec := json.NewDecoder(jsonSource) - - // Load container settings - if err := dec.Decode(container); err != nil { - return err - } - - if container.OS != "" { - // OS was deprecated in favor of ImagePlatform - // Make sure we migrate the OS to ImagePlatform.OS. - if container.ImagePlatform.OS == "" { - container.ImagePlatform.OS = container.OS //nolint:staticcheck // ignore SA1019: field is deprecated - } - } else { - // Pre multiple-OS support containers have no OS set. - // Assume it is the host platform. - container.ImagePlatform = platforms.DefaultSpec() - container.OS = container.ImagePlatform.OS //nolint:staticcheck // ignore SA1019: field is deprecated - } - - return container.readHostConfig() -} - -// toDisk writes the container's configuration (config.v2.json, hostconfig.json) -// to disk and returns a deep copy. -func (container *Container) toDisk() (*Container, error) { - pth, err := container.ConfigPath() - if err != nil { - return nil, err - } - - // Save container settings - f, err := atomicwriter.New(pth, 0o600) - if err != nil { - return nil, err - } - defer f.Close() - - var buf bytes.Buffer - w := io.MultiWriter(&buf, f) - if err := json.NewEncoder(w).Encode(container); err != nil { - return nil, err - } - - var deepCopy Container - if err := json.NewDecoder(&buf).Decode(&deepCopy); err != nil { - return nil, err - } - deepCopy.HostConfig, err = container.WriteHostConfig() - if err != nil { - return nil, err - } - return &deepCopy, nil -} - -// CheckpointTo makes the Container's current state visible to queries, and persists state. -// Callers must hold a Container lock. -func (container *Container) CheckpointTo(ctx context.Context, store *ViewDB) error { - ctx, span := otel.Tracer("").Start(ctx, "container.CheckpointTo", trace.WithAttributes( - attribute.String("container.ID", container.ID), - attribute.String("container.Name", container.Name))) - defer span.End() - - deepCopy, err := container.toDisk() - if err != nil { - return err - } - return store.Save(deepCopy) -} - -// readHostConfig reads the host configuration from disk for the container. -func (container *Container) readHostConfig() error { - container.HostConfig = &containertypes.HostConfig{} - // If the hostconfig file does not exist, do not read it. - // (We still have to initialize container.HostConfig, - // but that's OK, since we just did that above.) - pth, err := container.HostConfigPath() - if err != nil { - return err - } - - f, err := os.Open(pth) - if err != nil { - if os.IsNotExist(err) { - return nil - } - return err - } - defer f.Close() - - if err := json.NewDecoder(f).Decode(&container.HostConfig); err != nil { - return err - } - - container.InitDNSHostConfig() - - return nil -} - -// WriteHostConfig saves the host configuration on disk for the container, -// and returns a deep copy of the saved object. Callers must hold a Container lock. -func (container *Container) WriteHostConfig() (*containertypes.HostConfig, error) { - var ( - buf bytes.Buffer - deepCopy containertypes.HostConfig - ) - - pth, err := container.HostConfigPath() - if err != nil { - return nil, err - } - - f, err := atomicwriter.New(pth, 0o600) - if err != nil { - return nil, err - } - defer f.Close() - - w := io.MultiWriter(&buf, f) - if err := json.NewEncoder(w).Encode(&container.HostConfig); err != nil { - return nil, err - } - - if err := json.NewDecoder(&buf).Decode(&deepCopy); err != nil { - return nil, err - } - return &deepCopy, nil -} - -// CommitInMemory makes the Container's current state visible to queries, -// but does not persist state. -// -// Callers must hold a Container lock. -func (container *Container) CommitInMemory(store *ViewDB) error { - var buf bytes.Buffer - if err := json.NewEncoder(&buf).Encode(container); err != nil { - return err - } - - var deepCopy Container - if err := json.NewDecoder(&buf).Decode(&deepCopy); err != nil { - return err - } - - buf.Reset() - if err := json.NewEncoder(&buf).Encode(container.HostConfig); err != nil { - return err - } - if err := json.NewDecoder(&buf).Decode(&deepCopy.HostConfig); err != nil { - return err - } - - return store.Save(&deepCopy) -} - -// SetupWorkingDirectory sets up the container's working directory as set in container.Config.WorkingDir -func (container *Container) SetupWorkingDirectory(uid int, gid int) error { - if container.Config.WorkingDir == "" { - return nil - } - - workdir := filepath.Clean(container.Config.WorkingDir) - pth, err := container.GetResourcePath(workdir) - if err != nil { - return err - } - - if err := user.MkdirAllAndChown(pth, 0o755, uid, gid, user.WithOnlyNew); err != nil { - pthInfo, err2 := os.Stat(pth) - if err2 == nil && pthInfo != nil && !pthInfo.IsDir() { - return errors.Errorf("Cannot mkdir: %s is not a directory", container.Config.WorkingDir) - } - - return err - } - - return nil -} - -// GetResourcePath evaluates `path` in the scope of the container's BaseFS, with proper path -// sanitization. Symlinks are all scoped to the BaseFS of the container, as -// though the container's BaseFS was `/`. -// -// The BaseFS of a container is the host-facing path which is bind-mounted as -// `/` inside the container. This method is essentially used to access a -// particular path inside the container as though you were a process in that -// container. -// -// # NOTE -// The returned path is *only* safely scoped inside the container's BaseFS -// if no component of the returned path changes (such as a component -// symlinking to a different path) between using this method and using the -// path. See symlink.FollowSymlinkInScope for more details. -func (container *Container) GetResourcePath(path string) (string, error) { - if container.BaseFS == "" { - return "", errors.New("GetResourcePath: BaseFS of container " + container.ID + " is unexpectedly empty") - } - // IMPORTANT - These are paths on the OS where the daemon is running, hence - // any filepath operations must be done in an OS-agnostic way. - r, e := symlink.FollowSymlinkInScope(filepath.Join(container.BaseFS, cleanScopedPath(path)), container.BaseFS) - - // Log this here on the daemon side as there's otherwise no indication apart - // from the error being propagated all the way back to the client. This makes - // debugging significantly easier and clearly indicates the error comes from the daemon. - if e != nil { - log.G(context.TODO()).Errorf("Failed to ResolveScopedPath BaseFS %s path %s %s\n", container.BaseFS, path, e) - } - return r, e -} - -// cleanScopedPath prepares the given path to be combined with a mount path or -// a drive-letter. On Windows, it removes any existing driveletter (e.g. "C:"). -// The returned path is always prefixed with a [filepath.Separator]. -func cleanScopedPath(path string) string { - if len(path) >= 2 { - if v := filepath.VolumeName(path); len(v) > 0 { - path = path[len(v):] - } - } - return filepath.Join(string(filepath.Separator), path) -} - -// GetRootResourcePath evaluates `path` in the scope of the container's root, with proper path -// sanitization. Symlinks are all scoped to the root of the container, as -// though the container's root was `/`. -// -// The root of a container is the host-facing configuration metadata directory. -// Only use this method to safely access the container's `container.json` or -// other metadata files. If in doubt, use container.GetResourcePath. -// -// # NOTE -// The returned path is *only* safely scoped inside the container's root -// if no component of the returned path changes (such as a component -// symlinking to a different path) between using this method and using the -// path. See symlink.FollowSymlinkInScope for more details. -func (container *Container) GetRootResourcePath(path string) (string, error) { - // IMPORTANT - These are paths on the OS where the daemon is running, hence - // any filepath operations must be done in an OS agnostic way. - cleanPath := filepath.Join(string(os.PathSeparator), path) - return symlink.FollowSymlinkInScope(filepath.Join(container.Root, cleanPath), container.Root) -} - -// ExitOnNext signals to the monitor that it should not restart the container -// after we send the kill signal. -func (container *Container) ExitOnNext() { - container.RestartManager().Cancel() -} - -// HostConfigPath returns the path to the container's JSON hostconfig -func (container *Container) HostConfigPath() (string, error) { - return container.GetRootResourcePath(hostConfigFileName) -} - -// ConfigPath returns the path to the container's JSON config -func (container *Container) ConfigPath() (string, error) { - return container.GetRootResourcePath(configFileName) -} - -// CheckpointDir returns the directory checkpoints are stored in -func (container *Container) CheckpointDir() string { - return filepath.Join(container.Root, "checkpoints") -} - -// StartLogger starts a new logger driver for the container. -func (container *Container) StartLogger() (logger.Logger, error) { - cfg := container.HostConfig.LogConfig - initDriver, err := logger.GetLogDriver(cfg.Type) - if err != nil { - return nil, errors.Wrap(err, "failed to get logging factory") - } - info := logger.Info{ - Config: cfg.Config, - ContainerID: container.ID, - ContainerName: container.Name, - ContainerEntrypoint: container.Path, - ContainerArgs: container.Args, - ContainerImageID: container.ImageID.String(), - ContainerImageName: container.Config.Image, - ContainerCreated: container.Created, - ContainerEnv: container.Config.Env, - ContainerLabels: container.Config.Labels, - DaemonName: "docker", - } - - // Set logging file for "json-logger" - // TODO(@cpuguy83): Setup here based on log driver is a little weird. - switch cfg.Type { - case jsonfilelog.Name: - info.LogPath, err = container.GetRootResourcePath(fmt.Sprintf("%s-json.log", container.ID)) - if err != nil { - return nil, err - } - - container.LogPath = info.LogPath - case local.Name: - // Do not set container.LogPath for the local driver - // This would expose the value to the API, which should not be done as it means - // that the log file implementation would become a stable API that cannot change. - logDir, err := container.GetRootResourcePath("local-logs") - if err != nil { - return nil, err - } - if err := os.MkdirAll(logDir, 0o700); err != nil { - return nil, errdefs.System(errors.Wrap(err, "error creating local logs dir")) - } - info.LogPath = filepath.Join(logDir, "container.log") - } - - l, err := initDriver(info) - if err != nil { - return nil, err - } - - if containertypes.LogMode(cfg.Config["mode"]) == containertypes.LogModeNonBlock { - bufferSize := int64(-1) - if s, exists := cfg.Config["max-buffer-size"]; exists { - bufferSize, err = units.RAMInBytes(s) - if err != nil { - return nil, err - } - } - l = logger.NewRingLogger(l, info, bufferSize) - } - - if _, ok := l.(logger.LogReader); !ok { - if cache.ShouldUseCache(cfg.Config) { - logPath, err := container.GetRootResourcePath("container-cached.log") - if err != nil { - return nil, err - } - - if !container.LocalLogCacheMeta.HaveNotifyEnabled { - log.G(context.TODO()).WithField("container", container.ID).WithField("driver", container.HostConfig.LogConfig.Type).Info("Configured log driver does not support reads, enabling local file cache for container logs") - container.LocalLogCacheMeta.HaveNotifyEnabled = true - } - info.LogPath = logPath - l, err = cache.WithLocalCache(l, info) - if err != nil { - return nil, errors.Wrap(err, "error setting up local container log cache") - } - } - } - return l, nil -} - -// GetProcessLabel returns the process label for the container. -func (container *Container) GetProcessLabel() string { - // even if we have a process label return "" if we are running - // in privileged mode - if container.HostConfig.Privileged { - return "" - } - return container.ProcessLabel -} - -// GetMountLabel returns the mounting label for the container. -// This label is empty if the container is privileged. -func (container *Container) GetMountLabel() string { - return container.MountLabel -} - -// GetExecIDs returns the list of exec commands running on the container. -func (container *Container) GetExecIDs() []string { - return container.ExecCommands.List() -} - -// ShouldRestart decides whether the daemon should restart the container or not. -// This is based on the container's restart policy. -func (container *Container) ShouldRestart() bool { - shouldRestart, _, _ := container.RestartManager().ShouldRestart(uint32(container.ExitCode()), container.HasBeenManuallyStopped, container.FinishedAt.Sub(container.StartedAt)) - return shouldRestart -} - -// AddMountPointWithVolume adds a new mount point configured with a volume to the container. -func (container *Container) AddMountPointWithVolume(destination string, vol volume.Volume, rw bool) { - volumeParser := volumemounts.NewParser() - container.MountPoints[destination] = &volumemounts.MountPoint{ - Type: mounttypes.TypeVolume, - Name: vol.Name(), - Driver: vol.DriverName(), - Destination: destination, - RW: rw, - Volume: vol, - CopyData: volumeParser.DefaultCopyMode(), - } -} - -// UnmountVolumes unmounts all volumes -func (container *Container) UnmountVolumes(ctx context.Context, volumeEventLog func(name string, action events.Action, attributes map[string]string)) error { - var errs []string - for _, volumeMount := range container.MountPoints { - if volumeMount.Volume == nil { - continue - } - - if err := volumeMount.Cleanup(ctx); err != nil { - errs = append(errs, err.Error()) - continue - } - volumeEventLog(volumeMount.Volume.Name(), events.ActionUnmount, map[string]string{ - "driver": volumeMount.Volume.DriverName(), - "container": container.ID, - }) - } - if len(errs) > 0 { - return fmt.Errorf("error while unmounting volumes for container %s: %s", container.ID, strings.Join(errs, "; ")) - } - return nil -} - -// IsDestinationMounted checks whether a path is mounted on the container or not. -func (container *Container) IsDestinationMounted(destination string) bool { - return container.MountPoints[destination] != nil -} - -// StopSignal returns the signal used to stop the container. -func (container *Container) StopSignal() syscall.Signal { - stopSignal := defaultStopSignal - if container.Config.StopSignal != "" { - // signal.ParseSignal returns "-1" for invalid or unknown signals. - sig, err := signal.ParseSignal(container.Config.StopSignal) - if err == nil && sig > 0 { - stopSignal = sig - } - } - return stopSignal -} - -// StopTimeout returns the timeout (in seconds) used to stop the container. -func (container *Container) StopTimeout() int { - if container.Config.StopTimeout != nil { - return *container.Config.StopTimeout - } - return defaultStopTimeout -} - -// InitDNSHostConfig ensures that the dns fields are never nil. -// New containers don't ever have those fields nil, -// but pre created containers can still have those nil values. -// The non-recommended host configuration in the start api can -// make these fields nil again, this corrects that issue until -// we remove that behavior for good. -// See https://github.com/docker/docker/pull/17779 -// for a more detailed explanation on why we don't want that. -func (container *Container) InitDNSHostConfig() { - container.Lock() - defer container.Unlock() - if container.HostConfig.DNS == nil { - container.HostConfig.DNS = make([]string, 0) - } - - if container.HostConfig.DNSSearch == nil { - container.HostConfig.DNSSearch = make([]string, 0) - } - - if container.HostConfig.DNSOptions == nil { - container.HostConfig.DNSOptions = make([]string, 0) - } -} - -// UpdateMonitor updates monitor configure for running container -func (container *Container) UpdateMonitor(restartPolicy containertypes.RestartPolicy) { - container.RestartManager().SetPolicy(restartPolicy) -} - -// FullHostname returns hostname and optional domain appended to it. -func (container *Container) FullHostname() string { - fullHostname := container.Config.Hostname - if container.Config.Domainname != "" { - fullHostname = fmt.Sprintf("%s.%s", fullHostname, container.Config.Domainname) - } - return fullHostname -} - -// RestartManager returns the current restartmanager instance connected to container. -func (container *Container) RestartManager() *restartmanager.RestartManager { - if container.restartManager == nil { - container.restartManager = restartmanager.New(container.HostConfig.RestartPolicy, container.RestartCount) - } - return container.restartManager -} - -// ResetRestartManager initializes new restartmanager based on container config -func (container *Container) ResetRestartManager(resetCount bool) { - if container.restartManager != nil { - container.restartManager.Cancel() - } - if resetCount { - container.RestartCount = 0 - } - container.restartManager = nil -} - -// AttachContext returns the context for attach calls to track container liveness. -func (container *Container) AttachContext() context.Context { - return container.attachContext.init() -} - -// CancelAttachContext cancels attach context. All attach calls should detach -// after this call. -func (container *Container) CancelAttachContext() { - container.attachContext.cancel() -} - -func (container *Container) startLogging() error { - if container.HostConfig.LogConfig.Type == "none" { - return nil // do not start logging routines - } - - l, err := container.StartLogger() - if err != nil { - return fmt.Errorf("failed to initialize logging driver: %v", err) - } - - copier := logger.NewCopier(map[string]io.Reader{"stdout": container.StdoutPipe(), "stderr": container.StderrPipe()}, l) - container.LogCopier = copier - copier.Run() - container.LogDriver = l - - return nil -} - -// StdinPipe gets the stdin stream of the container -func (container *Container) StdinPipe() io.WriteCloser { - return container.StreamConfig.StdinPipe() -} - -// StdoutPipe gets the stdout stream of the container -func (container *Container) StdoutPipe() io.ReadCloser { - return container.StreamConfig.StdoutPipe() -} - -// StderrPipe gets the stderr stream of the container -func (container *Container) StderrPipe() io.ReadCloser { - return container.StreamConfig.StderrPipe() -} - -// CloseStreams closes the container's stdio streams -func (container *Container) CloseStreams() error { - return container.StreamConfig.CloseStreams() -} - -// InitializeStdio is called by libcontainerd to connect the stdio. -func (container *Container) InitializeStdio(iop *cio.DirectIO) (cio.IO, error) { - if err := container.startLogging(); err != nil { - container.Reset(false) - return nil, err - } - - container.StreamConfig.CopyToPipe(iop) - - if container.StreamConfig.Stdin() == nil && !container.Config.Tty { - if iop.Stdin != nil { - if err := iop.Stdin.Close(); err != nil { - log.G(context.TODO()).Warnf("error closing stdin: %+v", err) - } - } - } - - return &rio{IO: iop, sc: container.StreamConfig}, nil -} - -// MountsResourcePath returns the path where mounts are stored for the given mount -func (container *Container) MountsResourcePath(mount string) (string, error) { - return container.GetRootResourcePath(filepath.Join("mounts", mount)) -} - -// SecretMountPath returns the path of the secret mount for the container -func (container *Container) SecretMountPath() (string, error) { - return container.MountsResourcePath("secrets") -} - -// SecretFilePath returns the path to the location of a secret on the host. -func (container *Container) SecretFilePath(secretRef swarmtypes.SecretReference) (string, error) { - secrets, err := container.SecretMountPath() - if err != nil { - return "", err - } - return filepath.Join(secrets, secretRef.SecretID), nil -} - -func getSecretTargetPath(r *swarmtypes.SecretReference) string { - if filepath.IsAbs(r.File.Name) { - return r.File.Name - } - - return filepath.Join(containerSecretMountPath, r.File.Name) -} - -// getConfigTargetPath makes sure that config paths inside the container are -// absolute, as required by the runtime spec, and enforced by runc >= 1.0.0-rc94. -// see https://github.com/opencontainers/runc/issues/2928 -func getConfigTargetPath(r *swarmtypes.ConfigReference) string { - if filepath.IsAbs(r.File.Name) { - return r.File.Name - } - - return filepath.Join(containerConfigMountPath, r.File.Name) -} - -// CreateDaemonEnvironment creates a new environment variable slice for this container. -func (container *Container) CreateDaemonEnvironment(tty bool, linkedEnv []string) []string { - // Setup environment - ctrOS := container.ImagePlatform.OS - if ctrOS == "" { - ctrOS = runtime.GOOS - } - - // Figure out what size slice we need so we can allocate this all at once. - envSize := len(container.Config.Env) - if runtime.GOOS != "windows" { - envSize += 2 + len(linkedEnv) - } - if tty { - envSize++ - } - - env := make([]string, 0, envSize) - if runtime.GOOS != "windows" { - env = append(env, "PATH="+oci.DefaultPathEnv(ctrOS)) - env = append(env, "HOSTNAME="+container.Config.Hostname) - if tty { - env = append(env, "TERM=xterm") - } - env = append(env, linkedEnv...) - } - - // because the env on the container can override certain default values - // we need to replace the 'env' keys where they match and append anything - // else. - env = ReplaceOrAppendEnvValues(env, container.Config.Env) - return env -} - -// RestoreTask restores the containerd container and task handles and reattaches -// the IO for the running task. Container state is not synced with containerd's -// state. -// -// An errdefs.NotFound error is returned if the container does not exist in -// containerd. However, a nil error is returned if the task does not exist in -// containerd. -func (container *Container) RestoreTask(ctx context.Context, client libcontainerdtypes.Client) error { - container.Lock() - defer container.Unlock() - var err error - container.ctr, err = client.LoadContainer(ctx, container.ID) - if err != nil { - return err - } - container.task, err = container.ctr.AttachTask(ctx, container.InitializeStdio) - if err != nil && !errdefs.IsNotFound(err) { - return err - } - return nil -} - -// GetRunningTask asserts that the container is running and returns the Task for -// the container. An errdefs.Conflict error is returned if the container is not -// in the Running state. -// -// A system error is returned if container is in a bad state: Running is true -// but has a nil Task. -// -// The container lock must be held when calling this method. -func (container *Container) GetRunningTask() (libcontainerdtypes.Task, error) { - if !container.Running { - return nil, errdefs.Conflict(fmt.Errorf("container %s is not running", container.ID)) - } - tsk, ok := container.Task() - if !ok { - return nil, errdefs.System(errors.WithStack(fmt.Errorf("container %s is in Running state but has no containerd Task set", container.ID))) - } - return tsk, nil -} - -type rio struct { - cio.IO - - sc *stream.Config -} - -func (i *rio) Close() error { - i.IO.Close() - - return i.sc.CloseStreams() -} - -func (i *rio) Wait() { - i.sc.Wait(context.Background()) - - i.IO.Wait() -} - -type conflictingUpdateOptions string - -func (e conflictingUpdateOptions) Error() string { - return string(e) -} - -func (e conflictingUpdateOptions) Conflict() {} diff --git a/vendor/github.com/docker/docker/container/container_unix.go b/vendor/github.com/docker/docker/container/container_unix.go deleted file mode 100644 index d083c7df5a..0000000000 --- a/vendor/github.com/docker/docker/container/container_unix.go +++ /dev/null @@ -1,448 +0,0 @@ -//go:build !windows - -package container // import "github.com/docker/docker/container" - -import ( - "context" - "os" - "path/filepath" - "syscall" - - "github.com/containerd/continuity/fs" - "github.com/containerd/log" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - mounttypes "github.com/docker/docker/api/types/mount" - swarmtypes "github.com/docker/docker/api/types/swarm" - volumemounts "github.com/docker/docker/volume/mounts" - "github.com/moby/sys/mount" - "github.com/opencontainers/selinux/go-selinux/label" - "github.com/pkg/errors" -) - -const ( - // defaultStopTimeout sets the default time, in seconds, to wait - // for the graceful container stop before forcefully terminating it. - defaultStopTimeout = 10 - - containerConfigMountPath = "/" - containerSecretMountPath = "/run/secrets" -) - -// TrySetNetworkMount attempts to set the network mounts given a provided destination and -// the path to use for it; return true if the given destination was a network mount file -func (container *Container) TrySetNetworkMount(destination string, path string) bool { - if destination == "/etc/resolv.conf" { - container.ResolvConfPath = path - return true - } - if destination == "/etc/hostname" { - container.HostnamePath = path - return true - } - if destination == "/etc/hosts" { - container.HostsPath = path - return true - } - - return false -} - -// BuildHostnameFile writes the container's hostname file. -func (container *Container) BuildHostnameFile() error { - hostnamePath, err := container.GetRootResourcePath("hostname") - if err != nil { - return err - } - container.HostnamePath = hostnamePath - return os.WriteFile(container.HostnamePath, []byte(container.Config.Hostname+"\n"), 0o644) -} - -// NetworkMounts returns the list of network mounts. -func (container *Container) NetworkMounts() []Mount { - ctx := context.TODO() - - var mounts []Mount - shared := container.HostConfig.NetworkMode.IsContainer() - parser := volumemounts.NewParser() - if container.ResolvConfPath != "" { - if _, err := os.Stat(container.ResolvConfPath); err != nil { - log.G(ctx).Warnf("ResolvConfPath set to %q, but can't stat this filename (err = %v); skipping", container.ResolvConfPath, err) - } else { - writable := !container.HostConfig.ReadonlyRootfs - if m, exists := container.MountPoints["/etc/resolv.conf"]; exists { - writable = m.RW - } else { - label.Relabel(container.ResolvConfPath, container.MountLabel, shared) - } - mounts = append(mounts, Mount{ - Source: container.ResolvConfPath, - Destination: "/etc/resolv.conf", - Writable: writable, - Propagation: string(parser.DefaultPropagationMode()), - }) - } - } - if container.HostnamePath != "" { - if _, err := os.Stat(container.HostnamePath); err != nil { - log.G(ctx).Warnf("HostnamePath set to %q, but can't stat this filename (err = %v); skipping", container.HostnamePath, err) - } else { - writable := !container.HostConfig.ReadonlyRootfs - if m, exists := container.MountPoints["/etc/hostname"]; exists { - writable = m.RW - } else { - label.Relabel(container.HostnamePath, container.MountLabel, shared) - } - mounts = append(mounts, Mount{ - Source: container.HostnamePath, - Destination: "/etc/hostname", - Writable: writable, - Propagation: string(parser.DefaultPropagationMode()), - }) - } - } - if container.HostsPath != "" { - if _, err := os.Stat(container.HostsPath); err != nil { - log.G(ctx).Warnf("HostsPath set to %q, but can't stat this filename (err = %v); skipping", container.HostsPath, err) - } else { - writable := !container.HostConfig.ReadonlyRootfs - if m, exists := container.MountPoints["/etc/hosts"]; exists { - writable = m.RW - } else { - label.Relabel(container.HostsPath, container.MountLabel, shared) - } - mounts = append(mounts, Mount{ - Source: container.HostsPath, - Destination: "/etc/hosts", - Writable: writable, - Propagation: string(parser.DefaultPropagationMode()), - }) - } - } - return mounts -} - -// CopyImagePathContent copies files in destination to the volume. -func (container *Container) CopyImagePathContent(volumePath, destination string) error { - if err := label.Relabel(volumePath, container.MountLabel, true); err != nil && !errors.Is(err, syscall.ENOTSUP) { - return err - } - return copyExistingContents(destination, volumePath) -} - -// ShmResourcePath returns path to shm -func (container *Container) ShmResourcePath() (string, error) { - return container.MountsResourcePath("shm") -} - -// HasMountFor checks if path is a mountpoint -func (container *Container) HasMountFor(path string) bool { - _, exists := container.MountPoints[path] - if exists { - return true - } - - // Also search among the tmpfs mounts - for dest := range container.HostConfig.Tmpfs { - if dest == path { - return true - } - } - - return false -} - -// UnmountIpcMount unmounts shm if it was mounted -func (container *Container) UnmountIpcMount() error { - if container.HasMountFor("/dev/shm") { - return nil - } - - // container.ShmPath should not be used here as it may point - // to the host's or other container's /dev/shm - shmPath, err := container.ShmResourcePath() - if err != nil { - return err - } - if shmPath == "" { - return nil - } - if err = mount.Unmount(shmPath); err != nil && !errors.Is(err, os.ErrNotExist) { - return err - } - return nil -} - -// IpcMounts returns the list of IPC mounts -func (container *Container) IpcMounts() []Mount { - var mounts []Mount - parser := volumemounts.NewParser() - - if container.HasMountFor("/dev/shm") { - return mounts - } - if container.ShmPath == "" { - return mounts - } - - label.SetFileLabel(container.ShmPath, container.MountLabel) - mounts = append(mounts, Mount{ - Source: container.ShmPath, - Destination: "/dev/shm", - Writable: true, - Propagation: string(parser.DefaultPropagationMode()), - }) - - return mounts -} - -// SecretMounts returns the mounts for the secret path. -func (container *Container) SecretMounts() ([]Mount, error) { - var mounts []Mount - for _, r := range container.SecretReferences { - if r.File == nil { - continue - } - src, err := container.SecretFilePath(*r) - if err != nil { - return nil, err - } - mounts = append(mounts, Mount{ - Source: src, - Destination: getSecretTargetPath(r), - Writable: false, - }) - } - for _, r := range container.ConfigReferences { - fPath, err := container.ConfigFilePath(*r) - if err != nil { - return nil, err - } - mounts = append(mounts, Mount{ - Source: fPath, - Destination: getConfigTargetPath(r), - Writable: false, - }) - } - - return mounts, nil -} - -// UnmountSecrets unmounts the local tmpfs for secrets -func (container *Container) UnmountSecrets() error { - p, err := container.SecretMountPath() - if err != nil { - return err - } - if _, err := os.Stat(p); err != nil { - if os.IsNotExist(err) { - return nil - } - return err - } - - return mount.RecursiveUnmount(p) -} - -// UpdateContainer updates configuration of a container. Callers must hold a Lock on the Container. -func (container *Container) UpdateContainer(hostConfig *containertypes.HostConfig) error { - // update resources of container - resources := hostConfig.Resources - cResources := &container.HostConfig.Resources - - // validate NanoCPUs, CPUPeriod, and CPUQuota - // Because NanoCPU effectively updates CPUPeriod/CPUQuota, - // once NanoCPU is already set, updating CPUPeriod/CPUQuota will be blocked, and vice versa. - // In the following we make sure the intended update (resources) does not conflict with the existing (cResource). - if resources.NanoCPUs > 0 && cResources.CPUPeriod > 0 { - return conflictingUpdateOptions("Conflicting options: Nano CPUs cannot be updated as CPU Period has already been set") - } - if resources.NanoCPUs > 0 && cResources.CPUQuota > 0 { - return conflictingUpdateOptions("Conflicting options: Nano CPUs cannot be updated as CPU Quota has already been set") - } - if resources.CPUPeriod > 0 && cResources.NanoCPUs > 0 { - return conflictingUpdateOptions("Conflicting options: CPU Period cannot be updated as NanoCPUs has already been set") - } - if resources.CPUQuota > 0 && cResources.NanoCPUs > 0 { - return conflictingUpdateOptions("Conflicting options: CPU Quota cannot be updated as NanoCPUs has already been set") - } - - if resources.BlkioWeight != 0 { - cResources.BlkioWeight = resources.BlkioWeight - } - if resources.CPUShares != 0 { - cResources.CPUShares = resources.CPUShares - } - if resources.NanoCPUs != 0 { - cResources.NanoCPUs = resources.NanoCPUs - } - if resources.CPUPeriod != 0 { - cResources.CPUPeriod = resources.CPUPeriod - } - if resources.CPUQuota != 0 { - cResources.CPUQuota = resources.CPUQuota - } - if resources.CpusetCpus != "" { - cResources.CpusetCpus = resources.CpusetCpus - } - if resources.CpusetMems != "" { - cResources.CpusetMems = resources.CpusetMems - } - if resources.Memory != 0 { - // if memory limit smaller than already set memoryswap limit and doesn't - // update the memoryswap limit, then error out. - if resources.Memory > cResources.MemorySwap && resources.MemorySwap == 0 { - return conflictingUpdateOptions("Memory limit should be smaller than already set memoryswap limit, update the memoryswap at the same time") - } - cResources.Memory = resources.Memory - } - if resources.MemorySwap != 0 { - cResources.MemorySwap = resources.MemorySwap - } - if resources.MemoryReservation != 0 { - cResources.MemoryReservation = resources.MemoryReservation - } - if resources.KernelMemory != 0 { - cResources.KernelMemory = resources.KernelMemory - } - if resources.CPURealtimePeriod != 0 { - cResources.CPURealtimePeriod = resources.CPURealtimePeriod - } - if resources.CPURealtimeRuntime != 0 { - cResources.CPURealtimeRuntime = resources.CPURealtimeRuntime - } - if resources.PidsLimit != nil { - cResources.PidsLimit = resources.PidsLimit - } - - // update HostConfig of container - if hostConfig.RestartPolicy.Name != "" { - if container.HostConfig.AutoRemove && !hostConfig.RestartPolicy.IsNone() { - return conflictingUpdateOptions("Restart policy cannot be updated because AutoRemove is enabled for the container") - } - container.HostConfig.RestartPolicy = hostConfig.RestartPolicy - } - - return nil -} - -// DetachAndUnmount uses a detached mount on all mount destinations, then -// unmounts each volume normally. -// This is used from daemon/archive for `docker cp` -func (container *Container) DetachAndUnmount(volumeEventLog func(name string, action events.Action, attributes map[string]string)) error { - ctx := context.TODO() - - networkMounts := container.NetworkMounts() - mountPaths := make([]string, 0, len(container.MountPoints)+len(networkMounts)) - - for _, mntPoint := range container.MountPoints { - dest, err := container.GetResourcePath(mntPoint.Destination) - if err != nil { - log.G(ctx).Warnf("Failed to get volume destination path for container '%s' at '%s' while lazily unmounting: %v", container.ID, mntPoint.Destination, err) - continue - } - mountPaths = append(mountPaths, dest) - } - - for _, m := range networkMounts { - dest, err := container.GetResourcePath(m.Destination) - if err != nil { - log.G(ctx).Warnf("Failed to get volume destination path for container '%s' at '%s' while lazily unmounting: %v", container.ID, m.Destination, err) - continue - } - mountPaths = append(mountPaths, dest) - } - - for _, mountPath := range mountPaths { - if err := mount.Unmount(mountPath); err != nil { - log.G(ctx).WithError(err).WithField("container", container.ID). - Warn("Unable to unmount") - } - } - return container.UnmountVolumes(ctx, volumeEventLog) -} - -// ignoreUnsupportedXAttrs ignores errors when extended attributes -// are not supported -func ignoreUnsupportedXAttrs() fs.CopyDirOpt { - xeh := func(dst, src, xattrKey string, err error) error { - if !errors.Is(err, syscall.ENOTSUP) { - return err - } - return nil - } - return fs.WithXAttrErrorHandler(xeh) -} - -// copyExistingContents copies from the source to the destination and -// ensures the ownership is appropriately set. -func copyExistingContents(source, destination string) error { - dstList, err := os.ReadDir(destination) - if err != nil { - return err - } - if len(dstList) != 0 { - log.G(context.TODO()).WithFields(log.Fields{ - "source": source, - "destination": destination, - }).Debug("destination is not empty, do not copy") - return nil - } - - return fs.CopyDir(destination, source, ignoreUnsupportedXAttrs()) -} - -// TmpfsMounts returns the list of tmpfs mounts -func (container *Container) TmpfsMounts() ([]Mount, error) { - var mounts []Mount - for dest, data := range container.HostConfig.Tmpfs { - mounts = append(mounts, Mount{ - Source: "tmpfs", - Destination: dest, - Data: data, - }) - } - parser := volumemounts.NewParser() - for dest, mnt := range container.MountPoints { - if mnt.Type == mounttypes.TypeTmpfs { - data, err := parser.ConvertTmpfsOptions(mnt.Spec.TmpfsOptions, mnt.Spec.ReadOnly) - if err != nil { - return nil, err - } - mounts = append(mounts, Mount{ - Source: "tmpfs", - Destination: dest, - Data: data, - }) - } - } - return mounts, nil -} - -// GetMountPoints gives a platform specific transformation to types.MountPoint. Callers must hold a Container lock. -func (container *Container) GetMountPoints() []containertypes.MountPoint { - mountPoints := make([]containertypes.MountPoint, 0, len(container.MountPoints)) - for _, m := range container.MountPoints { - mountPoints = append(mountPoints, containertypes.MountPoint{ - Type: m.Type, - Name: m.Name, - Source: m.Path(), - Destination: m.Destination, - Driver: m.Driver, - Mode: m.Mode, - RW: m.RW, - Propagation: m.Propagation, - }) - } - return mountPoints -} - -// ConfigFilePath returns the path to the on-disk location of a config. -// On unix, configs are always considered secret -func (container *Container) ConfigFilePath(configRef swarmtypes.ConfigReference) (string, error) { - mounts, err := container.SecretMountPath() - if err != nil { - return "", err - } - return filepath.Join(mounts, configRef.ConfigID), nil -} diff --git a/vendor/github.com/docker/docker/container/container_windows.go b/vendor/github.com/docker/docker/container/container_windows.go deleted file mode 100644 index 8127b18b62..0000000000 --- a/vendor/github.com/docker/docker/container/container_windows.go +++ /dev/null @@ -1,209 +0,0 @@ -package container // import "github.com/docker/docker/container" - -import ( - "context" - "errors" - "os" - "path/filepath" - - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - swarmtypes "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/errdefs" -) - -const ( - containerConfigMountPath = `C:\` - containerSecretMountPath = `C:\ProgramData\Docker\secrets` - containerInternalSecretMountPath = `C:\ProgramData\Docker\internal\secrets` - containerInternalConfigsDirPath = `C:\ProgramData\Docker\internal\configs` - - // defaultStopTimeout is the timeout (in seconds) for the shutdown call on a container - defaultStopTimeout = 30 -) - -// UnmountIpcMount unmounts Ipc related mounts. -// This is a NOOP on windows. -func (container *Container) UnmountIpcMount() error { - return nil -} - -// IpcMounts returns the list of Ipc related mounts. -func (container *Container) IpcMounts() []Mount { - return nil -} - -// CreateSecretSymlinks creates symlinks to files in the secret mount. -func (container *Container) CreateSecretSymlinks() error { - for _, r := range container.SecretReferences { - if r.File == nil { - continue - } - resolvedPath, _, err := container.ResolvePath(getSecretTargetPath(r)) - if err != nil { - return err - } - if err := os.MkdirAll(filepath.Dir(resolvedPath), 0); err != nil { - return err - } - if err := os.Symlink(filepath.Join(containerInternalSecretMountPath, r.SecretID), resolvedPath); err != nil { - return err - } - } - - return nil -} - -// SecretMounts returns the mount for the secret path. -// All secrets are stored in a single mount on Windows. Target symlinks are -// created for each secret, pointing to the files in this mount. -func (container *Container) SecretMounts() ([]Mount, error) { - var mounts []Mount - if len(container.SecretReferences) > 0 { - src, err := container.SecretMountPath() - if err != nil { - return nil, err - } - mounts = append(mounts, Mount{ - Source: src, - Destination: containerInternalSecretMountPath, - Writable: false, - }) - } - - return mounts, nil -} - -// UnmountSecrets unmounts the fs for secrets -func (container *Container) UnmountSecrets() error { - p, err := container.SecretMountPath() - if err != nil { - return err - } - return os.RemoveAll(p) -} - -// CreateConfigSymlinks creates symlinks to files in the config mount. -func (container *Container) CreateConfigSymlinks() error { - for _, configRef := range container.ConfigReferences { - if configRef.File == nil { - continue - } - resolvedPath, _, err := container.ResolvePath(getConfigTargetPath(configRef)) - if err != nil { - return err - } - if err := os.MkdirAll(filepath.Dir(resolvedPath), 0); err != nil { - return err - } - if err := os.Symlink(filepath.Join(containerInternalConfigsDirPath, configRef.ConfigID), resolvedPath); err != nil { - return err - } - } - - return nil -} - -// ConfigMounts returns the mount for configs. -// TODO: Right now Windows doesn't really have a "secure" storage for secrets, -// however some configs may contain secrets. Once secure storage is worked out, -// configs and secret handling should be merged. -func (container *Container) ConfigMounts() []Mount { - var mounts []Mount - if len(container.ConfigReferences) > 0 { - mounts = append(mounts, Mount{ - Source: container.ConfigsDirPath(), - Destination: containerInternalConfigsDirPath, - Writable: false, - }) - } - - return mounts -} - -// DetachAndUnmount unmounts all volumes. -// On Windows it only delegates to `UnmountVolumes` since there is nothing to -// force unmount. -func (container *Container) DetachAndUnmount(volumeEventLog func(name string, action events.Action, attributes map[string]string)) error { - return container.UnmountVolumes(context.TODO(), volumeEventLog) -} - -// TmpfsMounts returns the list of tmpfs mounts -func (container *Container) TmpfsMounts() ([]Mount, error) { - var mounts []Mount - return mounts, nil -} - -// UpdateContainer updates configuration of a container. Callers must hold a Lock on the Container. -func (container *Container) UpdateContainer(hostConfig *containertypes.HostConfig) error { - resources := hostConfig.Resources - if resources.CPUShares != 0 || - resources.Memory != 0 || - resources.NanoCPUs != 0 || - resources.CgroupParent != "" || - resources.BlkioWeight != 0 || - len(resources.BlkioWeightDevice) != 0 || - len(resources.BlkioDeviceReadBps) != 0 || - len(resources.BlkioDeviceWriteBps) != 0 || - len(resources.BlkioDeviceReadIOps) != 0 || - len(resources.BlkioDeviceWriteIOps) != 0 || - resources.CPUPeriod != 0 || - resources.CPUQuota != 0 || - resources.CPURealtimePeriod != 0 || - resources.CPURealtimeRuntime != 0 || - resources.CpusetCpus != "" || - resources.CpusetMems != "" || - len(resources.Devices) != 0 || - len(resources.DeviceCgroupRules) != 0 || - resources.KernelMemory != 0 || - resources.MemoryReservation != 0 || - resources.MemorySwap != 0 || - resources.MemorySwappiness != nil || - resources.OomKillDisable != nil || - (resources.PidsLimit != nil && *resources.PidsLimit != 0) || - len(resources.Ulimits) != 0 || - resources.CPUCount != 0 || - resources.CPUPercent != 0 || - resources.IOMaximumIOps != 0 || - resources.IOMaximumBandwidth != 0 { - return errdefs.InvalidParameter(errors.New("resource updating isn't supported on Windows")) - } - // update HostConfig of container - if hostConfig.RestartPolicy.Name != "" { - if container.HostConfig.AutoRemove && !hostConfig.RestartPolicy.IsNone() { - return conflictingUpdateOptions("Restart policy cannot be updated because AutoRemove is enabled for the container") - } - container.HostConfig.RestartPolicy = hostConfig.RestartPolicy - } - return nil -} - -// BuildHostnameFile writes the container's hostname file. -func (container *Container) BuildHostnameFile() error { - return nil -} - -// GetMountPoints gives a platform specific transformation to types.MountPoint. Callers must hold a Container lock. -func (container *Container) GetMountPoints() []containertypes.MountPoint { - mountPoints := make([]containertypes.MountPoint, 0, len(container.MountPoints)) - for _, m := range container.MountPoints { - mountPoints = append(mountPoints, containertypes.MountPoint{ - Type: m.Type, - Name: m.Name, - Source: m.Path(), - Destination: m.Destination, - Driver: m.Driver, - RW: m.RW, - }) - } - return mountPoints -} - -func (container *Container) ConfigsDirPath() string { - return filepath.Join(container.Root, "configs") -} - -// ConfigFilePath returns the path to the on-disk location of a config. -func (container *Container) ConfigFilePath(configRef swarmtypes.ConfigReference) (string, error) { - return filepath.Join(container.ConfigsDirPath(), configRef.ConfigID), nil -} diff --git a/vendor/github.com/docker/docker/container/env.go b/vendor/github.com/docker/docker/container/env.go deleted file mode 100644 index e31088c885..0000000000 --- a/vendor/github.com/docker/docker/container/env.go +++ /dev/null @@ -1,43 +0,0 @@ -package container // import "github.com/docker/docker/container" - -import ( - "strings" -) - -// ReplaceOrAppendEnvValues returns the defaults with the overrides either -// replaced by env key or appended to the list -func ReplaceOrAppendEnvValues(defaults, overrides []string) []string { - cache := make(map[string]int, len(defaults)) - for i, e := range defaults { - index := strings.Index(e, "=") - cache[e[:index]] = i - } - - for _, value := range overrides { - // Values w/o = means they want this env to be removed/unset. - index := strings.Index(value, "=") - if index < 0 { - // no "=" in value - if i, exists := cache[value]; exists { - defaults[i] = "" // Used to indicate it should be removed - } - continue - } - - if i, exists := cache[value[:index]]; exists { - defaults[i] = value - } else { - defaults = append(defaults, value) - } - } - - // Now remove all entries that we want to "unset" - for i := 0; i < len(defaults); i++ { - if defaults[i] == "" { - defaults = append(defaults[:i], defaults[i+1:]...) - i-- - } - } - - return defaults -} diff --git a/vendor/github.com/docker/docker/container/exec.go b/vendor/github.com/docker/docker/container/exec.go deleted file mode 100644 index e55bdcbab3..0000000000 --- a/vendor/github.com/docker/docker/container/exec.go +++ /dev/null @@ -1,132 +0,0 @@ -package container // import "github.com/docker/docker/container" - -import ( - "context" - "runtime" - "sync" - - "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/log" - "github.com/docker/docker/container/stream" - "github.com/docker/docker/libcontainerd/types" - "github.com/docker/docker/pkg/stringid" -) - -// ExecConfig holds the configurations for execs. The Daemon keeps -// track of both running and finished execs so that they can be -// examined both during and after completion. -type ExecConfig struct { - sync.Mutex - Started chan struct{} - StreamConfig *stream.Config - ID string - Running bool - ExitCode *int - OpenStdin bool - OpenStderr bool - OpenStdout bool - CanRemove bool - Container *Container - DetachKeys []byte - Entrypoint string - Args []string - Tty bool - Privileged bool - User string - WorkingDir string - Env []string - Process types.Process - ConsoleSize *[2]uint -} - -// NewExecConfig initializes the a new exec configuration -func NewExecConfig(c *Container) *ExecConfig { - return &ExecConfig{ - ID: stringid.GenerateRandomID(), - Container: c, - StreamConfig: stream.NewConfig(), - Started: make(chan struct{}), - } -} - -// InitializeStdio is called by libcontainerd to connect the stdio. -func (c *ExecConfig) InitializeStdio(iop *cio.DirectIO) (cio.IO, error) { - c.StreamConfig.CopyToPipe(iop) - - if c.StreamConfig.Stdin() == nil && !c.Tty && runtime.GOOS == "windows" { - if iop.Stdin != nil { - if err := iop.Stdin.Close(); err != nil { - log.G(context.TODO()).Errorf("error closing exec stdin: %+v", err) - } - } - } - - return &rio{IO: iop, sc: c.StreamConfig}, nil -} - -// CloseStreams closes the stdio streams for the exec -func (c *ExecConfig) CloseStreams() error { - return c.StreamConfig.CloseStreams() -} - -// SetExitCode sets the exec config's exit code -func (c *ExecConfig) SetExitCode(code int) { - c.ExitCode = &code -} - -// ExecStore keeps track of the exec configurations. -type ExecStore struct { - byID map[string]*ExecConfig - mu sync.RWMutex -} - -// NewExecStore initializes a new exec store. -func NewExecStore() *ExecStore { - return &ExecStore{ - byID: make(map[string]*ExecConfig), - } -} - -// Commands returns the exec configurations in the store. -func (e *ExecStore) Commands() map[string]*ExecConfig { - e.mu.RLock() - byID := make(map[string]*ExecConfig, len(e.byID)) - for id, config := range e.byID { - byID[id] = config - } - e.mu.RUnlock() - return byID -} - -// Add adds a new exec configuration to the store. -func (e *ExecStore) Add(id string, Config *ExecConfig) { - e.mu.Lock() - e.byID[id] = Config - e.mu.Unlock() -} - -// Get returns an exec configuration by its id. -func (e *ExecStore) Get(id string) *ExecConfig { - e.mu.RLock() - res := e.byID[id] - e.mu.RUnlock() - return res -} - -// Delete removes an exec configuration from the store. -func (e *ExecStore) Delete(id string) { - e.mu.Lock() - delete(e.byID, id) - e.mu.Unlock() -} - -// List returns the list of exec ids in the store. -func (e *ExecStore) List() []string { - var IDs []string - e.mu.RLock() - for id := range e.byID { - IDs = append(IDs, id) - } - e.mu.RUnlock() - return IDs -} diff --git a/vendor/github.com/docker/docker/container/health.go b/vendor/github.com/docker/docker/container/health.go deleted file mode 100644 index 381d058b8a..0000000000 --- a/vendor/github.com/docker/docker/container/health.go +++ /dev/null @@ -1,83 +0,0 @@ -package container // import "github.com/docker/docker/container" - -import ( - "context" - "sync" - - "github.com/containerd/log" - "github.com/docker/docker/api/types/container" -) - -// Health holds the current container health-check state -type Health struct { - container.Health - stop chan struct{} // Write struct{} to stop the monitor - mu sync.Mutex -} - -// String returns a human-readable description of the health-check state -func (s *Health) String() string { - status := s.Status() - - switch status { - case container.Starting: - return "health: starting" - default: // Healthy and Unhealthy are clear on their own - return status - } -} - -// Status returns the current health status. -// -// Note that this takes a lock and the value may change after being read. -func (s *Health) Status() string { - s.mu.Lock() - defer s.mu.Unlock() - - // This happens when the monitor has yet to be setup. - if s.Health.Status == "" { - return container.Unhealthy - } - - return s.Health.Status -} - -// SetStatus writes the current status to the underlying health structure, -// obeying the locking semantics. -// -// Status may be set directly if another lock is used. -func (s *Health) SetStatus(new string) { - s.mu.Lock() - defer s.mu.Unlock() - - s.Health.Status = new -} - -// OpenMonitorChannel creates and returns a new monitor channel. If there -// already is one, it returns nil. -func (s *Health) OpenMonitorChannel() chan struct{} { - s.mu.Lock() - defer s.mu.Unlock() - - if s.stop == nil { - log.G(context.TODO()).Debug("OpenMonitorChannel") - s.stop = make(chan struct{}) - return s.stop - } - return nil -} - -// CloseMonitorChannel closes any existing monitor channel. -func (s *Health) CloseMonitorChannel() { - s.mu.Lock() - defer s.mu.Unlock() - - if s.stop != nil { - log.G(context.TODO()).Debug("CloseMonitorChannel: waiting for probe to stop") - close(s.stop) - s.stop = nil - // unhealthy when the monitor has stopped for compatibility reasons - s.Health.Status = container.Unhealthy - log.G(context.TODO()).Debug("CloseMonitorChannel done") - } -} diff --git a/vendor/github.com/docker/docker/container/history.go b/vendor/github.com/docker/docker/container/history.go deleted file mode 100644 index 7117d9a437..0000000000 --- a/vendor/github.com/docker/docker/container/history.go +++ /dev/null @@ -1,30 +0,0 @@ -package container // import "github.com/docker/docker/container" - -import "sort" - -// History is a convenience type for storing a list of containers, -// sorted by creation date in descendant order. -type History []*Container - -// Len returns the number of containers in the history. -func (history *History) Len() int { - return len(*history) -} - -// Less compares two containers and returns true if the second one -// was created before the first one. -func (history *History) Less(i, j int) bool { - containers := *history - return containers[j].Created.Before(containers[i].Created) -} - -// Swap switches containers i and j positions in the history. -func (history *History) Swap(i, j int) { - containers := *history - containers[i], containers[j] = containers[j], containers[i] -} - -// sort orders the history by creation date in descendant order. -func (history *History) sort() { - sort.Sort(history) -} diff --git a/vendor/github.com/docker/docker/container/memory_store.go b/vendor/github.com/docker/docker/container/memory_store.go deleted file mode 100644 index ad4c9e20f6..0000000000 --- a/vendor/github.com/docker/docker/container/memory_store.go +++ /dev/null @@ -1,95 +0,0 @@ -package container // import "github.com/docker/docker/container" - -import ( - "sync" -) - -// memoryStore implements a Store in memory. -type memoryStore struct { - s map[string]*Container - sync.RWMutex -} - -// NewMemoryStore initializes a new memory store. -func NewMemoryStore() Store { - return &memoryStore{ - s: make(map[string]*Container), - } -} - -// Add appends a new container to the memory store. -// It overrides the id if it existed before. -func (c *memoryStore) Add(id string, cont *Container) { - c.Lock() - c.s[id] = cont - c.Unlock() -} - -// Get returns a container from the store by id. -func (c *memoryStore) Get(id string) *Container { - var res *Container - c.RLock() - res = c.s[id] - c.RUnlock() - return res -} - -// Delete removes a container from the store by id. -func (c *memoryStore) Delete(id string) { - c.Lock() - delete(c.s, id) - c.Unlock() -} - -// List returns a sorted list of containers from the store. -// The containers are ordered by creation date. -func (c *memoryStore) List() []*Container { - containers := History(c.all()) - containers.sort() - return containers -} - -// Size returns the number of containers in the store. -func (c *memoryStore) Size() int { - c.RLock() - defer c.RUnlock() - return len(c.s) -} - -// First returns the first container found in the store by a given filter. -func (c *memoryStore) First(filter StoreFilter) *Container { - for _, cont := range c.all() { - if filter(cont) { - return cont - } - } - return nil -} - -// ApplyAll calls the reducer function with every container in the store. -// This operation is asynchronous in the memory store. -// NOTE: Modifications to the store MUST NOT be done by the StoreReducer. -func (c *memoryStore) ApplyAll(apply StoreReducer) { - wg := new(sync.WaitGroup) - for _, cont := range c.all() { - wg.Add(1) - go func(container *Container) { - apply(container) - wg.Done() - }(cont) - } - - wg.Wait() -} - -func (c *memoryStore) all() []*Container { - c.RLock() - containers := make([]*Container, 0, len(c.s)) - for _, cont := range c.s { - containers = append(containers, cont) - } - c.RUnlock() - return containers -} - -var _ Store = &memoryStore{} diff --git a/vendor/github.com/docker/docker/container/monitor.go b/vendor/github.com/docker/docker/container/monitor.go deleted file mode 100644 index 60a6228ee4..0000000000 --- a/vendor/github.com/docker/docker/container/monitor.go +++ /dev/null @@ -1,50 +0,0 @@ -package container // import "github.com/docker/docker/container" - -import ( - "context" - "time" - - "github.com/containerd/log" -) - -const ( - loggerCloseTimeout = 10 * time.Second -) - -// Reset puts a container into a state where it can be restarted again. -func (container *Container) Reset(lock bool) { - if lock { - container.Lock() - defer container.Unlock() - } - - if err := container.CloseStreams(); err != nil { - log.G(context.TODO()).Errorf("%s: %s", container.ID, err) - } - - // Re-create a brand new stdin pipe once the container exited - if container.Config.OpenStdin { - container.StreamConfig.NewInputPipes() - } - - if container.LogDriver != nil { - if container.LogCopier != nil { - exit := make(chan struct{}) - go func() { - container.LogCopier.Wait() - close(exit) - }() - - timer := time.NewTimer(loggerCloseTimeout) - defer timer.Stop() - select { - case <-timer.C: - log.G(context.TODO()).Warn("Logger didn't exit in time: logs may be truncated") - case <-exit: - } - } - container.LogDriver.Close() - container.LogCopier = nil - container.LogDriver = nil - } -} diff --git a/vendor/github.com/docker/docker/container/mounts_unix.go b/vendor/github.com/docker/docker/container/mounts_unix.go deleted file mode 100644 index 14c8d36c12..0000000000 --- a/vendor/github.com/docker/docker/container/mounts_unix.go +++ /dev/null @@ -1,15 +0,0 @@ -//go:build !windows - -package container // import "github.com/docker/docker/container" - -// Mount contains information for a mount operation. -type Mount struct { - Source string `json:"source"` - Destination string `json:"destination"` - Writable bool `json:"writable"` - Data string `json:"data"` - Propagation string `json:"mountpropagation"` - NonRecursive bool `json:"nonrecursive"` - ReadOnlyNonRecursive bool `json:"readonlynonrecursive"` - ReadOnlyForceRecursive bool `json:"readonlyforcerecursive"` -} diff --git a/vendor/github.com/docker/docker/container/mounts_windows.go b/vendor/github.com/docker/docker/container/mounts_windows.go deleted file mode 100644 index 8f27e88067..0000000000 --- a/vendor/github.com/docker/docker/container/mounts_windows.go +++ /dev/null @@ -1,8 +0,0 @@ -package container // import "github.com/docker/docker/container" - -// Mount contains information for a mount operation. -type Mount struct { - Source string `json:"source"` - Destination string `json:"destination"` - Writable bool `json:"writable"` -} diff --git a/vendor/github.com/docker/docker/container/rwlayer.go b/vendor/github.com/docker/docker/container/rwlayer.go deleted file mode 100644 index b70eb7e68d..0000000000 --- a/vendor/github.com/docker/docker/container/rwlayer.go +++ /dev/null @@ -1,16 +0,0 @@ -package container - -// RWLayer represents a writable layer for a container. -type RWLayer interface { - // Mount mounts the RWLayer and returns the filesystem path - // to the writable layer. - Mount(mountLabel string) (string, error) - - // Unmount unmounts the RWLayer. This should be called - // for every mount. If there are multiple mount calls - // this operation will only decrement the internal mount counter. - Unmount() error - - // Metadata returns the low level metadata for the mutable layer - Metadata() (map[string]string, error) -} diff --git a/vendor/github.com/docker/docker/container/state.go b/vendor/github.com/docker/docker/container/state.go deleted file mode 100644 index f6255a22e3..0000000000 --- a/vendor/github.com/docker/docker/container/state.go +++ /dev/null @@ -1,454 +0,0 @@ -package container // import "github.com/docker/docker/container" - -import ( - "context" - "errors" - "fmt" - "sync" - "time" - - "github.com/docker/docker/api/types/container" - libcontainerdtypes "github.com/docker/docker/libcontainerd/types" - "github.com/docker/go-units" -) - -// State holds the current container state, and has methods to get and -// set the state. State is embedded in the [Container] struct. -// -// State contains an exported [sync.Mutex] which is used as a global lock -// for both the State and the Container it's embedded in. -type State struct { - // This Mutex is exported by design and is used as a global lock - // for both the State and the Container it's embedded in. - sync.Mutex - // Note that `Running` and `Paused` are not mutually exclusive: - // When pausing a container (on Linux), the freezer cgroup is used to suspend - // all processes in the container. Freezing the process requires the process to - // be running. As a result, paused containers are both `Running` _and_ `Paused`. - Running bool - Paused bool - Restarting bool - OOMKilled bool - RemovalInProgress bool // Not need for this to be persistent on disk. - Dead bool - Pid int - ExitCodeValue int `json:"ExitCode"` - ErrorMsg string `json:"Error"` // contains last known error during container start, stop, or remove - StartedAt time.Time - FinishedAt time.Time - Health *Health - Removed bool `json:"-"` - - stopWaiters []chan<- StateStatus - removeOnlyWaiters []chan<- StateStatus - - // The libcontainerd reference fields are unexported to force consumers - // to access them through the getter methods with multi-valued returns - // so that they can't forget to nil-check: the code won't compile unless - // the nil-check result is explicitly consumed or discarded. - - ctr libcontainerdtypes.Container - task libcontainerdtypes.Task -} - -// StateStatus is used to return container wait results. -// Implements exec.ExitCode interface. -// This type is needed as State include a sync.Mutex field which make -// copying it unsafe. -type StateStatus struct { - exitCode int - err error -} - -// ExitCode returns current exitcode for the state. -func (s StateStatus) ExitCode() int { - return s.exitCode -} - -// Err returns current error for the state. Returns nil if the container had -// exited on its own. -func (s StateStatus) Err() error { - return s.err -} - -// NewState creates a default state object. -func NewState() *State { - return &State{} -} - -// String returns a human-readable description of the state -func (s *State) String() string { - if s.Running { - if s.Paused { - return fmt.Sprintf("Up %s (Paused)", units.HumanDuration(time.Now().UTC().Sub(s.StartedAt))) - } - if s.Restarting { - return fmt.Sprintf("Restarting (%d) %s ago", s.ExitCodeValue, units.HumanDuration(time.Now().UTC().Sub(s.FinishedAt))) - } - - if h := s.Health; h != nil { - return fmt.Sprintf("Up %s (%s)", units.HumanDuration(time.Now().UTC().Sub(s.StartedAt)), h.String()) - } - - return fmt.Sprintf("Up %s", units.HumanDuration(time.Now().UTC().Sub(s.StartedAt))) - } - - if s.RemovalInProgress { - return "Removal In Progress" - } - - if s.Dead { - return "Dead" - } - - if s.StartedAt.IsZero() { - return "Created" - } - - if s.FinishedAt.IsZero() { - return "" - } - - return fmt.Sprintf("Exited (%d) %s ago", s.ExitCodeValue, units.HumanDuration(time.Now().UTC().Sub(s.FinishedAt))) -} - -// IsValidHealthString checks if the provided string is a valid container health status or not. -func IsValidHealthString(s string) bool { - return s == container.Starting || - s == container.Healthy || - s == container.Unhealthy || - s == container.NoHealthcheck -} - -// StateString returns a single string to describe state -func (s *State) StateString() string { - if s.Running { - if s.Paused { - return "paused" - } - if s.Restarting { - return "restarting" - } - return "running" - } - - if s.RemovalInProgress { - return "removing" - } - - if s.Dead { - return "dead" - } - - if s.StartedAt.IsZero() { - return "created" - } - - return "exited" -} - -// IsValidStateString checks if the provided string is a valid container state or not. -func IsValidStateString(s string) bool { - if s != "paused" && - s != "restarting" && - s != "removing" && - s != "running" && - s != "dead" && - s != "created" && - s != "exited" { - return false - } - return true -} - -// WaitCondition is an enum type for different states to wait for. -type WaitCondition int - -// Possible WaitCondition Values. -// -// WaitConditionNotRunning (default) is used to wait for any of the non-running -// states: "created", "exited", "dead", "removing", or "removed". -// -// WaitConditionNextExit is used to wait for the next time the state changes -// to a non-running state. If the state is currently "created" or "exited", -// this would cause Wait() to block until either the container runs and exits -// or is removed. -// -// WaitConditionRemoved is used to wait for the container to be removed. -const ( - WaitConditionNotRunning WaitCondition = iota - WaitConditionNextExit - WaitConditionRemoved -) - -// Wait waits until the container is in a certain state indicated by the given -// condition. A context must be used for cancelling the request, controlling -// timeouts, and avoiding goroutine leaks. Wait must be called without holding -// the state lock. Returns a channel from which the caller will receive the -// result. If the container exited on its own, the result's Err() method will -// be nil and its ExitCode() method will return the container's exit code, -// otherwise, the results Err() method will return an error indicating why the -// wait operation failed. -func (s *State) Wait(ctx context.Context, condition WaitCondition) <-chan StateStatus { - s.Lock() - defer s.Unlock() - - // Buffer so we can put status and finish even nobody receives it. - resultC := make(chan StateStatus, 1) - - if s.conditionAlreadyMet(condition) { - resultC <- StateStatus{ - exitCode: s.ExitCode(), - err: s.Err(), - } - - return resultC - } - - waitC := make(chan StateStatus, 1) - - // Removal wakes up both removeOnlyWaiters and stopWaiters - // Container could be removed while still in "created" state - // in which case it is never actually stopped - if condition == WaitConditionRemoved { - s.removeOnlyWaiters = append(s.removeOnlyWaiters, waitC) - } else { - s.stopWaiters = append(s.stopWaiters, waitC) - } - - go func() { - select { - case <-ctx.Done(): - // Context timeout or cancellation. - resultC <- StateStatus{ - exitCode: -1, - err: ctx.Err(), - } - return - case status := <-waitC: - resultC <- status - } - }() - - return resultC -} - -func (s *State) conditionAlreadyMet(condition WaitCondition) bool { - switch condition { - case WaitConditionNotRunning: - return !s.Running - case WaitConditionRemoved: - return s.Removed - default: - // TODO(thaJeztah): how do we want to handle "WaitConditionNextExit"? - return false - } -} - -// IsRunning returns whether the running flag is set. Used by Container to check whether a container is running. -func (s *State) IsRunning() bool { - s.Lock() - res := s.Running - s.Unlock() - return res -} - -// GetPID holds the process id of a container. -func (s *State) GetPID() int { - s.Lock() - res := s.Pid - s.Unlock() - return res -} - -// ExitCode returns current exitcode for the state. Take lock before if state -// may be shared. -func (s *State) ExitCode() int { - return s.ExitCodeValue -} - -// SetExitCode sets current exitcode for the state. Take lock before if state -// may be shared. -func (s *State) SetExitCode(ec int) { - s.ExitCodeValue = ec -} - -// SetRunning sets the running state along with StartedAt time. -func (s *State) SetRunning(ctr libcontainerdtypes.Container, tsk libcontainerdtypes.Task, start time.Time) { - s.setRunning(ctr, tsk, &start) -} - -// SetRunningExternal sets the running state without setting the `StartedAt` time (used for containers not started by Docker instead of SetRunning). -func (s *State) SetRunningExternal(ctr libcontainerdtypes.Container, tsk libcontainerdtypes.Task) { - s.setRunning(ctr, tsk, nil) -} - -// setRunning sets the state of the container to "running". -func (s *State) setRunning(ctr libcontainerdtypes.Container, tsk libcontainerdtypes.Task, start *time.Time) { - s.ErrorMsg = "" - s.Paused = false - s.Running = true - s.Restarting = false - if start != nil { - s.Paused = false - } - s.ExitCodeValue = 0 - s.ctr = ctr - s.task = tsk - if tsk != nil { - s.Pid = int(tsk.Pid()) - } else { - s.Pid = 0 - } - s.OOMKilled = false - if start != nil { - s.StartedAt = start.UTC() - } -} - -// SetStopped sets the container state to "stopped" without locking. -func (s *State) SetStopped(exitStatus *ExitStatus) { - s.Running = false - s.Paused = false - s.Restarting = false - s.Pid = 0 - if exitStatus.ExitedAt.IsZero() { - s.FinishedAt = time.Now().UTC() - } else { - s.FinishedAt = exitStatus.ExitedAt - } - s.ExitCodeValue = exitStatus.ExitCode - - s.notifyAndClear(&s.stopWaiters) -} - -// SetRestarting sets the container state to "restarting" without locking. -// It also sets the container PID to 0. -func (s *State) SetRestarting(exitStatus *ExitStatus) { - // we should consider the container running when it is restarting because of - // all the checks in docker around rm/stop/etc - s.Running = true - s.Restarting = true - s.Paused = false - s.Pid = 0 - s.FinishedAt = time.Now().UTC() - s.ExitCodeValue = exitStatus.ExitCode - - s.notifyAndClear(&s.stopWaiters) -} - -// SetError sets the container's error state. This is useful when we want to -// know the error that occurred when container transits to another state -// when inspecting it -func (s *State) SetError(err error) { - s.ErrorMsg = "" - if err != nil { - s.ErrorMsg = err.Error() - } -} - -// IsPaused returns whether the container is paused or not. -func (s *State) IsPaused() bool { - s.Lock() - res := s.Paused - s.Unlock() - return res -} - -// IsRestarting returns whether the container is restarting or not. -func (s *State) IsRestarting() bool { - s.Lock() - res := s.Restarting - s.Unlock() - return res -} - -// SetRemovalInProgress sets the container state as being removed. -// It returns true if the container was already in that state. -func (s *State) SetRemovalInProgress() bool { - s.Lock() - defer s.Unlock() - if s.RemovalInProgress { - return true - } - s.RemovalInProgress = true - return false -} - -// ResetRemovalInProgress makes the RemovalInProgress state to false. -func (s *State) ResetRemovalInProgress() { - s.Lock() - s.RemovalInProgress = false - s.Unlock() -} - -// IsRemovalInProgress returns whether the RemovalInProgress flag is set. -// Used by Container to check whether a container is being removed. -func (s *State) IsRemovalInProgress() bool { - s.Lock() - res := s.RemovalInProgress - s.Unlock() - return res -} - -// IsDead returns whether the Dead flag is set. Used by Container to check whether a container is dead. -func (s *State) IsDead() bool { - s.Lock() - res := s.Dead - s.Unlock() - return res -} - -// SetRemoved assumes this container is already in the "dead" state and notifies all waiters. -func (s *State) SetRemoved() { - s.SetRemovalError(nil) -} - -// SetRemovalError is to be called in case a container remove failed. -// It sets an error and notifies all waiters. -func (s *State) SetRemovalError(err error) { - s.SetError(err) - s.Lock() - s.Removed = true - s.notifyAndClear(&s.removeOnlyWaiters) - s.notifyAndClear(&s.stopWaiters) - s.Unlock() -} - -// Err returns an error if there is one. -func (s *State) Err() error { - if s.ErrorMsg != "" { - return errors.New(s.ErrorMsg) - } - return nil -} - -func (s *State) notifyAndClear(waiters *[]chan<- StateStatus) { - result := StateStatus{ - exitCode: s.ExitCodeValue, - err: s.Err(), - } - - for _, c := range *waiters { - c <- result - } - *waiters = nil -} - -// C8dContainer returns a reference to the libcontainerd Container object for -// the container and whether the reference is valid. -// -// The container lock must be held when calling this method. -func (s *State) C8dContainer() (_ libcontainerdtypes.Container, ok bool) { - return s.ctr, s.ctr != nil -} - -// Task returns a reference to the libcontainerd Task object for the container -// and whether the reference is valid. -// -// The container lock must be held when calling this method. -// -// See also: (*Container).GetRunningTask(). -func (s *State) Task() (_ libcontainerdtypes.Task, ok bool) { - return s.task, s.task != nil -} diff --git a/vendor/github.com/docker/docker/container/store.go b/vendor/github.com/docker/docker/container/store.go deleted file mode 100644 index 3af0389856..0000000000 --- a/vendor/github.com/docker/docker/container/store.go +++ /dev/null @@ -1,28 +0,0 @@ -package container // import "github.com/docker/docker/container" - -// StoreFilter defines a function to filter -// container in the store. -type StoreFilter func(*Container) bool - -// StoreReducer defines a function to -// manipulate containers in the store -type StoreReducer func(*Container) - -// Store defines an interface that -// any container store must implement. -type Store interface { - // Add appends a new container to the store. - Add(string, *Container) - // Get returns a container from the store by the identifier it was stored with. - Get(string) *Container - // Delete removes a container from the store by the identifier it was stored with. - Delete(string) - // List returns a list of containers from the store. - List() []*Container - // Size returns the number of containers in the store. - Size() int - // First returns the first container found in the store by a given filter. - First(StoreFilter) *Container - // ApplyAll calls the reducer function with every container in the store. - ApplyAll(StoreReducer) -} diff --git a/vendor/github.com/docker/docker/container/stream/attach.go b/vendor/github.com/docker/docker/container/stream/attach.go deleted file mode 100644 index c0b0302f46..0000000000 --- a/vendor/github.com/docker/docker/container/stream/attach.go +++ /dev/null @@ -1,183 +0,0 @@ -package stream // import "github.com/docker/docker/container/stream" - -import ( - "context" - "io" - - "github.com/containerd/log" - "github.com/docker/docker/pkg/pools" - "github.com/moby/term" - "github.com/pkg/errors" - "golang.org/x/sync/errgroup" -) - -var defaultEscapeSequence = []byte{16, 17} // ctrl-p, ctrl-q - -// AttachConfig is the config struct used to attach a client to a stream's stdio -type AttachConfig struct { - // Tells the attach copier that the stream's stdin is a TTY and to look for - // escape sequences in stdin to detach from the stream. - // When true the escape sequence is not passed to the underlying stream - TTY bool - // Specifies the detach keys the client will be using - // Only useful when `TTY` is true - DetachKeys []byte - - // CloseStdin signals that once done, stdin for the attached stream should be closed - // For example, this would close the attached container's stdin. - CloseStdin bool - - // UseStd* indicate whether the client has requested to be connected to the - // given stream or not. These flags are used instead of checking Std* != nil - // at points before the client streams Std* are wired up. - UseStdin, UseStdout, UseStderr bool - - // CStd* are the streams directly connected to the container - CStdin io.WriteCloser - CStdout, CStderr io.ReadCloser - - // Provide client streams to wire up to - Stdin io.ReadCloser - Stdout, Stderr io.Writer -} - -// AttachStreams attaches the container's streams to the AttachConfig -func (c *Config) AttachStreams(cfg *AttachConfig) { - if cfg.UseStdin { - cfg.CStdin = c.StdinPipe() - } - - if cfg.UseStdout { - cfg.CStdout = c.StdoutPipe() - } - - if cfg.UseStderr { - cfg.CStderr = c.StderrPipe() - } -} - -// CopyStreams starts goroutines to copy data in and out to/from the container -func (c *Config) CopyStreams(ctx context.Context, cfg *AttachConfig) <-chan error { - var group errgroup.Group - - // Connect stdin of container to the attach stdin stream. - if cfg.Stdin != nil { - group.Go(func() error { - log.G(ctx).Debug("attach: stdin: begin") - defer log.G(ctx).Debug("attach: stdin: end") - - defer func() { - if cfg.CloseStdin && !cfg.TTY { - cfg.CStdin.Close() - } else { - // No matter what, when stdin is closed (io.Copy unblock), close stdout and stderr - if cfg.CStdout != nil { - cfg.CStdout.Close() - } - if cfg.CStderr != nil { - cfg.CStderr.Close() - } - } - }() - - var err error - if cfg.TTY { - _, err = copyEscapable(cfg.CStdin, cfg.Stdin, cfg.DetachKeys) - } else { - _, err = pools.Copy(cfg.CStdin, cfg.Stdin) - } - if err == io.ErrClosedPipe { - err = nil - } - if err != nil { - log.G(ctx).WithError(err).Debug("error on attach stdin") - return errors.Wrap(err, "error on attach stdin") - } - return nil - }) - } - - attachStream := func(name string, stream io.Writer, streamPipe io.ReadCloser) error { - log.G(ctx).Debugf("attach: %s: begin", name) - defer log.G(ctx).Debugf("attach: %s: end", name) - defer func() { - // Make sure stdin gets closed - if cfg.Stdin != nil { - cfg.Stdin.Close() - } - streamPipe.Close() - }() - - _, err := pools.Copy(stream, streamPipe) - if err == io.ErrClosedPipe { - err = nil - } - if err != nil { - log.G(ctx).WithError(err).Debugf("attach: %s", name) - return errors.Wrapf(err, "error attaching %s stream", name) - } - return nil - } - - if cfg.Stdout != nil { - group.Go(func() error { - return attachStream("stdout", cfg.Stdout, cfg.CStdout) - }) - } - if cfg.Stderr != nil { - group.Go(func() error { - return attachStream("stderr", cfg.Stderr, cfg.CStderr) - }) - } - - errs := make(chan error, 1) - go func() { - defer log.G(ctx).Debug("attach done") - groupErr := make(chan error, 1) - go func() { - groupErr <- group.Wait() - }() - select { - case <-ctx.Done(): - // close all pipes - if cfg.CStdin != nil { - cfg.CStdin.Close() - } - if cfg.CStdout != nil { - cfg.CStdout.Close() - } - if cfg.CStderr != nil { - cfg.CStderr.Close() - } - - if cfg.Stdin != nil { - // In this case, `cfg.Stdin` is a stream from the client. - // The way `io.Copy` works we may get stuck waiting to read from `cfg.Stdin` even if the container has exited. - // This will cause the `io.Copy` to never return and the `group.Wait()` to never return. - // By closing cfg.Stdin we will cause the `io.Copy` to return and the `group.Wait()` to return. - cfg.Stdin.Close() - } - - // Now with these closed, wait should return. - if err := group.Wait(); err != nil { - errs <- err - return - } - errs <- ctx.Err() - case err := <-groupErr: - errs <- err - } - }() - - return errs -} - -func copyEscapable(dst io.Writer, src io.ReadCloser, keys []byte) (written int64, err error) { - if len(keys) == 0 { - keys = defaultEscapeSequence - } - pr := term.NewEscapeProxy(src, keys) - defer src.Close() - - return pools.Copy(dst, pr) -} diff --git a/vendor/github.com/docker/docker/container/stream/bytespipe/buffer.go b/vendor/github.com/docker/docker/container/stream/bytespipe/buffer.go deleted file mode 100644 index 3beae1350f..0000000000 --- a/vendor/github.com/docker/docker/container/stream/bytespipe/buffer.go +++ /dev/null @@ -1,51 +0,0 @@ -package bytespipe - -import ( - "errors" - "io" -) - -var errBufferFull = errors.New("buffer is full") - -type fixedBuffer struct { - buf []byte - pos int - lastRead int -} - -func (b *fixedBuffer) Write(p []byte) (int, error) { - n := copy(b.buf[b.pos:cap(b.buf)], p) - b.pos += n - - if n < len(p) { - if b.pos == cap(b.buf) { - return n, errBufferFull - } - return n, io.ErrShortWrite - } - return n, nil -} - -func (b *fixedBuffer) Read(p []byte) (int, error) { - n := copy(p, b.buf[b.lastRead:b.pos]) - b.lastRead += n - return n, nil -} - -func (b *fixedBuffer) Len() int { - return b.pos - b.lastRead -} - -func (b *fixedBuffer) Cap() int { - return cap(b.buf) -} - -func (b *fixedBuffer) Reset() { - b.pos = 0 - b.lastRead = 0 - b.buf = b.buf[:0] -} - -func (b *fixedBuffer) String() string { - return string(b.buf[b.lastRead:b.pos]) -} diff --git a/vendor/github.com/docker/docker/container/stream/bytespipe/bytespipe.go b/vendor/github.com/docker/docker/container/stream/bytespipe/bytespipe.go deleted file mode 100644 index 4577a0c3a9..0000000000 --- a/vendor/github.com/docker/docker/container/stream/bytespipe/bytespipe.go +++ /dev/null @@ -1,188 +0,0 @@ -package bytespipe - -import ( - "errors" - "io" - "sync" -) - -// maxCap is the highest capacity to use in byte slices that buffer data. -const maxCap = 1e6 - -// minCap is the lowest capacity to use in byte slices that buffer data -const minCap = 64 - -// blockThreshold is the minimum number of bytes in the buffer which will cause -// a write to BytesPipe to block when allocating a new slice. -const blockThreshold = 1e6 - -var ( - // ErrClosed is returned when Write is called on a closed BytesPipe. - ErrClosed = errors.New("write to closed BytesPipe") - - bufPools = make(map[int]*sync.Pool) - bufPoolsLock sync.Mutex -) - -// BytesPipe is io.ReadWriteCloser which works similarly to pipe(queue). -// All written data may be read at most once. Also, BytesPipe allocates -// and releases new byte slices to adjust to current needs, so the buffer -// won't be overgrown after peak loads. -type BytesPipe struct { - mu sync.Mutex - wait *sync.Cond - buf []*fixedBuffer - bufLen int - closeErr error // error to return from next Read. set to nil if not closed. - readBlock bool // check read BytesPipe is Wait() or not -} - -// New creates new BytesPipe, initialized by specified slice. -// If buf is nil, then it will be initialized with slice which cap is 64. -// buf will be adjusted in a way that len(buf) == 0, cap(buf) == cap(buf). -func New() *BytesPipe { - bp := &BytesPipe{} - bp.buf = append(bp.buf, getBuffer(minCap)) - bp.wait = sync.NewCond(&bp.mu) - return bp -} - -// Write writes p to BytesPipe. -// It can allocate new []byte slices in a process of writing. -func (bp *BytesPipe) Write(p []byte) (int, error) { - bp.mu.Lock() - defer bp.mu.Unlock() - - written := 0 -loop0: - for { - if bp.closeErr != nil { - return written, ErrClosed - } - - if len(bp.buf) == 0 { - bp.buf = append(bp.buf, getBuffer(64)) - } - // get the last buffer - b := bp.buf[len(bp.buf)-1] - - n, err := b.Write(p) - written += n - bp.bufLen += n - - // errBufferFull is an error we expect to get if the buffer is full - if err != nil && err != errBufferFull { - bp.wait.Broadcast() - return written, err - } - - // if there was enough room to write all then break - if len(p) == n { - break - } - - // more data: write to the next slice - p = p[n:] - - // make sure the buffer doesn't grow too big from this write - for bp.bufLen >= blockThreshold { - if bp.readBlock { - bp.wait.Broadcast() - } - bp.wait.Wait() - if bp.closeErr != nil { - continue loop0 - } - } - - // add new byte slice to the buffers slice and continue writing - nextCap := b.Cap() * 2 - if nextCap > maxCap { - nextCap = maxCap - } - bp.buf = append(bp.buf, getBuffer(nextCap)) - } - bp.wait.Broadcast() - return written, nil -} - -// CloseWithError causes further reads from a BytesPipe to return immediately. -func (bp *BytesPipe) CloseWithError(err error) error { - bp.mu.Lock() - if err != nil { - bp.closeErr = err - } else { - bp.closeErr = io.EOF - } - bp.wait.Broadcast() - bp.mu.Unlock() - return nil -} - -// Close causes further reads from a BytesPipe to return immediately. -func (bp *BytesPipe) Close() error { - return bp.CloseWithError(nil) -} - -// Read reads bytes from BytesPipe. -// Data could be read only once. -func (bp *BytesPipe) Read(p []byte) (int, error) { - bp.mu.Lock() - defer bp.mu.Unlock() - if bp.bufLen == 0 { - if bp.closeErr != nil { - return 0, bp.closeErr - } - bp.readBlock = true - bp.wait.Wait() - bp.readBlock = false - if bp.bufLen == 0 && bp.closeErr != nil { - return 0, bp.closeErr - } - } - - var n int - for bp.bufLen > 0 { - b := bp.buf[0] - read, _ := b.Read(p) // ignore error since fixedBuffer doesn't really return an error - n += read - bp.bufLen -= read - - if b.Len() == 0 { - // it's empty so return it to the pool and move to the next one - returnBuffer(b) - bp.buf[0] = nil - bp.buf = bp.buf[1:] - } - - if len(p) == read { - break - } - - p = p[read:] - } - - bp.wait.Broadcast() - return n, nil -} - -func returnBuffer(b *fixedBuffer) { - b.Reset() - bufPoolsLock.Lock() - pool := bufPools[b.Cap()] - bufPoolsLock.Unlock() - if pool != nil { - pool.Put(b) - } -} - -func getBuffer(size int) *fixedBuffer { - bufPoolsLock.Lock() - pool, ok := bufPools[size] - if !ok { - pool = &sync.Pool{New: func() interface{} { return &fixedBuffer{buf: make([]byte, 0, size)} }} - bufPools[size] = pool - } - bufPoolsLock.Unlock() - return pool.Get().(*fixedBuffer) -} diff --git a/vendor/github.com/docker/docker/container/stream/streams.go b/vendor/github.com/docker/docker/container/stream/streams.go deleted file mode 100644 index 28350cde03..0000000000 --- a/vendor/github.com/docker/docker/container/stream/streams.go +++ /dev/null @@ -1,187 +0,0 @@ -package stream // import "github.com/docker/docker/container/stream" - -import ( - "context" - "errors" - "fmt" - "io" - "sync" - "sync/atomic" - - "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/log" - "github.com/docker/docker/container/stream/bytespipe" - "github.com/docker/docker/pkg/pools" -) - -// Config holds information about I/O streams managed together. -// -// config.StdinPipe returns a WriteCloser which can be used to feed data -// to the standard input of the streamConfig's active process. -// config.StdoutPipe and streamConfig.StderrPipe each return a ReadCloser -// which can be used to retrieve the standard output (and error) generated -// by the container's active process. The output (and error) are actually -// copied and delivered to all StdoutPipe and StderrPipe consumers, using -// a kind of "broadcaster". -type Config struct { - wg sync.WaitGroup - stdout *unbuffered - stderr *unbuffered - stdin io.ReadCloser - stdinPipe io.WriteCloser - dio *cio.DirectIO - // closed is set to true when CloseStreams is called - closed atomic.Bool -} - -// NewConfig creates a stream config and initializes -// the standard err and standard out to new unbuffered broadcasters. -func NewConfig() *Config { - return &Config{ - stderr: new(unbuffered), - stdout: new(unbuffered), - } -} - -// Stdout returns the standard output in the configuration. -func (c *Config) Stdout() io.Writer { - return c.stdout -} - -// Stderr returns the standard error in the configuration. -func (c *Config) Stderr() io.Writer { - return c.stderr -} - -// Stdin returns the standard input in the configuration. -func (c *Config) Stdin() io.ReadCloser { - return c.stdin -} - -// StdinPipe returns an input writer pipe as an io.WriteCloser. -func (c *Config) StdinPipe() io.WriteCloser { - return c.stdinPipe -} - -// StdoutPipe creates a new io.ReadCloser with an empty bytes pipe. -// It adds this new out pipe to the Stdout broadcaster. -// This will block stdout if unconsumed. -func (c *Config) StdoutPipe() io.ReadCloser { - bytesPipe := bytespipe.New() - c.stdout.Add(bytesPipe) - return bytesPipe -} - -// StderrPipe creates a new io.ReadCloser with an empty bytes pipe. -// It adds this new err pipe to the Stderr broadcaster. -// This will block stderr if unconsumed. -func (c *Config) StderrPipe() io.ReadCloser { - bytesPipe := bytespipe.New() - c.stderr.Add(bytesPipe) - return bytesPipe -} - -// NewInputPipes creates new pipes for both standard inputs, Stdin and StdinPipe. -func (c *Config) NewInputPipes() { - c.stdin, c.stdinPipe = io.Pipe() -} - -// NewNopInputPipe creates a new input pipe that will silently drop all messages in the input. -func (c *Config) NewNopInputPipe() { - c.stdinPipe = &nopWriteCloser{io.Discard} -} - -type nopWriteCloser struct { - io.Writer -} - -func (w *nopWriteCloser) Close() error { return nil } - -// CloseStreams ensures that the configured streams are properly closed. -func (c *Config) CloseStreams() error { - var errs error - - c.closed.Store(true) - - if c.stdin != nil { - if err := c.stdin.Close(); err != nil { - errs = errors.Join(errs, fmt.Errorf("error close stdin: %w", err)) - } - } - - if err := c.stdout.Clean(); err != nil { - errs = errors.Join(errs, fmt.Errorf("error close stdout: %w", err)) - } - - if err := c.stderr.Clean(); err != nil { - errs = errors.Join(errs, fmt.Errorf("error close stderr: %w", err)) - } - - return errs -} - -// CopyToPipe connects streamconfig with a libcontainerd.IOPipe -func (c *Config) CopyToPipe(iop *cio.DirectIO) { - ctx := context.TODO() - - c.dio = iop - copyFunc := func(name string, w io.Writer, r io.ReadCloser) { - c.wg.Add(1) - go func() { - defer c.wg.Done() - if _, err := pools.Copy(w, r); err != nil { - if c.closed.Load() { - return - } - log.G(ctx).WithFields(log.Fields{"stream": name, "error": err}).Error("copy stream failed") - } - if err := r.Close(); err != nil && !c.closed.Load() { - log.G(ctx).WithFields(log.Fields{"stream": name, "error": err}).Warn("close stream failed") - } - }() - } - - if iop.Stdout != nil { - copyFunc("stdout", c.Stdout(), iop.Stdout) - } - if iop.Stderr != nil { - copyFunc("stderr", c.Stderr(), iop.Stderr) - } - - if stdin := c.Stdin(); stdin != nil { - if iop.Stdin != nil { - go func() { - _, err := pools.Copy(iop.Stdin, stdin) - if err != nil { - if c.closed.Load() { - return - } - log.G(ctx).WithFields(log.Fields{"stream": "stdin", "error": err}).Error("copy stream failed") - } - if err := iop.Stdin.Close(); err != nil && !c.closed.Load() { - log.G(ctx).WithFields(log.Fields{"stream": "stdin", "error": err}).Warn("close stream failed") - } - }() - } - } -} - -// Wait for the stream to close -// Wait supports timeouts via the context to unblock and forcefully -// close the io streams -func (c *Config) Wait(ctx context.Context) { - done := make(chan struct{}, 1) - go func() { - c.wg.Wait() - close(done) - }() - select { - case <-done: - case <-ctx.Done(): - if c.dio != nil { - c.dio.Cancel() - c.dio.Wait() - c.dio.Close() - } - } -} diff --git a/vendor/github.com/docker/docker/container/stream/unbuffered.go b/vendor/github.com/docker/docker/container/stream/unbuffered.go deleted file mode 100644 index ff6f07924b..0000000000 --- a/vendor/github.com/docker/docker/container/stream/unbuffered.go +++ /dev/null @@ -1,49 +0,0 @@ -package stream - -import ( - "io" - "sync" -) - -// unbuffered accumulates multiple io.WriteCloser by stream. -type unbuffered struct { - mu sync.Mutex - writers []io.WriteCloser -} - -// Add adds new io.WriteCloser. -func (w *unbuffered) Add(writer io.WriteCloser) { - w.mu.Lock() - w.writers = append(w.writers, writer) - w.mu.Unlock() -} - -// Write writes bytes to all writers. Failed writers will be evicted during -// this call. -func (w *unbuffered) Write(p []byte) (n int, err error) { - w.mu.Lock() - var evict []int - for i, sw := range w.writers { - if n, err := sw.Write(p); err != nil || n != len(p) { - // On error, evict the writer - evict = append(evict, i) - } - } - for n, i := range evict { - w.writers = append(w.writers[:i-n], w.writers[i-n+1:]...) - } - w.mu.Unlock() - return len(p), nil -} - -// Clean closes and removes all writers. Last non-eol-terminated part of data -// will be saved. -func (w *unbuffered) Clean() error { - w.mu.Lock() - for _, sw := range w.writers { - sw.Close() - } - w.writers = nil - w.mu.Unlock() - return nil -} diff --git a/vendor/github.com/docker/docker/container/view.go b/vendor/github.com/docker/docker/container/view.go deleted file mode 100644 index db7160aa56..0000000000 --- a/vendor/github.com/docker/docker/container/view.go +++ /dev/null @@ -1,518 +0,0 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.23 - -package container // import "github.com/docker/docker/container" - -import ( - "bytes" - "context" - "errors" - "fmt" - "maps" - "strings" - "time" - - "github.com/containerd/log" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/errdefs" - "github.com/docker/go-connections/nat" - memdb "github.com/hashicorp/go-memdb" -) - -const ( - memdbContainersTable = "containers" - memdbNamesTable = "names" - memdbIDIndex = "id" - memdbIDIndexPrefix = "id_prefix" - memdbContainerIDIndex = "containerid" -) - -// Snapshot is a read only view for Containers. It holds all information necessary to serve container queries in a -// versioned ACID in-memory store. -type Snapshot struct { - container.Summary - - // additional info queries need to filter on - // preserve nanosec resolution for queries - CreatedAt time.Time - StartedAt time.Time - Name string - Pid int - ExitCode int - Running bool - Paused bool - Managed bool - ExposedPorts nat.PortSet - PortBindings nat.PortSet - Health string - HostConfig struct { - Isolation string - } -} - -// nameAssociation associates a container id with a name. -type nameAssociation struct { - // name is the name to associate. Note that name is the primary key - // ("id" in memdb). - name string - containerID string -} - -var schema = &memdb.DBSchema{ - Tables: map[string]*memdb.TableSchema{ - memdbContainersTable: { - Name: memdbContainersTable, - Indexes: map[string]*memdb.IndexSchema{ - memdbIDIndex: { - Name: memdbIDIndex, - Unique: true, - Indexer: &containerByIDIndexer{}, - }, - }, - }, - memdbNamesTable: { - Name: memdbNamesTable, - Indexes: map[string]*memdb.IndexSchema{ - // Used for names, because "id" is the primary key in memdb. - memdbIDIndex: { - Name: memdbIDIndex, - Unique: true, - Indexer: &namesByNameIndexer{}, - }, - memdbContainerIDIndex: { - Name: memdbContainerIDIndex, - Indexer: &namesByContainerIDIndexer{}, - }, - }, - }, - }, -} - -// ViewDB provides an in-memory transactional (ACID) container store. -type ViewDB struct { - store *memdb.MemDB -} - -// NewViewDB provides the default implementation, with the default schema -func NewViewDB() (*ViewDB, error) { - store, err := memdb.NewMemDB(schema) - if err != nil { - return nil, errdefs.System(err) - } - return &ViewDB{store: store}, nil -} - -// GetByPrefix returns a container with the given ID prefix. It returns an -// error if an empty prefix was given or if multiple containers match the prefix. -// It returns an [errdefs.NotFound] if the given s yielded no results. -func (db *ViewDB) GetByPrefix(s string) (string, error) { - if s == "" { - return "", errdefs.InvalidParameter(errors.New("prefix can't be empty")) - } - iter, err := db.store.Txn(false).Get(memdbContainersTable, memdbIDIndexPrefix, s) - if err != nil { - return "", errdefs.System(err) - } - - var id string - for { - item := iter.Next() - if item == nil { - break - } - if id != "" { - return "", errdefs.InvalidParameter(errors.New("multiple IDs found with provided prefix: " + s)) - } - id = item.(*Container).ID - } - - if id != "" { - return id, nil - } - - return "", errdefs.NotFound(errors.New("No such container: " + s)) -} - -// Snapshot provides a consistent read-only view of the database. -func (db *ViewDB) Snapshot() *View { - return &View{ - txn: db.store.Txn(false), - } -} - -func (db *ViewDB) withTxn(cb func(*memdb.Txn) error) error { - txn := db.store.Txn(true) - err := cb(txn) - if err != nil { - txn.Abort() - return err - } - txn.Commit() - return nil -} - -// Save atomically updates the in-memory store state for a Container. -// Only read only (deep) copies of containers may be passed in. -func (db *ViewDB) Save(c *Container) error { - return db.withTxn(func(txn *memdb.Txn) error { - return txn.Insert(memdbContainersTable, c) - }) -} - -// Delete removes an item by ID -func (db *ViewDB) Delete(c *Container) error { - return db.withTxn(func(txn *memdb.Txn) error { - view := &View{txn: txn} - names := view.getNames(c.ID) - - for _, name := range names { - txn.Delete(memdbNamesTable, nameAssociation{name: name}) - } - - // Ignore error - the container may not actually exist in the - // db, but we still need to clean up associated names. - txn.Delete(memdbContainersTable, NewBaseContainer(c.ID, c.Root)) - return nil - }) -} - -// ReserveName registers a container ID to a name. ReserveName is idempotent, -// but returns an [errdefs.Conflict] when attempting to reserve a container ID -// to a name that already is reserved. -func (db *ViewDB) ReserveName(name, containerID string) error { - return db.withTxn(func(txn *memdb.Txn) error { - s, err := txn.First(memdbNamesTable, memdbIDIndex, name) - if err != nil { - return errdefs.System(err) - } - if s != nil { - if s.(nameAssociation).containerID != containerID { - return errdefs.Conflict(errors.New("name is reserved")) - } - return nil - } - return txn.Insert(memdbNamesTable, nameAssociation{name: name, containerID: containerID}) - }) -} - -// ReleaseName releases the reserved name -// Once released, a name can be reserved again -func (db *ViewDB) ReleaseName(name string) error { - return db.withTxn(func(txn *memdb.Txn) error { - return txn.Delete(memdbNamesTable, nameAssociation{name: name}) - }) -} - -// View provides a consistent read-only view of the database. -type View struct { - txn *memdb.Txn -} - -// All returns a all items in this snapshot. Returned objects must never be modified. -func (v *View) All() ([]Snapshot, error) { - var all []Snapshot - iter, err := v.txn.Get(memdbContainersTable, memdbIDIndex) - if err != nil { - return nil, errdefs.System(err) - } - for { - item := iter.Next() - if item == nil { - break - } - snapshot := v.transform(item.(*Container)) - all = append(all, *snapshot) - } - return all, nil -} - -// Get returns an item by id. Returned objects must never be modified. -// It returns an [errdefs.NotFound] if the given id was not found. -func (v *View) Get(id string) (*Snapshot, error) { - s, err := v.txn.First(memdbContainersTable, memdbIDIndex, id) - if err != nil { - return nil, errdefs.System(err) - } - if s == nil { - return nil, errdefs.NotFound(errors.New("No such container: " + id)) - } - return v.transform(s.(*Container)), nil -} - -// getNames lists all the reserved names for the given container ID. -func (v *View) getNames(containerID string) []string { - iter, err := v.txn.Get(memdbNamesTable, memdbContainerIDIndex, containerID) - if err != nil { - return nil - } - - var names []string - for { - item := iter.Next() - if item == nil { - break - } - names = append(names, item.(nameAssociation).name) - } - - return names -} - -// GetID returns the container ID that the passed in name is reserved to. -// It returns an [errdefs.NotFound] if the given id was not found. -func (v *View) GetID(name string) (string, error) { - s, err := v.txn.First(memdbNamesTable, memdbIDIndex, name) - if err != nil { - return "", errdefs.System(err) - } - if s == nil { - return "", errdefs.NotFound(errors.New("name is not reserved")) - } - return s.(nameAssociation).containerID, nil -} - -// GetAllNames returns all registered names. -func (v *View) GetAllNames() map[string][]string { - iter, err := v.txn.Get(memdbNamesTable, memdbContainerIDIndex) - if err != nil { - return nil - } - - out := make(map[string][]string) - for { - item := iter.Next() - if item == nil { - break - } - assoc := item.(nameAssociation) - out[assoc.containerID] = append(out[assoc.containerID], assoc.name) - } - - return out -} - -// transform maps a (deep) copied Container object to what queries need. -// A lock on the Container is not held because these are immutable deep copies. -func (v *View) transform(ctr *Container) *Snapshot { - health := container.NoHealthcheck - if ctr.Health != nil { - health = ctr.Health.Status() - } - snapshot := &Snapshot{ - Summary: container.Summary{ - ID: ctr.ID, - Names: v.getNames(ctr.ID), - ImageID: ctr.ImageID.String(), - Ports: []container.Port{}, - Mounts: ctr.GetMountPoints(), - State: ctr.State.StateString(), - Status: ctr.State.String(), - Created: ctr.Created.Unix(), - }, - CreatedAt: ctr.Created, - StartedAt: ctr.StartedAt, - Name: ctr.Name, - Pid: ctr.Pid, - Managed: ctr.Managed, - ExposedPorts: make(nat.PortSet), - PortBindings: make(nat.PortSet), - Health: health, - Running: ctr.Running, - Paused: ctr.Paused, - ExitCode: ctr.ExitCode(), - } - - if snapshot.Names == nil { - // Dead containers will often have no name, so make sure the response isn't null - snapshot.Names = []string{} - } - - if ctr.HostConfig != nil { - snapshot.Summary.HostConfig.NetworkMode = string(ctr.HostConfig.NetworkMode) - snapshot.Summary.HostConfig.Annotations = maps.Clone(ctr.HostConfig.Annotations) - snapshot.HostConfig.Isolation = string(ctr.HostConfig.Isolation) - for binding := range ctr.HostConfig.PortBindings { - snapshot.PortBindings[binding] = struct{}{} - } - } - - if ctr.Config != nil { - snapshot.Image = ctr.Config.Image - snapshot.Labels = ctr.Config.Labels - for exposed := range ctr.Config.ExposedPorts { - snapshot.ExposedPorts[exposed] = struct{}{} - } - } - - if len(ctr.Args) > 0 { - var args []string - for _, arg := range ctr.Args { - if strings.Contains(arg, " ") { - args = append(args, fmt.Sprintf("'%s'", arg)) - } else { - args = append(args, arg) - } - } - argsAsString := strings.Join(args, " ") - snapshot.Command = fmt.Sprintf("%s %s", ctr.Path, argsAsString) - } else { - snapshot.Command = ctr.Path - } - - snapshot.Ports = []container.Port{} - networks := make(map[string]*network.EndpointSettings) - if ctr.NetworkSettings != nil { - for name, netw := range ctr.NetworkSettings.Networks { - if netw == nil || netw.EndpointSettings == nil { - continue - } - networks[name] = &network.EndpointSettings{ - EndpointID: netw.EndpointID, - Gateway: netw.Gateway, - IPAddress: netw.IPAddress, - IPPrefixLen: netw.IPPrefixLen, - IPv6Gateway: netw.IPv6Gateway, - GlobalIPv6Address: netw.GlobalIPv6Address, - GlobalIPv6PrefixLen: netw.GlobalIPv6PrefixLen, - MacAddress: netw.MacAddress, - NetworkID: netw.NetworkID, - GwPriority: netw.GwPriority, - } - if netw.IPAMConfig != nil { - networks[name].IPAMConfig = &network.EndpointIPAMConfig{ - IPv4Address: netw.IPAMConfig.IPv4Address, - IPv6Address: netw.IPAMConfig.IPv6Address, - } - } - } - for port, bindings := range ctr.NetworkSettings.Ports { - p, err := nat.ParsePort(port.Port()) - if err != nil { - log.G(context.TODO()).WithError(err).Warn("invalid port map") - continue - } - if len(bindings) == 0 { - snapshot.Ports = append(snapshot.Ports, container.Port{ - PrivatePort: uint16(p), - Type: port.Proto(), - }) - continue - } - for _, binding := range bindings { - h, err := nat.ParsePort(binding.HostPort) - if err != nil { - log.G(context.TODO()).WithError(err).Warn("invalid host port map") - continue - } - snapshot.Ports = append(snapshot.Ports, container.Port{ - PrivatePort: uint16(p), - PublicPort: uint16(h), - Type: port.Proto(), - IP: binding.HostIP, - }) - } - } - } - snapshot.NetworkSettings = &container.NetworkSettingsSummary{Networks: networks} - - if ctr.ImageManifest != nil { - imageManifest := *ctr.ImageManifest - if imageManifest.Platform == nil { - imageManifest.Platform = &ctr.ImagePlatform - } - snapshot.Summary.ImageManifestDescriptor = &imageManifest - } - - return snapshot -} - -// containerByIDIndexer is used to extract the ID field from Container types. -// memdb.StringFieldIndex can not be used since ID is a field from an embedded struct. -type containerByIDIndexer struct{} - -// terminator is the null character, used as a terminator. -const terminator = "\x00" - -// FromObject implements the memdb.SingleIndexer interface for Container objects -func (e *containerByIDIndexer) FromObject(obj any) (bool, []byte, error) { - c, ok := obj.(*Container) - if !ok { - return false, nil, fmt.Errorf("%T is not a Container", obj) - } - // Add the null character as a terminator - return true, []byte(c.ID + terminator), nil -} - -// FromArgs implements the memdb.Indexer interface -func (e *containerByIDIndexer) FromArgs(args ...any) ([]byte, error) { - if len(args) != 1 { - return nil, fmt.Errorf("must provide only a single argument") - } - arg, ok := args[0].(string) - if !ok { - return nil, fmt.Errorf("argument must be a string: %#v", args[0]) - } - // Add the null character as a terminator - return []byte(arg + terminator), nil -} - -func (e *containerByIDIndexer) PrefixFromArgs(args ...any) ([]byte, error) { - val, err := e.FromArgs(args...) - if err != nil { - return nil, err - } - - // Strip the null terminator, the rest is a prefix - return bytes.TrimSuffix(val, []byte(terminator)), nil -} - -// namesByNameIndexer is used to index container name associations by name. -type namesByNameIndexer struct{} - -func (e *namesByNameIndexer) FromObject(obj any) (bool, []byte, error) { - n, ok := obj.(nameAssociation) - if !ok { - return false, nil, fmt.Errorf(`%T does not have type "nameAssociation"`, obj) - } - - // Add the null character as a terminator - return true, []byte(n.name + terminator), nil -} - -func (e *namesByNameIndexer) FromArgs(args ...any) ([]byte, error) { - if len(args) != 1 { - return nil, fmt.Errorf("must provide only a single argument") - } - arg, ok := args[0].(string) - if !ok { - return nil, fmt.Errorf("argument must be a string: %#v", args[0]) - } - // Add the null character as a terminator - return []byte(arg + terminator), nil -} - -// namesByContainerIDIndexer is used to index container names by container ID. -type namesByContainerIDIndexer struct{} - -func (e *namesByContainerIDIndexer) FromObject(obj any) (bool, []byte, error) { - n, ok := obj.(nameAssociation) - if !ok { - return false, nil, fmt.Errorf(`%T does not have type "nameAssociation"`, obj) - } - - // Add the null character as a terminator - return true, []byte(n.containerID + terminator), nil -} - -func (e *namesByContainerIDIndexer) FromArgs(args ...any) ([]byte, error) { - if len(args) != 1 { - return nil, fmt.Errorf("must provide only a single argument") - } - arg, ok := args[0].(string) - if !ok { - return nil, fmt.Errorf("argument must be a string: %#v", args[0]) - } - // Add the null character as a terminator - return []byte(arg + terminator), nil -} diff --git a/vendor/github.com/docker/docker/daemon/graphdriver/fsdiff.go b/vendor/github.com/docker/docker/daemon/graphdriver/fsdiff.go index 1bfe91ffbe..32d7175845 100644 --- a/vendor/github.com/docker/docker/daemon/graphdriver/fsdiff.go +++ b/vendor/github.com/docker/docker/daemon/graphdriver/fsdiff.go @@ -47,7 +47,7 @@ func NewNaiveDiffDriver(driver ProtoDriver, idMap user.IdentityMapping) Driver { // Diff produces an archive of the changes between the specified // layer and its parent layer which may be "". -func (gdw *NaiveDiffDriver) Diff(id, parent string) (arch io.ReadCloser, err error) { +func (gdw *NaiveDiffDriver) Diff(id, parent string) (arch io.ReadCloser, retErr error) { startTime := time.Now() driver := gdw.ProtoDriver @@ -58,8 +58,8 @@ func (gdw *NaiveDiffDriver) Diff(id, parent string) (arch io.ReadCloser, err err layerFs := layerRootFs defer func() { - if err != nil { - driver.Put(id) + if retErr != nil { + _ = driver.Put(id) } }() @@ -131,7 +131,7 @@ func (gdw *NaiveDiffDriver) Changes(id, parent string) ([]archive.Change, error) // ApplyDiff extracts the changeset from the given diff into the // layer with the specified id and parent, returning the size of the // new layer in bytes. -func (gdw *NaiveDiffDriver) ApplyDiff(id, parent string, diff io.Reader) (size int64, err error) { +func (gdw *NaiveDiffDriver) ApplyDiff(id, parent string, diff io.Reader) (size int64, _ error) { driver := gdw.ProtoDriver // Mount the root filesystem so we can apply the diff/layer. diff --git a/vendor/github.com/docker/docker/daemon/logger/adapter.go b/vendor/github.com/docker/docker/daemon/logger/adapter.go deleted file mode 100644 index bd5cf5f226..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/adapter.go +++ /dev/null @@ -1,143 +0,0 @@ -package logger // import "github.com/docker/docker/daemon/logger" - -import ( - "context" - "io" - "os" - "path/filepath" - "sync" - "time" - - "github.com/containerd/log" - "github.com/docker/docker/api/types/plugins/logdriver" - "github.com/docker/docker/pkg/plugingetter" - "github.com/pkg/errors" -) - -// pluginAdapter takes a plugin and implements the Logger interface for logger -// instances -type pluginAdapter struct { - driverName string - id string - plugin logPlugin - fifoPath string - capabilities Capability - logInfo Info - - // synchronize access to the log stream and shared buffer - mu sync.Mutex - enc logdriver.LogEntryEncoder - stream io.WriteCloser - // buf is shared for each `Log()` call to reduce allocations. - // buf must be protected by mutex - buf logdriver.LogEntry -} - -func (a *pluginAdapter) Log(msg *Message) error { - a.mu.Lock() - - a.buf.Line = msg.Line - a.buf.TimeNano = msg.Timestamp.UnixNano() - a.buf.Partial = msg.PLogMetaData != nil - a.buf.Source = msg.Source - if msg.PLogMetaData != nil { - a.buf.PartialLogMetadata = &logdriver.PartialLogEntryMetadata{ - Id: msg.PLogMetaData.ID, - Last: msg.PLogMetaData.Last, - Ordinal: int32(msg.PLogMetaData.Ordinal), - } - } - - err := a.enc.Encode(&a.buf) - a.buf.Reset() - - a.mu.Unlock() - - PutMessage(msg) - return err -} - -func (a *pluginAdapter) Name() string { - return a.driverName -} - -func (a *pluginAdapter) Close() error { - a.mu.Lock() - defer a.mu.Unlock() - - if err := a.plugin.StopLogging(filepath.Join("/", "run", "docker", "logging", a.id)); err != nil { - return err - } - - if err := a.stream.Close(); err != nil { - log.G(context.TODO()).WithError(err).Error("error closing plugin fifo") - } - if err := os.Remove(a.fifoPath); err != nil && !os.IsNotExist(err) { - log.G(context.TODO()).WithError(err).Error("error cleaning up plugin fifo") - } - - // may be nil, especially for unit tests - if pluginGetter != nil { - pluginGetter.Get(a.Name(), extName, plugingetter.Release) - } - return nil -} - -type pluginAdapterWithRead struct { - *pluginAdapter -} - -func (a *pluginAdapterWithRead) ReadLogs(ctx context.Context, config ReadConfig) *LogWatcher { - watcher := NewLogWatcher() - - go func() { - defer close(watcher.Msg) - stream, err := a.plugin.ReadLogs(a.logInfo, config) - if err != nil { - watcher.Err <- errors.Wrap(err, "error getting log reader") - return - } - defer stream.Close() - - dec := logdriver.NewLogEntryDecoder(stream) - for { - if ctx.Err() != nil { - return - } - - var buf logdriver.LogEntry - if err := dec.Decode(&buf); err != nil { - if err == io.EOF { - return - } - watcher.Err <- errors.Wrap(err, "error decoding log message") - return - } - - msg := &Message{ - Timestamp: time.Unix(0, buf.TimeNano), - Line: buf.Line, - Source: buf.Source, - } - - // plugin should handle this, but check just in case - if !config.Since.IsZero() && msg.Timestamp.Before(config.Since) { - continue - } - if !config.Until.IsZero() && msg.Timestamp.After(config.Until) { - return - } - - // send the message unless the consumer is gone - select { - case watcher.Msg <- msg: - case <-ctx.Done(): - return - case <-watcher.WatchConsumerGone(): - return - } - } - }() - - return watcher -} diff --git a/vendor/github.com/docker/docker/daemon/logger/copier.go b/vendor/github.com/docker/docker/daemon/logger/copier.go deleted file mode 100644 index ac9639840e..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/copier.go +++ /dev/null @@ -1,190 +0,0 @@ -package logger // import "github.com/docker/docker/daemon/logger" - -import ( - "bytes" - "context" - "io" - "sync" - "time" - - "github.com/containerd/log" - types "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/pkg/stringid" -) - -const ( - // readSize is the maximum bytes read during a single read - // operation. - readSize = 2 * 1024 - - // defaultBufSize provides a reasonable default for loggers that do - // not have an external limit to impose on log line size. - defaultBufSize = 16 * 1024 -) - -// Copier can copy logs from specified sources to Logger and attach Timestamp. -// Writes are concurrent, so you need implement some sync in your logger. -type Copier struct { - // srcs is map of name -> reader pairs, for example "stdout", "stderr" - srcs map[string]io.Reader - dst Logger - copyJobs sync.WaitGroup - closeOnce sync.Once - closed chan struct{} -} - -// NewCopier creates a new Copier -func NewCopier(srcs map[string]io.Reader, dst Logger) *Copier { - return &Copier{ - srcs: srcs, - dst: dst, - closed: make(chan struct{}), - } -} - -// Run starts logs copying -func (c *Copier) Run() { - for src, w := range c.srcs { - c.copyJobs.Add(1) - go c.copySrc(src, w) - } -} - -func (c *Copier) copySrc(name string, src io.Reader) { - defer c.copyJobs.Done() - - bufSize := defaultBufSize - if sizedLogger, ok := c.dst.(SizedLogger); ok { - size := sizedLogger.BufSize() - // Loggers that wrap another loggers would have BufSize(), but cannot return the size - // when the wrapped loggers doesn't have BufSize(). - if size > 0 { - bufSize = size - } - } - buf := make([]byte, bufSize) - - n := 0 - eof := false - var partialid string - var partialTS time.Time - var ordinal int - firstPartial := true - hasMorePartial := false - - for { - select { - case <-c.closed: - return - default: - // Work out how much more data we are okay with reading this time. - upto := n + readSize - if upto > cap(buf) { - upto = cap(buf) - } - // Try to read that data. - if upto > n { - read, err := src.Read(buf[n:upto]) - if err != nil { - if err != io.EOF { - logReadsFailedCount.Inc(1) - log.G(context.TODO()).Errorf("Error scanning log stream: %s", err) - return - } - eof = true - } - n += read - } - // If we have no data to log, and there's no more coming, we're done. - if n == 0 && eof { - return - } - // Break up the data that we've buffered up into lines, and log each in turn. - p := 0 - - for q := bytes.IndexByte(buf[p:n], '\n'); q >= 0; q = bytes.IndexByte(buf[p:n], '\n') { - select { - case <-c.closed: - return - default: - msg := NewMessage() - msg.Source = name - msg.Line = append(msg.Line, buf[p:p+q]...) - - if hasMorePartial { - msg.PLogMetaData = &types.PartialLogMetaData{ID: partialid, Ordinal: ordinal, Last: true} - - // reset - partialid = "" - ordinal = 0 - firstPartial = true - hasMorePartial = false - } - if msg.PLogMetaData == nil { - msg.Timestamp = time.Now().UTC() - } else { - msg.Timestamp = partialTS - } - - if logErr := c.dst.Log(msg); logErr != nil { - logDriverError(c.dst.Name(), string(msg.Line), logErr) - } - } - p += q + 1 - } - // If there's no more coming, or the buffer is full but - // has no newlines, log whatever we haven't logged yet, - // noting that it's a partial log line. - if eof || (p == 0 && n == len(buf)) { - if p < n { - msg := NewMessage() - msg.Source = name - msg.Line = append(msg.Line, buf[p:n]...) - - // Generate unique partialID for first partial. Use it across partials. - // Record timestamp for first partial. Use it across partials. - // Initialize Ordinal for first partial. Increment it across partials. - if firstPartial { - msg.Timestamp = time.Now().UTC() - partialTS = msg.Timestamp - partialid = stringid.GenerateRandomID() - ordinal = 1 - firstPartial = false - totalPartialLogs.Inc(1) - } else { - msg.Timestamp = partialTS - } - msg.PLogMetaData = &types.PartialLogMetaData{ID: partialid, Ordinal: ordinal, Last: false} - ordinal++ - hasMorePartial = true - - if logErr := c.dst.Log(msg); logErr != nil { - logDriverError(c.dst.Name(), string(msg.Line), logErr) - } - p = 0 - n = 0 - } - if eof { - return - } - } - // Move any unlogged data to the front of the buffer in preparation for another read. - if p > 0 { - copy(buf[0:], buf[p:n]) - n -= p - } - } - } -} - -// Wait waits until all copying is done -func (c *Copier) Wait() { - c.copyJobs.Wait() -} - -// Close closes the copier -func (c *Copier) Close() { - c.closeOnce.Do(func() { - close(c.closed) - }) -} diff --git a/vendor/github.com/docker/docker/daemon/logger/factory.go b/vendor/github.com/docker/docker/daemon/logger/factory.go deleted file mode 100644 index 54f9653963..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/factory.go +++ /dev/null @@ -1,178 +0,0 @@ -package logger // import "github.com/docker/docker/daemon/logger" - -import ( - "fmt" - "sort" - "sync" - - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/pkg/plugingetter" - "github.com/docker/go-units" - "github.com/pkg/errors" -) - -// Creator builds a logging driver instance with given context. -type Creator func(Info) (Logger, error) - -// LogOptValidator checks the options specific to the underlying -// logging implementation. -type LogOptValidator func(cfg map[string]string) error - -type logdriverFactory struct { - registry map[string]Creator - optValidator map[string]LogOptValidator - m sync.Mutex -} - -func (lf *logdriverFactory) list() []string { - ls := make([]string, 0, len(lf.registry)) - lf.m.Lock() - for name := range lf.registry { - ls = append(ls, name) - } - lf.m.Unlock() - sort.Strings(ls) - return ls -} - -// ListDrivers gets the list of registered log driver names -func ListDrivers() []string { - return factory.list() -} - -func (lf *logdriverFactory) register(name string, c Creator) error { - registered, err := lf.driverRegistered(name) - if err != nil { - return err - } - if registered { - return fmt.Errorf("logger: log driver named '%s' is already registered", name) - } - - lf.m.Lock() - lf.registry[name] = c - lf.m.Unlock() - return nil -} - -func (lf *logdriverFactory) driverRegistered(name string) (bool, error) { - lf.m.Lock() - _, ok := lf.registry[name] - lf.m.Unlock() - if !ok { - if pluginGetter != nil { // this can be nil when the init functions are running - l, err := getPlugin(name, plugingetter.Lookup) - if err != nil { - return false, err - } - if l != nil { - return true, nil - } - } - } - return ok, nil -} - -func (lf *logdriverFactory) registerLogOptValidator(name string, l LogOptValidator) error { - lf.m.Lock() - defer lf.m.Unlock() - - if _, ok := lf.optValidator[name]; ok { - return fmt.Errorf("logger: log validator named '%s' is already registered", name) - } - lf.optValidator[name] = l - return nil -} - -func (lf *logdriverFactory) get(name string) (Creator, error) { - lf.m.Lock() - defer lf.m.Unlock() - - c, ok := lf.registry[name] - if ok { - return c, nil - } - - c, err := getPlugin(name, plugingetter.Acquire) - return c, errors.Wrapf(err, "logger: no log driver named '%s' is registered", name) -} - -func (lf *logdriverFactory) getLogOptValidator(name string) LogOptValidator { - lf.m.Lock() - defer lf.m.Unlock() - - c := lf.optValidator[name] - return c -} - -var factory = &logdriverFactory{registry: make(map[string]Creator), optValidator: make(map[string]LogOptValidator)} // global factory instance - -// RegisterLogDriver registers the given logging driver builder with given logging -// driver name. -func RegisterLogDriver(name string, c Creator) error { - return factory.register(name, c) -} - -// RegisterLogOptValidator registers the logging option validator with -// the given logging driver name. -func RegisterLogOptValidator(name string, l LogOptValidator) error { - return factory.registerLogOptValidator(name, l) -} - -// GetLogDriver provides the logging driver builder for a logging driver name. -func GetLogDriver(name string) (Creator, error) { - return factory.get(name) -} - -var builtInLogOpts = map[string]bool{ - "mode": true, - "max-buffer-size": true, -} - -// ValidateLogOpts checks the options for the given log driver. The -// options supported are specific to the LogDriver implementation. -func ValidateLogOpts(name string, cfg map[string]string) error { - if name == "none" { - return nil - } - - switch containertypes.LogMode(cfg["mode"]) { - case containertypes.LogModeBlocking, containertypes.LogModeNonBlock, containertypes.LogModeUnset: - default: - return fmt.Errorf("logger: logging mode not supported: %s", cfg["mode"]) - } - - if s, ok := cfg["max-buffer-size"]; ok { - if containertypes.LogMode(cfg["mode"]) != containertypes.LogModeNonBlock { - return fmt.Errorf("logger: max-buffer-size option is only supported with 'mode=%s'", containertypes.LogModeNonBlock) - } - if _, err := units.RAMInBytes(s); err != nil { - return errors.Wrap(err, "error parsing option max-buffer-size") - } - } - - if err := validateExternal(cfg); err != nil { - return err - } - - registered, err := factory.driverRegistered(name) - if err != nil { - return err - } - if !registered { - return fmt.Errorf("logger: no log driver named '%s' is registered", name) - } - - filteredOpts := make(map[string]string, len(builtInLogOpts)) - for k, v := range cfg { - if !builtInLogOpts[k] { - filteredOpts[k] = v - } - } - - validator := factory.getLogOptValidator(name) - if validator != nil { - return validator(filteredOpts) - } - return nil -} diff --git a/vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonfilelog.go b/vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonfilelog.go deleted file mode 100644 index ae9ad77865..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonfilelog.go +++ /dev/null @@ -1,182 +0,0 @@ -// Package jsonfilelog provides the default Logger implementation for -// Docker logging. This logger logs to files on the host server in the -// JSON format. -package jsonfilelog // import "github.com/docker/docker/daemon/logger/jsonfilelog" - -import ( - "bytes" - "encoding/json" - "fmt" - "strconv" - "sync" - - "github.com/docker/docker/daemon/logger" - "github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog" - "github.com/docker/docker/daemon/logger/loggerutils" - "github.com/docker/go-units" - "github.com/pkg/errors" -) - -// Name is the name of the file that the jsonlogger logs to. -const Name = "json-file" - -// Every buffer will have to store the same constant json structure with the message -// len(`{"log":"","stream:"stdout","time":"2000-01-01T00:00:00.000000000Z"}\n`) = 68. -// So let's start with a buffer bigger than this. -const initialBufSize = 256 - -var buffersPool = sync.Pool{New: func() interface{} { return bytes.NewBuffer(make([]byte, 0, initialBufSize)) }} - -// JSONFileLogger is Logger implementation for default Docker logging. -type JSONFileLogger struct { - writer *loggerutils.LogFile - tag string // tag values requested by the user to log - extra json.RawMessage -} - -func init() { - if err := logger.RegisterLogDriver(Name, New); err != nil { - panic(err) - } - if err := logger.RegisterLogOptValidator(Name, ValidateLogOpt); err != nil { - panic(err) - } -} - -// New creates new JSONFileLogger which writes to filename passed in -// on given context. -func New(info logger.Info) (logger.Logger, error) { - var capval int64 = -1 - if capacity, ok := info.Config["max-size"]; ok { - var err error - capval, err = units.FromHumanSize(capacity) - if err != nil { - return nil, err - } - if capval <= 0 { - return nil, fmt.Errorf("max-size must be a positive number") - } - } - maxFiles := 1 - if maxFileString, ok := info.Config["max-file"]; ok { - var err error - maxFiles, err = strconv.Atoi(maxFileString) - if err != nil { - return nil, err - } - if maxFiles < 1 { - return nil, fmt.Errorf("max-file cannot be less than 1") - } - } - - var compress bool - if compressString, ok := info.Config["compress"]; ok { - var err error - compress, err = strconv.ParseBool(compressString) - if err != nil { - return nil, err - } - if compress && (maxFiles == 1 || capval == -1) { - return nil, fmt.Errorf("compress cannot be true when max-file is less than 2 or max-size is not set") - } - } - - extraAttrs, err := info.ExtraAttributes(nil) - if err != nil { - return nil, err - } - - // no default template. only use a tag if the user asked for it - tag, err := loggerutils.ParseLogTag(info, "") - if err != nil { - return nil, err - } - if tag != "" { - extraAttrs["tag"] = tag - } - - var extra json.RawMessage - if len(extraAttrs) > 0 { - var err error - extra, err = json.Marshal(extraAttrs) - if err != nil { - return nil, err - } - } - - writer, err := loggerutils.NewLogFile(info.LogPath, capval, maxFiles, compress, decodeFunc, 0o640, getTailReader) - if err != nil { - return nil, err - } - - return &JSONFileLogger{ - writer: writer, - tag: tag, - extra: extra, - }, nil -} - -// Log converts logger.Message to jsonlog.JSONLog and serializes it to file. -func (l *JSONFileLogger) Log(msg *logger.Message) error { - buf := buffersPool.Get().(*bytes.Buffer) - buf.Reset() - defer buffersPool.Put(buf) - - timestamp := msg.Timestamp - err := marshalMessage(msg, l.extra, buf) - logger.PutMessage(msg) - - if err != nil { - return err - } - - return l.writer.WriteLogEntry(timestamp, buf.Bytes()) -} - -func marshalMessage(msg *logger.Message, extra json.RawMessage, buf *bytes.Buffer) error { - logLine := msg.Line - if msg.PLogMetaData == nil || (msg.PLogMetaData != nil && msg.PLogMetaData.Last) { - logLine = append(msg.Line, '\n') - } - err := (&jsonlog.JSONLogs{ - Log: logLine, - Stream: msg.Source, - Created: msg.Timestamp, - RawAttrs: extra, - }).MarshalJSONBuf(buf) - if err != nil { - return errors.Wrap(err, "error writing log message to buffer") - } - err = buf.WriteByte('\n') - return errors.Wrap(err, "error finalizing log buffer") -} - -// ValidateLogOpt looks for json specific log options max-file & max-size. -func ValidateLogOpt(cfg map[string]string) error { - for key := range cfg { - switch key { - case "max-file": - case "max-size": - case "compress": - case "labels": - case "labels-regex": - case "env": - case "env-regex": - case "tag": - default: - return fmt.Errorf("unknown log opt '%s' for json-file log driver", key) - } - } - return nil -} - -// Close closes underlying file and signals all the readers -// that the logs producer is gone. -func (l *JSONFileLogger) Close() error { - return l.writer.Close() -} - -// Name returns name of this logger. -func (l *JSONFileLogger) Name() string { - return Name -} diff --git a/vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog/jsonlog.go b/vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog/jsonlog.go deleted file mode 100644 index 050900197f..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog/jsonlog.go +++ /dev/null @@ -1,27 +0,0 @@ -package jsonlog // import "github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog" - -import ( - "time" -) - -// JSONLog is a log message, typically a single entry from a given log stream. -type JSONLog struct { - // Log is the log message - Log string `json:"log,omitempty"` - // Stream is the log source - Stream string `json:"stream,omitempty"` - // Created is the created timestamp of log - Created time.Time `json:"time"` - // Attrs is the list of extra attributes provided by the user - Attrs map[string]string `json:"attrs,omitempty"` -} - -// Reset all fields to their zero value. -func (jl *JSONLog) Reset() { - jl.Log = "" - jl.Stream = "" - jl.Created = time.Time{} - for k := range jl.Attrs { - delete(jl.Attrs, k) - } -} diff --git a/vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog/jsonlogbytes.go b/vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog/jsonlogbytes.go deleted file mode 100644 index d7e2e37184..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog/jsonlogbytes.go +++ /dev/null @@ -1,125 +0,0 @@ -package jsonlog // import "github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog" - -import ( - "bytes" - "encoding/json" - "time" - "unicode/utf8" -) - -// JSONLogs marshals encoded JSONLog objects -type JSONLogs struct { - Log []byte `json:"log,omitempty"` - Stream string `json:"stream,omitempty"` - Created time.Time `json:"time"` - - // json-encoded bytes - RawAttrs json.RawMessage `json:"attrs,omitempty"` -} - -// MarshalJSONBuf is an optimized JSON marshaller that avoids reflection -// and unnecessary allocation. -func (mj *JSONLogs) MarshalJSONBuf(buf *bytes.Buffer) error { - first := true - - buf.WriteString(`{`) - if len(mj.Log) != 0 { - first = false - buf.WriteString(`"log":`) - ffjsonWriteJSONBytesAsString(buf, mj.Log) - } - if len(mj.Stream) != 0 { - if first { - first = false - } else { - buf.WriteString(`,`) - } - buf.WriteString(`"stream":`) - ffjsonWriteJSONBytesAsString(buf, []byte(mj.Stream)) - } - if len(mj.RawAttrs) > 0 { - if first { - first = false - } else { - buf.WriteString(`,`) - } - buf.WriteString(`"attrs":`) - buf.Write(mj.RawAttrs) - } - if !first { - buf.WriteString(`,`) - } - - created, err := fastTimeMarshalJSON(mj.Created) - if err != nil { - return err - } - - buf.WriteString(`"time":`) - buf.WriteString(created) - buf.WriteString(`}`) - return nil -} - -func ffjsonWriteJSONBytesAsString(buf *bytes.Buffer, s []byte) { - const hex = "0123456789abcdef" - - buf.WriteByte('"') - start := 0 - for i := 0; i < len(s); { - if b := s[i]; b < utf8.RuneSelf { - if 0x20 <= b && b != '\\' && b != '"' && b != '<' && b != '>' && b != '&' { - i++ - continue - } - if start < i { - buf.Write(s[start:i]) - } - switch b { - case '\\', '"': - buf.WriteByte('\\') - buf.WriteByte(b) - case '\n': - buf.WriteByte('\\') - buf.WriteByte('n') - case '\r': - buf.WriteByte('\\') - buf.WriteByte('r') - default: - - buf.WriteString(`\u00`) - buf.WriteByte(hex[b>>4]) - buf.WriteByte(hex[b&0xF]) - } - i++ - start = i - continue - } - c, size := utf8.DecodeRune(s[i:]) - if c == utf8.RuneError && size == 1 { - if start < i { - buf.Write(s[start:i]) - } - buf.WriteString(`\ufffd`) - i += size - start = i - continue - } - - if c == '\u2028' || c == '\u2029' { - if start < i { - buf.Write(s[start:i]) - } - buf.WriteString(`\u202`) - buf.WriteByte(hex[c&0xF]) - i += size - start = i - continue - } - i += size - } - if start < len(s) { - buf.Write(s[start:]) - } - buf.WriteByte('"') -} diff --git a/vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog/time_marshalling.go b/vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog/time_marshalling.go deleted file mode 100644 index 1822ea5dbc..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog/time_marshalling.go +++ /dev/null @@ -1,20 +0,0 @@ -package jsonlog // import "github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog" - -import ( - "time" - - "github.com/pkg/errors" -) - -const jsonFormat = `"` + time.RFC3339Nano + `"` - -// fastTimeMarshalJSON avoids one of the extra allocations that -// time.MarshalJSON is making. -func fastTimeMarshalJSON(t time.Time) (string, error) { - if y := t.Year(); y < 0 || y >= 10000 { - // RFC 3339 is clear that years are 4 digits exactly. - // See golang.org/issue/4556#c15 for more discussion. - return "", errors.New("time.MarshalJSON: year outside of range [0,9999]") - } - return t.Format(jsonFormat), nil -} diff --git a/vendor/github.com/docker/docker/daemon/logger/jsonfilelog/read.go b/vendor/github.com/docker/docker/daemon/logger/jsonfilelog/read.go deleted file mode 100644 index 6627074fe2..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/jsonfilelog/read.go +++ /dev/null @@ -1,86 +0,0 @@ -package jsonfilelog // import "github.com/docker/docker/daemon/logger/jsonfilelog" - -import ( - "context" - "encoding/json" - "io" - - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/daemon/logger" - "github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog" - "github.com/docker/docker/daemon/logger/loggerutils" - "github.com/docker/docker/pkg/tailfile" -) - -var _ logger.LogReader = (*JSONFileLogger)(nil) - -// ReadLogs implements the logger's LogReader interface for the logs -// created by this driver. -func (l *JSONFileLogger) ReadLogs(ctx context.Context, config logger.ReadConfig) *logger.LogWatcher { - return l.writer.ReadLogs(ctx, config) -} - -func decodeLogLine(dec *json.Decoder, l *jsonlog.JSONLog) (*logger.Message, error) { - l.Reset() - if err := dec.Decode(l); err != nil { - return nil, err - } - - var attrs []backend.LogAttr - if len(l.Attrs) != 0 { - attrs = make([]backend.LogAttr, 0, len(l.Attrs)) - for k, v := range l.Attrs { - attrs = append(attrs, backend.LogAttr{Key: k, Value: v}) - } - } - msg := &logger.Message{ - Source: l.Stream, - Timestamp: l.Created, - Line: []byte(l.Log), - Attrs: attrs, - } - return msg, nil -} - -type decoder struct { - rdr io.Reader - dec *json.Decoder - jl *jsonlog.JSONLog -} - -func (d *decoder) Reset(rdr io.Reader) { - d.rdr = rdr - d.dec = nil - if d.jl != nil { - d.jl.Reset() - } -} - -func (d *decoder) Close() { - d.dec = nil - d.rdr = nil - d.jl = nil -} - -func (d *decoder) Decode() (msg *logger.Message, err error) { - if d.dec == nil { - d.dec = json.NewDecoder(d.rdr) - } - if d.jl == nil { - d.jl = &jsonlog.JSONLog{} - } - return decodeLogLine(d.dec, d.jl) -} - -// decodeFunc is used to create a decoder for the log file reader -func decodeFunc(rdr io.Reader) loggerutils.Decoder { - return &decoder{ - rdr: rdr, - dec: nil, - jl: nil, - } -} - -func getTailReader(ctx context.Context, r loggerutils.SizeReaderAt, req int) (loggerutils.SizeReaderAt, int, error) { - return tailfile.NewTailReader(ctx, r, req) -} diff --git a/vendor/github.com/docker/docker/daemon/logger/local/config.go b/vendor/github.com/docker/docker/daemon/logger/local/config.go deleted file mode 100644 index 8de160aea2..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/local/config.go +++ /dev/null @@ -1,36 +0,0 @@ -package local - -import ( - "github.com/pkg/errors" -) - -// CreateConfig is used to configure new instances of driver -type CreateConfig struct { - DisableCompression bool - MaxFileSize int64 - MaxFileCount int -} - -func newDefaultConfig() *CreateConfig { - return &CreateConfig{ - MaxFileSize: defaultMaxFileSize, - MaxFileCount: defaultMaxFileCount, - DisableCompression: !defaultCompressLogs, - } -} - -func validateConfig(cfg *CreateConfig) error { - if cfg.MaxFileSize < 0 { - return errors.New("max size should be a positive number") - } - if cfg.MaxFileCount < 0 { - return errors.New("max file count cannot be less than 0") - } - - if !cfg.DisableCompression { - if cfg.MaxFileCount <= 1 { - return errors.New("compression cannot be enabled when max file count is 1") - } - } - return nil -} diff --git a/vendor/github.com/docker/docker/daemon/logger/local/doc.go b/vendor/github.com/docker/docker/daemon/logger/local/doc.go deleted file mode 100644 index 7b082a3d53..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/local/doc.go +++ /dev/null @@ -1,9 +0,0 @@ -// Package local provides a logger implementation that stores logs on disk. -// -// Log messages are encoded as protobufs with a header and footer for each message. -// The header and footer are big-endian binary encoded uint32 values which indicate the size of the log message. -// The header and footer of each message allows you to efficiently read through a file either forwards or in -// backwards (such as is the case when tailing a file) -// -// Example log message format: [22][This is a log message.][22][28][This is another log message.][28] -package local // import "github.com/docker/docker/daemon/logger/local" diff --git a/vendor/github.com/docker/docker/daemon/logger/local/local.go b/vendor/github.com/docker/docker/daemon/logger/local/local.go deleted file mode 100644 index 88b4f0da28..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/local/local.go +++ /dev/null @@ -1,214 +0,0 @@ -package local // import "github.com/docker/docker/daemon/logger/local" - -import ( - "encoding/binary" - "io" - "math/bits" - "strconv" - "sync" - "time" - - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/plugins/logdriver" - "github.com/docker/docker/daemon/logger" - "github.com/docker/docker/daemon/logger/loggerutils" - "github.com/docker/docker/errdefs" - "github.com/docker/go-units" - "github.com/pkg/errors" -) - -const ( - // Name is the name of the driver - Name = "local" - - encodeBinaryLen = 4 - initialBufSize = 2048 - maxDecodeRetry = 20000 - - defaultMaxFileSize int64 = 20 * 1024 * 1024 - defaultMaxFileCount = 5 - defaultCompressLogs = true -) - -var buffersPool = sync.Pool{New: func() interface{} { - b := make([]byte, initialBufSize) - return &b -}} - -// LogOptKeys are the keys names used for log opts passed in to initialize the driver. -var LogOptKeys = map[string]bool{ - "max-file": true, - "max-size": true, - "compress": true, -} - -// ValidateLogOpt looks for log driver specific options. -func ValidateLogOpt(cfg map[string]string) error { - for key := range cfg { - if !LogOptKeys[key] { - return errors.Errorf("unknown log opt '%s' for log driver %s", key, Name) - } - } - return nil -} - -func init() { - if err := logger.RegisterLogDriver(Name, New); err != nil { - panic(err) - } - if err := logger.RegisterLogOptValidator(Name, ValidateLogOpt); err != nil { - panic(err) - } -} - -type driver struct { - logfile *loggerutils.LogFile -} - -// New creates a new local logger -// You must provide the `LogPath` in the passed in info argument, this is the file path that logs are written to. -func New(info logger.Info) (logger.Logger, error) { - if info.LogPath == "" { - return nil, errdefs.System(errors.New("log path is missing -- this is a bug and should not happen")) - } - - cfg := newDefaultConfig() - if capacity, ok := info.Config["max-size"]; ok { - var err error - cfg.MaxFileSize, err = units.FromHumanSize(capacity) - if err != nil { - return nil, errdefs.InvalidParameter(errors.Wrapf(err, "invalid value for max-size: %s", capacity)) - } - } - - if userMaxFileCount, ok := info.Config["max-file"]; ok { - var err error - cfg.MaxFileCount, err = strconv.Atoi(userMaxFileCount) - if err != nil { - return nil, errdefs.InvalidParameter(errors.Wrapf(err, "invalid value for max-file: %s", userMaxFileCount)) - } - } - - if userCompress, ok := info.Config["compress"]; ok { - compressLogs, err := strconv.ParseBool(userCompress) - if err != nil { - return nil, errdefs.InvalidParameter(errors.Wrap(err, "error reading compress log option")) - } - cfg.DisableCompression = !compressLogs - } - return newDriver(info.LogPath, cfg) -} - -func marshal(m *logger.Message, buffer *[]byte) error { - proto := logdriver.LogEntry{} - md := logdriver.PartialLogEntryMetadata{} - - resetProto(&proto) - - messageToProto(m, &proto, &md) - protoSize := proto.Size() - writeLen := protoSize + (2 * encodeBinaryLen) // + len(messageDelimiter) - - buf := *buffer - if writeLen > cap(buf) { - // If we already need to reallocate the buffer, make it larger to be more reusable. - // Round to the next power of two. - capacity := 1 << (bits.Len(uint(writeLen)) + 1) - - buf = make([]byte, writeLen, capacity) - } else { - buf = buf[:writeLen] - } - *buffer = buf - - binary.BigEndian.PutUint32(buf[:encodeBinaryLen], uint32(protoSize)) - n, err := proto.MarshalTo(buf[encodeBinaryLen:writeLen]) - if err != nil { - return errors.Wrap(err, "error marshaling log entry") - } - if n+(encodeBinaryLen*2) != writeLen { - return io.ErrShortWrite - } - binary.BigEndian.PutUint32(buf[writeLen-encodeBinaryLen:writeLen], uint32(protoSize)) - return nil -} - -func newDriver(logPath string, cfg *CreateConfig) (logger.Logger, error) { - if err := validateConfig(cfg); err != nil { - return nil, errdefs.InvalidParameter(err) - } - - lf, err := loggerutils.NewLogFile(logPath, cfg.MaxFileSize, cfg.MaxFileCount, !cfg.DisableCompression, decodeFunc, 0o640, getTailReader) - if err != nil { - return nil, err - } - return &driver{ - logfile: lf, - }, nil -} - -func (d *driver) Name() string { - return Name -} - -func (d *driver) Log(msg *logger.Message) error { - buf := buffersPool.Get().(*[]byte) - defer buffersPool.Put(buf) - - timestamp := msg.Timestamp - err := marshal(msg, buf) - logger.PutMessage(msg) - - if err != nil { - return errors.Wrap(err, "error marshalling logger.Message") - } - return d.logfile.WriteLogEntry(timestamp, *buf) -} - -func (d *driver) Close() error { - return d.logfile.Close() -} - -func messageToProto(msg *logger.Message, proto *logdriver.LogEntry, partial *logdriver.PartialLogEntryMetadata) { - proto.Source = msg.Source - proto.TimeNano = msg.Timestamp.UnixNano() - proto.Line = append(proto.Line[:0], msg.Line...) - proto.Partial = msg.PLogMetaData != nil - if proto.Partial { - partial.Ordinal = int32(msg.PLogMetaData.Ordinal) - partial.Last = msg.PLogMetaData.Last - partial.Id = msg.PLogMetaData.ID - proto.PartialLogMetadata = partial - } else { - proto.PartialLogMetadata = nil - } -} - -func protoToMessage(proto *logdriver.LogEntry) *logger.Message { - msg := &logger.Message{ - Source: proto.Source, - Timestamp: time.Unix(0, proto.TimeNano).UTC(), - } - if proto.Partial { - var md backend.PartialLogMetaData - md.Last = proto.GetPartialLogMetadata().GetLast() - md.ID = proto.GetPartialLogMetadata().GetId() - md.Ordinal = int(proto.GetPartialLogMetadata().GetOrdinal()) - msg.PLogMetaData = &md - } - msg.Line = append(msg.Line[:0], proto.Line...) - return msg -} - -func resetProto(proto *logdriver.LogEntry) { - proto.Source = "" - proto.Line = proto.Line[:0] - proto.TimeNano = 0 - proto.Partial = false - if proto.PartialLogMetadata != nil { - proto.PartialLogMetadata.Id = "" - proto.PartialLogMetadata.Last = false - proto.PartialLogMetadata.Ordinal = 0 - } - proto.PartialLogMetadata = nil -} diff --git a/vendor/github.com/docker/docker/daemon/logger/local/read.go b/vendor/github.com/docker/docker/daemon/logger/local/read.go deleted file mode 100644 index 14771a52db..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/local/read.go +++ /dev/null @@ -1,210 +0,0 @@ -package local - -import ( - "bytes" - "context" - "encoding/binary" - "fmt" - "io" - - "github.com/docker/docker/api/types/plugins/logdriver" - "github.com/docker/docker/daemon/logger" - "github.com/docker/docker/daemon/logger/loggerutils" - "github.com/docker/docker/errdefs" - "github.com/pkg/errors" -) - -// maxMsgLen is the maximum size of the logger.Message after serialization. -// logger.defaultBufSize caps the size of Line field. -const maxMsgLen int = 1e6 // 1MB. - -func (d *driver) ReadLogs(ctx context.Context, config logger.ReadConfig) *logger.LogWatcher { - return d.logfile.ReadLogs(ctx, config) -} - -func getTailReader(ctx context.Context, r loggerutils.SizeReaderAt, req int) (loggerutils.SizeReaderAt, int, error) { - size := r.Size() - if req < 0 { - return nil, 0, errdefs.InvalidParameter(errors.Errorf("invalid number of lines to tail: %d", req)) - } - - if size < (encodeBinaryLen*2)+1 { - return bytes.NewReader(nil), 0, nil - } - - const encodeBinaryLen64 = int64(encodeBinaryLen) - var found int - - buf := make([]byte, encodeBinaryLen) - - offset := size - for { - select { - case <-ctx.Done(): - return nil, 0, ctx.Err() - default: - } - - n, err := r.ReadAt(buf, offset-encodeBinaryLen64) - if err != nil && err != io.EOF { - return nil, 0, errors.Wrap(err, "error reading log message footer") - } - - if n != encodeBinaryLen { - return nil, 0, errdefs.DataLoss(errors.New("unexpected number of bytes read from log message footer")) - } - - msgLen := binary.BigEndian.Uint32(buf) - - n, err = r.ReadAt(buf, offset-encodeBinaryLen64-encodeBinaryLen64-int64(msgLen)) - if err != nil && err != io.EOF { - return nil, 0, errors.Wrap(err, "error reading log message header") - } - - if n != encodeBinaryLen { - return nil, 0, errdefs.DataLoss(errors.New("unexpected number of bytes read from log message header")) - } - - if msgLen != binary.BigEndian.Uint32(buf) { - return nil, 0, errdefs.DataLoss(errors.New("log message header and footer indicate different message sizes")) - } - - found++ - offset -= int64(msgLen) - offset -= encodeBinaryLen64 * 2 - if found == req { - break - } - if offset <= 0 { - break - } - } - - return io.NewSectionReader(r, offset, size), found, nil -} - -type decoder struct { - rdr io.Reader - proto *logdriver.LogEntry - // buf keeps bytes from rdr. - buf []byte - // offset is the position in buf. - // If offset > 0, buf[offset:] has bytes which are read but haven't used. - offset int - // nextMsgLen is the length of the next log message. - // If nextMsgLen = 0, a new value must be read from rdr. - nextMsgLen int -} - -func (d *decoder) readRecord(size int) error { - var err error - for i := 0; i < maxDecodeRetry; i++ { - var n int - n, err = io.ReadFull(d.rdr, d.buf[d.offset:size]) - d.offset += n - if err != nil { - if err != io.ErrUnexpectedEOF { - return err - } - continue - } - break - } - if err != nil { - return err - } - d.offset = 0 - return nil -} - -func (d *decoder) Decode() (*logger.Message, error) { - if d.proto == nil { - d.proto = &logdriver.LogEntry{} - } else { - resetProto(d.proto) - } - if d.buf == nil { - d.buf = make([]byte, initialBufSize) - } - - if d.nextMsgLen == 0 { - msgLen, err := d.decodeSizeHeader() - if err != nil { - return nil, err - } - - if msgLen > maxMsgLen { - return nil, fmt.Errorf("log message is too large (%d > %d)", msgLen, maxMsgLen) - } - - if len(d.buf) < msgLen+encodeBinaryLen { - d.buf = make([]byte, msgLen+encodeBinaryLen) - } else if msgLen <= initialBufSize { - d.buf = d.buf[:initialBufSize] - } else { - d.buf = d.buf[:msgLen+encodeBinaryLen] - } - - d.nextMsgLen = msgLen - } - return d.decodeLogEntry() -} - -func (d *decoder) Reset(rdr io.Reader) { - if d.rdr == rdr { - return - } - - d.rdr = rdr - if d.proto != nil { - resetProto(d.proto) - } - if d.buf != nil { - d.buf = d.buf[:initialBufSize] - } - d.offset = 0 - d.nextMsgLen = 0 -} - -func (d *decoder) Close() { - d.buf = d.buf[:0] - d.buf = nil - if d.proto != nil { - resetProto(d.proto) - } - d.rdr = nil -} - -func decodeFunc(rdr io.Reader) loggerutils.Decoder { - return &decoder{rdr: rdr} -} - -func (d *decoder) decodeSizeHeader() (int, error) { - err := d.readRecord(encodeBinaryLen) - if err != nil { - return 0, errors.Wrap(err, "could not read a size header") - } - - msgLen := int(binary.BigEndian.Uint32(d.buf[:encodeBinaryLen])) - return msgLen, nil -} - -func (d *decoder) decodeLogEntry() (*logger.Message, error) { - msgLen := d.nextMsgLen - err := d.readRecord(msgLen + encodeBinaryLen) - if err != nil { - return nil, errors.Wrapf(err, "could not read a log entry (size=%d+%d)", msgLen, encodeBinaryLen) - } - d.nextMsgLen = 0 - - if err := d.proto.Unmarshal(d.buf[:msgLen]); err != nil { - return nil, errors.Wrapf(err, "error unmarshalling log entry (size=%d)", msgLen) - } - - msg := protoToMessage(d.proto) - if msg.PLogMetaData == nil || msg.PLogMetaData.Last { - msg.Line = append(msg.Line, '\n') - } - - return msg, nil -} diff --git a/vendor/github.com/docker/docker/daemon/logger/log_cache_opts.go b/vendor/github.com/docker/docker/daemon/logger/log_cache_opts.go deleted file mode 100644 index 8d09c489ed..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/log_cache_opts.go +++ /dev/null @@ -1,29 +0,0 @@ -package logger - -var externalValidators []LogOptValidator - -// RegisterExternalValidator adds the validator to the list of external validators. -// External validators are used by packages outside this package that need to add their own validation logic. -// This should only be called on package initialization. -func RegisterExternalValidator(v LogOptValidator) { - externalValidators = append(externalValidators, v) -} - -// AddBuiltinLogOpts updates the list of built-in log opts. This allows other packages to supplement additional log options -// without having to register an actual log driver. This is used by things that are more proxy log drivers and should -// not be exposed as a usable log driver to the API. -// This should only be called on package initialization. -func AddBuiltinLogOpts(opts map[string]bool) { - for k, v := range opts { - builtInLogOpts[k] = v - } -} - -func validateExternal(cfg map[string]string) error { - for _, v := range externalValidators { - if err := v(cfg); err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/docker/docker/daemon/logger/logger.go b/vendor/github.com/docker/docker/daemon/logger/logger.go deleted file mode 100644 index 868ac8b168..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/logger.go +++ /dev/null @@ -1,134 +0,0 @@ -// Package logger defines interfaces that logger drivers implement to -// log messages. -// -// The other half of a logger driver is the implementation of the -// factory, which holds the contextual instance information that -// allows multiple loggers of the same type to perform different -// actions, such as logging to different locations. -package logger // import "github.com/docker/docker/daemon/logger" - -import ( - "context" - "sync" - "time" - - "github.com/docker/docker/api/types/backend" -) - -// ErrReadLogsNotSupported is returned when the underlying log driver does not support reading -type ErrReadLogsNotSupported struct{} - -func (ErrReadLogsNotSupported) Error() string { - return "configured logging driver does not support reading" -} - -// NotImplemented makes this error implement the `NotImplemented` interface from api/errdefs -func (ErrReadLogsNotSupported) NotImplemented() {} - -const ( - logWatcherBufferSize = 4096 -) - -var messagePool = &sync.Pool{New: func() interface{} { return &Message{Line: make([]byte, 0, 256)} }} - -// NewMessage returns a new message from the message sync.Pool -func NewMessage() *Message { - return messagePool.Get().(*Message) -} - -// PutMessage puts the specified message back n the message pool. -// The message fields are reset before putting into the pool. -func PutMessage(msg *Message) { - msg.reset() - messagePool.Put(msg) -} - -// Message is data structure that represents piece of output produced by some -// container. The Line member is a slice of an array whose contents can be -// changed after a log driver's Log() method returns. -// -// Message is subtyped from backend.LogMessage because there is a lot of -// internal complexity around the Message type that should not be exposed -// to any package not explicitly importing the logger type. -type Message backend.LogMessage - -// reset sets the message back to default values -// This is used when putting a message back into the message pool. -func (m *Message) reset() { - *m = Message{Line: m.Line[:0]} -} - -// AsLogMessage returns a pointer to the message as a pointer to -// backend.LogMessage, which is an identical type with a different purpose -func (m *Message) AsLogMessage() *backend.LogMessage { - return (*backend.LogMessage)(m) -} - -// Logger is the interface for docker logging drivers. -type Logger interface { - Log(*Message) error - Name() string - Close() error -} - -// SizedLogger is the interface for logging drivers that can control -// the size of buffer used for their messages. -type SizedLogger interface { - Logger - BufSize() int -} - -// ReadConfig is the configuration passed into ReadLogs. -type ReadConfig struct { - Since time.Time - Until time.Time - Tail int - Follow bool -} - -// LogReader is the interface for reading log messages for loggers that support reading. -type LogReader interface { - // ReadLogs reads logs from underlying logging backend. - ReadLogs(context.Context, ReadConfig) *LogWatcher -} - -// LogWatcher is used when consuming logs read from the LogReader interface. -type LogWatcher struct { - // For sending log messages to a reader. - Msg chan *Message - // For sending error messages that occur while reading logs. - Err chan error - consumerOnce sync.Once - consumerGone chan struct{} -} - -// NewLogWatcher returns a new LogWatcher. -func NewLogWatcher() *LogWatcher { - return &LogWatcher{ - Msg: make(chan *Message, logWatcherBufferSize), - Err: make(chan error, 1), - consumerGone: make(chan struct{}), - } -} - -// ConsumerGone notifies that the logs consumer is gone. -func (w *LogWatcher) ConsumerGone() { - // only close if not already closed - w.consumerOnce.Do(func() { - close(w.consumerGone) - }) -} - -// WatchConsumerGone returns a channel receiver that receives notification -// when the log watcher consumer is gone. -func (w *LogWatcher) WatchConsumerGone() <-chan struct{} { - return w.consumerGone -} - -// Capability defines the list of capabilities that a driver can implement -// These capabilities are not required to be a logging driver, however do -// determine how a logging driver can be used -type Capability struct { - // Determines if a log driver can read back logs - ReadLogs bool -} diff --git a/vendor/github.com/docker/docker/daemon/logger/logger_error.go b/vendor/github.com/docker/docker/daemon/logger/logger_error.go deleted file mode 100644 index d36c920216..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/logger_error.go +++ /dev/null @@ -1,27 +0,0 @@ -package logger - -import ( - "context" - - "github.com/containerd/log" - "golang.org/x/time/rate" -) - -// Rates based on journald defaults of 10,000 messages in 30s. -// reference: https://www.freedesktop.org/software/systemd/man/journald.conf.html#RateLimitIntervalSec= -var logErrorLimiter = rate.NewLimiter(333, 333) - -// logDriverError logs errors produced by log drivers to the daemon logs. It also increments the logWritesFailedCount -// metric. -// Logging to the daemon logs is limited to 333 operations per second at most. If this limit is exceeded, the -// logWritesFailedCount is still counted, but logging to the daemon logs is omitted in order to prevent disk saturation. -func logDriverError(loggerName, msgLine string, logErr error) { - logWritesFailedCount.Inc(1) - if logErrorLimiter.Allow() { - log.G(context.TODO()).WithFields(log.Fields{ - "error": logErr, - "driver": loggerName, - "message": msgLine, - }).Error("Error writing log message") - } -} diff --git a/vendor/github.com/docker/docker/daemon/logger/loggerutils/cache/local_cache.go b/vendor/github.com/docker/docker/daemon/logger/loggerutils/cache/local_cache.go deleted file mode 100644 index 8688740713..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/loggerutils/cache/local_cache.go +++ /dev/null @@ -1,124 +0,0 @@ -package cache // import "github.com/docker/docker/daemon/logger/loggerutils/cache" - -import ( - "context" - "strconv" - - "github.com/containerd/log" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/daemon/logger" - "github.com/docker/docker/daemon/logger/local" - "github.com/docker/go-units" - "github.com/pkg/errors" -) - -const ( - // DriverName is the name of the driver used for local log caching - DriverName = local.Name - - cachePrefix = "cache-" - cacheDisabledKey = cachePrefix + "disabled" -) - -var builtInCacheLogOpts = map[string]bool{ - cacheDisabledKey: true, -} - -var _ logger.LogReader = (*loggerWithCache)(nil) - -// WithLocalCache wraps the passed in logger with a logger caches all writes locally -// in addition to writing to the passed in logger. -func WithLocalCache(l logger.Logger, info logger.Info) (logger.Logger, error) { - initLogger, err := logger.GetLogDriver(DriverName) - if err != nil { - return nil, err - } - - cacher, err := initLogger(info) - if err != nil { - return nil, errors.Wrap(err, "error initializing local log cache driver") - } - - if container.LogMode(info.Config["mode"]) == container.LogModeUnset || container.LogMode(info.Config["mode"]) == container.LogModeNonBlock { - var size int64 = -1 - if s, exists := info.Config["max-buffer-size"]; exists { - size, err = units.RAMInBytes(s) - if err != nil { - return nil, err - } - } - cacher = logger.NewRingLogger(cacher, info, size) - } - - return &loggerWithCache{ - l: l, - cache: cacher, - }, nil -} - -type loggerWithCache struct { - l logger.Logger - cache logger.Logger -} - -var _ logger.SizedLogger = &loggerWithCache{} - -// BufSize returns the buffer size of the underlying logger. -// Returns -1 if the logger doesn't match SizedLogger interface. -func (l *loggerWithCache) BufSize() int { - if sl, ok := l.l.(logger.SizedLogger); ok { - return sl.BufSize() - } - return -1 -} - -func (l *loggerWithCache) Log(msg *logger.Message) error { - // copy the message as the original will be reset once the call to `Log` is complete - dup := logger.NewMessage() - dumbCopyMessage(dup, msg) - - if err := l.l.Log(msg); err != nil { - return err - } - return l.cache.Log(dup) -} - -func (l *loggerWithCache) Name() string { - return l.l.Name() -} - -func (l *loggerWithCache) ReadLogs(ctx context.Context, config logger.ReadConfig) *logger.LogWatcher { - return l.cache.(logger.LogReader).ReadLogs(ctx, config) -} - -func (l *loggerWithCache) Close() error { - err := l.l.Close() - if err := l.cache.Close(); err != nil { - log.G(context.TODO()).WithError(err).Warn("error while shutting cache logger") - } - return err -} - -// ShouldUseCache reads the log opts to determine if caching should be enabled -func ShouldUseCache(cfg map[string]string) bool { - if cfg[cacheDisabledKey] == "" { - return true - } - b, err := strconv.ParseBool(cfg[cacheDisabledKey]) - if err != nil { - // This shouldn't happen since the values are validated before hand. - return false - } - return !b -} - -// dumbCopyMessage is a bit of a fake copy but avoids extra allocations which -// are not necessary for this use case. -func dumbCopyMessage(dst, src *logger.Message) { - dst.Source = src.Source - dst.Timestamp = src.Timestamp - dst.PLogMetaData = src.PLogMetaData - dst.Err = src.Err - dst.Attrs = src.Attrs - dst.Line = append(dst.Line[:0], src.Line...) -} diff --git a/vendor/github.com/docker/docker/daemon/logger/loggerutils/cache/validate.go b/vendor/github.com/docker/docker/daemon/logger/loggerutils/cache/validate.go deleted file mode 100644 index 70bd8810d0..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/loggerutils/cache/validate.go +++ /dev/null @@ -1,40 +0,0 @@ -package cache - -import ( - "strconv" - - "github.com/docker/docker/daemon/logger" - "github.com/docker/docker/daemon/logger/local" - "github.com/pkg/errors" -) - -func init() { - for k, v := range local.LogOptKeys { - builtInCacheLogOpts[cachePrefix+k] = v - } - logger.AddBuiltinLogOpts(builtInCacheLogOpts) - logger.RegisterExternalValidator(validateLogCacheOpts) -} - -func validateLogCacheOpts(cfg map[string]string) error { - if v := cfg[cacheDisabledKey]; v != "" { - _, err := strconv.ParseBool(v) - if err != nil { - return errors.Errorf("invalid value for option %s: %s", cacheDisabledKey, cfg[cacheDisabledKey]) - } - } - return nil -} - -// MergeDefaultLogConfig reads the default log opts and makes sure that any caching related keys that exist there are -// added to dst. -func MergeDefaultLogConfig(dst, defaults map[string]string) { - for k, v := range defaults { - if !builtInCacheLogOpts[k] { - continue - } - if _, exists := dst[k]; !exists { - dst[k] = v - } - } -} diff --git a/vendor/github.com/docker/docker/daemon/logger/loggerutils/file_unix.go b/vendor/github.com/docker/docker/daemon/logger/loggerutils/file_unix.go deleted file mode 100644 index f505691c4d..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/loggerutils/file_unix.go +++ /dev/null @@ -1,17 +0,0 @@ -//go:build !windows - -package loggerutils - -import "os" - -func openFile(name string, flag int, perm os.FileMode) (*os.File, error) { - return os.OpenFile(name, flag, perm) -} - -func open(name string) (*os.File, error) { - return os.Open(name) -} - -func unlink(name string) error { - return os.Remove(name) -} diff --git a/vendor/github.com/docker/docker/daemon/logger/loggerutils/file_windows.go b/vendor/github.com/docker/docker/daemon/logger/loggerutils/file_windows.go deleted file mode 100644 index d2989252aa..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/loggerutils/file_windows.go +++ /dev/null @@ -1,252 +0,0 @@ -package loggerutils - -import ( - "os" - "path/filepath" - "syscall" - "unsafe" -) - -func open(name string) (*os.File, error) { - return openFile(name, os.O_RDONLY, 0) -} - -func openFile(name string, flag int, perm os.FileMode) (*os.File, error) { - if name == "" { - return nil, &os.PathError{Op: "open", Path: name, Err: syscall.ENOENT} - } - h, err := syscallOpen(fixLongPath(name), flag|syscall.O_CLOEXEC, syscallMode(perm)) - if err != nil { - return nil, &os.PathError{Op: "open", Path: name, Err: err} - } - return os.NewFile(uintptr(h), name), nil -} - -// syscallOpen is copied from syscall.Open but is modified to -// always open a file with FILE_SHARE_DELETE -func syscallOpen(path string, mode int, perm uint32) (fd syscall.Handle, err error) { - if len(path) == 0 { - return syscall.InvalidHandle, syscall.ERROR_FILE_NOT_FOUND - } - - pathp, err := syscall.UTF16PtrFromString(path) - if err != nil { - return syscall.InvalidHandle, err - } - var access uint32 - switch mode & (syscall.O_RDONLY | syscall.O_WRONLY | syscall.O_RDWR) { - case syscall.O_RDONLY: - access = syscall.GENERIC_READ - case syscall.O_WRONLY: - access = syscall.GENERIC_WRITE - case syscall.O_RDWR: - access = syscall.GENERIC_READ | syscall.GENERIC_WRITE - } - if mode&syscall.O_CREAT != 0 { - access |= syscall.GENERIC_WRITE - } - if mode&syscall.O_APPEND != 0 { - access &^= syscall.GENERIC_WRITE - access |= syscall.FILE_APPEND_DATA - } - sharemode := uint32(syscall.FILE_SHARE_READ | syscall.FILE_SHARE_WRITE | syscall.FILE_SHARE_DELETE) - var sa *syscall.SecurityAttributes - if mode&syscall.O_CLOEXEC == 0 { - sa = makeInheritSa() - } - var createmode uint32 - switch { - case mode&(syscall.O_CREAT|syscall.O_EXCL) == (syscall.O_CREAT | syscall.O_EXCL): - createmode = syscall.CREATE_NEW - case mode&(syscall.O_CREAT|syscall.O_TRUNC) == (syscall.O_CREAT | syscall.O_TRUNC): - createmode = syscall.CREATE_ALWAYS - case mode&syscall.O_CREAT == syscall.O_CREAT: - createmode = syscall.OPEN_ALWAYS - case mode&syscall.O_TRUNC == syscall.O_TRUNC: - createmode = syscall.TRUNCATE_EXISTING - default: - createmode = syscall.OPEN_EXISTING - } - h, e := syscall.CreateFile(pathp, access, sharemode, sa, createmode, syscall.FILE_ATTRIBUTE_NORMAL, 0) - return h, e -} - -func makeInheritSa() *syscall.SecurityAttributes { - var sa syscall.SecurityAttributes - sa.Length = uint32(unsafe.Sizeof(sa)) - sa.InheritHandle = 1 - return &sa -} - -// fixLongPath returns the extended-length (\\?\-prefixed) form of -// path when needed, in order to avoid the default 260 character file -// path limit imposed by Windows. If path is not easily converted to -// the extended-length form (for example, if path is a relative path -// or contains .. elements), or is short enough, fixLongPath returns -// path unmodified. -// -// See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath -// -// Copied from os.OpenFile -func fixLongPath(path string) string { - // Do nothing (and don't allocate) if the path is "short". - // Empirically (at least on the Windows Server 2013 builder), - // the kernel is arbitrarily okay with < 248 bytes. That - // matches what the docs above say: - // "When using an API to create a directory, the specified - // path cannot be so long that you cannot append an 8.3 file - // name (that is, the directory name cannot exceed MAX_PATH - // minus 12)." Since MAX_PATH is 260, 260 - 12 = 248. - // - // The MSDN docs appear to say that a normal path that is 248 bytes long - // will work; empirically the path must be less then 248 bytes long. - if len(path) < 248 { - // Don't fix. (This is how Go 1.7 and earlier worked, - // not automatically generating the \\?\ form) - return path - } - - // The extended form begins with \\?\, as in - // \\?\c:\windows\foo.txt or \\?\UNC\server\share\foo.txt. - // The extended form disables evaluation of . and .. path - // elements and disables the interpretation of / as equivalent - // to \. The conversion here rewrites / to \ and elides - // . elements as well as trailing or duplicate separators. For - // simplicity it avoids the conversion entirely for relative - // paths or paths containing .. elements. For now, - // \\server\share paths are not converted to - // \\?\UNC\server\share paths because the rules for doing so - // are less well-specified. - if len(path) >= 2 && path[:2] == `\\` { - // Don't canonicalize UNC paths. - return path - } - if !isAbs(path) { - // Relative path - return path - } - - const prefix = `\\?` - - pathbuf := make([]byte, len(prefix)+len(path)+len(`\`)) - copy(pathbuf, prefix) - n := len(path) - r, w := 0, len(prefix) - for r < n { - switch { - case os.IsPathSeparator(path[r]): - // empty block - r++ - case path[r] == '.' && (r+1 == n || os.IsPathSeparator(path[r+1])): - // /./ - r++ - case r+1 < n && path[r] == '.' && path[r+1] == '.' && (r+2 == n || os.IsPathSeparator(path[r+2])): - // /../ is currently unhandled - return path - default: - pathbuf[w] = '\\' - w++ - for ; r < n && !os.IsPathSeparator(path[r]); r++ { - pathbuf[w] = path[r] - w++ - } - } - } - // A drive's root directory needs a trailing \ - if w == len(`\\?\c:`) { - pathbuf[w] = '\\' - w++ - } - return string(pathbuf[:w]) -} - -// copied from os package for os.OpenFile -func syscallMode(i os.FileMode) (o uint32) { - o |= uint32(i.Perm()) - if i&os.ModeSetuid != 0 { - o |= syscall.S_ISUID - } - if i&os.ModeSetgid != 0 { - o |= syscall.S_ISGID - } - if i&os.ModeSticky != 0 { - o |= syscall.S_ISVTX - } - // No mapping for Go's ModeTemporary (plan9 only). - return -} - -func isAbs(path string) (b bool) { - v := volumeName(path) - if v == "" { - return false - } - path = path[len(v):] - if path == "" { - return false - } - return os.IsPathSeparator(path[0]) -} - -func volumeName(path string) (v string) { - if len(path) < 2 { - return "" - } - // with drive letter - c := path[0] - if path[1] == ':' && - ('0' <= c && c <= '9' || 'a' <= c && c <= 'z' || - 'A' <= c && c <= 'Z') { - return path[:2] - } - // is it UNC - if l := len(path); l >= 5 && os.IsPathSeparator(path[0]) && os.IsPathSeparator(path[1]) && - !os.IsPathSeparator(path[2]) && path[2] != '.' { - // first, leading `\\` and next shouldn't be `\`. its server name. - for n := 3; n < l-1; n++ { - // second, next '\' shouldn't be repeated. - if os.IsPathSeparator(path[n]) { - n++ - // third, following something characters. its share name. - if !os.IsPathSeparator(path[n]) { - if path[n] == '.' { - break - } - for ; n < l; n++ { - if os.IsPathSeparator(path[n]) { - break - } - } - return path[:n] - } - break - } - } - } - return "" -} - -func unlink(name string) error { - // Rename the file before deleting it so that the original name is freed - // up to be reused, even while there are still open FILE_SHARE_DELETE - // file handles. Emulate POSIX unlink() semantics, essentially. - name, err := filepath.Abs(name) - if err != nil { - return err - } - dir, fname := filepath.Split(name) - f, err := os.CreateTemp(dir, fname+".*.deleted") - if err != nil { - return err - } - tmpname := f.Name() - if err := f.Close(); err != nil { - return err - } - err = os.Rename(name, tmpname) - rmErr := os.Remove(tmpname) - if err != nil { - return err - } - return rmErr -} diff --git a/vendor/github.com/docker/docker/daemon/logger/loggerutils/follow.go b/vendor/github.com/docker/docker/daemon/logger/loggerutils/follow.go deleted file mode 100644 index 7a6b8e50f0..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/loggerutils/follow.go +++ /dev/null @@ -1,143 +0,0 @@ -package loggerutils // import "github.com/docker/docker/daemon/logger/loggerutils" - -import ( - "context" - "fmt" - "io" - "os" - - "github.com/containerd/log" - "github.com/docker/docker/daemon/logger" - "github.com/pkg/errors" -) - -type follow struct { - LogFile *LogFile - Watcher *logger.LogWatcher - Decoder Decoder - Forwarder *forwarder - - log *log.Entry - c chan logPos -} - -// Do follows the log file as it is written, starting from f at read. -func (fl *follow) Do(ctx context.Context, f *os.File, read logPos) { - fl.log = log.G(ctx).WithFields(log.Fields{ - "module": "logger", - "file": f.Name(), - }) - // Optimization: allocate the write-notifications channel only once and - // reuse it for multiple invocations of nextPos(). - fl.c = make(chan logPos, 1) - - defer func() { - if err := f.Close(); err != nil && !errors.Is(err, os.ErrClosed) { - fl.log.WithError(err).Warn("error closing current log file") - } - }() - - for { - wrote, ok := fl.nextPos(ctx, read) - if !ok { - return - } - - if wrote.rotation != read.rotation { - // Flush the current file before moving on to the next. - if _, err := f.Seek(read.size, io.SeekStart); err != nil { - fl.Watcher.Err <- err - return - } - if !fl.forward(ctx, f) { - return - } - - // Open the new file, which has the same name as the old - // file thanks to file rotation. Make no mistake: they - // are different files, with distinct identities. - // Atomically capture the wrote position to make - // absolutely sure that the position corresponds to the - // file we have opened; more rotations could have - // occurred since we previously received it. - if err := f.Close(); err != nil { - fl.log.WithError(err).Warn("error closing rotated log file") - } - var err error - func() { - fl.LogFile.fsopMu.RLock() - st := <-fl.LogFile.read - defer func() { - fl.LogFile.read <- st - fl.LogFile.fsopMu.RUnlock() - }() - f, err = open(f.Name()) - wrote = st.pos - }() - // We tried to open the file inside a critical section - // so we shouldn't have been racing the rotation of the - // file. Any error, even fs.ErrNotFound, is exceptional. - if err != nil { - fl.Watcher.Err <- fmt.Errorf("logger: error opening log file for follow after rotation: %w", err) - return - } - - if nrot := wrote.rotation - read.rotation; nrot > 1 { - fl.log.WithField("missed-rotations", nrot). - Warn("file rotations were missed while following logs; some log messages have been skipped over") - } - - // Set up our read position to start from the top of the file. - read.size = 0 - } - - if !fl.forward(ctx, io.NewSectionReader(f, read.size, wrote.size-read.size)) { - return - } - read = wrote - } -} - -// nextPos waits until the write position of the LogFile being followed has -// advanced from current and returns the new position. -func (fl *follow) nextPos(ctx context.Context, current logPos) (next logPos, ok bool) { - var st logReadState - select { - case <-ctx.Done(): - return current, false - case <-fl.Watcher.WatchConsumerGone(): - return current, false - case st = <-fl.LogFile.read: - } - - // Have any logs been written since we last checked? - if st.pos == current { // Nope. - // Add ourself to the notify list. - st.wait = append(st.wait, fl.c) - } else { // Yes. - // "Notify" ourself immediately. - fl.c <- st.pos - } - fl.LogFile.read <- st - - select { - case <-fl.LogFile.closed: // No more logs will be written. - select { // Have we followed to the end? - case next = <-fl.c: // No: received a new position. - default: // Yes. - return current, false - } - case <-fl.Watcher.WatchConsumerGone(): - return current, false - case next = <-fl.c: - } - return next, true -} - -// forward decodes log messages from r and forwards them to the log watcher. -// -// The return value, cont, signals whether following should continue. -func (fl *follow) forward(ctx context.Context, r io.Reader) (cont bool) { - fl.Decoder.Reset(r) - return fl.Forwarder.Do(ctx, fl.Watcher, fl.Decoder.Decode) -} diff --git a/vendor/github.com/docker/docker/daemon/logger/loggerutils/log_tag.go b/vendor/github.com/docker/docker/daemon/logger/loggerutils/log_tag.go deleted file mode 100644 index 719512dbdb..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/loggerutils/log_tag.go +++ /dev/null @@ -1,31 +0,0 @@ -package loggerutils // import "github.com/docker/docker/daemon/logger/loggerutils" - -import ( - "bytes" - - "github.com/docker/docker/daemon/logger" - "github.com/docker/docker/daemon/logger/templates" -) - -// DefaultTemplate defines the defaults template logger should use. -const DefaultTemplate = "{{.ID}}" - -// ParseLogTag generates a context aware tag for consistency across different -// log drivers based on the context of the running container. -func ParseLogTag(info logger.Info, defaultTemplate string) (string, error) { - tagTemplate := info.Config["tag"] - if tagTemplate == "" { - tagTemplate = defaultTemplate - } - - tmpl, err := templates.NewParse("log-tag", tagTemplate) - if err != nil { - return "", err - } - buf := new(bytes.Buffer) - if err := tmpl.Execute(buf, &info); err != nil { - return "", err - } - - return buf.String(), nil -} diff --git a/vendor/github.com/docker/docker/daemon/logger/loggerutils/logfile.go b/vendor/github.com/docker/docker/daemon/logger/loggerutils/logfile.go deleted file mode 100644 index d6f3f38377..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/loggerutils/logfile.go +++ /dev/null @@ -1,914 +0,0 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.23 - -package loggerutils // import "github.com/docker/docker/daemon/logger/loggerutils" - -import ( - "compress/gzip" - "context" - "encoding/json" - "fmt" - "io" - "io/fs" - "math" - "os" - "slices" - "strconv" - "sync" - "time" - - "github.com/containerd/containerd/v2/pkg/tracing" - "github.com/containerd/log" - "github.com/docker/docker/daemon/logger" - "github.com/docker/docker/pkg/pools" - "github.com/pkg/errors" - "go.opentelemetry.io/otel/attribute" -) - -// rotateFileMetadata is a metadata of the gzip header of the compressed log file -type rotateFileMetadata struct { - LastTime time.Time `json:"lastTime,omitempty"` -} - -// LogFile is Logger implementation for default Docker logging. -type LogFile struct { - mu sync.Mutex // protects the logfile access - closed chan struct{} - rotateMu sync.Mutex // blocks the next rotation until the current rotation is completed - // Lock out readers while performing a non-atomic sequence of filesystem - // operations (RLock: open, Lock: rename, delete). - // - // fsopMu should be locked for writing only while holding rotateMu. - fsopMu sync.RWMutex - - // Logger configuration - - capacity int64 // maximum size of each file - maxFiles int // maximum number of files - compress bool // whether old versions of log files are compressed - perms os.FileMode - - // Log file codec - - createDecoder MakeDecoderFn - getTailReader GetTailReaderFunc - - // Log reader state in a 1-buffered channel. - // - // Share memory by communicating: receive to acquire, send to release. - // The state struct is passed around by value so that use-after-send - // bugs cannot escalate to data races. - // - // A method which receives the state value takes ownership of it. The - // owner is responsible for either passing ownership along or sending - // the state back to the channel. By convention, the semantics of - // passing along ownership is expressed with function argument types. - // Methods which take a pointer *logReadState argument borrow the state, - // analogous to functions which require a lock to be held when calling. - // The caller retains ownership. Calling a method which takes a - // value logFileState argument gives ownership to the callee. - read chan logReadState - - decompress *sharedTempFileConverter - - pos logPos // Current log file write position. - f *os.File // Current log file for writing. - lastTimestamp time.Time // timestamp of the last log -} - -type logPos struct { - // Size of the current file. - size int64 - // File rotation sequence number (modulo 2**16). - rotation uint16 -} - -type logReadState struct { - // Current log file position. - pos logPos - // Wait list to be notified of the value of pos next time it changes. - wait []chan<- logPos -} - -// MakeDecoderFn creates a decoder -type MakeDecoderFn func(rdr io.Reader) Decoder - -// Decoder is for reading logs -// It is created by the log reader by calling the `MakeDecoderFunc` -type Decoder interface { - // Reset resets the decoder - // Reset is called for certain events, such as log rotations - Reset(io.Reader) - // Decode decodes the next log message from the stream - Decode() (*logger.Message, error) - // Close signals to the decoder that it can release whatever resources it was using. - Close() -} - -// SizeReaderAt defines a ReaderAt that also reports its size. -// This is used for tailing log files. -type SizeReaderAt interface { - io.Reader - io.ReaderAt - Size() int64 -} - -// GetTailReaderFunc is used to truncate a reader to only read as much as is required -// in order to get the passed in number of log lines. -// It returns the sectioned reader, the number of lines that the section reader -// contains, and any error that occurs. -type GetTailReaderFunc func(ctx context.Context, f SizeReaderAt, nLogLines int) (rdr SizeReaderAt, nLines int, err error) - -// NewLogFile creates new LogFile -func NewLogFile(logPath string, capacity int64, maxFiles int, compress bool, decodeFunc MakeDecoderFn, perms os.FileMode, getTailReader GetTailReaderFunc) (*LogFile, error) { - log, err := openFile(logPath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, perms) - if err != nil { - return nil, err - } - - size, err := log.Seek(0, io.SeekEnd) - if err != nil { - return nil, err - } - - pos := logPos{ - size: size, - // Force a wraparound on first rotation to shake out any - // modular-arithmetic bugs. - rotation: math.MaxUint16, - } - st := make(chan logReadState, 1) - st <- logReadState{pos: pos} - - return &LogFile{ - f: log, - read: st, - pos: pos, - closed: make(chan struct{}), - capacity: capacity, - maxFiles: maxFiles, - compress: compress, - decompress: newSharedTempFileConverter(decompress), - createDecoder: decodeFunc, - perms: perms, - getTailReader: getTailReader, - }, nil -} - -// WriteLogEntry writes the provided log message to the current log file. -// This may trigger a rotation event if the max file/capacity limits are hit. -func (w *LogFile) WriteLogEntry(timestamp time.Time, marshalled []byte) error { - select { - case <-w.closed: - return errors.New("cannot write because the output file was closed") - default: - } - w.mu.Lock() - defer w.mu.Unlock() - - // Are we due for a rotation? - if w.capacity != -1 && w.pos.size >= w.capacity { - if err := w.rotate(); err != nil { - return errors.Wrap(err, "error rotating log file") - } - } - - n, err := w.f.Write(marshalled) - if err != nil { - return errors.Wrap(err, "error writing log entry") - } - w.pos.size += int64(n) - w.lastTimestamp = timestamp - - // Notify any waiting readers that there is a new log entry to read. - st := <-w.read - defer func() { w.read <- st }() - st.pos = w.pos - - for _, c := range st.wait { - c <- st.pos - } - // Optimization: retain the backing array to save a heap allocation next - // time a reader appends to the list. - if st.wait != nil { - st.wait = st.wait[:0] - } - return nil -} - -func (w *LogFile) rotate() (retErr error) { - w.rotateMu.Lock() - noCompress := w.maxFiles <= 1 || !w.compress - defer func() { - // If we aren't going to run the goroutine to compress the log file, then we need to unlock in this function. - // Otherwise the lock will be released in the goroutine that handles compression. - if retErr != nil || noCompress { - w.rotateMu.Unlock() - } - }() - - fname := w.f.Name() - if err := w.f.Close(); err != nil { - // if there was an error during a prior rotate, the file could already be closed - if !errors.Is(err, fs.ErrClosed) { - return errors.Wrap(err, "error closing file") - } - } - - file, err := func() (*os.File, error) { - w.fsopMu.Lock() - defer w.fsopMu.Unlock() - - if err := rotate(fname, w.maxFiles, w.compress); err != nil { - log.G(context.TODO()).WithError(err).Warn("Error rotating log file, log data may have been lost") - } else { - // We may have readers working their way through the - // current log file so we can't truncate it. We need to - // start writing new logs to an empty file with the same - // name as the current one so we need to rotate the - // current file out of the way. - if w.maxFiles < 2 { - if err := unlink(fname); err != nil && !errors.Is(err, fs.ErrNotExist) { - log.G(context.TODO()).WithError(err).Error("Error unlinking current log file") - } - } else { - if err := os.Rename(fname, fname+".1"); err != nil && !errors.Is(err, fs.ErrNotExist) { - log.G(context.TODO()).WithError(err).Error("Error renaming current log file") - } - } - } - - // Notwithstanding the above, open with the truncate flag anyway - // in case rotation didn't work out as planned. - return openFile(fname, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, w.perms) - }() - if err != nil { - return err - } - w.f = file - w.pos = logPos{rotation: w.pos.rotation + 1} - - if noCompress { - return nil - } - - ts := w.lastTimestamp - go func() { - defer w.rotateMu.Unlock() - // No need to hold fsopMu as at no point will the filesystem be - // in a state which would cause problems for readers. Opening - // the uncompressed file is tried first, falling back to the - // compressed one. compressFile only deletes the uncompressed - // file once the compressed one is fully written out, so at no - // point during the compression process will a reader fail to - // open a complete copy of the file. - if err := compressFile(fname+".1", ts); err != nil { - log.G(context.TODO()).WithError(err).Error("Error compressing log file after rotation") - } - }() - - return nil -} - -func rotate(name string, maxFiles int, compress bool) error { - if maxFiles < 2 { - return nil - } - - var extension string - if compress { - extension = ".gz" - } - - lastFile := fmt.Sprintf("%s.%d%s", name, maxFiles-1, extension) - err := unlink(lastFile) - if err != nil && !errors.Is(err, fs.ErrNotExist) { - return errors.Wrap(err, "error removing oldest log file") - } - - for i := maxFiles - 1; i > 1; i-- { - toPath := name + "." + strconv.Itoa(i) + extension - fromPath := name + "." + strconv.Itoa(i-1) + extension - err := os.Rename(fromPath, toPath) - log.G(context.TODO()).WithError(err).WithField("source", fromPath).WithField("target", toPath).Trace("Rotating log file") - if err != nil && !errors.Is(err, fs.ErrNotExist) { - return err - } - } - - return nil -} - -func compressFile(fileName string, lastTimestamp time.Time) (retErr error) { - file, err := open(fileName) - if err != nil { - if errors.Is(err, fs.ErrNotExist) { - log.G(context.TODO()).WithField("file", fileName).WithError(err).Debug("Could not open log file to compress") - return nil - } - return errors.Wrap(err, "failed to open log file") - } - defer func() { - file.Close() - if retErr == nil { - err := unlink(fileName) - if err != nil && !errors.Is(err, fs.ErrNotExist) { - retErr = errors.Wrap(err, "failed to remove source log file") - } - } - }() - - outFile, err := openFile(fileName+".gz", os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0o640) - if err != nil { - return errors.Wrap(err, "failed to open or create gzip log file") - } - defer func() { - outFile.Close() - if retErr != nil { - if err := unlink(fileName + ".gz"); err != nil && !errors.Is(err, fs.ErrNotExist) { - log.G(context.TODO()).WithError(err).Error("Error cleaning up after failed log compression") - } - } - }() - - compressWriter := gzip.NewWriter(outFile) - defer compressWriter.Close() - - // Add the last log entry timestamp to the gzip header - extra := rotateFileMetadata{} - extra.LastTime = lastTimestamp - compressWriter.Header.Extra, err = json.Marshal(&extra) - if err != nil { - // Here log the error only and don't return since this is just an optimization. - log.G(context.TODO()).Warningf("Failed to marshal gzip header as JSON: %v", err) - } - - _, err = pools.Copy(compressWriter, file) - if err != nil { - return errors.Wrapf(err, "error compressing log file %s", fileName) - } - - return nil -} - -// MaxFiles return maximum number of files -func (w *LogFile) MaxFiles() int { - return w.maxFiles -} - -// Close closes underlying file and signals all readers to stop. -func (w *LogFile) Close() error { - w.mu.Lock() - defer w.mu.Unlock() - select { - case <-w.closed: - return nil - default: - } - if err := w.f.Close(); err != nil && !errors.Is(err, fs.ErrClosed) { - return err - } - close(w.closed) - // Wait until any in-progress rotation is complete. - w.rotateMu.Lock() - w.rotateMu.Unlock() //nolint:staticcheck - return nil -} - -// ReadLogs decodes entries from log files. -// -// It is the caller's responsibility to call ConsumerGone on the LogWatcher. -func (w *LogFile) ReadLogs(ctx context.Context, config logger.ReadConfig) *logger.LogWatcher { - ctx, span := tracing.StartSpan(ctx, "logger.LogFile.ReadLogs") - defer span.End() - - span.SetAttributes(tracing.Attribute("config", config)) - - watcher := logger.NewLogWatcher() - // Lock out filesystem operations so that we can capture the read - // position and atomically open the corresponding log file, without the - // file getting rotated out from under us. - w.fsopMu.RLock() - // Capture the read position synchronously to ensure that we start - // following from the last entry logged before ReadLogs was called, - // which is required for flake-free unit testing. - st := <-w.read - pos := st.pos - w.read <- st - go w.readLogsLocked(ctx, pos, config, watcher) - return watcher -} - -// tailFiles must be called with w.fsopMu locked for reads. -// w.fsopMu.RUnlock() is called before returning. -func (w *LogFile) tailFiles(ctx context.Context, config logger.ReadConfig, watcher *logger.LogWatcher, current SizeReaderAt, dec Decoder, fwd *forwarder) (cont bool) { - if config.Tail == 0 { - w.fsopMu.RUnlock() - return true - } - - ctx, span := tracing.StartSpan(ctx, "logger.Logfile.TailLogs") - defer func() { - span.SetAttributes(attribute.Bool("continue", cont)) - span.End() - }() - - files, err := w.openRotatedFiles(ctx, config) - w.fsopMu.RUnlock() - - if err != nil { - // TODO: Should we allow this to continue (as in set `cont=true`) and not error out the log stream? - err = errors.Wrap(err, "error opening rotated log files") - span.SetStatus(err) - watcher.Err <- err - return false - } - - if current.Size() > 0 { - files = append(files, &sizeReaderAtOpener{current, "current"}) - } - - return tailFiles(ctx, files, watcher, dec, w.getTailReader, config.Tail, fwd) -} - -type sizeReaderAtOpener struct { - SizeReaderAt - ref string -} - -func (o *sizeReaderAtOpener) ReaderAt(context.Context) (sizeReaderAtCloser, error) { - return &sizeReaderAtWithCloser{o, nil}, nil -} - -func (o *sizeReaderAtOpener) Close() {} - -func (o *sizeReaderAtOpener) Ref() string { - return o.ref -} - -type sizeReaderAtWithCloser struct { - SizeReaderAt - close func() error -} - -func (r *sizeReaderAtWithCloser) ReadAt(p []byte, offset int64) (int, error) { - if r.SizeReaderAt == nil { - return 0, io.EOF - } - return r.SizeReaderAt.ReadAt(p, offset) -} - -func (r *sizeReaderAtWithCloser) Read(p []byte) (int, error) { - if r.SizeReaderAt == nil { - return 0, io.EOF - } - return r.SizeReaderAt.Read(p) -} - -func (r *sizeReaderAtWithCloser) Size() int64 { - if r.SizeReaderAt == nil { - return 0 - } - return r.SizeReaderAt.Size() -} - -func (r *sizeReaderAtWithCloser) Close() error { - if r.close != nil { - return r.close() - } - return nil -} - -// readLogsLocked is the bulk of the implementation of ReadLogs. -// -// w.fsopMu must be locked for reading when calling this method. -// w.fsopMu.RUnlock() is called before returning. -func (w *LogFile) readLogsLocked(ctx context.Context, currentPos logPos, config logger.ReadConfig, watcher *logger.LogWatcher) { - ctx, span := tracing.StartSpan(ctx, "logger.Logfile.ReadLogsLocked") - defer span.End() - - defer close(watcher.Msg) - - currentFile, err := open(w.f.Name()) - if err != nil { - w.fsopMu.RUnlock() - span.SetStatus(err) - watcher.Err <- err - return - } - defer currentFile.Close() - - dec := w.createDecoder(nil) - defer dec.Close() - - fwd := newForwarder(config) - - // At this point, w.tailFiles is responsible for unlocking w.fsopmu - ok := w.tailFiles(ctx, config, watcher, io.NewSectionReader(currentFile, 0, currentPos.size), dec, fwd) - - if !ok { - return - } - - if !config.Follow { - return - } - - (&follow{ - LogFile: w, - Watcher: watcher, - Decoder: dec, - Forwarder: fwd, - }).Do(ctx, currentFile, currentPos) -} - -type fileOpener interface { - ReaderAt(context.Context) (ra sizeReaderAtCloser, err error) - Close() - Ref() string -} - -// simpleFileOpener just holds a reference to an already open file -type simpleFileOpener struct { - f *os.File - sz int64 - closed bool -} - -func (o *simpleFileOpener) ReaderAt(context.Context) (sizeReaderAtCloser, error) { - if o.closed { - return nil, errors.New("file is closed") - } - - if o.sz == 0 { - stat, err := o.f.Stat() - if err != nil { - return nil, errors.Wrap(err, "error stating file") - } - o.sz = stat.Size() - } - return &sizeReaderAtWithCloser{io.NewSectionReader(o.f, 0, o.sz), nil}, nil -} - -func (o *simpleFileOpener) Ref() string { - return o.f.Name() -} - -func (o *simpleFileOpener) Close() { - _ = o.f.Close() - o.closed = true -} - -// converter function used by shareTempFileConverter -func decompress(dst io.WriteSeeker, src io.ReadSeeker) error { - if _, err := src.Seek(0, io.SeekStart); err != nil { - return err - } - rc, err := gzip.NewReader(src) - if err != nil { - return err - } - _, err = pools.Copy(dst, rc) - if err != nil { - return err - } - return rc.Close() -} - -// compressedFileOpener holds a reference to compressed a log file and will -// lazily open a decompressed version of the file. -type compressedFileOpener struct { - closed bool - - f *os.File - - lf *LogFile - ifBefore time.Time -} - -func (cfo *compressedFileOpener) ReaderAt(ctx context.Context) (_ sizeReaderAtCloser, retErr error) { - _, span := tracing.StartSpan(ctx, "logger.Logfile.Compressed.ReaderAt") - defer func() { - if retErr != nil { - span.SetStatus(retErr) - } - span.End() - }() - - span.SetAttributes(attribute.String("file", cfo.f.Name())) - - if cfo.closed { - return nil, errors.New("compressed file closed") - } - - gzr, err := gzip.NewReader(cfo.f) - if err != nil { - return nil, err - } - defer gzr.Close() - - // Extract the last log entry timestamp from the gzip header - // Use this to determine if we even need to read this file based on inputs - extra := &rotateFileMetadata{} - err = json.Unmarshal(gzr.Header.Extra, extra) - if err == nil && !extra.LastTime.IsZero() && extra.LastTime.Before(cfo.ifBefore) { - span.SetAttributes(attribute.Bool("skip", true)) - return &sizeReaderAtWithCloser{}, nil - } - if err == nil { - span.SetAttributes(attribute.Stringer("lastLogTime", extra.LastTime)) - } - - span.AddEvent("Start decompress") - return cfo.lf.decompress.Do(cfo.f) -} - -func (cfo *compressedFileOpener) Close() { - cfo.closed = true - cfo.f.Close() -} - -func (cfo *compressedFileOpener) Ref() string { - return cfo.f.Name() -} - -type emptyFileOpener struct{} - -func (emptyFileOpener) ReaderAt(context.Context) (sizeReaderAtCloser, error) { - return &sizeReaderAtWithCloser{}, nil -} - -func (emptyFileOpener) Close() {} - -func (emptyFileOpener) Ref() string { - return "null" -} - -// openRotatedFiles returns a slice of files open for reading, in order from -// oldest to newest, and calls w.fsopMu.RUnlock() before returning. -// -// This method must only be called with w.fsopMu locked for reading. -func (w *LogFile) openRotatedFiles(ctx context.Context, config logger.ReadConfig) (_ []fileOpener, retErr error) { - var out []fileOpener - - defer func() { - if retErr != nil { - for _, fo := range out { - fo.Close() - } - } - }() - - for i := w.maxFiles; i > 1; i-- { - fo, err := w.openRotatedFile(ctx, i-1, config) - if err != nil { - return nil, err - } - out = append(out, fo) - } - - return out, nil -} - -func (w *LogFile) openRotatedFile(ctx context.Context, i int, config logger.ReadConfig) (fileOpener, error) { - f, err := open(fmt.Sprintf("%s.%d", w.f.Name(), i)) - if err == nil { - return &simpleFileOpener{ - f: f, - }, nil - } - - if !errors.Is(err, fs.ErrNotExist) { - return nil, errors.Wrap(err, "error opening rotated log file") - } - - f, err = open(fmt.Sprintf("%s.%d.gz", w.f.Name(), i)) - if err != nil { - if !errors.Is(err, fs.ErrNotExist) { - return nil, errors.Wrap(err, "error opening file for decompression") - } - return &emptyFileOpener{}, nil - } - - return &compressedFileOpener{ - f: f, - lf: w, - ifBefore: config.Since, - }, nil -} - -// This is used to improve type safety around tailing logs -// Some log readers require the log file to be closed, so this makes sure all -// implementers have a closer even if it may be a no-op. -// This is opposed to asserting a type. -type sizeReaderAtCloser interface { - SizeReaderAt - io.Closer -} - -func getTailFiles(ctx context.Context, files []fileOpener, nLines int, getTailReader GetTailReaderFunc) (_ []sizeReaderAtCloser, retErr error) { - ctx, span := tracing.StartSpan(ctx, "logger.Logfile.CollectTailFiles") - span.SetAttributes(attribute.Int("requested_lines", nLines)) - - defer func() { - if retErr != nil { - span.SetStatus(retErr) - } - span.End() - }() - out := make([]sizeReaderAtCloser, 0, len(files)) - - defer func() { - if retErr != nil { - for _, ra := range out { - if err := ra.Close(); err != nil { - log.G(ctx).WithError(err).Warn("Error closing log reader") - } - } - } - }() - - if nLines <= 0 { - for _, fo := range files { - span.AddEvent("Open file", attribute.String("file", fo.Ref())) - - ra, err := fo.ReaderAt(ctx) - if err != nil { - return nil, err - } - out = append(out, ra) - - } - return out, nil - } - - for i := len(files) - 1; i >= 0 && nLines > 0; i-- { - if err := ctx.Err(); err != nil { - return nil, errors.Wrap(err, "stopping parsing files to tail due to error") - } - - fo := files[i] - - fileAttr := attribute.String("file", fo.Ref()) - span.AddEvent("Open file", fileAttr) - - ra, err := fo.ReaderAt(ctx) - if err != nil { - return nil, err - } - - span.AddEvent("Scan file to tail", fileAttr, attribute.Int("remaining_lines", nLines)) - - tail, n, err := getTailReader(ctx, ra, nLines) - if err != nil { - ra.Close() - log.G(ctx).WithError(err).Warn("Error scanning log file for tail file request, skipping") - continue - } - nLines -= n - out = append(out, &sizeReaderAtWithCloser{tail, ra.Close}) - } - - slices.Reverse(out) - - return out, nil -} - -func tailFiles(ctx context.Context, files []fileOpener, watcher *logger.LogWatcher, dec Decoder, getTailReader GetTailReaderFunc, nLines int, fwd *forwarder) (cont bool) { - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - go func() { - select { - case <-ctx.Done(): - case <-watcher.WatchConsumerGone(): - cancel() - } - }() - - readers, err := getTailFiles(ctx, files, nLines, getTailReader) - if err != nil { - watcher.Err <- err - return false - } - - var idx int - defer func() { - // Make sure all are released if there is an early return. - if !cont { - for _, r := range readers[idx:] { - if err := r.Close(); err != nil { - log.G(ctx).WithError(err).Debug("Error closing log reader") - } - } - } - }() - - for _, ra := range readers { - select { - case <-watcher.WatchConsumerGone(): - return false - case <-ctx.Done(): - return false - default: - } - - dec.Reset(ra) - - cancel := context.AfterFunc(ctx, func() { - if err := ra.Close(); err != nil { - log.G(ctx).WithError(err).Debug("Error closing log reader") - } - }) - - ok := fwd.Do(ctx, watcher, func() (*logger.Message, error) { - msg, err := dec.Decode() - if err != nil && !errors.Is(err, io.EOF) { - // We have an error decoding the stream, but we don't want to error out - // the whole log reader. - // If we return anything other than EOF then the forwarder will return - // false and we'll exit the loop. - // Instead just log the error here and return an EOF so we can move to - // the next file. - log.G(ctx).WithError(err).Warn("Error decoding log file") - return nil, io.EOF - } - return msg, err - }) - cancel() - idx++ - if !ok { - return false - } - } - - return true -} - -type forwarder struct { - since, until time.Time -} - -func newForwarder(config logger.ReadConfig) *forwarder { - return &forwarder{since: config.Since, until: config.Until} -} - -// Do reads log messages from dec and sends the messages matching the filter -// conditions to watcher. Do returns cont=true iff it has read all messages from -// dec without encountering a message with a timestamp which is after the -// configured until time. -func (fwd *forwarder) Do(ctx context.Context, watcher *logger.LogWatcher, next func() (*logger.Message, error)) (cont bool) { - ctx, span := tracing.StartSpan(ctx, "logger.Logfile.Forward") - defer func() { - span.SetAttributes(attribute.Bool("continue", cont)) - span.End() - }() - - for { - select { - case <-watcher.WatchConsumerGone(): - span.AddEvent("watch consumer gone") - return false - case <-ctx.Done(): - span.AddEvent(ctx.Err().Error()) - return false - default: - } - - msg, err := next() - if err != nil { - if errors.Is(err, io.EOF) { - span.AddEvent("EOF") - return true - } - span.SetStatus(err) - log.G(ctx).WithError(err).Debug("Error while decoding log entry, not continuing") - return false - } - - if !fwd.since.IsZero() { - if msg.Timestamp.Before(fwd.since) { - continue - } - // We've found our first message with a timestamp >= since. As message - // timestamps might not be monotonic, we need to skip the since check for all - // subsequent messages so we do not filter out later messages which happen to - // have timestamps before since. - fwd.since = time.Time{} - } - if !fwd.until.IsZero() && msg.Timestamp.After(fwd.until) { - log.G(ctx).Debug("Log is newer than requested window, skipping remaining logs") - return false - } - - select { - case <-ctx.Done(): - span.AddEvent(ctx.Err().Error()) - return false - case <-watcher.WatchConsumerGone(): - span.AddEvent("watch consumer gone") - return false - case watcher.Msg <- msg: - } - } -} diff --git a/vendor/github.com/docker/docker/daemon/logger/loggerutils/queue.go b/vendor/github.com/docker/docker/daemon/logger/loggerutils/queue.go deleted file mode 100644 index edc68c8126..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/loggerutils/queue.go +++ /dev/null @@ -1,156 +0,0 @@ -package loggerutils - -import ( - "context" - "sync" - - "github.com/docker/docker/daemon/logger" - "github.com/pkg/errors" -) - -// MessageQueue is a queue for log messages. -// -// [MessageQueue.Enqueue] will block when the queue is full. -// To dequeue messages call [MessageQueue.Receiver] and pull messages off the -// returned channel. -// -// Closing only prevents new messages from being added to the queue. -// The queue can still be drained after close. -// -// The zero value of MessageQueue is safe to use, but does not do any internal -// buffering (queue size is 0). -type MessageQueue struct { - maxSize int - - mu sync.Mutex - closing bool - closed chan struct{} - - // Blocks multiple calls to [MessageQueue.Close] until the queue is actually closed - closeWait chan struct{} - - // We need to be able to safely close the send channel so that [MessageQueue.Dequeue] - // can drain the queue without blocking. - // This cond var helps deal with that. - cond *sync.Cond - sendWaiters int - - ch chan *logger.Message -} - -// NewMessageQueue creates a new queue with the specified size. -func NewMessageQueue(maxSize int) *MessageQueue { - var q MessageQueue - q.maxSize = maxSize - q.init() - return &q -} - -func (q *MessageQueue) init() { - if q.cond == nil { - q.cond = sync.NewCond(&q.mu) - } - - if q.ch == nil { - q.ch = make(chan *logger.Message, q.maxSize) - } - - if q.closed == nil { - q.closed = make(chan struct{}) - } - - if q.closeWait == nil { - q.closeWait = make(chan struct{}) - } -} - -var ErrQueueClosed = errors.New("queue is closed") - -// Enqueue adds the provided message to the queue. -// Enqueue blocks if the queue is full. -// -// The two possible error cases are: -// 1. The provided context is cancelled -// 2. [ErrQueueClosed] when the queue has been closed. -func (q *MessageQueue) Enqueue(ctx context.Context, m *logger.Message) error { - q.mu.Lock() - q.init() - - // Increment the waiter count - // This prevents the send channel from being closed while we are trying to send. - q.sendWaiters++ - q.mu.Unlock() - - defer func() { - q.mu.Lock() - // Decrement the waiter count and signal to any potential closer to check - // the wait count again. - // Only bother signaling if this is the last waiter. - q.sendWaiters-- - if q.sendWaiters == 0 { - q.cond.Signal() - } - q.mu.Unlock() - }() - - // Before trying to send on the channel, check if we care closed. - select { - case <-ctx.Done(): - return ctx.Err() - case <-q.closed: - return ErrQueueClosed - default: - } - - select { - case <-ctx.Done(): - return ctx.Err() - case <-q.closed: - return ErrQueueClosed - case q.ch <- m: - return nil - } -} - -// Close prevents any new messages from being added to the queue. -func (q *MessageQueue) Close() { - q.mu.Lock() - - q.init() - - if q.closing { - // unlock the mutex here so that the goroutine waiting on the cond var can - // take the lock when signaled. - q.mu.Unlock() - <-q.closeWait - return - } - - defer q.mu.Unlock() - - // Prevent multiple Close calls from trying to close things. - q.closing = true - - close(q.closed) - - // Wait for any senders to finish - // Because we closed the channel above, this shouldn't block for a long period. - for q.sendWaiters > 0 { - q.cond.Wait() - } - - close(q.ch) - close(q.closeWait) -} - -// Receiver returns a channel that can be used to dequeue messages -// The channel will be closed when the message queue is closed but may have -// messages buffered. -func (q *MessageQueue) Receiver() <-chan *logger.Message { - q.mu.Lock() - defer q.mu.Unlock() - - q.init() - - return q.ch -} diff --git a/vendor/github.com/docker/docker/daemon/logger/loggerutils/sharedtemp.go b/vendor/github.com/docker/docker/daemon/logger/loggerutils/sharedtemp.go deleted file mode 100644 index f5c8c1f035..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/loggerutils/sharedtemp.go +++ /dev/null @@ -1,226 +0,0 @@ -package loggerutils // import "github.com/docker/docker/daemon/logger/loggerutils" - -import ( - "io" - "io/fs" - "os" - "runtime" -) - -type fileConvertFn func(dst io.WriteSeeker, src io.ReadSeeker) error - -type stfID uint64 - -// sharedTempFileConverter converts files using a user-supplied function and -// writes the results to temporary files which are automatically cleaned up on -// close. If another request is made to convert the same file, the conversion -// result and temporary file are reused if they have not yet been cleaned up. -// -// A file is considered the same as another file using the os.SameFile function, -// which compares file identity (e.g. device and inode numbers on Linux) and is -// robust to file renames. Input files are assumed to be immutable; no attempt -// is made to ascertain whether the file contents have changed between requests. -// -// One file descriptor is used per source file, irrespective of the number of -// concurrent readers of the converted contents. -type sharedTempFileConverter struct { - // The directory where temporary converted files are to be written to. - // If set to the empty string, the default directory for temporary files - // is used. - TempDir string - - conv fileConvertFn - st chan stfcState -} - -type stfcState struct { - fl map[stfID]sharedTempFile - nextID stfID -} - -type sharedTempFile struct { - src os.FileInfo // Info about the source file for path-independent identification with os.SameFile. - fd *os.File - size int64 - ref int // Reference count of open readers on the temporary file. - wait []chan<- stfConvertResult // Wait list for the conversion to complete. -} - -type stfConvertResult struct { - fr *sharedFileReader - err error -} - -func newSharedTempFileConverter(conv fileConvertFn) *sharedTempFileConverter { - st := make(chan stfcState, 1) - st <- stfcState{fl: make(map[stfID]sharedTempFile)} - return &sharedTempFileConverter{conv: conv, st: st} -} - -// Do returns a reader for the contents of f as converted by the c.C function. -// It is the caller's responsibility to close the returned reader. -// -// This function is safe for concurrent use by multiple goroutines. -func (c *sharedTempFileConverter) Do(f *os.File) (*sharedFileReader, error) { - stat, err := f.Stat() - if err != nil { - return nil, err - } - - st := <-c.st - for id, tf := range st.fl { - // os.SameFile can have false positives if one of the files was - // deleted before the other file was created -- such as during - // log rotations... https://github.com/golang/go/issues/36895 - // Weed out those false positives by also comparing the files' - // ModTime, which conveniently also handles the case of true - // positives where the file has also been modified since it was - // first converted. - if os.SameFile(tf.src, stat) && tf.src.ModTime().Equal(stat.ModTime()) { - return c.openExisting(st, id, tf) - } - } - return c.openNew(st, f, stat) -} - -func (c *sharedTempFileConverter) openNew(st stfcState, f *os.File, stat os.FileInfo) (*sharedFileReader, error) { - // Record that we are starting to convert this file so that any other - // requests for the same source file while the conversion is in progress - // can join. - id := st.nextID - st.nextID++ - st.fl[id] = sharedTempFile{src: stat} - c.st <- st - - dst, size, convErr := c.convert(f) - - st = <-c.st - flid := st.fl[id] - - if convErr != nil { - // Conversion failed. Delete it from the state so that future - // requests to convert the same file can try again fresh. - delete(st.fl, id) - c.st <- st - for _, w := range flid.wait { - w <- stfConvertResult{err: convErr} - } - return nil, convErr - } - - flid.fd = dst - flid.size = size - flid.ref = len(flid.wait) + 1 - for _, w := range flid.wait { - // Each waiter needs its own reader with an independent read pointer. - w <- stfConvertResult{fr: flid.Reader(c, id)} - } - flid.wait = nil - st.fl[id] = flid - c.st <- st - return flid.Reader(c, id), nil -} - -func (c *sharedTempFileConverter) openExisting(st stfcState, id stfID, v sharedTempFile) (*sharedFileReader, error) { - if v.fd != nil { - // Already converted. - v.ref++ - st.fl[id] = v - c.st <- st - return v.Reader(c, id), nil - } - // The file has not finished being converted. - // Add ourselves to the wait list. "Don't call us; we'll call you." - wait := make(chan stfConvertResult, 1) - v.wait = append(v.wait, wait) - st.fl[id] = v - c.st <- st - - res := <-wait - return res.fr, res.err -} - -func (c *sharedTempFileConverter) convert(f *os.File) (converted *os.File, size int64, err error) { - dst, err := os.CreateTemp(c.TempDir, "dockerdtemp.*") - if err != nil { - return nil, 0, err - } - defer func() { - _ = dst.Close() - // Delete the temporary file immediately so that final cleanup - // of the file on disk is deferred to the OS once we close all - // our file descriptors (or the process dies). Assuming no early - // returns due to errors, the file will be open by this process - // with a read-only descriptor at this point. As we don't care - // about being able to reuse the file name -- it's randomly - // generated and unique -- we can safely use os.Remove on - // Windows. - _ = os.Remove(dst.Name()) - }() - err = c.conv(dst, f) - if err != nil { - return nil, 0, err - } - // Close the exclusive read-write file descriptor, catching any delayed - // write errors (and on Windows, releasing the share-locks on the file) - if err := dst.Close(); err != nil { - _ = os.Remove(dst.Name()) - return nil, 0, err - } - // Open the file again read-only (without locking the file against - // deletion on Windows). - converted, err = open(dst.Name()) - if err != nil { - return nil, 0, err - } - - // The position of the file's read pointer doesn't matter as all readers - // will be accessing the file through its io.ReaderAt interface. - size, err = converted.Seek(0, io.SeekEnd) - if err != nil { - _ = converted.Close() - return nil, 0, err - } - return converted, size, nil -} - -type sharedFileReader struct { - *io.SectionReader - - c *sharedTempFileConverter - id stfID - closed bool -} - -func (stf sharedTempFile) Reader(c *sharedTempFileConverter, id stfID) *sharedFileReader { - rdr := &sharedFileReader{SectionReader: io.NewSectionReader(stf.fd, 0, stf.size), c: c, id: id} - runtime.SetFinalizer(rdr, (*sharedFileReader).Close) - return rdr -} - -func (r *sharedFileReader) Close() error { - if r.closed { - return fs.ErrClosed - } - - st := <-r.c.st - flid, ok := st.fl[r.id] - if !ok { - panic("invariant violation: temp file state missing from map") - } - flid.ref-- - lastRef := flid.ref <= 0 - if lastRef { - delete(st.fl, r.id) - } else { - st.fl[r.id] = flid - } - r.closed = true - r.c.st <- st - - if lastRef { - return flid.fd.Close() - } - runtime.SetFinalizer(r, nil) - return nil -} diff --git a/vendor/github.com/docker/docker/daemon/logger/loginfo.go b/vendor/github.com/docker/docker/daemon/logger/loginfo.go deleted file mode 100644 index 4c07a25b4a..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/loginfo.go +++ /dev/null @@ -1,147 +0,0 @@ -package logger // import "github.com/docker/docker/daemon/logger" - -import ( - "fmt" - "os" - "regexp" - "strings" - "time" -) - -// Info provides enough information for a logging driver to do its function. -type Info struct { - Config map[string]string - ContainerID string - ContainerName string - ContainerEntrypoint string - ContainerArgs []string - ContainerImageID string - ContainerImageName string - ContainerCreated time.Time - ContainerEnv []string - ContainerLabels map[string]string - LogPath string - DaemonName string -} - -// ExtraAttributes returns the user-defined extra attributes (labels, -// environment variables) in key-value format. This can be used by log drivers -// that support metadata to add more context to a log. -func (info *Info) ExtraAttributes(keyMod func(string) string) (map[string]string, error) { - extra := make(map[string]string) - - if labels, ok := info.Config["labels"]; ok && len(labels) > 0 { - for _, l := range strings.Split(labels, ",") { - if v, ok := info.ContainerLabels[l]; ok { - if keyMod != nil { - l = keyMod(l) - } - extra[l] = v - } - } - } - - if labelsRegex, ok := info.Config["labels-regex"]; ok && len(labelsRegex) > 0 { - re, err := regexp.Compile(labelsRegex) - if err != nil { - return nil, err - } - for k, v := range info.ContainerLabels { - if re.MatchString(k) { - if keyMod != nil { - k = keyMod(k) - } - extra[k] = v - } - } - } - - envMapping := make(map[string]string) - for _, e := range info.ContainerEnv { - if k, v, ok := strings.Cut(e, "="); ok { - envMapping[k] = v - } - } - - // Code below is only to handle adding attributes based on env-vars. - if len(envMapping) == 0 { - return extra, nil - } - - if env, ok := info.Config["env"]; ok && len(env) > 0 { - for _, l := range strings.Split(env, ",") { - if v, ok := envMapping[l]; ok { - if keyMod != nil { - l = keyMod(l) - } - extra[l] = v - } - } - } - - if envRegex, ok := info.Config["env-regex"]; ok && len(envRegex) > 0 { - re, err := regexp.Compile(envRegex) - if err != nil { - return nil, err - } - for k, v := range envMapping { - if re.MatchString(k) { - if keyMod != nil { - k = keyMod(k) - } - extra[k] = v - } - } - } - - return extra, nil -} - -// Hostname returns the hostname from the underlying OS. -func (info *Info) Hostname() (string, error) { - hostname, err := os.Hostname() - if err != nil { - return "", fmt.Errorf("logger: can not resolve hostname: %v", err) - } - return hostname, nil -} - -// Command returns the command that the container being logged was -// started with. The Entrypoint is prepended to the container -// arguments. -func (info *Info) Command() string { - terms := []string{info.ContainerEntrypoint} - terms = append(terms, info.ContainerArgs...) - command := strings.Join(terms, " ") - return command -} - -// ID Returns the Container ID shortened to 12 characters. -func (info *Info) ID() string { - return info.ContainerID[:12] -} - -// FullID is an alias of ContainerID. -func (info *Info) FullID() string { - return info.ContainerID -} - -// Name returns the ContainerName without a preceding '/'. -func (info *Info) Name() string { - return strings.TrimPrefix(info.ContainerName, "/") -} - -// ImageID returns the ContainerImageID shortened to 12 characters. -func (info *Info) ImageID() string { - return info.ContainerImageID[:12] -} - -// ImageFullID is an alias of ContainerImageID. -func (info *Info) ImageFullID() string { - return info.ContainerImageID -} - -// ImageName is an alias of ContainerImageName -func (info *Info) ImageName() string { - return info.ContainerImageName -} diff --git a/vendor/github.com/docker/docker/daemon/logger/metrics.go b/vendor/github.com/docker/docker/daemon/logger/metrics.go deleted file mode 100644 index 2362c9d714..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/metrics.go +++ /dev/null @@ -1,21 +0,0 @@ -package logger // import "github.com/docker/docker/daemon/logger" - -import ( - gometrics "github.com/docker/go-metrics" -) - -var ( - logWritesFailedCount gometrics.Counter - logReadsFailedCount gometrics.Counter - totalPartialLogs gometrics.Counter -) - -func init() { - loggerMetrics := gometrics.NewNamespace("logger", "", nil) - - logWritesFailedCount = loggerMetrics.NewCounter("log_write_operations_failed", "Number of log write operations that failed") - logReadsFailedCount = loggerMetrics.NewCounter("log_read_operations_failed", "Number of log reads from container stdio that failed") - totalPartialLogs = loggerMetrics.NewCounter("log_entries_size_greater_than_buffer", "Number of log entries which are larger than the log buffer") - - gometrics.Register(loggerMetrics) -} diff --git a/vendor/github.com/docker/docker/daemon/logger/plugin.go b/vendor/github.com/docker/docker/daemon/logger/plugin.go deleted file mode 100644 index 2916fbe55a..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/plugin.go +++ /dev/null @@ -1,116 +0,0 @@ -package logger // import "github.com/docker/docker/daemon/logger" - -import ( - "fmt" - "io" - "os" - "path/filepath" - - "github.com/docker/docker/api/types/plugins/logdriver" - "github.com/docker/docker/errdefs" - "github.com/docker/docker/pkg/plugingetter" - "github.com/docker/docker/pkg/plugins" - "github.com/docker/docker/pkg/stringid" - "github.com/pkg/errors" -) - -var pluginGetter plugingetter.PluginGetter - -const extName = "LogDriver" - -// logPlugin defines the available functions that logging plugins must implement. -type logPlugin interface { - StartLogging(streamPath string, info Info) (err error) - StopLogging(streamPath string) (err error) - Capabilities() (cap Capability, err error) - ReadLogs(info Info, config ReadConfig) (stream io.ReadCloser, err error) -} - -// RegisterPluginGetter sets the plugingetter -func RegisterPluginGetter(g plugingetter.PluginGetter) { - pluginGetter = g -} - -// getPlugin returns a logging driver by its name. -// If the driver is empty, it looks for the local driver. -func getPlugin(name string, mode int) (Creator, error) { - p, err := pluginGetter.Get(name, extName, mode) - if err != nil { - return nil, fmt.Errorf("error looking up logging plugin %s: %v", name, err) - } - - client, err := makePluginClient(p) - if err != nil { - return nil, err - } - return makePluginCreator(name, client, p.ScopedPath), nil -} - -func makePluginClient(p plugingetter.CompatPlugin) (logPlugin, error) { - if pc, ok := p.(plugingetter.PluginWithV1Client); ok { - return &logPluginProxy{pc.Client()}, nil - } - pa, ok := p.(plugingetter.PluginAddr) - if !ok { - return nil, errdefs.System(errors.Errorf("got unknown plugin type %T", p)) - } - - if pa.Protocol() != plugins.ProtocolSchemeHTTPV1 { - return nil, errors.Errorf("plugin protocol not supported: %s", p) - } - - addr := pa.Addr() - c, err := plugins.NewClientWithTimeout(addr.Network()+"://"+addr.String(), nil, pa.Timeout()) - if err != nil { - return nil, errors.Wrap(err, "error making plugin client") - } - return &logPluginProxy{c}, nil -} - -func makePluginCreator(name string, l logPlugin, scopePath func(s string) string) Creator { - return func(logCtx Info) (logger Logger, err error) { - defer func() { - if err != nil { - pluginGetter.Get(name, extName, plugingetter.Release) - } - }() - - unscopedPath := filepath.Join("/", "run", "docker", "logging") - logRoot := scopePath(unscopedPath) - if err := os.MkdirAll(logRoot, 0o700); err != nil { - return nil, err - } - - id := stringid.GenerateRandomID() - a := &pluginAdapter{ - driverName: name, - id: id, - plugin: l, - fifoPath: filepath.Join(logRoot, id), - logInfo: logCtx, - } - - cap, err := a.plugin.Capabilities() - if err == nil { - a.capabilities = cap - } - - stream, err := openPluginStream(a) - if err != nil { - return nil, err - } - - a.stream = stream - a.enc = logdriver.NewLogEntryEncoder(a.stream) - - if err := l.StartLogging(filepath.Join(unscopedPath, id), logCtx); err != nil { - return nil, errors.Wrapf(err, "error creating logger") - } - - if cap.ReadLogs { - return &pluginAdapterWithRead{a}, nil - } - - return a, nil - } -} diff --git a/vendor/github.com/docker/docker/daemon/logger/plugin_unix.go b/vendor/github.com/docker/docker/daemon/logger/plugin_unix.go deleted file mode 100644 index 1951ca88bd..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/plugin_unix.go +++ /dev/null @@ -1,23 +0,0 @@ -//go:build linux || freebsd - -package logger // import "github.com/docker/docker/daemon/logger" - -import ( - "context" - "io" - - "github.com/containerd/fifo" - "github.com/pkg/errors" - "golang.org/x/sys/unix" -) - -func openPluginStream(a *pluginAdapter) (io.WriteCloser, error) { - // Make sure to also open with read (in addition to write) to avoid broken pipe errors on plugin failure. - // It is up to the plugin to keep track of pipes that it should re-attach to, however. - // If the plugin doesn't open for reads, then the container will block once the pipe is full. - f, err := fifo.OpenFifo(context.Background(), a.fifoPath, unix.O_RDWR|unix.O_CREAT|unix.O_NONBLOCK, 0o700) - if err != nil { - return nil, errors.Wrapf(err, "error creating i/o pipe for log plugin: %s", a.Name()) - } - return f, nil -} diff --git a/vendor/github.com/docker/docker/daemon/logger/plugin_unsupported.go b/vendor/github.com/docker/docker/daemon/logger/plugin_unsupported.go deleted file mode 100644 index de2d4fb259..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/plugin_unsupported.go +++ /dev/null @@ -1,12 +0,0 @@ -//go:build !linux && !freebsd - -package logger // import "github.com/docker/docker/daemon/logger" - -import ( - "errors" - "io" -) - -func openPluginStream(a *pluginAdapter) (io.WriteCloser, error) { - return nil, errors.New("log plugin not supported") -} diff --git a/vendor/github.com/docker/docker/daemon/logger/proxy.go b/vendor/github.com/docker/docker/daemon/logger/proxy.go deleted file mode 100644 index 502271b240..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/proxy.go +++ /dev/null @@ -1,100 +0,0 @@ -package logger // import "github.com/docker/docker/daemon/logger" - -import ( - "errors" - "io" -) - -type client interface { - Call(string, interface{}, interface{}) error - Stream(string, interface{}) (io.ReadCloser, error) -} - -type logPluginProxy struct { - client -} - -type logPluginProxyStartLoggingRequest struct { - File string - Info Info -} - -type logPluginProxyStartLoggingResponse struct { - Err string -} - -func (pp *logPluginProxy) StartLogging(file string, info Info) (err error) { - var ( - req logPluginProxyStartLoggingRequest - ret logPluginProxyStartLoggingResponse - ) - - req.File = file - req.Info = info - if err = pp.Call("LogDriver.StartLogging", req, &ret); err != nil { - return err - } - - if ret.Err != "" { - return errors.New(ret.Err) - } - - return nil -} - -type logPluginProxyStopLoggingRequest struct { - File string -} - -type logPluginProxyStopLoggingResponse struct { - Err string -} - -func (pp *logPluginProxy) StopLogging(file string) (err error) { - var ( - req logPluginProxyStopLoggingRequest - ret logPluginProxyStopLoggingResponse - ) - - req.File = file - if err = pp.Call("LogDriver.StopLogging", req, &ret); err != nil { - return err - } - - if ret.Err != "" { - return errors.New(ret.Err) - } - - return nil -} - -type logPluginProxyCapabilitiesResponse struct { - Cap Capability - Err string -} - -func (pp *logPluginProxy) Capabilities() (cap Capability, err error) { - var ret logPluginProxyCapabilitiesResponse - - if err = pp.Call("LogDriver.Capabilities", nil, &ret); err != nil { - return Capability{}, err - } - - if ret.Err != "" { - return Capability{}, errors.New(ret.Err) - } - - return ret.Cap, nil -} - -type logPluginProxyReadLogsRequest struct { - Info Info - Config ReadConfig -} - -func (pp *logPluginProxy) ReadLogs(info Info, config ReadConfig) (stream io.ReadCloser, err error) { - return pp.Stream("LogDriver.ReadLogs", logPluginProxyReadLogsRequest{ - Info: info, - Config: config, - }) -} diff --git a/vendor/github.com/docker/docker/daemon/logger/ring.go b/vendor/github.com/docker/docker/daemon/logger/ring.go deleted file mode 100644 index 10b6c13cd8..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/ring.go +++ /dev/null @@ -1,234 +0,0 @@ -package logger // import "github.com/docker/docker/daemon/logger" - -import ( - "context" - "errors" - "sync" - "sync/atomic" -) - -const ( - defaultRingMaxSize = 1e6 // 1MB -) - -// ringLogger is a ring buffer that implements the Logger interface. -// This is used when lossy logging is OK. -type ringLogger struct { - buffer *messageRing - l Logger - logInfo Info - closeFlag atomic.Bool - wg sync.WaitGroup -} - -var ( - _ SizedLogger = (*ringLogger)(nil) - _ LogReader = (*ringWithReader)(nil) -) - -type ringWithReader struct { - *ringLogger -} - -func (r *ringWithReader) ReadLogs(ctx context.Context, cfg ReadConfig) *LogWatcher { - reader, ok := r.l.(LogReader) - if !ok { - // something is wrong if we get here - panic("expected log reader") - } - return reader.ReadLogs(ctx, cfg) -} - -func newRingLogger(driver Logger, logInfo Info, maxSize int64) *ringLogger { - l := &ringLogger{ - buffer: newRing(maxSize), - l: driver, - logInfo: logInfo, - } - l.wg.Add(1) - go l.run() - return l -} - -// NewRingLogger creates a new Logger that is implemented as a RingBuffer wrapping -// the passed in logger. -func NewRingLogger(driver Logger, logInfo Info, maxSize int64) Logger { - if maxSize < 0 { - maxSize = defaultRingMaxSize - } - l := newRingLogger(driver, logInfo, maxSize) - if _, ok := driver.(LogReader); ok { - return &ringWithReader{l} - } - return l -} - -// BufSize returns the buffer size of the underlying logger. -// Returns -1 if the logger doesn't match SizedLogger interface. -func (r *ringLogger) BufSize() int { - if sl, ok := r.l.(SizedLogger); ok { - return sl.BufSize() - } - return -1 -} - -// Log queues messages into the ring buffer -func (r *ringLogger) Log(msg *Message) error { - if r.closed() { - return errClosed - } - return r.buffer.Enqueue(msg) -} - -// Name returns the name of the underlying logger -func (r *ringLogger) Name() string { - return r.l.Name() -} - -func (r *ringLogger) closed() bool { - return r.closeFlag.Load() -} - -func (r *ringLogger) setClosed() { - r.closeFlag.Store(true) -} - -// Close closes the logger -func (r *ringLogger) Close() error { - r.setClosed() - r.buffer.Close() - r.wg.Wait() - // empty out the queue - var logErr bool - for _, msg := range r.buffer.Drain() { - if logErr { - // some error logging a previous message, so re-insert to message pool - // and assume log driver is hosed - PutMessage(msg) - continue - } - - if err := r.l.Log(msg); err != nil { - logDriverError(r.l.Name(), string(msg.Line), err) - logErr = true - } - } - return r.l.Close() -} - -// run consumes messages from the ring buffer and forwards them to the underling -// logger. -// This is run in a goroutine when the ringLogger is created -func (r *ringLogger) run() { - defer r.wg.Done() - for { - if r.closed() { - return - } - msg, err := r.buffer.Dequeue() - if err != nil { - // buffer is closed - return - } - if err := r.l.Log(msg); err != nil { - logDriverError(r.l.Name(), string(msg.Line), err) - } - } -} - -type messageRing struct { - mu sync.Mutex - // signals callers of `Dequeue` to wake up either on `Close` or when a new `Message` is added - wait *sync.Cond - - sizeBytes int64 // current buffer size - maxBytes int64 // max buffer size - queue []*Message - closed bool -} - -func newRing(maxBytes int64) *messageRing { - queueSize := 1000 - if maxBytes == 0 || maxBytes == 1 { - // With 0 or 1 max byte size, the maximum size of the queue would only ever be 1 - // message long. - queueSize = 1 - } - - r := &messageRing{queue: make([]*Message, 0, queueSize), maxBytes: maxBytes} - r.wait = sync.NewCond(&r.mu) - return r -} - -// Enqueue adds a message to the buffer queue -// If the message is too big for the buffer it drops the new message. -// If there are no messages in the queue and the message is still too big, it adds the message anyway. -func (r *messageRing) Enqueue(m *Message) error { - mSize := int64(len(m.Line)) - - r.mu.Lock() - if r.closed { - r.mu.Unlock() - return errClosed - } - if mSize+r.sizeBytes > r.maxBytes && len(r.queue) > 0 { - r.wait.Signal() - r.mu.Unlock() - return nil - } - - r.queue = append(r.queue, m) - r.sizeBytes += mSize - r.wait.Signal() - r.mu.Unlock() - return nil -} - -// Dequeue pulls a message off the queue -// If there are no messages, it waits for one. -// If the buffer is closed, it will return immediately. -func (r *messageRing) Dequeue() (*Message, error) { - r.mu.Lock() - for len(r.queue) == 0 && !r.closed { - r.wait.Wait() - } - - if r.closed { - r.mu.Unlock() - return nil, errClosed - } - - msg := r.queue[0] - r.queue = r.queue[1:] - r.sizeBytes -= int64(len(msg.Line)) - r.mu.Unlock() - return msg, nil -} - -var errClosed = errors.New("closed") - -// Close closes the buffer ensuring no new messages can be added. -// Any callers waiting to dequeue a message will be woken up. -func (r *messageRing) Close() { - r.mu.Lock() - if r.closed { - r.mu.Unlock() - return - } - - r.closed = true - r.wait.Broadcast() - r.mu.Unlock() -} - -// Drain drains all messages from the queue. -// This can be used after `Close()` to get any remaining messages that were in queue. -func (r *messageRing) Drain() []*Message { - r.mu.Lock() - ls := make([]*Message, 0, len(r.queue)) - ls = append(ls, r.queue...) - r.sizeBytes = 0 - r.queue = r.queue[:0] - r.mu.Unlock() - return ls -} diff --git a/vendor/github.com/docker/docker/daemon/logger/templates/templates.go b/vendor/github.com/docker/docker/daemon/logger/templates/templates.go deleted file mode 100644 index ca4129ac68..0000000000 --- a/vendor/github.com/docker/docker/daemon/logger/templates/templates.go +++ /dev/null @@ -1,50 +0,0 @@ -package templates // import "github.com/docker/docker/daemon/logger/templates" - -import ( - "bytes" - "encoding/json" - "strings" - "text/template" -) - -// basicFunctions are the set of initial -// functions provided to every template. -var basicFunctions = template.FuncMap{ - "json": func(v interface{}) string { - buf := &bytes.Buffer{} - enc := json.NewEncoder(buf) - enc.SetEscapeHTML(false) - _ = enc.Encode(v) //nolint:errchkjson // ignore "Error return json.Encoder.Encode` is not checked" - // Remove the trailing new line added by the encoder - return strings.TrimSpace(buf.String()) - }, - "split": strings.Split, - "join": strings.Join, - "title": strings.Title, //nolint:staticcheck // SA1019: strings.Title is deprecated: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. - "lower": strings.ToLower, - "upper": strings.ToUpper, - "pad": padWithSpace, - "truncate": truncateWithLength, -} - -// NewParse creates a new tagged template with the basic functions -// and parses the given format. -func NewParse(tag, format string) (*template.Template, error) { - return template.New(tag).Funcs(basicFunctions).Parse(format) -} - -// padWithSpace adds whitespace to the input if the input is non-empty -func padWithSpace(source string, prefix, suffix int) string { - if source == "" { - return source - } - return strings.Repeat(" ", prefix) + source + strings.Repeat(" ", suffix) -} - -// truncateWithLength truncates the source string up to the length provided by the input -func truncateWithLength(source string, length int) string { - if len(source) < length { - return source - } - return source[:length] -} diff --git a/vendor/github.com/docker/docker/errdefs/doc.go b/vendor/github.com/docker/docker/errdefs/doc.go index c211f174fc..b8d32eb484 100644 --- a/vendor/github.com/docker/docker/errdefs/doc.go +++ b/vendor/github.com/docker/docker/errdefs/doc.go @@ -4,5 +4,5 @@ // Packages should not reference these interfaces directly, only implement them. // To check if a particular error implements one of these interfaces, there are helper // functions provided (e.g. `Is`) which can be used rather than asserting the interfaces directly. -// If you must assert on these interfaces, be sure to check the causal chain (`err.Cause()`). +// If you must assert on these interfaces, be sure to check the causal chain (`err.Unwrap()`). package errdefs // import "github.com/docker/docker/errdefs" diff --git a/vendor/github.com/docker/docker/errdefs/helpers.go b/vendor/github.com/docker/docker/errdefs/helpers.go index ab76e62736..2a9f7ffd86 100644 --- a/vendor/github.com/docker/docker/errdefs/helpers.go +++ b/vendor/github.com/docker/docker/errdefs/helpers.go @@ -1,6 +1,10 @@ package errdefs -import "context" +import ( + "context" + + cerrdefs "github.com/containerd/errdefs" +) type errNotFound struct{ error } @@ -18,7 +22,7 @@ func (e errNotFound) Unwrap() error { // It returns the error as-is if it is either nil (no error) or already implements // [ErrNotFound], func NotFound(err error) error { - if err == nil || IsNotFound(err) { + if err == nil || cerrdefs.IsNotFound(err) { return err } return errNotFound{err} @@ -40,7 +44,7 @@ func (e errInvalidParameter) Unwrap() error { // It returns the error as-is if it is either nil (no error) or already implements // [ErrInvalidParameter], func InvalidParameter(err error) error { - if err == nil || IsInvalidParameter(err) { + if err == nil || cerrdefs.IsInvalidArgument(err) { return err } return errInvalidParameter{err} @@ -62,7 +66,7 @@ func (e errConflict) Unwrap() error { // It returns the error as-is if it is either nil (no error) or already implements // [ErrConflict], func Conflict(err error) error { - if err == nil || IsConflict(err) { + if err == nil || cerrdefs.IsConflict(err) { return err } return errConflict{err} @@ -84,7 +88,7 @@ func (e errUnauthorized) Unwrap() error { // It returns the error as-is if it is either nil (no error) or already implements // [ErrUnauthorized], func Unauthorized(err error) error { - if err == nil || IsUnauthorized(err) { + if err == nil || cerrdefs.IsUnauthorized(err) { return err } return errUnauthorized{err} @@ -106,7 +110,7 @@ func (e errUnavailable) Unwrap() error { // It returns the error as-is if it is either nil (no error) or already implements // [ErrUnavailable], func Unavailable(err error) error { - if err == nil || IsUnavailable(err) { + if err == nil || cerrdefs.IsUnavailable(err) { return err } return errUnavailable{err} @@ -128,7 +132,7 @@ func (e errForbidden) Unwrap() error { // It returns the error as-is if it is either nil (no error) or already implements // [ErrForbidden], func Forbidden(err error) error { - if err == nil || IsForbidden(err) { + if err == nil || cerrdefs.IsPermissionDenied(err) { return err } return errForbidden{err} @@ -150,7 +154,7 @@ func (e errSystem) Unwrap() error { // It returns the error as-is if it is either nil (no error) or already implements // [ErrSystem], func System(err error) error { - if err == nil || IsSystem(err) { + if err == nil || cerrdefs.IsInternal(err) { return err } return errSystem{err} @@ -172,7 +176,7 @@ func (e errNotModified) Unwrap() error { // It returns the error as-is if it is either nil (no error) or already implements // [NotModified], func NotModified(err error) error { - if err == nil || IsNotModified(err) { + if err == nil || cerrdefs.IsNotModified(err) { return err } return errNotModified{err} @@ -194,7 +198,7 @@ func (e errNotImplemented) Unwrap() error { // It returns the error as-is if it is either nil (no error) or already implements // [ErrNotImplemented], func NotImplemented(err error) error { - if err == nil || IsNotImplemented(err) { + if err == nil || cerrdefs.IsNotImplemented(err) { return err } return errNotImplemented{err} @@ -216,7 +220,7 @@ func (e errUnknown) Unwrap() error { // It returns the error as-is if it is either nil (no error) or already implements // [ErrUnknown], func Unknown(err error) error { - if err == nil || IsUnknown(err) { + if err == nil || cerrdefs.IsUnknown(err) { return err } return errUnknown{err} @@ -238,7 +242,7 @@ func (e errCancelled) Unwrap() error { // It returns the error as-is if it is either nil (no error) or already implements // [ErrCancelled], func Cancelled(err error) error { - if err == nil || IsCancelled(err) { + if err == nil || cerrdefs.IsCanceled(err) { return err } return errCancelled{err} @@ -260,7 +264,7 @@ func (e errDeadline) Unwrap() error { // It returns the error as-is if it is either nil (no error) or already implements // [ErrDeadline], func Deadline(err error) error { - if err == nil || IsDeadline(err) { + if err == nil || cerrdefs.IsDeadlineExceeded(err) { return err } return errDeadline{err} @@ -282,7 +286,7 @@ func (e errDataLoss) Unwrap() error { // It returns the error as-is if it is either nil (no error) or already implements // [ErrDataLoss], func DataLoss(err error) error { - if err == nil || IsDataLoss(err) { + if err == nil || cerrdefs.IsDataLoss(err) { return err } return errDataLoss{err} diff --git a/vendor/github.com/docker/docker/errdefs/http_helpers.go b/vendor/github.com/docker/docker/errdefs/http_helpers.go index 0a8fadd48f..823ff2d9fc 100644 --- a/vendor/github.com/docker/docker/errdefs/http_helpers.go +++ b/vendor/github.com/docker/docker/errdefs/http_helpers.go @@ -5,6 +5,8 @@ import ( ) // FromStatusCode creates an errdef error, based on the provided HTTP status-code +// +// Deprecated: Use [cerrdefs.ToNative] instead func FromStatusCode(err error, statusCode int) error { if err == nil { return nil @@ -33,12 +35,12 @@ func FromStatusCode(err error, statusCode int) error { return System(err) default: switch { - case statusCode >= 200 && statusCode < 400: + case statusCode >= http.StatusOK && statusCode < http.StatusBadRequest: // it's a client error return err - case statusCode >= 400 && statusCode < 500: + case statusCode >= http.StatusBadRequest && statusCode < http.StatusInternalServerError: return InvalidParameter(err) - case statusCode >= 500 && statusCode < 600: + case statusCode >= http.StatusInternalServerError && statusCode < 600: return System(err) default: return Unknown(err) diff --git a/vendor/github.com/docker/docker/errdefs/is.go b/vendor/github.com/docker/docker/errdefs/is.go index 30ea7e6fec..ceb754a954 100644 --- a/vendor/github.com/docker/docker/errdefs/is.go +++ b/vendor/github.com/docker/docker/errdefs/is.go @@ -3,119 +3,74 @@ package errdefs import ( "context" "errors" -) - -type causer interface { - Cause() error -} - -type wrapErr interface { - Unwrap() error -} -func getImplementer(err error) error { - switch e := err.(type) { - case - ErrNotFound, - ErrInvalidParameter, - ErrConflict, - ErrUnauthorized, - ErrUnavailable, - ErrForbidden, - ErrSystem, - ErrNotModified, - ErrNotImplemented, - ErrCancelled, - ErrDeadline, - ErrDataLoss, - ErrUnknown: - return err - case causer: - return getImplementer(e.Cause()) - case wrapErr: - return getImplementer(e.Unwrap()) - default: - return err - } -} + cerrdefs "github.com/containerd/errdefs" +) // IsNotFound returns if the passed in error is an [ErrNotFound], -func IsNotFound(err error) bool { - _, ok := getImplementer(err).(ErrNotFound) - return ok -} +// +// Deprecated: use containerd [cerrdefs.IsNotFound] +var IsNotFound = cerrdefs.IsNotFound // IsInvalidParameter returns if the passed in error is an [ErrInvalidParameter]. -func IsInvalidParameter(err error) bool { - _, ok := getImplementer(err).(ErrInvalidParameter) - return ok -} +// +// Deprecated: use containerd [cerrdefs.IsInvalidArgument] +var IsInvalidParameter = cerrdefs.IsInvalidArgument // IsConflict returns if the passed in error is an [ErrConflict]. -func IsConflict(err error) bool { - _, ok := getImplementer(err).(ErrConflict) - return ok -} +// +// Deprecated: use containerd [cerrdefs.IsConflict] +var IsConflict = cerrdefs.IsConflict // IsUnauthorized returns if the passed in error is an [ErrUnauthorized]. -func IsUnauthorized(err error) bool { - _, ok := getImplementer(err).(ErrUnauthorized) - return ok -} +// +// Deprecated: use containerd [cerrdefs.IsUnauthorized] +var IsUnauthorized = cerrdefs.IsUnauthorized // IsUnavailable returns if the passed in error is an [ErrUnavailable]. -func IsUnavailable(err error) bool { - _, ok := getImplementer(err).(ErrUnavailable) - return ok -} +// +// Deprecated: use containerd [cerrdefs.IsUnavailable] +var IsUnavailable = cerrdefs.IsUnavailable // IsForbidden returns if the passed in error is an [ErrForbidden]. -func IsForbidden(err error) bool { - _, ok := getImplementer(err).(ErrForbidden) - return ok -} +// +// Deprecated: use containerd [cerrdefs.IsPermissionDenied] +var IsForbidden = cerrdefs.IsPermissionDenied // IsSystem returns if the passed in error is an [ErrSystem]. -func IsSystem(err error) bool { - _, ok := getImplementer(err).(ErrSystem) - return ok -} +// +// Deprecated: use containerd [cerrdefs.IsInternal] +var IsSystem = cerrdefs.IsInternal // IsNotModified returns if the passed in error is an [ErrNotModified]. -func IsNotModified(err error) bool { - _, ok := getImplementer(err).(ErrNotModified) - return ok -} +// +// Deprecated: use containerd [cerrdefs.IsNotModified] +var IsNotModified = cerrdefs.IsNotModified // IsNotImplemented returns if the passed in error is an [ErrNotImplemented]. -func IsNotImplemented(err error) bool { - _, ok := getImplementer(err).(ErrNotImplemented) - return ok -} +// +// Deprecated: use containerd [cerrdefs.IsNotImplemented] +var IsNotImplemented = cerrdefs.IsNotImplemented // IsUnknown returns if the passed in error is an [ErrUnknown]. -func IsUnknown(err error) bool { - _, ok := getImplementer(err).(ErrUnknown) - return ok -} +// +// Deprecated: use containerd [cerrdefs.IsUnknown] +var IsUnknown = cerrdefs.IsUnknown // IsCancelled returns if the passed in error is an [ErrCancelled]. -func IsCancelled(err error) bool { - _, ok := getImplementer(err).(ErrCancelled) - return ok -} +// +// Deprecated: use containerd [cerrdefs.IsCanceled] +var IsCancelled = cerrdefs.IsCanceled // IsDeadline returns if the passed in error is an [ErrDeadline]. -func IsDeadline(err error) bool { - _, ok := getImplementer(err).(ErrDeadline) - return ok -} +// +// Deprecated: use containerd [cerrdefs.IsDeadlineExceeded] +var IsDeadline = cerrdefs.IsDeadlineExceeded // IsDataLoss returns if the passed in error is an [ErrDataLoss]. -func IsDataLoss(err error) bool { - _, ok := getImplementer(err).(ErrDataLoss) - return ok -} +// +// Deprecated: use containerd [cerrdefs.IsDataLoss] +var IsDataLoss = cerrdefs.IsDataLoss // IsContext returns if the passed in error is due to context cancellation or deadline exceeded. func IsContext(err error) bool { diff --git a/vendor/github.com/docker/docker/internal/cleanups/composite.go b/vendor/github.com/docker/docker/internal/cleanups/composite.go deleted file mode 100644 index 3c00cd6d75..0000000000 --- a/vendor/github.com/docker/docker/internal/cleanups/composite.go +++ /dev/null @@ -1,44 +0,0 @@ -package cleanups - -import ( - "context" - - "github.com/docker/docker/internal/multierror" -) - -type Composite struct { - cleanups []func(context.Context) error -} - -// Add adds a cleanup to be called. -func (c *Composite) Add(f func(context.Context) error) { - c.cleanups = append(c.cleanups, f) -} - -// Call calls all cleanups in reverse order and returns an error combining all -// non-nil errors. -func (c *Composite) Call(ctx context.Context) error { - err := call(ctx, c.cleanups) - c.cleanups = nil - return err -} - -// Release removes all cleanups, turning Call into a no-op. -// Caller still can call the cleanups by calling the returned function -// which is equivalent to calling the Call before Release was called. -func (c *Composite) Release() func(context.Context) error { - cleanups := c.cleanups - c.cleanups = nil - return func(ctx context.Context) error { - return call(ctx, cleanups) - } -} - -func call(ctx context.Context, cleanups []func(context.Context) error) error { - var errs []error - for idx := len(cleanups) - 1; idx >= 0; idx-- { - c := cleanups[idx] - errs = append(errs, c(ctx)) - } - return multierror.Join(errs...) -} diff --git a/vendor/github.com/docker/docker/internal/multierror/multierror.go b/vendor/github.com/docker/docker/internal/multierror/multierror.go index cf4d6a5957..e899f4de85 100644 --- a/vendor/github.com/docker/docker/internal/multierror/multierror.go +++ b/vendor/github.com/docker/docker/internal/multierror/multierror.go @@ -36,7 +36,7 @@ func (e *joinError) Error() string { } stringErrs := make([]string, 0, len(e.errs)) for _, subErr := range e.errs { - stringErrs = append(stringErrs, strings.Replace(subErr.Error(), "\n", "\n\t", -1)) + stringErrs = append(stringErrs, strings.ReplaceAll(subErr.Error(), "\n", "\n\t")) } return "* " + strings.Join(stringErrs, "\n* ") } diff --git a/vendor/github.com/docker/docker/internal/safepath/common.go b/vendor/github.com/docker/docker/internal/safepath/common.go deleted file mode 100644 index 5beb2e6e43..0000000000 --- a/vendor/github.com/docker/docker/internal/safepath/common.go +++ /dev/null @@ -1,66 +0,0 @@ -package safepath - -import ( - "os" - "path/filepath" - - "github.com/pkg/errors" -) - -// evaluatePath evaluates symlinks in the concatenation of path and subpath. If -// err is nil, resolvedBasePath will contain result of resolving all symlinks -// in the given path, and resolvedSubpath will contain a relative path rooted -// at the resolvedBasePath pointing to the concatenation after resolving all -// symlinks. -func evaluatePath(path, subpath string) (resolvedBasePath string, resolvedSubpath string, err error) { - baseResolved, err := filepath.EvalSymlinks(path) - if err != nil { - if errors.Is(err, os.ErrNotExist) { - return "", "", &ErrNotAccessible{Path: path, Cause: err} - } - return "", "", errors.Wrapf(err, "error while resolving symlinks in base directory %q", path) - } - - combinedPath := filepath.Join(baseResolved, subpath) - combinedResolved, err := filepath.EvalSymlinks(combinedPath) - if err != nil { - if errors.Is(err, os.ErrNotExist) { - return "", "", &ErrNotAccessible{Path: combinedPath, Cause: err} - } - return "", "", errors.Wrapf(err, "error while resolving symlinks in combined path %q", combinedPath) - } - - subpart, err := filepath.Rel(baseResolved, combinedResolved) - if err != nil { - return "", "", &ErrEscapesBase{Base: baseResolved, Subpath: subpath} - } - - if !filepath.IsLocal(subpart) { - return "", "", &ErrEscapesBase{Base: baseResolved, Subpath: subpath} - } - - return baseResolved, subpart, nil -} - -// isLocalTo reports whether path, using lexical analysis only, has all of these properties: -// - is within the subtree rooted at basepath -// - is not empty -// - on Windows, is not a reserved name such as "NUL" -// -// If isLocalTo(path, basepath) returns true, then -// -// filepath.Rel(basepath, path) -// -// will always produce an unrooted path with no `..` elements. -// -// isLocalTo is a purely lexical operation. In particular, it does not account for the effect of any symbolic links that may exist in the filesystem. -// -// Both path and basepath are expected to be absolute paths. -func isLocalTo(path, basepath string) bool { - rel, err := filepath.Rel(basepath, path) - if err != nil { - return false - } - - return filepath.IsLocal(rel) -} diff --git a/vendor/github.com/docker/docker/internal/safepath/errors.go b/vendor/github.com/docker/docker/internal/safepath/errors.go deleted file mode 100644 index 8fcfe262ee..0000000000 --- a/vendor/github.com/docker/docker/internal/safepath/errors.go +++ /dev/null @@ -1,42 +0,0 @@ -package safepath - -// ErrNotAccessible is returned by Join when the resulting path doesn't exist, -// is not accessible, or any of the path components was replaced with a symlink -// during the path traversal. -type ErrNotAccessible struct { - Path string - Cause error -} - -func (*ErrNotAccessible) NotFound() {} - -func (e *ErrNotAccessible) Unwrap() error { - return e.Cause -} - -func (e *ErrNotAccessible) Error() string { - msg := "cannot access path " + e.Path - if e.Cause != nil { - msg += ": " + e.Cause.Error() - } - return msg -} - -// ErrEscapesBase is returned by Join when the resulting concatenation would -// point outside of the specified base directory. -type ErrEscapesBase struct { - Base, Subpath string -} - -func (*ErrEscapesBase) InvalidParameter() {} - -func (e *ErrEscapesBase) Error() string { - msg := "path concatenation escapes the base directory" - if e.Base != "" { - msg += ", base: " + e.Base - } - if e.Subpath != "" { - msg += ", subpath: " + e.Subpath - } - return msg -} diff --git a/vendor/github.com/docker/docker/internal/safepath/join_linux.go b/vendor/github.com/docker/docker/internal/safepath/join_linux.go deleted file mode 100644 index fabf64e0e3..0000000000 --- a/vendor/github.com/docker/docker/internal/safepath/join_linux.go +++ /dev/null @@ -1,149 +0,0 @@ -package safepath - -import ( - "context" - "os" - "path/filepath" - "runtime" - "strconv" - - "github.com/containerd/log" - "github.com/docker/docker/internal/unix_noeintr" - "github.com/pkg/errors" - "golang.org/x/sys/unix" -) - -// Join makes sure that the concatenation of path and subpath doesn't -// resolve to a path outside of path and returns a path to a temporary file that is -// a bind mount to the exact same file/directory that was validated. -// -// After use, it is the caller's responsibility to call Close on the returned -// SafePath object, which will unmount the temporary file/directory -// and remove it. -func Join(ctx context.Context, path, subpath string) (*SafePath, error) { - base, subpart, err := evaluatePath(path, subpath) - if err != nil { - return nil, err - } - - runtime.LockOSThread() - defer runtime.UnlockOSThread() - fd, err := safeOpenFd(base, subpart) - if err != nil { - return nil, err - } - - defer func() { - if err := unix_noeintr.Close(fd); err != nil { - log.G(ctx).WithError(err).Errorf("Closing FD %d failed for safeOpenFd(%s, %s)", fd, base, subpart) - } - }() - - tmpMount, err := tempMountPoint(fd) - if err != nil { - return nil, errors.Wrap(err, "failed to create temporary file for safe mount") - } - - if err := unix_noeintr.Mount("/proc/self/fd/"+strconv.Itoa(fd), tmpMount, "none", unix.MS_BIND, ""); err != nil { - if err := os.Remove(tmpMount); err != nil { - log.G(ctx).WithError(err).Warn("failed to remove tmpMount after failed mount") - } - return nil, errors.Wrap(err, "failed to mount resolved path") - } - - return &SafePath{ - path: tmpMount, - sourceBase: base, - sourceSubpath: subpart, - cleanup: cleanupSafePath(tmpMount), - }, nil -} - -// safeOpenFd opens the file at filepath.Join(path, subpath) in O_PATH -// mode and returns the file descriptor if subpath is within the subtree -// rooted at path. It is an error if any of components of path or subpath -// are symbolic links. -// -// It is a caller's responsibility to close the returned file descriptor, if no -// error was returned. -func safeOpenFd(path, subpath string) (int, error) { - // Open base volume path (_data directory). - prevFd, err := unix_noeintr.Open(path, unix.O_PATH|unix.O_DIRECTORY|unix.O_CLOEXEC|unix.O_NOFOLLOW, 0) - if err != nil { - return -1, &ErrNotAccessible{Path: path, Cause: err} - } - defer unix_noeintr.Close(prevFd) - - // Try to use the Openat2 syscall first (available on Linux 5.6+). - fd, err := unix_noeintr.Openat2(prevFd, subpath, &unix.OpenHow{ - Flags: unix.O_PATH | unix.O_CLOEXEC, - Mode: 0, - Resolve: unix.RESOLVE_BENEATH | unix.RESOLVE_NO_MAGICLINKS | unix.RESOLVE_NO_SYMLINKS, - }) - - switch { - case errors.Is(err, unix.ENOSYS): - // Openat2 is not available, fallback to Openat loop. - return kubernetesSafeOpen(path, subpath) - case errors.Is(err, unix.EXDEV): - return -1, &ErrEscapesBase{Base: path, Subpath: subpath} - case errors.Is(err, unix.ENOENT), errors.Is(err, unix.ELOOP): - return -1, &ErrNotAccessible{Path: filepath.Join(path, subpath), Cause: err} - case err != nil: - return -1, &os.PathError{Op: "openat2", Path: subpath, Err: err} - } - - // Openat2 is available and succeeded. - return fd, nil -} - -// tempMountPoint creates a temporary file/directory to act as mount -// point for the file descriptor. -func tempMountPoint(sourceFd int) (string, error) { - var stat unix.Stat_t - err := unix_noeintr.Fstat(sourceFd, &stat) - if err != nil { - return "", errors.Wrap(err, "failed to Fstat mount source fd") - } - - isDir := (stat.Mode & unix.S_IFMT) == unix.S_IFDIR - if isDir { - return os.MkdirTemp("", "safe-mount") - } - - f, err := os.CreateTemp("", "safe-mount") - if err != nil { - return "", err - } - - p := f.Name() - if err := f.Close(); err != nil { - return "", err - } - return p, nil -} - -// cleanupSafePath returns a function that unmounts the path and removes the -// mountpoint. -func cleanupSafePath(path string) func(context.Context) error { - return func(ctx context.Context) error { - log.G(ctx).WithField("path", path).Debug("removing safe temp mount") - - if err := unix_noeintr.Unmount(path, unix.MNT_DETACH); err != nil { - if errors.Is(err, unix.EINVAL) { - log.G(ctx).WithField("path", path).Warn("safe temp mount no longer exists?") - return nil - } - return errors.Wrapf(err, "error unmounting safe mount %s", path) - } - if err := os.Remove(path); err != nil { - if errors.Is(err, os.ErrNotExist) { - log.G(ctx).WithField("path", path).Warn("safe temp mount no longer exists?") - return nil - } - return errors.Wrapf(err, "failed to delete temporary safe mount") - } - - return nil - } -} diff --git a/vendor/github.com/docker/docker/internal/safepath/join_windows.go b/vendor/github.com/docker/docker/internal/safepath/join_windows.go deleted file mode 100644 index 5acfc22ec8..0000000000 --- a/vendor/github.com/docker/docker/internal/safepath/join_windows.go +++ /dev/null @@ -1,92 +0,0 @@ -package safepath - -import ( - "context" - "os" - "path/filepath" - "strings" - - "github.com/containerd/log" - "github.com/docker/docker/internal/cleanups" - "github.com/pkg/errors" - "golang.org/x/sys/windows" -) - -// Join locks all individual components of the path which is the concatenation -// of provided path and its subpath, checks that it doesn't escape the base path -// and returns the concatenated path. -// -// The path is safe (the path target won't change) until the returned SafePath -// is Closed. -// Caller is responsible for calling the Close function which unlocks the path. -func Join(ctx context.Context, path, subpath string) (*SafePath, error) { - base, subpart, err := evaluatePath(path, subpath) - if err != nil { - return nil, err - } - parts := strings.Split(subpart, string(os.PathSeparator)) - - cleanupJobs := cleanups.Composite{} - defer func() { - if cErr := cleanupJobs.Call(context.WithoutCancel(ctx)); cErr != nil { - log.G(ctx).WithError(cErr).Warn("failed to close handles after error") - } - }() - - fullPath := base - for _, part := range parts { - fullPath = filepath.Join(fullPath, part) - - handle, err := lockFile(fullPath) - if err != nil { - if errors.Is(err, windows.ERROR_FILE_NOT_FOUND) { - return nil, &ErrNotAccessible{Path: fullPath, Cause: err} - } - return nil, errors.Wrapf(err, "failed to lock file %s", fullPath) - } - cleanupJobs.Add(func(context.Context) error { - if err := windows.CloseHandle(handle); err != nil { - return &os.PathError{Op: "CloseHandle", Path: fullPath, Err: err} - } - return err - }) - - realPath, err := filepath.EvalSymlinks(fullPath) - if err != nil { - return nil, errors.Wrapf(err, "failed to eval symlinks of %s", fullPath) - } - - if realPath != fullPath && !isLocalTo(realPath, base) { - return nil, &ErrEscapesBase{Base: base, Subpath: subpart} - } - - var info windows.ByHandleFileInformation - if err := windows.GetFileInformationByHandle(handle, &info); err != nil { - return nil, errors.WithStack(&os.PathError{Op: "GetFileInformationByHandle", Path: fullPath, Err: err}) - } - - if (info.FileAttributes & windows.FILE_ATTRIBUTE_REPARSE_POINT) != 0 { - return nil, &ErrNotAccessible{Path: fullPath, Cause: err} - } - } - - return &SafePath{ - path: fullPath, - sourceBase: base, - sourceSubpath: subpart, - cleanup: cleanupJobs.Release(), - }, nil -} - -func lockFile(path string) (windows.Handle, error) { - p, err := windows.UTF16PtrFromString(path) - if err != nil { - return windows.InvalidHandle, &os.PathError{Op: "UTF16PtrFromString", Path: path, Err: err} - } - const flags = windows.FILE_FLAG_BACKUP_SEMANTICS | windows.FILE_FLAG_OPEN_REPARSE_POINT - handle, err := windows.CreateFile(p, windows.GENERIC_READ, windows.FILE_SHARE_READ, nil, windows.OPEN_EXISTING, flags, 0) - if err != nil { - return handle, &os.PathError{Op: "CreateFile", Path: path, Err: err} - } - return handle, nil -} diff --git a/vendor/github.com/docker/docker/internal/safepath/k8s_safeopen_linux.go b/vendor/github.com/docker/docker/internal/safepath/k8s_safeopen_linux.go deleted file mode 100644 index 02db43a66b..0000000000 --- a/vendor/github.com/docker/docker/internal/safepath/k8s_safeopen_linux.go +++ /dev/null @@ -1,112 +0,0 @@ -package safepath - -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import ( - "context" - "fmt" - "path/filepath" - "strings" - - "github.com/containerd/log" - "github.com/docker/docker/internal/unix_noeintr" - "golang.org/x/sys/unix" -) - -// kubernetesSafeOpen open path formed by concatenation of the base directory -// and its subpath and return its fd. -// Symlinks are disallowed (pathname must already resolve symlinks) and the -// path must be within the base directory. -// This is minimally modified code from https://github.com/kubernetes/kubernetes/blob/55fb1805a1217b91b36fa8fe8f2bf3a28af2454d/pkg/volume/util/subpath/subpath_linux.go#L530 -func kubernetesSafeOpen(base, subpath string) (int, error) { - // syscall.Openat flags used to traverse directories not following symlinks - const nofollowFlags = unix.O_RDONLY | unix.O_NOFOLLOW - // flags for getting file descriptor without following the symlink - const openFDFlags = unix.O_NOFOLLOW | unix.O_PATH - - pathname := filepath.Join(base, subpath) - segments := strings.Split(subpath, string(filepath.Separator)) - - // Assumption: base is the only directory that we have under control. - // Base dir is not allowed to be a symlink. - parentFD, err := unix_noeintr.Open(base, nofollowFlags|unix.O_CLOEXEC, 0) - if err != nil { - return -1, &ErrNotAccessible{Path: base, Cause: err} - } - defer func() { - if parentFD != -1 { - if err = unix_noeintr.Close(parentFD); err != nil { - log.G(context.TODO()).Errorf("Closing FD %v failed for safeopen(%v): %v", parentFD, pathname, err) - } - } - }() - - childFD := -1 - defer func() { - if childFD != -1 { - if err = unix_noeintr.Close(childFD); err != nil { - log.G(context.TODO()).Errorf("Closing FD %v failed for safeopen(%v): %v", childFD, pathname, err) - } - } - }() - - currentPath := base - - // Follow the segments one by one using openat() to make - // sure the user cannot change already existing directories into symlinks. - for _, seg := range segments { - var deviceStat unix.Stat_t - - currentPath = filepath.Join(currentPath, seg) - if !isLocalTo(currentPath, base) { - return -1, &ErrEscapesBase{Base: currentPath, Subpath: seg} - } - - // Trigger auto mount if it's an auto-mounted directory, ignore error if not a directory. - // Notice the trailing slash is mandatory, see "automount" in openat(2) and open_by_handle_at(2). - _ = unix_noeintr.Fstatat(parentFD, seg+"/", &deviceStat, unix.AT_SYMLINK_NOFOLLOW) - - log.G(context.TODO()).Debugf("Opening path %s", currentPath) - childFD, err = unix_noeintr.Openat(parentFD, seg, openFDFlags|unix.O_CLOEXEC, 0) - if err != nil { - return -1, &ErrNotAccessible{Path: currentPath, Cause: err} - } - - err := unix_noeintr.Fstat(childFD, &deviceStat) - if err != nil { - return -1, fmt.Errorf("error running fstat on %s with %v", currentPath, err) - } - fileFmt := deviceStat.Mode & unix.S_IFMT - if fileFmt == unix.S_IFLNK { - return -1, fmt.Errorf("unexpected symlink found %s", currentPath) - } - - // Close parentFD - if err = unix_noeintr.Close(parentFD); err != nil { - return -1, fmt.Errorf("closing fd for %q failed: %v", filepath.Dir(currentPath), err) - } - // Set child to new parent - parentFD = childFD - childFD = -1 - } - - // We made it to the end, return this fd, don't close it - finalFD := parentFD - parentFD = -1 - - return finalFD, nil -} diff --git a/vendor/github.com/docker/docker/internal/safepath/safepath.go b/vendor/github.com/docker/docker/internal/safepath/safepath.go deleted file mode 100644 index c43e06fd22..0000000000 --- a/vendor/github.com/docker/docker/internal/safepath/safepath.go +++ /dev/null @@ -1,63 +0,0 @@ -package safepath - -import ( - "context" - "fmt" - "sync" - - "github.com/containerd/log" -) - -type SafePath struct { - path string - cleanup func(ctx context.Context) error - mutex sync.Mutex - - // Immutable fields - sourceBase, sourceSubpath string -} - -// Close releases the resources used by the path. -func (s *SafePath) Close(ctx context.Context) error { - s.mutex.Lock() - defer s.mutex.Unlock() - - if s.path == "" { - base, sub := s.SourcePath() - log.G(ctx).WithFields(log.Fields{ - "path": s.Path(), - "sourceBase": base, - "sourceSubpath": sub, - }).Warn("an attempt to close an already closed SafePath") - return nil - } - - s.path = "" - if s.cleanup != nil { - return s.cleanup(ctx) - } - return nil -} - -// IsValid return true when path can still be used and wasn't cleaned up by Close. -func (s *SafePath) IsValid() bool { - s.mutex.Lock() - defer s.mutex.Unlock() - return s.path != "" -} - -// Path returns a safe, temporary path that can be used to access the original path. -func (s *SafePath) Path() string { - s.mutex.Lock() - defer s.mutex.Unlock() - if s.path == "" { - panic(fmt.Sprintf("use-after-close attempted for safepath with source [%s, %s]", s.sourceBase, s.sourceSubpath)) - } - return s.path -} - -// SourcePath returns the source path the safepath points to. -func (s *SafePath) SourcePath() (string, string) { - // No mutex lock because these are immutable. - return s.sourceBase, s.sourceSubpath -} diff --git a/vendor/github.com/docker/docker/internal/unix_noeintr/epoll_linux.go b/vendor/github.com/docker/docker/internal/unix_noeintr/epoll_linux.go deleted file mode 100644 index ef691ab3eb..0000000000 --- a/vendor/github.com/docker/docker/internal/unix_noeintr/epoll_linux.go +++ /dev/null @@ -1,37 +0,0 @@ -package unix_noeintr - -import ( - "errors" - - "golang.org/x/sys/unix" -) - -func EpollCreate() (int, error) { - for { - fd, err := unix.EpollCreate1(unix.EPOLL_CLOEXEC) - if errors.Is(err, unix.EINTR) { - continue - } - return fd, err - } -} - -func EpollCtl(epFd int, op int, fd int, event *unix.EpollEvent) error { - for { - err := unix.EpollCtl(epFd, op, fd, event) - if errors.Is(err, unix.EINTR) { - continue - } - return err - } -} - -func EpollWait(epFd int, events []unix.EpollEvent, msec int) (int, error) { - for { - n, err := unix.EpollWait(epFd, events, msec) - if errors.Is(err, unix.EINTR) { - continue - } - return n, err - } -} diff --git a/vendor/github.com/docker/docker/internal/unix_noeintr/fs_unix.go b/vendor/github.com/docker/docker/internal/unix_noeintr/fs_unix.go deleted file mode 100644 index 326029b812..0000000000 --- a/vendor/github.com/docker/docker/internal/unix_noeintr/fs_unix.go +++ /dev/null @@ -1,85 +0,0 @@ -//go:build !windows - -// Package unix_noeintr provides wrappers for unix syscalls that retry on EINTR. -// -// TODO: Consider moving (for example to moby/sys) and making the wrappers auto-generated. -package unix_noeintr - -import ( - "errors" - - "golang.org/x/sys/unix" -) - -func Retry(f func() error) { - for { - err := f() - if !errors.Is(err, unix.EINTR) { - return - } - } -} - -func Mount(source string, target string, fstype string, flags uintptr, data string) (err error) { - Retry(func() error { - err = unix.Mount(source, target, fstype, flags, data) - return err - }) - return err -} - -func Unmount(target string, flags int) (err error) { - Retry(func() error { - err = unix.Unmount(target, flags) - return err - }) - return err -} - -func Open(path string, mode int, perm uint32) (fd int, err error) { - Retry(func() error { - fd, err = unix.Open(path, mode, perm) - return err - }) - return fd, err -} - -func Close(fd int) (err error) { - Retry(func() error { - err = unix.Close(fd) - return err - }) - return err -} - -func Openat(dirfd int, path string, mode int, perms uint32) (fd int, err error) { - Retry(func() error { - fd, err = unix.Openat(dirfd, path, mode, perms) - return err - }) - return fd, err -} - -func Openat2(dirfd int, path string, how *unix.OpenHow) (fd int, err error) { - Retry(func() error { - fd, err = unix.Openat2(dirfd, path, how) - return err - }) - return fd, err -} - -func Fstat(fd int, stat *unix.Stat_t) (err error) { - Retry(func() error { - err = unix.Fstat(fd, stat) - return err - }) - return err -} - -func Fstatat(fd int, path string, stat *unix.Stat_t, flags int) (err error) { - Retry(func() error { - err = unix.Fstatat(fd, path, stat, flags) - return err - }) - return err -} diff --git a/vendor/github.com/docker/docker/internal/usergroup/add_linux.go b/vendor/github.com/docker/docker/internal/usergroup/add_linux.go index 631ffc1076..e3454935cf 100644 --- a/vendor/github.com/docker/docker/internal/usergroup/add_linux.go +++ b/vendor/github.com/docker/docker/internal/usergroup/add_linux.go @@ -164,8 +164,8 @@ func findNextRangeStart(rangeList []user.SubID) (int, error) { } func wouldOverlap(arange user.SubID, ID int64) bool { - var low int64 = ID - var high int64 = ID + defaultRangeLen + low := ID + high := low + defaultRangeLen if (low >= arange.SubID && low <= arange.SubID+arange.Count) || (high <= arange.SubID+arange.Count && high >= arange.SubID) { return true diff --git a/vendor/github.com/docker/docker/layer/layer_store.go b/vendor/github.com/docker/docker/layer/layer_store.go index 9b0996c70a..29d0a44d85 100644 --- a/vendor/github.com/docker/docker/layer/layer_store.go +++ b/vendor/github.com/docker/docker/layer/layer_store.go @@ -486,7 +486,7 @@ func (ls *layerStore) CreateRWLayer(name string, parent ChainID, opts *CreateRWL return nil, ErrMountNameConflict } - var pid string + var parentID string var p *roLayer if string(parent) != "" { ls.layerL.Lock() @@ -495,13 +495,13 @@ func (ls *layerStore) CreateRWLayer(name string, parent ChainID, opts *CreateRWL if p == nil { return nil, ErrLayerDoesNotExist } - pid = p.cacheID + parentID = p.cacheID // Release parent chain if error defer func() { if retErr != nil { ls.layerL.Lock() - ls.releaseLayer(p) + _, _ = ls.releaseLayer(p) ls.layerL.Unlock() } }() @@ -517,18 +517,18 @@ func (ls *layerStore) CreateRWLayer(name string, parent ChainID, opts *CreateRWL if initFunc != nil { var err error - pid, err = ls.initMount(m.mountID, pid, mountLabel, initFunc, storageOpt) + parentID, err = ls.initMount(m.mountID, parentID, mountLabel, initFunc, storageOpt) if err != nil { return nil, err } - m.initID = pid + m.initID = parentID } createOpts := &graphdriver.CreateOpts{ StorageOpt: storageOpt, } - if err := ls.driver.CreateReadWrite(m.mountID, pid, createOpts); err != nil { + if err := ls.driver.CreateReadWrite(m.mountID, parentID, createOpts); err != nil { return nil, err } if err := ls.saveMount(m); err != nil { diff --git a/vendor/github.com/docker/docker/layer/migration.go b/vendor/github.com/docker/docker/layer/migration.go index bf475107c1..7e4b4645b1 100644 --- a/vendor/github.com/docker/docker/layer/migration.go +++ b/vendor/github.com/docker/docker/layer/migration.go @@ -13,12 +13,12 @@ import ( "github.com/vbatts/tar-split/tar/storage" ) -func (ls *layerStore) ChecksumForGraphID(id, parent, newTarDataPath string) (diffID DiffID, size int64, err error) { - rawarchive, err := ls.driver.Diff(id, parent) +func (ls *layerStore) ChecksumForGraphID(id, parent, newTarDataPath string) (diffID DiffID, size int64, _ error) { + rawArchive, err := ls.driver.Diff(id, parent) if err != nil { return "", 0, err } - defer rawarchive.Close() + defer rawArchive.Close() f, err := os.Create(newTarDataPath) if err != nil { @@ -31,7 +31,7 @@ func (ls *layerStore) ChecksumForGraphID(id, parent, newTarDataPath string) (dif packerCounter := &packSizeCounter{metaPacker, &size} - archive, err := asm.NewInputTarStream(rawarchive, packerCounter, nil) + archive, err := asm.NewInputTarStream(rawArchive, packerCounter, nil) if err != nil { return "", 0, err } @@ -43,10 +43,10 @@ func (ls *layerStore) ChecksumForGraphID(id, parent, newTarDataPath string) (dif } func (ls *layerStore) RegisterByGraphID(graphID string, parent ChainID, diffID DiffID, tarDataFile string, size int64) (Layer, error) { - // err is used to hold the error which will always trigger + // cleanupErr is used to hold the error which will always trigger // cleanup of creates sources but may not be an error returned // to the caller (already exists). - var err error + var cleanupErr error var p *roLayer if string(parent) != "" { ls.layerL.Lock() @@ -58,9 +58,9 @@ func (ls *layerStore) RegisterByGraphID(graphID string, parent ChainID, diffID D // Release parent chain if error defer func() { - if err != nil { + if cleanupErr != nil { ls.layerL.Lock() - ls.releaseLayer(p) + _, _ = ls.releaseLayer(p) ls.layerL.Unlock() } }() @@ -83,45 +83,45 @@ func (ls *layerStore) RegisterByGraphID(graphID string, parent ChainID, diffID D if existingLayer := ls.get(layer.chainID); existingLayer != nil { // Set error for cleanup, but do not return - err = errors.New("layer already exists") + cleanupErr = errors.New("layer already exists") return existingLayer.getReference(), nil } - tx, err := ls.store.StartTransaction() - if err != nil { - return nil, err + tx, cleanupErr := ls.store.StartTransaction() + if cleanupErr != nil { + return nil, cleanupErr } defer func() { - if err != nil { - log.G(context.TODO()).Debugf("Cleaning up transaction after failed migration for %s: %v", graphID, err) + if cleanupErr != nil { + log.G(context.TODO()).Debugf("Cleaning up transaction after failed migration for %s: %v", graphID, cleanupErr) if err := tx.Cancel(); err != nil { log.G(context.TODO()).Errorf("Error canceling metadata transaction %q: %s", tx.String(), err) } } }() - tsw, err := tx.TarSplitWriter(false) - if err != nil { - return nil, err + tsw, cleanupErr := tx.TarSplitWriter(false) + if cleanupErr != nil { + return nil, cleanupErr } defer tsw.Close() - tdf, err := os.Open(tarDataFile) - if err != nil { - return nil, err + tdf, cleanupErr := os.Open(tarDataFile) + if cleanupErr != nil { + return nil, cleanupErr } defer tdf.Close() - _, err = io.Copy(tsw, tdf) - if err != nil { - return nil, err + _, cleanupErr = io.Copy(tsw, tdf) + if cleanupErr != nil { + return nil, cleanupErr } - if err = storeLayer(tx, layer); err != nil { - return nil, err + if cleanupErr = storeLayer(tx, layer); cleanupErr != nil { + return nil, cleanupErr } - if err = tx.Commit(layer.chainID); err != nil { - return nil, err + if cleanupErr = tx.Commit(layer.chainID); cleanupErr != nil { + return nil, cleanupErr } ls.layerMap[layer.chainID] = layer diff --git a/vendor/github.com/docker/docker/libcontainerd/types/types.go b/vendor/github.com/docker/docker/libcontainerd/types/types.go deleted file mode 100644 index 5984baca9b..0000000000 --- a/vendor/github.com/docker/docker/libcontainerd/types/types.go +++ /dev/null @@ -1,103 +0,0 @@ -package types // import "github.com/docker/docker/libcontainerd/types" - -import ( - "context" - "syscall" - "time" - - containerd "github.com/containerd/containerd/v2/client" - "github.com/containerd/containerd/v2/pkg/cio" - "github.com/opencontainers/runtime-spec/specs-go" -) - -// EventType represents a possible event from libcontainerd -type EventType string - -// Event constants used when reporting events -const ( - EventUnknown EventType = "unknown" - EventExit EventType = "exit" - EventOOM EventType = "oom" - EventCreate EventType = "create" - EventStart EventType = "start" - EventExecAdded EventType = "exec-added" - EventExecStarted EventType = "exec-started" - EventPaused EventType = "paused" - EventResumed EventType = "resumed" -) - -// EventInfo contains the event info -type EventInfo struct { - ContainerID string - ProcessID string - Pid uint32 - ExitCode uint32 - ExitedAt time.Time - Error error -} - -// Backend defines callbacks that the client of the library needs to implement. -type Backend interface { - ProcessEvent(containerID string, event EventType, ei EventInfo) error -} - -// Process of a container -type Process interface { - // Pid is the system specific process id - Pid() uint32 - // Kill sends the provided signal to the process - Kill(ctx context.Context, signal syscall.Signal) error - // Resize changes the width and height of the process's terminal - Resize(ctx context.Context, width, height uint32) error - // Delete removes the process and any resources allocated returning the exit status - Delete(context.Context) (*containerd.ExitStatus, error) -} - -// Client provides access to containerd features. -type Client interface { - Version(ctx context.Context) (containerd.Version, error) - // LoadContainer loads the metadata for a container from containerd. - LoadContainer(ctx context.Context, containerID string) (Container, error) - // NewContainer creates a new containerd container. - NewContainer(ctx context.Context, containerID string, spec *specs.Spec, shim string, runtimeOptions interface{}, opts ...containerd.NewContainerOpts) (Container, error) -} - -// Container provides access to a containerd container. -type Container interface { - NewTask(ctx context.Context, checkpointDir string, withStdin bool, attachStdio StdioCallback) (Task, error) - Task(ctx context.Context) (Task, error) - // AttachTask returns the current task for the container and reattaches - // to the IO for the running task. If no task exists for the container - // a NotFound error is returned. - // - // Clients must make sure that only one reader is attached to the task. - AttachTask(ctx context.Context, attachStdio StdioCallback) (Task, error) - // Delete removes the container and associated resources - Delete(context.Context) error -} - -// Task provides access to a running containerd container. -type Task interface { - Process - // Start begins execution of the task - Start(context.Context) error - // Pause suspends the execution of the task - Pause(context.Context) error - // Resume the execution of the task - Resume(context.Context) error - Stats(ctx context.Context) (*Stats, error) - // Pids returns a list of system specific process ids inside the task - Pids(context.Context) ([]containerd.ProcessInfo, error) - Summary(ctx context.Context) ([]Summary, error) - // ForceDelete forcefully kills the task's processes and deletes the task - ForceDelete(context.Context) error - // Status returns the executing status of the task - Status(ctx context.Context) (containerd.Status, error) - // Exec creates and starts a new process inside the task - Exec(ctx context.Context, processID string, spec *specs.Process, withStdin bool, attachStdio StdioCallback) (Process, error) - UpdateResources(ctx context.Context, resources *Resources) error - CreateCheckpoint(ctx context.Context, checkpointDir string, exit bool) error -} - -// StdioCallback is called to connect a container or process stdio. -type StdioCallback func(io *cio.DirectIO) (cio.IO, error) diff --git a/vendor/github.com/docker/docker/libcontainerd/types/types_linux.go b/vendor/github.com/docker/docker/libcontainerd/types/types_linux.go deleted file mode 100644 index ef85404c90..0000000000 --- a/vendor/github.com/docker/docker/libcontainerd/types/types_linux.go +++ /dev/null @@ -1,33 +0,0 @@ -package types // import "github.com/docker/docker/libcontainerd/types" - -import ( - "time" - - "github.com/opencontainers/runtime-spec/specs-go" -) - -// Summary is not used on linux -type Summary struct{} - -// Stats holds metrics properties as returned by containerd -type Stats struct { - Read time.Time - // Metrics is expected to be either one of: - // * github.com/containerd/cgroups/v3/cgroup1/stats.Metrics - // * github.com/containerd/cgroups/v3/cgroup2/stats.Metrics - Metrics interface{} -} - -// InterfaceToStats returns a stats object from the platform-specific interface. -func InterfaceToStats(read time.Time, v interface{}) *Stats { - return &Stats{ - Metrics: v, - Read: read, - } -} - -// Resources defines updatable container resource values. TODO: it must match containerd upcoming API -type Resources = specs.LinuxResources - -// Checkpoints contains the details of a checkpoint -type Checkpoints struct{} diff --git a/vendor/github.com/docker/docker/libcontainerd/types/types_windows.go b/vendor/github.com/docker/docker/libcontainerd/types/types_windows.go deleted file mode 100644 index 3b521f1342..0000000000 --- a/vendor/github.com/docker/docker/libcontainerd/types/types_windows.go +++ /dev/null @@ -1,37 +0,0 @@ -package types // import "github.com/docker/docker/libcontainerd/types" - -import ( - "time" - - "github.com/Microsoft/hcsshim" - "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options" -) - -type Summary options.ProcessDetails - -// Stats contains statistics from HCS -type Stats struct { - Read time.Time - HCSStats *hcsshim.Statistics -} - -// InterfaceToStats returns a stats object from the platform-specific interface. -func InterfaceToStats(read time.Time, v interface{}) *Stats { - return &Stats{ - HCSStats: v.(*hcsshim.Statistics), - Read: read, - } -} - -// Resources defines updatable container resource values. -type Resources struct{} - -// Checkpoint holds the details of a checkpoint (not supported in windows) -type Checkpoint struct { - Name string -} - -// Checkpoints contains the details of a checkpoint -type Checkpoints struct { - Checkpoints []*Checkpoint -} diff --git a/vendor/github.com/docker/docker/oci/devices_linux.go b/vendor/github.com/docker/docker/oci/devices_linux.go index d559a7c2e2..ed0a140f8a 100644 --- a/vendor/github.com/docker/docker/oci/devices_linux.go +++ b/vendor/github.com/docker/docker/oci/devices_linux.go @@ -21,7 +21,7 @@ func deviceCgroup(d *specs.LinuxDevice, permissions string) specs.LinuxDeviceCgr } // DevicesFromPath computes a list of devices and device permissions from paths (pathOnHost and pathInContainer) and cgroup permissions. -func DevicesFromPath(pathOnHost, pathInContainer, cgroupPermissions string) (devs []specs.LinuxDevice, devPermissions []specs.LinuxDeviceCgroup, err error) { +func DevicesFromPath(pathOnHost, pathInContainer, cgroupPermissions string) (devs []specs.LinuxDevice, devPermissions []specs.LinuxDeviceCgroup, _ error) { resolvedPathOnHost := pathOnHost // check if it is a symbolic link diff --git a/vendor/github.com/docker/docker/oci/oci.go b/vendor/github.com/docker/docker/oci/oci.go index 656a339322..8d5443ee00 100644 --- a/vendor/github.com/docker/docker/oci/oci.go +++ b/vendor/github.com/docker/docker/oci/oci.go @@ -15,7 +15,7 @@ import ( // that *only* passes `a` as value: `echo a > /sys/fs/cgroup/1/devices.allow, which would be // the "implicit" equivalent of "a *:* rwm". Source-code also looks to confirm this, and returns // early for "a" (all); https://github.com/torvalds/linux/blob/v5.10/security/device_cgroup.c#L614-L642 -var deviceCgroupRuleRegex = lazyregexp.New("^([acb]) ([0-9]+|\\*):([0-9]+|\\*) ([rwm]{1,3})$") //nolint: gosimple +var deviceCgroupRuleRegex = lazyregexp.New("^([acb]) ([0-9]+|\\*):([0-9]+|\\*) ([rwm]{1,3})$") // SetCapabilities sets the provided capabilities on the spec // All capabilities are added if privileged is true. diff --git a/vendor/github.com/docker/docker/pkg/homedir/homedir.go b/vendor/github.com/docker/docker/pkg/homedir/homedir.go deleted file mode 100644 index c0ab3f5bf3..0000000000 --- a/vendor/github.com/docker/docker/pkg/homedir/homedir.go +++ /dev/null @@ -1,28 +0,0 @@ -package homedir - -import ( - "os" - "os/user" - "runtime" -) - -// Get returns the home directory of the current user with the help of -// environment variables depending on the target operating system. -// Returned path should be used with "path/filepath" to form new paths. -// -// On non-Windows platforms, it falls back to nss lookups, if the home -// directory cannot be obtained from environment-variables. -// -// If linking statically with cgo enabled against glibc, ensure the -// osusergo build tag is used. -// -// If needing to do nss lookups, do not disable cgo or set osusergo. -func Get() string { - home, _ := os.UserHomeDir() - if home == "" && runtime.GOOS != "windows" { - if u, err := user.Current(); err == nil { - return u.HomeDir - } - } - return home -} diff --git a/vendor/github.com/docker/docker/pkg/homedir/homedir_linux.go b/vendor/github.com/docker/docker/pkg/homedir/homedir_linux.go deleted file mode 100644 index ded1c7c8c6..0000000000 --- a/vendor/github.com/docker/docker/pkg/homedir/homedir_linux.go +++ /dev/null @@ -1,105 +0,0 @@ -package homedir // import "github.com/docker/docker/pkg/homedir" - -import ( - "errors" - "os" - "path/filepath" - "strings" -) - -// GetRuntimeDir returns XDG_RUNTIME_DIR. -// XDG_RUNTIME_DIR is typically configured via pam_systemd. -// GetRuntimeDir returns non-nil error if XDG_RUNTIME_DIR is not set. -// -// See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html -func GetRuntimeDir() (string, error) { - if xdgRuntimeDir := os.Getenv("XDG_RUNTIME_DIR"); xdgRuntimeDir != "" { - return xdgRuntimeDir, nil - } - return "", errors.New("could not get XDG_RUNTIME_DIR") -} - -// StickRuntimeDirContents sets the sticky bit on files that are under -// XDG_RUNTIME_DIR, so that the files won't be periodically removed by the system. -// -// StickyRuntimeDir returns slice of sticked files. -// StickyRuntimeDir returns nil error if XDG_RUNTIME_DIR is not set. -// -// See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html -func StickRuntimeDirContents(files []string) ([]string, error) { - runtimeDir, err := GetRuntimeDir() - if err != nil { - // ignore error if runtimeDir is empty - return nil, nil - } - runtimeDir, err = filepath.Abs(runtimeDir) - if err != nil { - return nil, err - } - var sticked []string - for _, f := range files { - f, err = filepath.Abs(f) - if err != nil { - return sticked, err - } - if strings.HasPrefix(f, runtimeDir+"/") { - if err = stick(f); err != nil { - return sticked, err - } - sticked = append(sticked, f) - } - } - return sticked, nil -} - -func stick(f string) error { - st, err := os.Stat(f) - if err != nil { - return err - } - m := st.Mode() - m |= os.ModeSticky - return os.Chmod(f, m) -} - -// GetDataHome returns XDG_DATA_HOME. -// GetDataHome returns $HOME/.local/share and nil error if XDG_DATA_HOME is not set. -// If HOME and XDG_DATA_HOME are not set, getpwent(3) is consulted to determine the users home directory. -// -// See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html -func GetDataHome() (string, error) { - if xdgDataHome := os.Getenv("XDG_DATA_HOME"); xdgDataHome != "" { - return xdgDataHome, nil - } - home := Get() - if home == "" { - return "", errors.New("could not get either XDG_DATA_HOME or HOME") - } - return filepath.Join(home, ".local", "share"), nil -} - -// GetConfigHome returns XDG_CONFIG_HOME. -// GetConfigHome returns $HOME/.config and nil error if XDG_CONFIG_HOME is not set. -// If HOME and XDG_CONFIG_HOME are not set, getpwent(3) is consulted to determine the users home directory. -// -// See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html -func GetConfigHome() (string, error) { - if xdgConfigHome := os.Getenv("XDG_CONFIG_HOME"); xdgConfigHome != "" { - return xdgConfigHome, nil - } - home := Get() - if home == "" { - return "", errors.New("could not get either XDG_CONFIG_HOME or HOME") - } - return filepath.Join(home, ".config"), nil -} - -// GetLibHome returns $HOME/.local/lib -// If HOME is not set, getpwent(3) is consulted to determine the users home directory. -func GetLibHome() (string, error) { - home := Get() - if home == "" { - return "", errors.New("could not get HOME") - } - return filepath.Join(home, ".local/lib"), nil -} diff --git a/vendor/github.com/docker/docker/pkg/homedir/homedir_others.go b/vendor/github.com/docker/docker/pkg/homedir/homedir_others.go deleted file mode 100644 index 4eeb26b5dc..0000000000 --- a/vendor/github.com/docker/docker/pkg/homedir/homedir_others.go +++ /dev/null @@ -1,32 +0,0 @@ -//go:build !linux - -package homedir // import "github.com/docker/docker/pkg/homedir" - -import ( - "errors" -) - -// GetRuntimeDir is unsupported on non-linux system. -func GetRuntimeDir() (string, error) { - return "", errors.New("homedir.GetRuntimeDir() is not supported on this system") -} - -// StickRuntimeDirContents is unsupported on non-linux system. -func StickRuntimeDirContents(files []string) ([]string, error) { - return nil, errors.New("homedir.StickRuntimeDirContents() is not supported on this system") -} - -// GetDataHome is unsupported on non-linux system. -func GetDataHome() (string, error) { - return "", errors.New("homedir.GetDataHome() is not supported on this system") -} - -// GetConfigHome is unsupported on non-linux system. -func GetConfigHome() (string, error) { - return "", errors.New("homedir.GetConfigHome() is not supported on this system") -} - -// GetLibHome is unsupported on non-linux system. -func GetLibHome() (string, error) { - return "", errors.New("homedir.GetLibHome() is not supported on this system") -} diff --git a/vendor/github.com/docker/docker/pkg/ioutils/readers.go b/vendor/github.com/docker/docker/pkg/ioutils/readers.go index 9ddba2468d..811c6e6ceb 100644 --- a/vendor/github.com/docker/docker/pkg/ioutils/readers.go +++ b/vendor/github.com/docker/docker/pkg/ioutils/readers.go @@ -88,14 +88,14 @@ func NewCancelReadCloser(ctx context.Context, in io.ReadCloser) io.ReadCloser { // Read wraps the Read method of the pipe that provides data from the wrapped // ReadCloser. -func (p *cancelReadCloser) Read(buf []byte) (n int, err error) { +func (p *cancelReadCloser) Read(buf []byte) (int, error) { return p.pR.Read(buf) } // closeWithError closes the wrapper and its underlying reader. It will // cause future calls to Read to return err. func (p *cancelReadCloser) closeWithError(err error) { - p.pW.CloseWithError(err) + _ = p.pW.CloseWithError(err) p.cancel() } diff --git a/vendor/github.com/docker/docker/pkg/ioutils/writeflusher.go b/vendor/github.com/docker/docker/pkg/ioutils/writeflusher.go index 010db59fe6..62eeb2600d 100644 --- a/vendor/github.com/docker/docker/pkg/ioutils/writeflusher.go +++ b/vendor/github.com/docker/docker/pkg/ioutils/writeflusher.go @@ -21,14 +21,14 @@ type flusher interface { Flush() } -func (wf *WriteFlusher) Write(b []byte) (n int, err error) { +func (wf *WriteFlusher) Write(b []byte) (int, error) { select { case <-wf.closed: return 0, io.EOF default: } - n, err = wf.w.Write(b) + n, err := wf.w.Write(b) wf.Flush() // every write is a flush. return n, err } diff --git a/vendor/github.com/docker/docker/pkg/plugingetter/getter.go b/vendor/github.com/docker/docker/pkg/plugingetter/getter.go deleted file mode 100644 index 370e0d5b97..0000000000 --- a/vendor/github.com/docker/docker/pkg/plugingetter/getter.go +++ /dev/null @@ -1,52 +0,0 @@ -package plugingetter // import "github.com/docker/docker/pkg/plugingetter" - -import ( - "net" - "time" - - "github.com/docker/docker/pkg/plugins" -) - -const ( - // Lookup doesn't update RefCount - Lookup = 0 - // Acquire increments RefCount - Acquire = 1 - // Release decrements RefCount - Release = -1 -) - -// CompatPlugin is an abstraction to handle both v2(new) and v1(legacy) plugins. -type CompatPlugin interface { - Name() string - ScopedPath(string) string - IsV1() bool - PluginWithV1Client -} - -// PluginWithV1Client is a plugin that directly utilizes the v1/http plugin client -type PluginWithV1Client interface { - Client() *plugins.Client -} - -// PluginAddr is a plugin that exposes the socket address for creating custom clients rather than the built-in `*plugins.Client` -type PluginAddr interface { - Addr() net.Addr - Timeout() time.Duration - Protocol() string -} - -// CountedPlugin is a plugin which is reference counted. -type CountedPlugin interface { - Acquire() - Release() - CompatPlugin -} - -// PluginGetter is the interface implemented by Store -type PluginGetter interface { - Get(name, capability string, mode int) (CompatPlugin, error) - GetAllByCap(capability string) ([]CompatPlugin, error) - GetAllManagedPluginsByCap(capability string) []CompatPlugin - Handle(capability string, callback func(string, *plugins.Client)) -} diff --git a/vendor/github.com/docker/docker/pkg/plugins/client.go b/vendor/github.com/docker/docker/pkg/plugins/client.go deleted file mode 100644 index 8ac39972c0..0000000000 --- a/vendor/github.com/docker/docker/pkg/plugins/client.go +++ /dev/null @@ -1,270 +0,0 @@ -package plugins // import "github.com/docker/docker/pkg/plugins" - -import ( - "bytes" - "context" - "encoding/json" - "io" - "net/http" - "net/url" - "time" - - "github.com/containerd/log" - "github.com/docker/docker/pkg/ioutils" - "github.com/docker/docker/pkg/plugins/transport" - "github.com/docker/go-connections/sockets" - "github.com/docker/go-connections/tlsconfig" -) - -const ( - defaultTimeOut = 30 * time.Second - - // dummyHost is a hostname used for local communication. - // - // For local communications (npipe://, unix://), the hostname is not used, - // but we need valid and meaningful hostname. - dummyHost = "plugin.moby.localhost" -) - -// VersionMimetype is the Content-Type the engine sends to plugins. -const VersionMimetype = transport.VersionMimetype - -func newTransport(addr string, tlsConfig *tlsconfig.Options) (*transport.HTTPTransport, error) { - tr := &http.Transport{} - - if tlsConfig != nil { - c, err := tlsconfig.Client(*tlsConfig) - if err != nil { - return nil, err - } - tr.TLSClientConfig = c - } - - u, err := url.Parse(addr) - if err != nil { - return nil, err - } - socket := u.Host - if socket == "" { - // valid local socket addresses have the host empty. - socket = u.Path - } - if err := sockets.ConfigureTransport(tr, u.Scheme, socket); err != nil { - return nil, err - } - scheme := httpScheme(u) - hostName := u.Host - if hostName == "" || u.Scheme == "unix" || u.Scheme == "npipe" { - // Override host header for non-tcp connections. - hostName = dummyHost - } - return transport.NewHTTPTransport(tr, scheme, hostName), nil -} - -// NewClient creates a new plugin client (http). -func NewClient(addr string, tlsConfig *tlsconfig.Options) (*Client, error) { - clientTransport, err := newTransport(addr, tlsConfig) - if err != nil { - return nil, err - } - return newClientWithTransport(clientTransport, 0), nil -} - -// NewClientWithTimeout creates a new plugin client (http). -func NewClientWithTimeout(addr string, tlsConfig *tlsconfig.Options, timeout time.Duration) (*Client, error) { - clientTransport, err := newTransport(addr, tlsConfig) - if err != nil { - return nil, err - } - return newClientWithTransport(clientTransport, timeout), nil -} - -// newClientWithTransport creates a new plugin client with a given transport. -func newClientWithTransport(tr *transport.HTTPTransport, timeout time.Duration) *Client { - return &Client{ - http: &http.Client{ - Transport: tr, - Timeout: timeout, - }, - requestFactory: tr, - } -} - -// requestFactory defines an interface that transports can implement to -// create new requests. It's used in testing. -type requestFactory interface { - NewRequest(path string, data io.Reader) (*http.Request, error) -} - -// Client represents a plugin client. -type Client struct { - http *http.Client // http client to use - requestFactory requestFactory -} - -// RequestOpts is the set of options that can be passed into a request -type RequestOpts struct { - Timeout time.Duration - - // testTimeOut is used during tests to limit the max timeout in [abort] - testTimeOut time.Duration -} - -// WithRequestTimeout sets a timeout duration for plugin requests -func WithRequestTimeout(t time.Duration) func(*RequestOpts) { - return func(o *RequestOpts) { - o.Timeout = t - } -} - -// Call calls the specified method with the specified arguments for the plugin. -// It will retry for 30 seconds if a failure occurs when calling. -func (c *Client) Call(serviceMethod string, args, ret interface{}) error { - return c.CallWithOptions(serviceMethod, args, ret) -} - -// CallWithOptions is just like call except it takes options -func (c *Client) CallWithOptions(serviceMethod string, args interface{}, ret interface{}, opts ...func(*RequestOpts)) error { - var buf bytes.Buffer - if args != nil { - if err := json.NewEncoder(&buf).Encode(args); err != nil { - return err - } - } - body, err := c.callWithRetry(serviceMethod, &buf, true, opts...) - if err != nil { - return err - } - defer body.Close() - if ret != nil { - if err := json.NewDecoder(body).Decode(&ret); err != nil { - log.G(context.TODO()).Errorf("%s: error reading plugin resp: %v", serviceMethod, err) - return err - } - } - return nil -} - -// Stream calls the specified method with the specified arguments for the plugin and returns the response body -func (c *Client) Stream(serviceMethod string, args interface{}) (io.ReadCloser, error) { - var buf bytes.Buffer - if err := json.NewEncoder(&buf).Encode(args); err != nil { - return nil, err - } - return c.callWithRetry(serviceMethod, &buf, true) -} - -// SendFile calls the specified method, and passes through the IO stream -func (c *Client) SendFile(serviceMethod string, data io.Reader, ret interface{}) error { - body, err := c.callWithRetry(serviceMethod, data, true) - if err != nil { - return err - } - defer body.Close() - if err := json.NewDecoder(body).Decode(&ret); err != nil { - log.G(context.TODO()).Errorf("%s: error reading plugin resp: %v", serviceMethod, err) - return err - } - return nil -} - -func (c *Client) callWithRetry(serviceMethod string, data io.Reader, retry bool, reqOpts ...func(*RequestOpts)) (io.ReadCloser, error) { - var retries int - start := time.Now() - - var opts RequestOpts - for _, o := range reqOpts { - o(&opts) - } - - for { - req, err := c.requestFactory.NewRequest(serviceMethod, data) - if err != nil { - return nil, err - } - - cancelRequest := func() {} - if opts.Timeout > 0 { - var ctx context.Context - ctx, cancelRequest = context.WithTimeout(req.Context(), opts.Timeout) - req = req.WithContext(ctx) - } - - resp, err := c.http.Do(req) - if err != nil { - cancelRequest() - if !retry { - return nil, err - } - - timeOff := backoff(retries) - if abort(start, timeOff, opts.testTimeOut) { - return nil, err - } - retries++ - log.G(context.TODO()).Warnf("Unable to connect to plugin: %s%s: %v, retrying in %v", req.URL.Host, req.URL.Path, err, timeOff) - time.Sleep(timeOff) - continue - } - - if resp.StatusCode != http.StatusOK { - b, err := io.ReadAll(resp.Body) - resp.Body.Close() - cancelRequest() - if err != nil { - return nil, &statusError{resp.StatusCode, serviceMethod, err.Error()} - } - - // Plugins' Response(s) should have an Err field indicating what went - // wrong. Try to unmarshal into ResponseErr. Otherwise fallback to just - // return the string(body) - type responseErr struct { - Err string - } - remoteErr := responseErr{} - if err := json.Unmarshal(b, &remoteErr); err == nil { - if remoteErr.Err != "" { - return nil, &statusError{resp.StatusCode, serviceMethod, remoteErr.Err} - } - } - // old way... - return nil, &statusError{resp.StatusCode, serviceMethod, string(b)} - } - return ioutils.NewReadCloserWrapper(resp.Body, func() error { - err := resp.Body.Close() - cancelRequest() - return err - }), nil - } -} - -func backoff(retries int) time.Duration { - b, maxTimeout := 1*time.Second, defaultTimeOut - for b < maxTimeout && retries > 0 { - b *= 2 - retries-- - } - if b > maxTimeout { - b = maxTimeout - } - return b -} - -// testNonExistingPlugin is a special plugin-name, which overrides defaultTimeOut in tests. -const testNonExistingPlugin = "this-plugin-does-not-exist" - -func abort(start time.Time, timeOff time.Duration, overrideTimeout time.Duration) bool { - to := defaultTimeOut - if overrideTimeout > 0 { - to = overrideTimeout - } - return timeOff+time.Since(start) >= to -} - -func httpScheme(u *url.URL) string { - scheme := u.Scheme - if scheme != "https" { - scheme = "http" - } - return scheme -} diff --git a/vendor/github.com/docker/docker/pkg/plugins/discovery.go b/vendor/github.com/docker/docker/pkg/plugins/discovery.go deleted file mode 100644 index baa39ccccf..0000000000 --- a/vendor/github.com/docker/docker/pkg/plugins/discovery.go +++ /dev/null @@ -1,186 +0,0 @@ -package plugins // import "github.com/docker/docker/pkg/plugins" - -import ( - "encoding/json" - "fmt" - "io/fs" - "net/url" - "os" - "path/filepath" - "strings" - "sync" - - "github.com/containerd/log" - "github.com/moby/sys/userns" - "github.com/pkg/errors" -) - -// ErrNotFound plugin not found -var ErrNotFound = errors.New("plugin not found") - -const defaultSocketsPath = "/run/docker/plugins" - -// LocalRegistry defines a registry that is local (using unix socket). -type LocalRegistry struct { - socketsPath string - specsPaths []string -} - -func NewLocalRegistry() LocalRegistry { - return LocalRegistry{ - socketsPath: defaultSocketsPath, - specsPaths: specsPaths(), - } -} - -// Scan scans all the plugin paths and returns all the names it found -func (l *LocalRegistry) Scan() ([]string, error) { - var names []string - dirEntries, err := os.ReadDir(l.socketsPath) - if err != nil && !os.IsNotExist(err) { - return nil, errors.Wrap(err, "error reading dir entries") - } - - for _, entry := range dirEntries { - if entry.IsDir() { - fi, err := os.Stat(filepath.Join(l.socketsPath, entry.Name(), entry.Name()+".sock")) - if err != nil { - continue - } - - entry = fs.FileInfoToDirEntry(fi) - } - - if entry.Type()&os.ModeSocket != 0 { - names = append(names, strings.TrimSuffix(filepath.Base(entry.Name()), filepath.Ext(entry.Name()))) - } - } - - for _, p := range l.specsPaths { - dirEntries, err = os.ReadDir(p) - if err != nil { - if os.IsNotExist(err) { - continue - } - if os.IsPermission(err) && userns.RunningInUserNS() { - log.L.Debug(err.Error()) - continue - } - return nil, errors.Wrap(err, "error reading dir entries") - } - for _, entry := range dirEntries { - if entry.IsDir() { - infos, err := os.ReadDir(filepath.Join(p, entry.Name())) - if err != nil { - continue - } - - for _, info := range infos { - if strings.TrimSuffix(info.Name(), filepath.Ext(info.Name())) == entry.Name() { - entry = info - break - } - } - } - - switch ext := filepath.Ext(entry.Name()); ext { - case ".spec", ".json": - plugin := strings.TrimSuffix(entry.Name(), ext) - names = append(names, plugin) - default: - } - } - } - return names, nil -} - -// Plugin returns the plugin registered with the given name (or returns an error). -func (l *LocalRegistry) Plugin(name string) (*Plugin, error) { - socketPaths := pluginPaths(l.socketsPath, name, ".sock") - for _, p := range socketPaths { - if fi, err := os.Stat(p); err == nil && fi.Mode()&os.ModeSocket != 0 { - return NewLocalPlugin(name, "unix://"+p), nil - } - } - - var txtSpecPaths []string - for _, p := range l.specsPaths { - txtSpecPaths = append(txtSpecPaths, pluginPaths(p, name, ".spec")...) - txtSpecPaths = append(txtSpecPaths, pluginPaths(p, name, ".json")...) - } - - for _, p := range txtSpecPaths { - if _, err := os.Stat(p); err == nil { - if strings.HasSuffix(p, ".json") { - return readPluginJSONInfo(name, p) - } - return readPluginInfo(name, p) - } - } - return nil, errors.Wrapf(ErrNotFound, "could not find plugin %s in v1 plugin registry", name) -} - -// SpecsPaths returns paths in which to look for plugins, in order of priority. -// -// On Windows: -// -// - "%programdata%\docker\plugins" -// -// On Unix in non-rootless mode: -// -// - "/etc/docker/plugins" -// - "/usr/lib/docker/plugins" -// -// On Unix in rootless-mode: -// -// - "$XDG_CONFIG_HOME/docker/plugins" (or "/etc/docker/plugins" if $XDG_CONFIG_HOME is not set) -// - "$HOME/.local/lib/docker/plugins" (pr "/usr/lib/docker/plugins" if $HOME is set) -func SpecsPaths() []string { - return specsPaths() -} - -func readPluginInfo(name, path string) (*Plugin, error) { - content, err := os.ReadFile(path) - if err != nil { - return nil, err - } - addr := strings.TrimSpace(string(content)) - - u, err := url.Parse(addr) - if err != nil { - return nil, err - } - - if len(u.Scheme) == 0 { - return nil, fmt.Errorf("Unknown protocol") - } - - return NewLocalPlugin(name, addr), nil -} - -func readPluginJSONInfo(name, path string) (*Plugin, error) { - f, err := os.Open(path) - if err != nil { - return nil, err - } - defer f.Close() - - var p Plugin - if err := json.NewDecoder(f).Decode(&p); err != nil { - return nil, err - } - p.name = name - if p.TLSConfig != nil && len(p.TLSConfig.CAFile) == 0 { - p.TLSConfig.InsecureSkipVerify = true - } - p.activateWait = sync.NewCond(&sync.Mutex{}) - - return &p, nil -} - -func pluginPaths(base, name, ext string) []string { - return []string{ - filepath.Join(base, name+ext), - filepath.Join(base, name, name+ext), - } -} diff --git a/vendor/github.com/docker/docker/pkg/plugins/discovery_unix.go b/vendor/github.com/docker/docker/pkg/plugins/discovery_unix.go deleted file mode 100644 index 1a05307b74..0000000000 --- a/vendor/github.com/docker/docker/pkg/plugins/discovery_unix.go +++ /dev/null @@ -1,31 +0,0 @@ -//go:build !windows - -package plugins // import "github.com/docker/docker/pkg/plugins" -import ( - "path/filepath" - - "github.com/docker/docker/pkg/homedir" - "github.com/docker/docker/pkg/rootless" -) - -func rootlessConfigPluginsPath() string { - if configHome, err := homedir.GetConfigHome(); err != nil { - return filepath.Join(configHome, "docker/plugins") - } - return "/etc/docker/plugins" -} - -func rootlessLibPluginsPath() string { - if libHome, err := homedir.GetLibHome(); err == nil { - return filepath.Join(libHome, "docker/plugins") - } - return "/usr/lib/docker/plugins" -} - -// specsPaths is the non-Windows implementation of [SpecsPaths]. -func specsPaths() []string { - if rootless.RunningWithRootlessKit() { - return []string{rootlessConfigPluginsPath(), rootlessLibPluginsPath()} - } - return []string{"/etc/docker/plugins", "/usr/lib/docker/plugins"} -} diff --git a/vendor/github.com/docker/docker/pkg/plugins/discovery_windows.go b/vendor/github.com/docker/docker/pkg/plugins/discovery_windows.go deleted file mode 100644 index fe825792ba..0000000000 --- a/vendor/github.com/docker/docker/pkg/plugins/discovery_windows.go +++ /dev/null @@ -1,11 +0,0 @@ -package plugins // import "github.com/docker/docker/pkg/plugins" - -import ( - "os" - "path/filepath" -) - -// specsPaths is the Windows implementation of [SpecsPaths]. -func specsPaths() []string { - return []string{filepath.Join(os.Getenv("programdata"), "docker", "plugins")} -} diff --git a/vendor/github.com/docker/docker/pkg/plugins/errors.go b/vendor/github.com/docker/docker/pkg/plugins/errors.go deleted file mode 100644 index 6735c304bf..0000000000 --- a/vendor/github.com/docker/docker/pkg/plugins/errors.go +++ /dev/null @@ -1,33 +0,0 @@ -package plugins // import "github.com/docker/docker/pkg/plugins" - -import ( - "fmt" - "net/http" -) - -type statusError struct { - status int - method string - err string -} - -// Error returns a formatted string for this error type -func (e *statusError) Error() string { - return fmt.Sprintf("%s: %v", e.method, e.err) -} - -// IsNotFound indicates if the passed in error is from an http.StatusNotFound from the plugin -func IsNotFound(err error) bool { - return isStatusError(err, http.StatusNotFound) -} - -func isStatusError(err error, status int) bool { - if err == nil { - return false - } - e, ok := err.(*statusError) - if !ok { - return false - } - return e.status == status -} diff --git a/vendor/github.com/docker/docker/pkg/plugins/plugins.go b/vendor/github.com/docker/docker/pkg/plugins/plugins.go deleted file mode 100644 index 552f21585f..0000000000 --- a/vendor/github.com/docker/docker/pkg/plugins/plugins.go +++ /dev/null @@ -1,344 +0,0 @@ -// Package plugins provides structures and helper functions to manage Docker -// plugins. -// -// Docker discovers plugins by looking for them in the plugin directory whenever -// a user or container tries to use one by name. UNIX domain socket files must -// be located under /run/docker/plugins, whereas spec files can be located -// either under /etc/docker/plugins or /usr/lib/docker/plugins. This is handled -// by the Registry interface, which lets you list all plugins or get a plugin by -// its name if it exists. -// -// The plugins need to implement an HTTP server and bind this to the UNIX socket -// or the address specified in the spec files. -// A handshake is send at /Plugin.Activate, and plugins are expected to return -// a Manifest with a list of Docker subsystems which this plugin implements. -// -// In order to use a plugins, you can use the `Get` with the name of the -// plugin and the subsystem it implements. -// -// plugin, err := plugins.Get("example", "VolumeDriver") -// if err != nil { -// return fmt.Errorf("Error looking up volume plugin example: %v", err) -// } -package plugins // import "github.com/docker/docker/pkg/plugins" - -import ( - "context" - "errors" - "fmt" - "sync" - "time" - - "github.com/containerd/log" - "github.com/docker/go-connections/tlsconfig" -) - -// ProtocolSchemeHTTPV1 is the name of the protocol used for interacting with plugins using this package. -const ProtocolSchemeHTTPV1 = "moby.plugins.http/v1" - -// ErrNotImplements is returned if the plugin does not implement the requested driver. -var ErrNotImplements = errors.New("Plugin does not implement the requested driver") - -type plugins struct { - sync.Mutex - plugins map[string]*Plugin -} - -type extpointHandlers struct { - sync.RWMutex - extpointHandlers map[string][]func(string, *Client) -} - -var ( - storage = plugins{plugins: make(map[string]*Plugin)} - handlers = extpointHandlers{extpointHandlers: make(map[string][]func(string, *Client))} -) - -// Manifest lists what a plugin implements. -type Manifest struct { - // List of subsystem the plugin implements. - Implements []string -} - -// Plugin is the definition of a docker plugin. -type Plugin struct { - // Name of the plugin - name string - // Address of the plugin - Addr string - // TLS configuration of the plugin - TLSConfig *tlsconfig.Options - // Client attached to the plugin - client *Client - // Manifest of the plugin (see above) - Manifest *Manifest `json:"-"` - - // wait for activation to finish - activateWait *sync.Cond - // error produced by activation - activateErr error - // keeps track of callback handlers run against this plugin - handlersRun bool -} - -// Name returns the name of the plugin. -func (p *Plugin) Name() string { - return p.name -} - -// Client returns a ready-to-use plugin client that can be used to communicate with the plugin. -func (p *Plugin) Client() *Client { - return p.client -} - -// Protocol returns the protocol name/version used for plugins in this package. -func (p *Plugin) Protocol() string { - return ProtocolSchemeHTTPV1 -} - -// IsV1 returns true for V1 plugins and false otherwise. -func (p *Plugin) IsV1() bool { - return true -} - -// ScopedPath returns the path scoped to the plugin's rootfs. -// For v1 plugins, this always returns the path unchanged as v1 plugins run directly on the host. -func (p *Plugin) ScopedPath(s string) string { - return s -} - -// NewLocalPlugin creates a new local plugin. -func NewLocalPlugin(name, addr string) *Plugin { - return &Plugin{ - name: name, - Addr: addr, - // TODO: change to nil - TLSConfig: &tlsconfig.Options{InsecureSkipVerify: true}, - activateWait: sync.NewCond(&sync.Mutex{}), - } -} - -func (p *Plugin) activate() error { - p.activateWait.L.Lock() - - if p.activated() { - p.runHandlers() - p.activateWait.L.Unlock() - return p.activateErr - } - - p.activateErr = p.activateWithLock() - - p.runHandlers() - p.activateWait.L.Unlock() - p.activateWait.Broadcast() - return p.activateErr -} - -// runHandlers runs the registered handlers for the implemented plugin types -// This should only be run after activation, and while the activation lock is held. -func (p *Plugin) runHandlers() { - if !p.activated() { - return - } - - handlers.RLock() - if !p.handlersRun { - for _, iface := range p.Manifest.Implements { - hdlrs, handled := handlers.extpointHandlers[iface] - if !handled { - continue - } - for _, handler := range hdlrs { - handler(p.name, p.client) - } - } - p.handlersRun = true - } - handlers.RUnlock() -} - -// activated returns if the plugin has already been activated. -// This should only be called with the activation lock held -func (p *Plugin) activated() bool { - return p.Manifest != nil -} - -func (p *Plugin) activateWithLock() error { - c, err := NewClient(p.Addr, p.TLSConfig) - if err != nil { - return err - } - p.client = c - - m := new(Manifest) - if err = p.client.Call("Plugin.Activate", nil, m); err != nil { - return err - } - - p.Manifest = m - return nil -} - -func (p *Plugin) waitActive() error { - p.activateWait.L.Lock() - for !p.activated() && p.activateErr == nil { - p.activateWait.Wait() - } - p.activateWait.L.Unlock() - return p.activateErr -} - -func (p *Plugin) implements(kind string) bool { - if p.Manifest == nil { - return false - } - for _, driver := range p.Manifest.Implements { - if driver == kind { - return true - } - } - return false -} - -func loadWithRetry(name string, retry bool) (*Plugin, error) { - registry := NewLocalRegistry() - start := time.Now() - var testTimeOut time.Duration - if name == testNonExistingPlugin { - // override the timeout in tests - testTimeOut = 2 * time.Second - } - var retries int - for { - plugin, err := registry.Plugin(name) - if err != nil { - if !retry { - return nil, err - } - - timeOff := backoff(retries) - if abort(start, timeOff, testTimeOut) { - return nil, err - } - retries++ - log.G(context.TODO()).Warnf("Unable to locate plugin: %s, retrying in %v", name, timeOff) - time.Sleep(timeOff) - continue - } - - storage.Lock() - if pl, exists := storage.plugins[name]; exists { - storage.Unlock() - return pl, pl.activate() - } - storage.plugins[name] = plugin - storage.Unlock() - - err = plugin.activate() - if err != nil { - storage.Lock() - delete(storage.plugins, name) - storage.Unlock() - } - - return plugin, err - } -} - -func get(name string) (*Plugin, error) { - storage.Lock() - pl, ok := storage.plugins[name] - storage.Unlock() - if ok { - return pl, pl.activate() - } - return loadWithRetry(name, true) -} - -// Get returns the plugin given the specified name and requested implementation. -func Get(name, imp string) (*Plugin, error) { - if name == "" { - return nil, errors.New("Unable to find plugin without name") - } - pl, err := get(name) - if err != nil { - return nil, err - } - if err := pl.waitActive(); err == nil && pl.implements(imp) { - log.G(context.TODO()).Debugf("%s implements: %s", name, imp) - return pl, nil - } - return nil, fmt.Errorf("%w: plugin=%q, requested implementation=%q", ErrNotImplements, name, imp) -} - -// Handle adds the specified function to the extpointHandlers. -func Handle(iface string, fn func(string, *Client)) { - handlers.Lock() - hdlrs, ok := handlers.extpointHandlers[iface] - if !ok { - hdlrs = []func(string, *Client){} - } - - hdlrs = append(hdlrs, fn) - handlers.extpointHandlers[iface] = hdlrs - - storage.Lock() - for _, p := range storage.plugins { - p.activateWait.L.Lock() - if p.activated() && p.implements(iface) { - p.handlersRun = false - } - p.activateWait.L.Unlock() - } - storage.Unlock() - - handlers.Unlock() -} - -// GetAll returns all the plugins for the specified implementation -func (l *LocalRegistry) GetAll(imp string) ([]*Plugin, error) { - pluginNames, err := l.Scan() - if err != nil { - return nil, err - } - - type plLoad struct { - pl *Plugin - err error - } - - chPl := make(chan *plLoad, len(pluginNames)) - var wg sync.WaitGroup - for _, name := range pluginNames { - storage.Lock() - pl, ok := storage.plugins[name] - storage.Unlock() - if ok { - chPl <- &plLoad{pl, nil} - continue - } - - wg.Add(1) - go func(name string) { - defer wg.Done() - pl, err := loadWithRetry(name, false) - chPl <- &plLoad{pl, err} - }(name) - } - - wg.Wait() - close(chPl) - - var out []*Plugin - for pl := range chPl { - if pl.err != nil { - log.G(context.TODO()).Error(pl.err) - continue - } - if err := pl.pl.waitActive(); err == nil && pl.pl.implements(imp) { - out = append(out, pl.pl) - } - } - return out, nil -} diff --git a/vendor/github.com/docker/docker/pkg/plugins/transport/http.go b/vendor/github.com/docker/docker/pkg/plugins/transport/http.go deleted file mode 100644 index e4c1979b8b..0000000000 --- a/vendor/github.com/docker/docker/pkg/plugins/transport/http.go +++ /dev/null @@ -1,41 +0,0 @@ -package transport // import "github.com/docker/docker/pkg/plugins/transport" - -import ( - "io" - "net/http" - "strings" -) - -// HTTPTransport holds an [http.RoundTripper] -// and information about the scheme and address the transport -// sends request to. -type HTTPTransport struct { - http.RoundTripper - scheme string - addr string -} - -// NewHTTPTransport creates a new HTTPTransport. -func NewHTTPTransport(r http.RoundTripper, scheme, addr string) *HTTPTransport { - return &HTTPTransport{ - RoundTripper: r, - scheme: scheme, - addr: addr, - } -} - -// NewRequest creates a new http.Request and sets the URL -// scheme and address with the transport's fields. -func (t HTTPTransport) NewRequest(path string, data io.Reader) (*http.Request, error) { - if !strings.HasPrefix(path, "/") { - path = "/" + path - } - req, err := http.NewRequest(http.MethodPost, path, data) - if err != nil { - return nil, err - } - req.Header.Add("Accept", VersionMimetype) - req.URL.Scheme = t.scheme - req.URL.Host = t.addr - return req, nil -} diff --git a/vendor/github.com/docker/docker/pkg/plugins/transport/mimetype.go b/vendor/github.com/docker/docker/pkg/plugins/transport/mimetype.go deleted file mode 100644 index b5336d515c..0000000000 --- a/vendor/github.com/docker/docker/pkg/plugins/transport/mimetype.go +++ /dev/null @@ -1,6 +0,0 @@ -package transport // import "github.com/docker/docker/pkg/plugins/transport" - -// VersionMimetype is the Content-Type the engine sends to plugins. -// -// For convenience, there is an alias in [github.com/docker/docker/pkg/plugins.VersionMimetype]. -const VersionMimetype = "application/vnd.docker.plugins.v1.2+json" diff --git a/vendor/github.com/docker/docker/pkg/progress/progressreader.go b/vendor/github.com/docker/docker/pkg/progress/progressreader.go index 07450a2d70..1438814d63 100644 --- a/vendor/github.com/docker/docker/pkg/progress/progressreader.go +++ b/vendor/github.com/docker/docker/pkg/progress/progressreader.go @@ -31,7 +31,7 @@ func NewProgressReader(in io.ReadCloser, out Output, size int64, id, action stri } } -func (p *Reader) Read(buf []byte) (n int, err error) { +func (p *Reader) Read(buf []byte) (int, error) { read, err := p.in.Read(buf) p.current += int64(read) updateEvery := int64(1024 * 512) // 512kB diff --git a/vendor/github.com/docker/docker/pkg/rootless/rootless.go b/vendor/github.com/docker/docker/pkg/rootless/rootless.go deleted file mode 100644 index 1251b48817..0000000000 --- a/vendor/github.com/docker/docker/pkg/rootless/rootless.go +++ /dev/null @@ -1,8 +0,0 @@ -package rootless // import "github.com/docker/docker/pkg/rootless" - -import "os" - -// RunningWithRootlessKit returns true if running under RootlessKit namespaces. -func RunningWithRootlessKit() bool { - return os.Getenv("ROOTLESSKIT_STATE_DIR") != "" -} diff --git a/vendor/github.com/docker/docker/pkg/tailfile/tailfile.go b/vendor/github.com/docker/docker/pkg/tailfile/tailfile.go deleted file mode 100644 index af70b3e8a5..0000000000 --- a/vendor/github.com/docker/docker/pkg/tailfile/tailfile.go +++ /dev/null @@ -1,220 +0,0 @@ -// Package tailfile provides helper functions to read the nth lines of any -// ReadSeeker. -package tailfile // import "github.com/docker/docker/pkg/tailfile" - -import ( - "bufio" - "bytes" - "context" - "errors" - "io" - "os" -) - -const blockSize = 1024 - -var eol = []byte("\n") - -// ErrNonPositiveLinesNumber is an error returned if the lines number was negative. -var ErrNonPositiveLinesNumber = errors.New("The number of lines to extract from the file must be positive") - -// TailFile returns last n lines of the passed in file. -func TailFile(f *os.File, n int) ([][]byte, error) { - size, err := f.Seek(0, io.SeekEnd) - if err != nil { - return nil, err - } - - rAt := io.NewSectionReader(f, 0, size) - r, nLines, err := NewTailReader(context.Background(), rAt, n) - if err != nil { - return nil, err - } - - buf := make([][]byte, 0, nLines) - scanner := bufio.NewScanner(r) - - for scanner.Scan() { - buf = append(buf, scanner.Bytes()) - } - return buf, nil -} - -// SizeReaderAt is an interface used to get a ReaderAt as well as the size of the underlying reader. -// Note that the size of the underlying reader should not change when using this interface. -type SizeReaderAt interface { - io.ReaderAt - Size() int64 -} - -// NewTailReader scopes the passed in reader to just the last N lines passed in -func NewTailReader(ctx context.Context, r SizeReaderAt, reqLines int) (*io.SectionReader, int, error) { - return NewTailReaderWithDelimiter(ctx, r, reqLines, eol) -} - -// NewTailReaderWithDelimiter scopes the passed in reader to just the last N lines passed in -// In this case a "line" is defined by the passed in delimiter. -// -// Delimiter lengths should be generally small, no more than 12 bytes -func NewTailReaderWithDelimiter(ctx context.Context, r SizeReaderAt, reqLines int, delimiter []byte) (*io.SectionReader, int, error) { - if reqLines < 1 { - return nil, 0, ErrNonPositiveLinesNumber - } - if len(delimiter) == 0 { - return nil, 0, errors.New("must provide a delimiter") - } - var ( - size = r.Size() - tailStart int64 - tailEnd = size - found int - ) - - if int64(len(delimiter)) >= size { - return io.NewSectionReader(bytes.NewReader(nil), 0, 0), 0, nil - } - - scanner := newScanner(r, delimiter) - for scanner.Scan(ctx) { - if err := scanner.Err(); err != nil { - return nil, 0, scanner.Err() - } - - found++ - if found == 1 { - tailEnd = scanner.End() - } - if found == reqLines { - break - } - } - - tailStart = scanner.Start(ctx) - - if found == 0 { - return io.NewSectionReader(bytes.NewReader(nil), 0, 0), 0, nil - } - - if found < reqLines && tailStart != 0 { - tailStart = 0 - } - return io.NewSectionReader(r, tailStart, tailEnd-tailStart), found, nil -} - -func newScanner(r SizeReaderAt, delim []byte) *scanner { - size := r.Size() - readSize := blockSize - if readSize > int(size) { - readSize = int(size) - } - // silly case... - if len(delim) >= readSize/2 { - readSize = len(delim)*2 + 2 - } - - return &scanner{ - r: r, - pos: size, - buf: make([]byte, readSize), - delim: delim, - } -} - -type scanner struct { - r SizeReaderAt - pos int64 - buf []byte - delim []byte - err error - idx int -} - -func (s *scanner) Start(ctx context.Context) int64 { - if s.idx > 0 { - idx := bytes.LastIndex(s.buf[:s.idx], s.delim) - if idx >= 0 { - return s.pos + int64(idx) + int64(len(s.delim)) - } - } - - // slow path - buf := make([]byte, len(s.buf)) - copy(buf, s.buf) - - readAhead := &scanner{ - r: s.r, - pos: s.pos, - delim: s.delim, - idx: s.idx, - buf: buf, - } - - if !readAhead.Scan(ctx) { - return 0 - } - return readAhead.End() -} - -func (s *scanner) End() int64 { - return s.pos + int64(s.idx) + int64(len(s.delim)) -} - -func (s *scanner) Err() error { - return s.err -} - -func (s *scanner) Scan(ctx context.Context) bool { - if s.err != nil { - return false - } - - for { - select { - case <-ctx.Done(): - s.err = ctx.Err() - return false - default: - } - - idx := s.idx - len(s.delim) - if idx < 0 { - readSize := int(s.pos) - if readSize > len(s.buf) { - readSize = len(s.buf) - } - - if readSize < len(s.delim) { - return false - } - - offset := s.pos - int64(readSize) - n, err := s.r.ReadAt(s.buf[:readSize], offset) - if err != nil && err != io.EOF { - s.err = err - return false - } - - s.pos -= int64(n) - idx = n - } - - s.idx = bytes.LastIndex(s.buf[:idx], s.delim) - if s.idx >= 0 { - return true - } - - if len(s.delim) > 1 && s.pos > 0 { - // in this case, there may be a partial delimiter at the front of the buffer, so set the position forward - // up to the maximum size partial that could be there so it can be read again in the next iteration with any - // potential remainder. - // An example where delimiter is `####`: - // [##asdfqwerty] - // ^ - // This resets the position to where the arrow is pointing. - // It could actually check if a partial exists and at the front, but that is pretty similar to the indexing - // code above though a bit more complex since each byte has to be checked (`len(delimiter)-1`) factorial). - // It's much simpler and cleaner to just re-read `len(delimiter)-1` bytes again. - s.pos += int64(len(s.delim)) - 1 - } - } -} diff --git a/vendor/github.com/docker/docker/pkg/tarsum/builder_context.go b/vendor/github.com/docker/docker/pkg/tarsum/builder_context.go index bc7d84df4e..376194750f 100644 --- a/vendor/github.com/docker/docker/pkg/tarsum/builder_context.go +++ b/vendor/github.com/docker/docker/pkg/tarsum/builder_context.go @@ -10,10 +10,10 @@ type BuilderContext interface { Remove(string) } -func (bc *tarSum) Remove(filename string) { - for i, fis := range bc.sums { +func (ts *tarSum) Remove(filename string) { + for i, fis := range ts.sums { if fis.Name() == filename { - bc.sums = append(bc.sums[:i], bc.sums[i+1:]...) + ts.sums = append(ts.sums[:i], ts.sums[i+1:]...) // Note, we don't just return because there could be // more than one with this name } diff --git a/vendor/github.com/docker/docker/restartmanager/restartmanager.go b/vendor/github.com/docker/docker/restartmanager/restartmanager.go deleted file mode 100644 index 16a85077f8..0000000000 --- a/vendor/github.com/docker/docker/restartmanager/restartmanager.go +++ /dev/null @@ -1,133 +0,0 @@ -package restartmanager // import "github.com/docker/docker/restartmanager" - -import ( - "errors" - "fmt" - "sync" - "time" - - "github.com/docker/docker/api/types/container" -) - -const ( - backoffMultiplier = 2 - defaultTimeout = 100 * time.Millisecond - maxRestartTimeout = 1 * time.Minute -) - -// ErrRestartCanceled is returned when the restart manager has been -// canceled and will no longer restart the container. -var ErrRestartCanceled = errors.New("restart canceled") - -// RestartManager defines object that controls container restarting rules. -type RestartManager struct { - sync.Mutex - sync.Once - policy container.RestartPolicy - restartCount int - timeout time.Duration - active bool - cancel chan struct{} - canceled bool -} - -// New returns a new RestartManager based on a policy. -func New(policy container.RestartPolicy, restartCount int) *RestartManager { - return &RestartManager{policy: policy, restartCount: restartCount, cancel: make(chan struct{})} -} - -// SetPolicy sets the restart-policy for the RestartManager. -func (rm *RestartManager) SetPolicy(policy container.RestartPolicy) { - rm.Lock() - rm.policy = policy - rm.Unlock() -} - -// ShouldRestart returns whether the container should be restarted. -func (rm *RestartManager) ShouldRestart(exitCode uint32, hasBeenManuallyStopped bool, executionDuration time.Duration) (bool, chan error, error) { - if rm.policy.IsNone() { - return false, nil, nil - } - rm.Lock() - unlockOnExit := true - defer func() { - if unlockOnExit { - rm.Unlock() - } - }() - - if rm.canceled { - return false, nil, ErrRestartCanceled - } - - if rm.active { - return false, nil, fmt.Errorf("invalid call on an active restart manager") - } - // if the container ran for more than 10s, regardless of status and policy reset - // the timeout back to the default. - if executionDuration.Seconds() >= 10 { - rm.timeout = 0 - } - switch { - case rm.timeout == 0: - rm.timeout = defaultTimeout - case rm.timeout < maxRestartTimeout: - rm.timeout *= backoffMultiplier - } - if rm.timeout > maxRestartTimeout { - rm.timeout = maxRestartTimeout - } - - var restart bool - switch { - case rm.policy.IsAlways(): - restart = true - case rm.policy.IsUnlessStopped() && !hasBeenManuallyStopped: - restart = true - case rm.policy.IsOnFailure(): - // the default value of 0 for MaximumRetryCount means that we will not enforce a maximum count - if maxRetryCount := rm.policy.MaximumRetryCount; maxRetryCount == 0 || rm.restartCount < maxRetryCount { - restart = exitCode != 0 - } - } - - if !restart { - rm.active = false - return false, nil, nil - } - - rm.restartCount++ - - unlockOnExit = false - rm.active = true - rm.Unlock() - - ch := make(chan error) - go func() { - timeout := time.NewTimer(rm.timeout) - defer timeout.Stop() - - select { - case <-rm.cancel: - ch <- ErrRestartCanceled - close(ch) - case <-timeout.C: - rm.Lock() - close(ch) - rm.active = false - rm.Unlock() - } - }() - - return true, ch, nil -} - -// Cancel tells the RestartManager to no longer restart the container. -func (rm *RestartManager) Cancel() { - rm.Do(func() { - rm.Lock() - rm.canceled = true - close(rm.cancel) - rm.Unlock() - }) -} diff --git a/vendor/github.com/docker/docker/volume/mounts/lcow_parser.go b/vendor/github.com/docker/docker/volume/mounts/lcow_parser.go deleted file mode 100644 index 63d458d6c1..0000000000 --- a/vendor/github.com/docker/docker/volume/mounts/lcow_parser.go +++ /dev/null @@ -1,66 +0,0 @@ -package mounts // import "github.com/docker/docker/volume/mounts" - -import ( - "errors" - "fmt" - "path" - "strings" - - "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/internal/lazyregexp" -) - -// NewLCOWParser creates a parser with Linux Containers on Windows semantics. -func NewLCOWParser() Parser { - return &lcowParser{ - windowsParser{ - fi: defaultFileInfoProvider{}, - }, - } -} - -// rxLCOWDestination is the regex expression for the mount destination for LCOW -// -// Destination (aka container path): -// - Variation on hostdir but can be a drive followed by colon as well -// - If a path, must be absolute. Can include spaces -// - Drive cannot be c: (explicitly checked in code, not RegEx) -const rxLCOWDestination = `(?P/(?:[^\\/:*?"<>\r\n]+[/]?)*)` - -var ( - lcowMountDestinationRegex = lazyregexp.New(`^` + rxLCOWDestination + `$`) - lcowSplitRawSpec = lazyregexp.New(`^` + rxSource + rxLCOWDestination + rxMode + `$`) -) - -var lcowValidators mountValidator = func(m *mount.Mount) error { - if path.Clean(m.Target) == "/" { - return ErrVolumeTargetIsRoot - } - if m.Type == mount.TypeNamedPipe { - return errors.New("Linux containers on Windows do not support named pipe mounts") - } - if !lcowMountDestinationRegex.MatchString(strings.ToLower(m.Target)) { - return fmt.Errorf("invalid mount path: '%s'", m.Target) - } - return nil -} - -type lcowParser struct { - windowsParser -} - -func (p *lcowParser) ValidateMountConfig(mnt *mount.Mount) error { - return p.validateMountConfigReg(mnt, lcowValidators) -} - -func (p *lcowParser) ParseMountRaw(raw, volumeDriver string) (*MountPoint, error) { - arr, err := p.splitRawSpec(raw, lcowSplitRawSpec) - if err != nil { - return nil, err - } - return p.parseMount(arr, raw, volumeDriver, false, lcowValidators) -} - -func (p *lcowParser) ParseMountSpec(cfg mount.Mount) (*MountPoint, error) { - return p.parseMountSpec(cfg, false, lcowValidators) -} diff --git a/vendor/github.com/docker/docker/volume/mounts/linux_parser.go b/vendor/github.com/docker/docker/volume/mounts/linux_parser.go deleted file mode 100644 index 2f2f2b268f..0000000000 --- a/vendor/github.com/docker/docker/volume/mounts/linux_parser.go +++ /dev/null @@ -1,495 +0,0 @@ -package mounts // import "github.com/docker/docker/volume/mounts" - -import ( - "errors" - "fmt" - "path" - "path/filepath" - "strings" - - "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/volume" -) - -// NewLinuxParser creates a parser with Linux semantics. -func NewLinuxParser() Parser { - return &linuxParser{ - fi: defaultFileInfoProvider{}, - } -} - -type linuxParser struct { - fi fileInfoProvider -} - -func linuxValidateNotRoot(p string) error { - p = path.Clean(strings.ReplaceAll(p, `\`, `/`)) - if p == "/" { - return ErrVolumeTargetIsRoot - } - return nil -} - -func linuxValidateAbsolute(p string) error { - p = strings.ReplaceAll(p, `\`, `/`) - if path.IsAbs(p) { - return nil - } - return fmt.Errorf("invalid mount path: '%s' mount path must be absolute", p) -} - -func (p *linuxParser) ValidateMountConfig(mnt *mount.Mount) error { - // there was something looking like a bug in existing codebase: - // - validateMountConfig on linux was called with options skipping bind source existence when calling ParseMountRaw - // - but not when calling ParseMountSpec directly... nor when the unit test called it directly - return p.validateMountConfigImpl(mnt, true) -} - -func (p *linuxParser) validateMountConfigImpl(mnt *mount.Mount, validateBindSourceExists bool) error { - if len(mnt.Target) == 0 { - return &errMountConfig{mnt, errMissingField("Target")} - } - - if err := linuxValidateNotRoot(mnt.Target); err != nil { - return &errMountConfig{mnt, err} - } - - if err := linuxValidateAbsolute(mnt.Target); err != nil { - return &errMountConfig{mnt, err} - } - - switch mnt.Type { - case mount.TypeBind: - if len(mnt.Source) == 0 { - return &errMountConfig{mnt, errMissingField("Source")} - } - // Don't error out just because the propagation mode is not supported on the platform - if opts := mnt.BindOptions; opts != nil { - if len(opts.Propagation) > 0 && len(linuxPropagationModes) > 0 { - if _, ok := linuxPropagationModes[opts.Propagation]; !ok { - return &errMountConfig{mnt, fmt.Errorf("invalid propagation mode: %s", opts.Propagation)} - } - } - } - if mnt.VolumeOptions != nil { - return &errMountConfig{mnt, errExtraField("VolumeOptions")} - } - if mnt.ImageOptions != nil { - return &errMountConfig{mnt, errExtraField("ImageOptions")} - } - - if err := linuxValidateAbsolute(mnt.Source); err != nil { - return &errMountConfig{mnt, err} - } - - if validateBindSourceExists { - exists, _, err := p.fi.fileInfo(mnt.Source) - if err != nil { - return &errMountConfig{mnt, err} - } - - createMountpoint := mnt.BindOptions != nil && mnt.BindOptions.CreateMountpoint - if !exists && !createMountpoint { - return &errMountConfig{mnt, errBindSourceDoesNotExist(mnt.Source)} - } - } - - case mount.TypeVolume: - if mnt.BindOptions != nil { - return &errMountConfig{mnt, errExtraField("BindOptions")} - } - if mnt.ImageOptions != nil { - return &errMountConfig{mnt, errExtraField("ImageOptions")} - } - anonymousVolume := len(mnt.Source) == 0 - - if mnt.VolumeOptions != nil && mnt.VolumeOptions.Subpath != "" { - if anonymousVolume { - return &errMountConfig{mnt, errAnonymousVolumeWithSubpath} - } - - if !filepath.IsLocal(mnt.VolumeOptions.Subpath) { - return &errMountConfig{mnt, errInvalidSubpath} - } - } - if mnt.ReadOnly && anonymousVolume { - return &errMountConfig{mnt, fmt.Errorf("must not set ReadOnly mode when using anonymous volumes")} - } - case mount.TypeTmpfs: - if mnt.BindOptions != nil { - return &errMountConfig{mnt, errExtraField("BindOptions")} - } - if mnt.ImageOptions != nil { - return &errMountConfig{mnt, errExtraField("ImageOptions")} - } - if len(mnt.Source) != 0 { - return &errMountConfig{mnt, errExtraField("Source")} - } - if _, err := p.ConvertTmpfsOptions(mnt.TmpfsOptions, mnt.ReadOnly); err != nil { - return &errMountConfig{mnt, err} - } - case mount.TypeImage: - if mnt.BindOptions != nil { - return &errMountConfig{mnt, errExtraField("BindOptions")} - } - if mnt.VolumeOptions != nil { - return &errMountConfig{mnt, errExtraField("VolumeOptions")} - } - if len(mnt.Source) == 0 { - return &errMountConfig{mnt, errMissingField("Source")} - } - if mnt.ImageOptions != nil && mnt.ImageOptions.Subpath != "" { - if !filepath.IsLocal(mnt.ImageOptions.Subpath) { - return &errMountConfig{mnt, errInvalidSubpath} - } - } - default: - return &errMountConfig{mnt, errors.New("mount type unknown")} - } - return nil -} - -// label modes -var linuxLabelModes = map[string]bool{ - "Z": true, - "z": true, -} - -// consistency modes -var linuxConsistencyModes = map[mount.Consistency]bool{ - mount.ConsistencyFull: true, - mount.ConsistencyCached: true, - mount.ConsistencyDelegated: true, -} - -var linuxPropagationModes = map[mount.Propagation]bool{ - mount.PropagationPrivate: true, - mount.PropagationRPrivate: true, - mount.PropagationSlave: true, - mount.PropagationRSlave: true, - mount.PropagationShared: true, - mount.PropagationRShared: true, -} - -const linuxDefaultPropagationMode = mount.PropagationRPrivate - -func linuxGetPropagation(mode string) mount.Propagation { - for _, o := range strings.Split(mode, ",") { - prop := mount.Propagation(o) - if linuxPropagationModes[prop] { - return prop - } - } - return linuxDefaultPropagationMode -} - -func linuxHasPropagation(mode string) bool { - for _, o := range strings.Split(mode, ",") { - if linuxPropagationModes[mount.Propagation(o)] { - return true - } - } - return false -} - -func linuxValidMountMode(mode string) bool { - if mode == "" { - return true - } - - rwModeCount := 0 - labelModeCount := 0 - propagationModeCount := 0 - copyModeCount := 0 - consistencyModeCount := 0 - - for _, o := range strings.Split(mode, ",") { - switch { - case rwModes[o]: - rwModeCount++ - case linuxLabelModes[o]: - labelModeCount++ - case linuxPropagationModes[mount.Propagation(o)]: - propagationModeCount++ - case copyModeExists(o): - copyModeCount++ - case linuxConsistencyModes[mount.Consistency(o)]: - consistencyModeCount++ - default: - return false - } - } - - // Only one string for each mode is allowed. - if rwModeCount > 1 || labelModeCount > 1 || propagationModeCount > 1 || copyModeCount > 1 || consistencyModeCount > 1 { - return false - } - return true -} - -var validTmpfsOptions = map[string]bool{ - "exec": true, - "noexec": true, -} - -func validateTmpfsOptions(rawOptions [][]string) ([]string, error) { - var options []string - for _, opt := range rawOptions { - if len(opt) < 1 || len(opt) > 2 { - return nil, errors.New("invalid option array length") - } - if _, ok := validTmpfsOptions[opt[0]]; !ok { - return nil, errors.New("invalid option: " + opt[0]) - } - - if len(opt) == 1 { - options = append(options, opt[0]) - } else { - options = append(options, fmt.Sprintf("%s=%s", opt[0], opt[1])) - } - } - return options, nil -} - -func (p *linuxParser) ReadWrite(mode string) bool { - if !linuxValidMountMode(mode) { - return false - } - - for _, o := range strings.Split(mode, ",") { - if o == "ro" { - return false - } - } - return true -} - -func (p *linuxParser) ParseMountRaw(raw, volumeDriver string) (*MountPoint, error) { - arr := strings.SplitN(raw, ":", 4) - if arr[0] == "" { - return nil, errInvalidSpec(raw) - } - - var spec mount.Mount - var mode string - switch len(arr) { - case 1: - // Just a destination path in the container - spec.Target = arr[0] - case 2: - if linuxValidMountMode(arr[1]) { - // Destination + Mode is not a valid volume - volumes - // cannot include a mode. e.g. /foo:rw - return nil, errInvalidSpec(raw) - } - // Host Source Path or Name + Destination - spec.Source = arr[0] - spec.Target = arr[1] - case 3: - // HostSourcePath+DestinationPath+Mode - spec.Source = arr[0] - spec.Target = arr[1] - mode = arr[2] - default: - return nil, errInvalidSpec(raw) - } - - if !linuxValidMountMode(mode) { - return nil, errInvalidMode(mode) - } - - if path.IsAbs(spec.Source) { - spec.Type = mount.TypeBind - } else { - spec.Type = mount.TypeVolume - } - - spec.ReadOnly = !p.ReadWrite(mode) - - // cannot assume that if a volume driver is passed in that we should set it - if volumeDriver != "" && spec.Type == mount.TypeVolume { - spec.VolumeOptions = &mount.VolumeOptions{ - DriverConfig: &mount.Driver{Name: volumeDriver}, - } - } - - if copyData, isSet := getCopyMode(mode, p.DefaultCopyMode()); isSet { - if spec.VolumeOptions == nil { - spec.VolumeOptions = &mount.VolumeOptions{} - } - spec.VolumeOptions.NoCopy = !copyData - } - if linuxHasPropagation(mode) { - spec.BindOptions = &mount.BindOptions{ - Propagation: linuxGetPropagation(mode), - } - } - - mp, err := p.parseMountSpec(spec, false) - if mp != nil { - mp.Mode = mode - } - if err != nil { - err = fmt.Errorf("%v: %v", errInvalidSpec(raw), err) - } - return mp, err -} - -func (p *linuxParser) ParseMountSpec(cfg mount.Mount) (*MountPoint, error) { - return p.parseMountSpec(cfg, true) -} - -func (p *linuxParser) parseMountSpec(cfg mount.Mount, validateBindSourceExists bool) (*MountPoint, error) { - if err := p.validateMountConfigImpl(&cfg, validateBindSourceExists); err != nil { - return nil, err - } - mp := &MountPoint{ - RW: !cfg.ReadOnly, - Destination: path.Clean(filepath.ToSlash(cfg.Target)), - Type: cfg.Type, - Spec: cfg, - } - - switch cfg.Type { - case mount.TypeVolume: - if cfg.Source != "" { - // non-anonymous volume - mp.Name = cfg.Source - } - mp.CopyData = p.DefaultCopyMode() - - if cfg.VolumeOptions != nil { - if cfg.VolumeOptions.DriverConfig != nil { - mp.Driver = cfg.VolumeOptions.DriverConfig.Name - } - if cfg.VolumeOptions.NoCopy { - mp.CopyData = false - } - } - case mount.TypeBind: - mp.Source = path.Clean(filepath.ToSlash(cfg.Source)) - if cfg.BindOptions != nil && len(cfg.BindOptions.Propagation) > 0 { - mp.Propagation = cfg.BindOptions.Propagation - } else { - // If user did not specify a propagation mode, get - // default propagation mode. - mp.Propagation = linuxDefaultPropagationMode - } - case mount.TypeTmpfs: - // NOP - case mount.TypeImage: - mp.Source = cfg.Source - if cfg.BindOptions != nil && len(cfg.BindOptions.Propagation) > 0 { - mp.Propagation = cfg.BindOptions.Propagation - } else { - // If user did not specify a propagation mode, get - // default propagation mode. - mp.Propagation = linuxDefaultPropagationMode - } - default: - // TODO(thaJeztah): make switch exhaustive: anything to do for mount.TypeNamedPipe, mount.TypeCluster ? - } - return mp, nil -} - -func (p *linuxParser) ParseVolumesFrom(spec string) (string, string, error) { - if len(spec) == 0 { - return "", "", fmt.Errorf("volumes-from specification cannot be an empty string") - } - - id, mode, _ := strings.Cut(spec, ":") - if mode == "" { - return id, "rw", nil - } - if !linuxValidMountMode(mode) { - return "", "", errInvalidMode(mode) - } - // For now don't allow propagation properties while importing - // volumes from data container. These volumes will inherit - // the same propagation property as of the original volume - // in data container. This probably can be relaxed in future. - if linuxHasPropagation(mode) { - return "", "", errInvalidMode(mode) - } - // Do not allow copy modes on volumes-from - if _, isSet := getCopyMode(mode, p.DefaultCopyMode()); isSet { - return "", "", errInvalidMode(mode) - } - return id, mode, nil -} - -func (p *linuxParser) DefaultPropagationMode() mount.Propagation { - return linuxDefaultPropagationMode -} - -func (p *linuxParser) ConvertTmpfsOptions(opt *mount.TmpfsOptions, readOnly bool) (string, error) { - var rawOpts []string - if readOnly { - rawOpts = append(rawOpts, "ro") - } - - if opt != nil && opt.Mode != 0 { - rawOpts = append(rawOpts, fmt.Sprintf("mode=%o", opt.Mode)) - } - - if opt != nil && opt.SizeBytes != 0 { - // calculate suffix here, making this linux specific, but that is - // okay, since API is that way anyways. - - // we do this by finding the suffix that divides evenly into the - // value, returning the value itself, with no suffix, if it fails. - // - // For the most part, we don't enforce any semantic to this values. - // The operating system will usually align this and enforce minimum - // and maximums. - var ( - size = opt.SizeBytes - suffix string - ) - for _, r := range []struct { - suffix string - divisor int64 - }{ - {"g", 1 << 30}, - {"m", 1 << 20}, - {"k", 1 << 10}, - } { - if size%r.divisor == 0 { - size = size / r.divisor - suffix = r.suffix - break - } - } - - rawOpts = append(rawOpts, fmt.Sprintf("size=%d%s", size, suffix)) - } - - if opt != nil && len(opt.Options) > 0 { - tmpfsOpts, err := validateTmpfsOptions(opt.Options) - if err != nil { - return "", err - } - rawOpts = append(rawOpts, tmpfsOpts...) - } - - return strings.Join(rawOpts, ","), nil -} - -func (p *linuxParser) DefaultCopyMode() bool { - return true -} - -func (p *linuxParser) ValidateVolumeName(name string) error { - return nil -} - -func (p *linuxParser) IsBackwardCompatible(m *MountPoint) bool { - return len(m.Source) > 0 || m.Driver == volume.DefaultDriverName -} - -func (p *linuxParser) ValidateTmpfsMountDestination(dest string) error { - if err := linuxValidateNotRoot(dest); err != nil { - return err - } - return linuxValidateAbsolute(dest) -} diff --git a/vendor/github.com/docker/docker/volume/mounts/mounts.go b/vendor/github.com/docker/docker/volume/mounts/mounts.go deleted file mode 100644 index a42f3116df..0000000000 --- a/vendor/github.com/docker/docker/volume/mounts/mounts.go +++ /dev/null @@ -1,309 +0,0 @@ -package mounts // import "github.com/docker/docker/volume/mounts" - -import ( - "context" - "fmt" - "os" - "path/filepath" - "runtime/debug" - "syscall" - - "github.com/containerd/log" - mounttypes "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/internal/safepath" - "github.com/docker/docker/pkg/idtools" - "github.com/docker/docker/pkg/stringid" - "github.com/docker/docker/volume" - "github.com/moby/sys/user" - "github.com/opencontainers/selinux/go-selinux/label" - "github.com/pkg/errors" -) - -// RWLayer represents a writable layer. -type RWLayer interface { - // Mount mounts the RWLayer and returns the filesystem path - // to the writable layer. - Mount(mountLabel string) (string, error) - - // Unmount unmounts the RWLayer. This should be called - // for every mount. If there are multiple mount calls - // this operation will only decrement the internal mount counter. - Unmount() error - - // Metadata returns the low level metadata for the mutable layer - Metadata() (map[string]string, error) -} - -// MountPoint is the intersection point between a volume and a container. It -// specifies which volume is to be used and where inside a container it should -// be mounted. -// -// Note that this type is embedded in `container.Container` object and persisted to disk. -// Changes to this struct need to by synced with on disk state. -type MountPoint struct { - // Source is the source path of the mount. - // E.g. `mount --bind /foo /bar`, `/foo` is the `Source`. - Source string - // Destination is the path relative to the container root (`/`) to the mount point - // It is where the `Source` is mounted to - Destination string - // RW is set to true when the mountpoint should be mounted as read-write - RW bool - // Name is the name reference to the underlying data defined by `Source` - // e.g., the volume name - Name string - // Driver is the volume driver used to create the volume (if it is a volume) - Driver string - // Type of mount to use, see `Type` definitions in github.com/docker/docker/api/types/mount - Type mounttypes.Type `json:",omitempty"` - // Volume is the volume providing data to this mountpoint. - // This is nil unless `Type` is set to `TypeVolume` - Volume volume.Volume `json:"-"` - - // Mode is the comma separated list of options supplied by the user when creating - // the bind/volume mount. - // Note Mode is not used on Windows - Mode string `json:"Relabel,omitempty"` // Originally field was `Relabel`" - - // Propagation describes how the mounts are propagated from the host into the - // mount point, and vice-versa. - // See https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt - // Note Propagation is not used on Windows - Propagation mounttypes.Propagation `json:",omitempty"` // Mount propagation string - - // Specifies if data should be copied from the container before the first mount - // Use a pointer here so we can tell if the user set this value explicitly - // This allows us to error out when the user explicitly enabled copy but we can't copy due to the volume being populated - CopyData bool `json:"-"` - // ID is the opaque ID used to pass to the volume driver. - // This should be set by calls to `Mount` and unset by calls to `Unmount` - ID string `json:",omitempty"` - - // Spec is a copy of the API request that created this mount. - Spec mounttypes.Mount - - // Some bind mounts should not be automatically created. - // (Some are auto-created for backwards-compatibility) - // This is checked on the API but setting this here prevents race conditions. - // where a bind dir existed during validation was removed before reaching the setup code. - SkipMountpointCreation bool - - // Track usage of this mountpoint - // Specifically needed for containers which are running and calls to `docker cp` - // because both these actions require mounting the volumes. - active int - - // SafePaths created by Setup that should be cleaned up before unmounting - // the volume. - safePaths []*safepath.SafePath - - Layer RWLayer `json:"-"` -} - -// Cleanup frees resources used by the mountpoint and cleans up all the paths -// returned by Setup that hasn't been cleaned up by the caller. -func (m *MountPoint) Cleanup(ctx context.Context) error { - if m.Volume == nil || m.ID == "" { - return nil - } - - logger := log.G(ctx).WithFields(log.Fields{"active": m.active, "id": m.ID}) - - // TODO: Remove once the real bug is fixed: https://github.com/moby/moby/issues/46508 - if m.active == 0 { - logger.Error("An attempt to decrement a zero mount count") - logger.Error(string(debug.Stack())) - return nil - } - - for _, p := range m.safePaths { - if !p.IsValid() { - continue - } - - err := p.Close(ctx) - base, sub := p.SourcePath() - log.G(ctx).WithFields(log.Fields{ - "error": err, - "path": p.Path(), - "sourceBase": base, - "sourceSubpath": sub, - }).Warn("cleaning up SafePath that hasn't been cleaned up by the caller") - } - - if err := m.Volume.Unmount(m.ID); err != nil { - return errors.Wrapf(err, "error unmounting volume %s", m.Volume.Name()) - } - - m.active-- - logger.Debug("MountPoint.Cleanup Decrement active count") - - if m.active == 0 { - m.ID = "" - } - return nil -} - -// Setup sets up a mount point by either mounting the volume if it is -// configured, or creating the source directory if supplied. -// The, optional, checkFun parameter allows doing additional checking -// before creating the source directory on the host. -// -// The returned path can be a temporary path, caller is responsible to -// call the returned cleanup function as soon as the path is not needed. -// Cleanup doesn't unmount the underlying volumes (if any), it only -// frees up the resources that were needed to guarantee that the path -// still points to the same target (to avoid TOCTOU attack). -// -// Cleanup function doesn't need to be called when error is returned. -func (m *MountPoint) Setup(ctx context.Context, mountLabel string, rootIDs idtools.Identity, checkFun func(m *MountPoint) error) (path string, cleanup func(context.Context) error, retErr error) { - if m.SkipMountpointCreation { - return m.Source, noCleanup, nil - } - - defer func() { - if retErr != nil || !label.RelabelNeeded(m.Mode) { - return - } - - sourcePath, err := filepath.EvalSymlinks(path) - if err != nil { - path = "" - retErr = errors.Wrapf(err, "error evaluating symlinks from mount source %q", m.Source) - if cleanupErr := cleanup(ctx); cleanupErr != nil { - log.G(ctx).WithError(cleanupErr).Warn("failed to cleanup after error") - } - cleanup = noCleanup - return - } - err = label.Relabel(sourcePath, mountLabel, label.IsShared(m.Mode)) - if err != nil && !errors.Is(err, syscall.ENOTSUP) { - path = "" - retErr = errors.Wrapf(err, "error setting label on mount source '%s'", sourcePath) - if cleanupErr := cleanup(ctx); cleanupErr != nil { - log.G(ctx).WithError(cleanupErr).Warn("failed to cleanup after error") - } - cleanup = noCleanup - } - }() - - if m.Volume != nil { - id := m.ID - if id == "" { - id = stringid.GenerateRandomID() - } - volumePath, err := m.Volume.Mount(id) - if err != nil { - return "", noCleanup, errors.Wrapf(err, "error while mounting volume '%s'", m.Source) - } - - m.ID = id - clean := noCleanup - if m.Spec.VolumeOptions != nil && m.Spec.VolumeOptions.Subpath != "" { - subpath := m.Spec.VolumeOptions.Subpath - - safePath, err := safepath.Join(ctx, volumePath, subpath) - if err != nil { - if err := m.Volume.Unmount(id); err != nil { - log.G(ctx).WithError(err).Error("failed to unmount after safepath.Join failed") - } - return "", noCleanup, err - } - m.safePaths = append(m.safePaths, safePath) - log.G(ctx).Debugf("mounting (%s|%s) via %s", volumePath, subpath, safePath.Path()) - - clean = safePath.Close - volumePath = safePath.Path() - } - - m.active++ - return volumePath, clean, nil - } - - if m.Type == mounttypes.TypeImage { - if m.Spec.ImageOptions != nil && m.Spec.ImageOptions.Subpath != "" { - subpath := m.Spec.ImageOptions.Subpath - - safePath, err := safepath.Join(ctx, m.Source, subpath) - if err != nil { - return "", noCleanup, err - } - m.safePaths = append(m.safePaths, safePath) - log.G(ctx).Debugf("mounting (%s|%s) via %s", m.Source, subpath, safePath.Path()) - return safePath.Path(), safePath.Close, nil - } - } - - if len(m.Source) == 0 { - return "", noCleanup, fmt.Errorf("Unable to setup mount point, neither source nor volume defined") - } - - if m.Type == mounttypes.TypeBind { - // Before creating the source directory on the host, invoke checkFun if it's not nil. One of - // the use case is to forbid creating the daemon socket as a directory if the daemon is in - // the process of shutting down. - if checkFun != nil { - if err := checkFun(m); err != nil { - return "", noCleanup, err - } - } - - // user.MkdirAllAndChown produces an error if m.Source exists and is a file (not a directory) - // also, makes sure that if the directory is created, the correct remapped rootUID/rootGID will own it - if err := user.MkdirAllAndChown(m.Source, 0o755, rootIDs.UID, rootIDs.GID, user.WithOnlyNew); err != nil { - if perr, ok := err.(*os.PathError); ok { - if perr.Err != syscall.ENOTDIR { - return "", noCleanup, errors.Wrapf(err, "error while creating mount source path '%s'", m.Source) - } - } - } - } - return m.Source, noCleanup, nil -} - -func (m *MountPoint) LiveRestore(ctx context.Context) error { - if m.Volume == nil { - log.G(ctx).Debug("No volume to restore") - return nil - } - - lrv, ok := m.Volume.(volume.LiveRestorer) - if !ok { - log.G(ctx).WithField("volume", m.Volume.Name()).Debugf("Volume does not support live restore: %T", m.Volume) - return nil - } - - id := m.ID - if id == "" { - id = stringid.GenerateRandomID() - } - - if err := lrv.LiveRestoreVolume(ctx, id); err != nil { - return errors.Wrapf(err, "error while restoring volume '%s'", m.Source) - } - - m.ID = id - m.active++ - return nil -} - -// Path returns the path of a volume in a mount point. -func (m *MountPoint) Path() string { - if m.Volume != nil { - return m.Volume.Path() - } - return m.Source -} - -func errInvalidMode(mode string) error { - return errors.Errorf("invalid mode: %v", mode) -} - -func errInvalidSpec(spec string) error { - return errors.Errorf("invalid volume specification: '%s'", spec) -} - -// noCleanup is a no-op cleanup function. -func noCleanup(_ context.Context) error { - return nil -} diff --git a/vendor/github.com/docker/docker/volume/mounts/parser.go b/vendor/github.com/docker/docker/volume/mounts/parser.go deleted file mode 100644 index c4ff6c8c7e..0000000000 --- a/vendor/github.com/docker/docker/volume/mounts/parser.go +++ /dev/null @@ -1,50 +0,0 @@ -package mounts // import "github.com/docker/docker/volume/mounts" - -import ( - "errors" - "runtime" - - "github.com/docker/docker/api/types/mount" -) - -// ErrVolumeTargetIsRoot is returned when the target destination is root. -// It's used by both LCOW and Linux parsers. -var ErrVolumeTargetIsRoot = errors.New("invalid specification: destination can't be '/'") - -// errAnonymousVolumeWithSubpath is returned when Subpath is specified for -// anonymous volume. -var errAnonymousVolumeWithSubpath = errors.New("must not set Subpath when using anonymous volumes") - -// errInvalidSubpath is returned when the provided Subpath is not lexically an -// relative path within volume. -var errInvalidSubpath = errors.New("subpath must be a relative path within the volume") - -// read-write modes -var rwModes = map[string]bool{ - "rw": true, - "ro": true, // attempts recursive read-only if possible -} - -// Parser represents a platform specific parser for mount expressions -type Parser interface { - ParseMountRaw(raw, volumeDriver string) (*MountPoint, error) - ParseMountSpec(cfg mount.Mount) (*MountPoint, error) - ParseVolumesFrom(spec string) (string, string, error) - DefaultPropagationMode() mount.Propagation - ConvertTmpfsOptions(opt *mount.TmpfsOptions, readOnly bool) (string, error) - DefaultCopyMode() bool - ValidateVolumeName(name string) error - ReadWrite(mode string) bool - IsBackwardCompatible(m *MountPoint) bool - HasResource(m *MountPoint, absPath string) bool - ValidateTmpfsMountDestination(dest string) error - ValidateMountConfig(mt *mount.Mount) error -} - -// NewParser creates a parser for the current host OS -func NewParser() Parser { - if runtime.GOOS == "windows" { - return NewWindowsParser() - } - return NewLinuxParser() -} diff --git a/vendor/github.com/docker/docker/volume/mounts/validate.go b/vendor/github.com/docker/docker/volume/mounts/validate.go deleted file mode 100644 index f40438290d..0000000000 --- a/vendor/github.com/docker/docker/volume/mounts/validate.go +++ /dev/null @@ -1,29 +0,0 @@ -package mounts // import "github.com/docker/docker/volume/mounts" - -import ( - "fmt" - - "github.com/docker/docker/api/types/mount" - "github.com/pkg/errors" -) - -type errMountConfig struct { - mount *mount.Mount - err error -} - -func (e *errMountConfig) Error() string { - return fmt.Sprintf("invalid mount config for type %q: %v", e.mount.Type, e.err.Error()) -} - -func errBindSourceDoesNotExist(path string) error { - return errors.Errorf("bind source path does not exist: %s", path) -} - -func errExtraField(name string) error { - return errors.Errorf("field %s must not be specified", name) -} - -func errMissingField(name string) error { - return errors.Errorf("field %s must not be empty", name) -} diff --git a/vendor/github.com/docker/docker/volume/mounts/volume_copy.go b/vendor/github.com/docker/docker/volume/mounts/volume_copy.go deleted file mode 100644 index 04056fa50a..0000000000 --- a/vendor/github.com/docker/docker/volume/mounts/volume_copy.go +++ /dev/null @@ -1,23 +0,0 @@ -package mounts // import "github.com/docker/docker/volume/mounts" - -import "strings" - -// {=isEnabled} -var copyModes = map[string]bool{ - "nocopy": false, -} - -func copyModeExists(mode string) bool { - _, exists := copyModes[mode] - return exists -} - -// GetCopyMode gets the copy mode from the mode string for mounts -func getCopyMode(mode string, def bool) (bool, bool) { - for _, o := range strings.Split(mode, ",") { - if isEnabled, exists := copyModes[o]; exists { - return isEnabled, true - } - } - return def, false -} diff --git a/vendor/github.com/docker/docker/volume/mounts/volume_unix.go b/vendor/github.com/docker/docker/volume/mounts/volume_unix.go deleted file mode 100644 index 8556bbe0d2..0000000000 --- a/vendor/github.com/docker/docker/volume/mounts/volume_unix.go +++ /dev/null @@ -1,14 +0,0 @@ -//go:build linux || freebsd || darwin - -package mounts // import "github.com/docker/docker/volume/mounts" - -import ( - "fmt" - "path/filepath" - "strings" -) - -func (p *linuxParser) HasResource(m *MountPoint, absolutePath string) bool { - relPath, err := filepath.Rel(m.Destination, absolutePath) - return err == nil && relPath != ".." && !strings.HasPrefix(relPath, fmt.Sprintf("..%c", filepath.Separator)) -} diff --git a/vendor/github.com/docker/docker/volume/mounts/volume_windows.go b/vendor/github.com/docker/docker/volume/mounts/volume_windows.go deleted file mode 100644 index d91f6cee3a..0000000000 --- a/vendor/github.com/docker/docker/volume/mounts/volume_windows.go +++ /dev/null @@ -1,5 +0,0 @@ -package mounts // import "github.com/docker/docker/volume/mounts" - -func (p *linuxParser) HasResource(m *MountPoint, absolutePath string) bool { - return false -} diff --git a/vendor/github.com/docker/docker/volume/mounts/windows_parser.go b/vendor/github.com/docker/docker/volume/mounts/windows_parser.go deleted file mode 100644 index cc8e6501cd..0000000000 --- a/vendor/github.com/docker/docker/volume/mounts/windows_parser.go +++ /dev/null @@ -1,468 +0,0 @@ -package mounts // import "github.com/docker/docker/volume/mounts" - -import ( - "errors" - "fmt" - "os" - "path/filepath" - "strings" - - "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/internal/lazyregexp" -) - -// NewWindowsParser creates a parser with Windows semantics. -func NewWindowsParser() Parser { - return &windowsParser{ - fi: defaultFileInfoProvider{}, - } -} - -type windowsParser struct { - fi fileInfoProvider -} - -const ( - // Spec should be in the format [source:]destination[:mode] - // - // Examples: c:\foo bar:d:rw - // c:\foo:d:\bar - // myname:d: - // d:\ - // - // Explanation of this regex! Thanks @thaJeztah on IRC and gist for help. See - // https://gist.github.com/thaJeztah/6185659e4978789fb2b2. A good place to - // test is https://regex-golang.appspot.com/assets/html/index.html - // - // Useful link for referencing named capturing groups: - // http://stackoverflow.com/questions/20750843/using-named-matches-from-go-regex - // - // There are three match groups: source, destination and mode. - // - - // rxHostDir is the first option of a source - rxHostDir = `(?:\\\\\?\\)?[a-z]:[\\/](?:[^\\/:*?"<>|\r\n]+[\\/]?)*` - // rxName is the second option of a source - rxName = `[^\\/:*?"<>|\r\n]+` - - // RXReservedNames are reserved names not possible on Windows - rxReservedNames = `(con|prn|nul|aux|com[1-9]|lpt[1-9])` - - // rxPipe is a named path pipe (starts with `\\.\pipe\`, possibly with / instead of \) - rxPipe = `[/\\]{2}.[/\\]pipe[/\\][^:*?"<>|\r\n]+` - // rxSource is the combined possibilities for a source - rxSource = `((?P((` + rxHostDir + `)|(` + rxName + `)|(` + rxPipe + `))):)?` - - // Source. Can be either a host directory, a name, or omitted: - // HostDir: - // - Essentially using the folder solution from - // https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9781449327453/ch08s18.html - // but adding case insensitivity. - // - Must be an absolute path such as c:\path - // - Can include spaces such as `c:\program files` - // - And then followed by a colon which is not in the capture group - // - And can be optional - // Name: - // - Must not contain invalid NTFS filename characters (https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx) - // - And then followed by a colon which is not in the capture group - // - And can be optional - - // rxDestination is the regex expression for the mount destination - rxDestination = `(?P((?:\\\\\?\\)?([a-z]):((?:[\\/][^\\/:*?"<>\r\n]+)*[\\/]?))|(` + rxPipe + `))` - - // rxMode is the regex expression for the mode of the mount - // Mode (optional): - // - Hopefully self explanatory in comparison to above regex's. - // - Colon is not in the capture group - rxMode = `(:(?P(?i)ro|rw))?` -) - -var ( - volumeNameRegexp = lazyregexp.New(`^` + rxName + `$`) - reservedNameRegexp = lazyregexp.New(`^` + rxReservedNames + `$`) - hostDirRegexp = lazyregexp.New(`^` + rxHostDir + `$`) - mountDestinationRegexp = lazyregexp.New(`^` + rxDestination + `$`) - windowsSplitRawSpecRegexp = lazyregexp.New(`^` + rxSource + rxDestination + rxMode + `$`) -) - -type mountValidator func(mnt *mount.Mount) error - -func (p *windowsParser) splitRawSpec(raw string, splitRegexp *lazyregexp.Regexp) ([]string, error) { - match := splitRegexp.FindStringSubmatch(strings.ToLower(raw)) - if len(match) == 0 { - return nil, errInvalidSpec(raw) - } - - var split []string - matchgroups := make(map[string]string) - // Pull out the sub expressions from the named capture groups - for i, name := range splitRegexp.SubexpNames() { - matchgroups[name] = strings.ToLower(match[i]) - } - if source, exists := matchgroups["source"]; exists { - if source != "" { - split = append(split, source) - } - } - if destination, exists := matchgroups["destination"]; exists { - if destination != "" { - split = append(split, destination) - } - } - if mode, exists := matchgroups["mode"]; exists { - if mode != "" { - split = append(split, mode) - } - } - // Fix #26329. If the destination appears to be a file, and the source is null, - // it may be because we've fallen through the possible naming regex and hit a - // situation where the user intention was to map a file into a container through - // a local volume, but this is not supported by the platform. - if matchgroups["source"] == "" && matchgroups["destination"] != "" { - if volumeNameRegexp.MatchString(matchgroups["destination"]) { - if reservedNameRegexp.MatchString(matchgroups["destination"]) { - return nil, fmt.Errorf("volume name %q cannot be a reserved word for Windows filenames", matchgroups["destination"]) - } - } else { - exists, isDir, _ := p.fi.fileInfo(matchgroups["destination"]) - if exists && !isDir { - return nil, fmt.Errorf("file '%s' cannot be mapped. Only directories can be mapped on this platform", matchgroups["destination"]) - } - } - } - return split, nil -} - -func windowsValidMountMode(mode string) bool { - if mode == "" { - return true - } - // TODO should windows mounts produce an error if any mode was provided (they're a no-op on windows) - return rwModes[strings.ToLower(mode)] -} - -func windowsValidateNotRoot(p string) error { - p = strings.ToLower(strings.ReplaceAll(p, `/`, `\`)) - if p == "c:" || p == `c:\` { - return fmt.Errorf(`destination path (%v) cannot be 'c:' or 'c:\'`, p) - } - return nil -} - -var windowsValidators mountValidator = func(m *mount.Mount) error { - if err := windowsValidateNotRoot(m.Target); err != nil { - return err - } - if !mountDestinationRegexp.MatchString(strings.ToLower(m.Target)) { - return fmt.Errorf("invalid mount path: '%s'", m.Target) - } - return nil -} - -func windowsValidateAbsolute(p string) error { - if !mountDestinationRegexp.MatchString(strings.ToLower(p)) { - return fmt.Errorf("invalid mount path: '%s' mount path must be absolute", p) - } - return nil -} - -func windowsDetectMountType(p string) mount.Type { - if strings.HasPrefix(p, `\\.\pipe\`) { - return mount.TypeNamedPipe - } else if hostDirRegexp.MatchString(p) { - return mount.TypeBind - } else { - return mount.TypeVolume - } -} - -func (p *windowsParser) ReadWrite(mode string) bool { - return strings.ToLower(mode) != "ro" -} - -// ValidateVolumeName checks a volume name in a platform specific manner. -func (p *windowsParser) ValidateVolumeName(name string) error { - if !volumeNameRegexp.MatchString(name) { - return errors.New("invalid volume name") - } - if reservedNameRegexp.MatchString(name) { - return fmt.Errorf("volume name %q cannot be a reserved word for Windows filenames", name) - } - return nil -} - -func (p *windowsParser) ValidateMountConfig(mnt *mount.Mount) error { - return p.validateMountConfigReg(mnt, windowsValidators) -} - -type fileInfoProvider interface { - fileInfo(path string) (exist, isDir bool, err error) -} - -type defaultFileInfoProvider struct{} - -func (defaultFileInfoProvider) fileInfo(path string) (exist, isDir bool, err error) { - fi, err := os.Stat(path) - if err != nil { - if !os.IsNotExist(err) { - return false, false, err - } - return false, false, nil - } - return true, fi.IsDir(), nil -} - -func (p *windowsParser) validateMountConfigReg(mnt *mount.Mount, additionalValidators ...mountValidator) error { - if len(mnt.Target) == 0 { - return &errMountConfig{mnt, errMissingField("Target")} - } - for _, v := range additionalValidators { - if err := v(mnt); err != nil { - return &errMountConfig{mnt, err} - } - } - - switch mnt.Type { - case mount.TypeBind: - if len(mnt.Source) == 0 { - return &errMountConfig{mnt, errMissingField("Source")} - } - // Don't error out just because the propagation mode is not supported on the platform - if opts := mnt.BindOptions; opts != nil { - if len(opts.Propagation) > 0 { - return &errMountConfig{mnt, fmt.Errorf("invalid propagation mode: %s", opts.Propagation)} - } - } - if mnt.VolumeOptions != nil { - return &errMountConfig{mnt, errExtraField("VolumeOptions")} - } - - if err := windowsValidateAbsolute(mnt.Source); err != nil { - return &errMountConfig{mnt, err} - } - - exists, isdir, err := p.fi.fileInfo(mnt.Source) - if err != nil { - return &errMountConfig{mnt, err} - } - if !exists { - return &errMountConfig{mnt, errBindSourceDoesNotExist(mnt.Source)} - } - if !isdir { - return &errMountConfig{mnt, fmt.Errorf("source path must be a directory")} - } - - case mount.TypeVolume: - if mnt.BindOptions != nil { - return &errMountConfig{mnt, errExtraField("BindOptions")} - } - - anonymousVolume := len(mnt.Source) == 0 - if mnt.VolumeOptions != nil && mnt.VolumeOptions.Subpath != "" { - if anonymousVolume { - return errAnonymousVolumeWithSubpath - } - - // Check if path is relative but without any back traversals - if !filepath.IsLocal(mnt.VolumeOptions.Subpath) { - return &errMountConfig{mnt, errInvalidSubpath} - } - } - - if anonymousVolume && mnt.ReadOnly { - return &errMountConfig{mnt, fmt.Errorf("must not set ReadOnly mode when using anonymous volumes")} - } - - if len(mnt.Source) != 0 { - if err := p.ValidateVolumeName(mnt.Source); err != nil { - return &errMountConfig{mnt, err} - } - } - case mount.TypeNamedPipe: - if len(mnt.Source) == 0 { - return &errMountConfig{mnt, errMissingField("Source")} - } - - if mnt.BindOptions != nil { - return &errMountConfig{mnt, errExtraField("BindOptions")} - } - - if mnt.ReadOnly { - return &errMountConfig{mnt, errExtraField("ReadOnly")} - } - - if windowsDetectMountType(mnt.Source) != mount.TypeNamedPipe { - return &errMountConfig{mnt, fmt.Errorf("'%s' is not a valid pipe path", mnt.Source)} - } - - if windowsDetectMountType(mnt.Target) != mount.TypeNamedPipe { - return &errMountConfig{mnt, fmt.Errorf("'%s' is not a valid pipe path", mnt.Target)} - } - default: - return &errMountConfig{mnt, errors.New("mount type unknown")} - } - return nil -} - -func (p *windowsParser) ParseMountRaw(raw, volumeDriver string) (*MountPoint, error) { - arr, err := p.splitRawSpec(raw, windowsSplitRawSpecRegexp) - if err != nil { - return nil, err - } - return p.parseMount(arr, raw, volumeDriver, true, windowsValidators) -} - -func (p *windowsParser) parseMount(arr []string, raw, volumeDriver string, convertTargetToBackslash bool, additionalValidators ...mountValidator) (*MountPoint, error) { - var spec mount.Mount - var mode string - switch len(arr) { - case 1: - // Just a destination path in the container - spec.Target = arr[0] - case 2: - if windowsValidMountMode(arr[1]) { - // Destination + Mode is not a valid volume - volumes - // cannot include a mode. e.g. /foo:rw - return nil, errInvalidSpec(raw) - } - // Host Source Path or Name + Destination - spec.Source = strings.ReplaceAll(arr[0], `/`, `\`) - spec.Target = arr[1] - case 3: - // HostSourcePath+DestinationPath+Mode - spec.Source = strings.ReplaceAll(arr[0], `/`, `\`) - spec.Target = arr[1] - mode = arr[2] - default: - return nil, errInvalidSpec(raw) - } - if convertTargetToBackslash { - spec.Target = strings.ReplaceAll(spec.Target, `/`, `\`) - } - - if !windowsValidMountMode(mode) { - return nil, errInvalidMode(mode) - } - - spec.Type = windowsDetectMountType(spec.Source) - spec.ReadOnly = !p.ReadWrite(mode) - - // cannot assume that if a volume driver is passed in that we should set it - if volumeDriver != "" && spec.Type == mount.TypeVolume { - spec.VolumeOptions = &mount.VolumeOptions{ - DriverConfig: &mount.Driver{Name: volumeDriver}, - } - } - - if copyData, isSet := getCopyMode(mode, p.DefaultCopyMode()); isSet { - if spec.VolumeOptions == nil { - spec.VolumeOptions = &mount.VolumeOptions{} - } - spec.VolumeOptions.NoCopy = !copyData - } - - mp, err := p.parseMountSpec(spec, convertTargetToBackslash, additionalValidators...) - if mp != nil { - mp.Mode = mode - } - if err != nil { - err = fmt.Errorf("%v: %v", errInvalidSpec(raw), err) - } - return mp, err -} - -func (p *windowsParser) ParseMountSpec(cfg mount.Mount) (*MountPoint, error) { - return p.parseMountSpec(cfg, true, windowsValidators) -} - -func (p *windowsParser) parseMountSpec(cfg mount.Mount, convertTargetToBackslash bool, additionalValidators ...mountValidator) (*MountPoint, error) { - if err := p.validateMountConfigReg(&cfg, additionalValidators...); err != nil { - return nil, err - } - mp := &MountPoint{ - RW: !cfg.ReadOnly, - Destination: cfg.Target, - Type: cfg.Type, - Spec: cfg, - } - if convertTargetToBackslash { - mp.Destination = strings.ReplaceAll(cfg.Target, `/`, `\`) - } - - switch cfg.Type { - case mount.TypeVolume: - if cfg.Source != "" { - // non-anonymous volume - mp.Name = cfg.Source - } - mp.CopyData = p.DefaultCopyMode() - - if cfg.VolumeOptions != nil { - if cfg.VolumeOptions.DriverConfig != nil { - mp.Driver = cfg.VolumeOptions.DriverConfig.Name - } - if cfg.VolumeOptions.NoCopy { - mp.CopyData = false - } - } - case mount.TypeBind: - mp.Source = strings.ReplaceAll(cfg.Source, `/`, `\`) - case mount.TypeNamedPipe: - mp.Source = strings.ReplaceAll(cfg.Source, `/`, `\`) - default: - // TODO(thaJeztah): make switch exhaustive: anything to do for mount.TypeTmpfs, mount.TypeCluster, mount.TypeImage ? - } - // cleanup trailing `\` except for paths like `c:\` - if len(mp.Source) > 3 && mp.Source[len(mp.Source)-1] == '\\' { - mp.Source = mp.Source[:len(mp.Source)-1] - } - if len(mp.Destination) > 3 && mp.Destination[len(mp.Destination)-1] == '\\' { - mp.Destination = mp.Destination[:len(mp.Destination)-1] - } - return mp, nil -} - -func (p *windowsParser) ParseVolumesFrom(spec string) (string, string, error) { - if len(spec) == 0 { - return "", "", fmt.Errorf("volumes-from specification cannot be an empty string") - } - - id, mode, _ := strings.Cut(spec, ":") - if mode == "" { - return id, "rw", nil - } - - if !windowsValidMountMode(mode) { - return "", "", errInvalidMode(mode) - } - - // Do not allow copy modes on volumes-from - if _, isSet := getCopyMode(mode, p.DefaultCopyMode()); isSet { - return "", "", errInvalidMode(mode) - } - return id, mode, nil -} - -func (p *windowsParser) DefaultPropagationMode() mount.Propagation { - return "" -} - -func (p *windowsParser) ConvertTmpfsOptions(opt *mount.TmpfsOptions, readOnly bool) (string, error) { - return "", errors.New("windows does not support tmpfs") -} - -func (p *windowsParser) DefaultCopyMode() bool { - return false -} - -func (p *windowsParser) IsBackwardCompatible(m *MountPoint) bool { - return false -} - -func (p *windowsParser) ValidateTmpfsMountDestination(dest string) error { - return errors.New("windows does not support tmpfs") -} - -func (p *windowsParser) HasResource(m *MountPoint, absolutePath string) bool { - return false -} diff --git a/vendor/github.com/docker/docker/volume/volume.go b/vendor/github.com/docker/docker/volume/volume.go deleted file mode 100644 index 2dcbdebe16..0000000000 --- a/vendor/github.com/docker/docker/volume/volume.go +++ /dev/null @@ -1,79 +0,0 @@ -package volume // import "github.com/docker/docker/volume" - -import ( - "context" - "time" -) - -// DefaultDriverName is the driver name used for the driver -// implemented in the local package. -const DefaultDriverName = "local" - -// Scopes define if a volume has is cluster-wide (global) or local only. -// Scopes are returned by the volume driver when it is queried for capabilities and then set on a volume -const ( - LocalScope = "local" - GlobalScope = "global" -) - -// Driver is for creating and removing volumes. -type Driver interface { - // Name returns the name of the volume driver. - Name() string - // Create makes a new volume with the given name. - Create(name string, opts map[string]string) (Volume, error) - // Remove deletes the volume. - Remove(vol Volume) (err error) - // List lists all the volumes the driver has - List() ([]Volume, error) - // Get retrieves the volume with the requested name - Get(name string) (Volume, error) - // Scope returns the scope of the driver (e.g. `global` or `local`). - // Scope determines how the driver is handled at a cluster level - Scope() string -} - -// Capability defines a set of capabilities that a driver is able to handle. -type Capability struct { - // Scope is the scope of the driver, `global` or `local` - // A `global` scope indicates that the driver manages volumes across the cluster - // A `local` scope indicates that the driver only manages volumes resources local to the host - // Scope is declared by the driver - Scope string -} - -// Volume is a place to store data. It is backed by a specific driver, and can be mounted. -type Volume interface { - // Name returns the name of the volume - Name() string - // DriverName returns the name of the driver which owns this volume. - DriverName() string - // Path returns the absolute path to the volume. - Path() string - // Mount mounts the volume and returns the absolute path to - // where it can be consumed. - Mount(id string) (string, error) - // Unmount unmounts the volume when it is no longer in use. - Unmount(id string) error - // CreatedAt returns Volume Creation time - CreatedAt() (time.Time, error) - // Status returns low-level status information about a volume - Status() map[string]interface{} -} - -// LiveRestorer is an optional interface that can be implemented by a volume driver -// It is used to restore any resources that are necessary for a volume to be used by a live-restored container -type LiveRestorer interface { - // LiveRestoreVolume allows a volume driver which implements this interface to restore any necessary resources (such as reference counting) - // This is called only after the daemon is restarted with live-restored containers - // It is called once per live-restored container. - LiveRestoreVolume(_ context.Context, ref string) error -} - -// DetailedVolume wraps a Volume with user-defined labels, options, and cluster scope (e.g., `local` or `global`) -type DetailedVolume interface { - Labels() map[string]string - Options() map[string]string - Scope() string - Volume -} diff --git a/vendor/github.com/docker/go-events/.gitignore b/vendor/github.com/docker/go-events/.gitignore deleted file mode 100644 index daf913b1b3..0000000000 --- a/vendor/github.com/docker/go-events/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/vendor/github.com/docker/go-events/CONTRIBUTING.md b/vendor/github.com/docker/go-events/CONTRIBUTING.md deleted file mode 100644 index d813af779b..0000000000 --- a/vendor/github.com/docker/go-events/CONTRIBUTING.md +++ /dev/null @@ -1,70 +0,0 @@ -# Contributing to Docker open source projects - -Want to hack on go-events? Awesome! Here are instructions to get you started. - -go-events is part of the [Docker](https://www.docker.com) project, and -follows the same rules and principles. If you're already familiar with the way -Docker does things, you'll feel right at home. - -Otherwise, go read Docker's -[contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md), -[issue triaging](https://github.com/docker/docker/blob/master/project/ISSUE-TRIAGE.md), -[review process](https://github.com/docker/docker/blob/master/project/REVIEWING.md) and -[branches and tags](https://github.com/docker/docker/blob/master/project/BRANCHES-AND-TAGS.md). - -For an in-depth description of our contribution process, visit the -contributors guide: [Understand how to contribute](https://docs.docker.com/opensource/workflow/make-a-contribution/) - -### Sign your work - -The sign-off is a simple line at the end of the explanation for the patch. Your -signature certifies that you wrote the patch or otherwise have the right to pass -it on as an open-source patch. The rules are pretty simple: if you can certify -the below (from [developercertificate.org](http://developercertificate.org/)): - -``` -Developer Certificate of Origin -Version 1.1 - -Copyright (C) 2004, 2006 The Linux Foundation and its contributors. -660 York Street, Suite 102, -San Francisco, CA 94110 USA - -Everyone is permitted to copy and distribute verbatim copies of this -license document, but changing it is not allowed. - -Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -(a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -(b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -(c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -(d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. -``` - -Then you just add a line to every git commit message: - - Signed-off-by: Joe Smith - -Use your real name (sorry, no pseudonyms or anonymous contributions.) - -If you set your `user.name` and `user.email` git configs, you can sign your -commit automatically with `git commit -s`. diff --git a/vendor/github.com/docker/go-events/LICENSE b/vendor/github.com/docker/go-events/LICENSE deleted file mode 100644 index 6d630cf595..0000000000 --- a/vendor/github.com/docker/go-events/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2016 Docker, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/docker/go-events/MAINTAINERS b/vendor/github.com/docker/go-events/MAINTAINERS deleted file mode 100644 index e414d82e96..0000000000 --- a/vendor/github.com/docker/go-events/MAINTAINERS +++ /dev/null @@ -1,46 +0,0 @@ -# go-events maintainers file -# -# This file describes who runs the docker/go-events project and how. -# This is a living document - if you see something out of date or missing, speak up! -# -# It is structured to be consumable by both humans and programs. -# To extract its contents programmatically, use any TOML-compliant parser. -# -# This file is compiled into the MAINTAINERS file in docker/opensource. -# -[Org] - [Org."Core maintainers"] - people = [ - "aaronlehmann", - "aluzzardi", - "lk4d4", - "stevvooe", - ] - -[people] - -# A reference list of all people associated with the project. -# All other sections should refer to people by their canonical key -# in the people section. - - # ADD YOURSELF HERE IN ALPHABETICAL ORDER - - [people.aaronlehmann] - Name = "Aaron Lehmann" - Email = "aaron.lehmann@docker.com" - GitHub = "aaronlehmann" - - [people.aluzzardi] - Name = "Andrea Luzzardi" - Email = "al@docker.com" - GitHub = "aluzzardi" - - [people.lk4d4] - Name = "Alexander Morozov" - Email = "lk4d4@docker.com" - GitHub = "lk4d4" - - [people.stevvooe] - Name = "Stephen Day" - Email = "stephen.day@docker.com" - GitHub = "stevvooe" diff --git a/vendor/github.com/docker/go-events/README.md b/vendor/github.com/docker/go-events/README.md deleted file mode 100644 index 662d855fb3..0000000000 --- a/vendor/github.com/docker/go-events/README.md +++ /dev/null @@ -1,116 +0,0 @@ -# Docker Events Package - -[![GoDoc](https://godoc.org/github.com/docker/go-events?status.svg)](https://godoc.org/github.com/docker/go-events) - -The Docker `events` package implements a composable event distribution package -for Go. - -Originally created to implement the [notifications in Docker Registry -2](https://github.com/docker/distribution/blob/master/docs/notifications.md), -we've found the pattern to be useful in other applications. This package is -most of the same code with slightly updated interfaces. Much of the internals -have been made available. - -## Usage - -The `events` package centers around a `Sink` type. Events are written with -calls to `Sink.Write(event Event)`. Sinks can be wired up in various -configurations to achieve interesting behavior. - -The canonical example is that employed by the -[docker/distribution/notifications](https://godoc.org/github.com/docker/distribution/notifications) -package. Let's say we have a type `httpSink` where we'd like to queue -notifications. As a rule, it should send a single http request and return an -error if it fails: - -```go -func (h *httpSink) Write(event Event) error { - p, err := json.Marshal(event) - if err != nil { - return err - } - body := bytes.NewReader(p) - resp, err := h.client.Post(h.url, "application/json", body) - if err != nil { - return err - } - defer resp.Body.Close() - - if resp.Status != 200 { - return errors.New("unexpected status") - } - - return nil -} - -// implement (*httpSink).Close() -``` - -With just that, we can start using components from this package. One can call -`(*httpSink).Write` to send events as the body of a post request to a -configured URL. - -### Retries - -HTTP can be unreliable. The first feature we'd like is to have some retry: - -```go -hs := newHTTPSink(/*...*/) -retry := NewRetryingSink(hs, NewBreaker(5, time.Second)) -``` - -We now have a sink that will retry events against the `httpSink` until they -succeed. The retry will backoff for one second after 5 consecutive failures -using the breaker strategy. - -### Queues - -This isn't quite enough. We we want a sink that doesn't block while we are -waiting for events to be sent. Let's add a `Queue`: - -```go -queue := NewQueue(retry) -``` - -Now, we have an unbounded queue that will work through all events sent with -`(*Queue).Write`. Events can be added asynchronously to the queue without -blocking the current execution path. This is ideal for use in an http request. - -### Broadcast - -It usually turns out that you want to send to more than one listener. We can -use `Broadcaster` to support this: - -```go -var broadcast = NewBroadcaster() // make it available somewhere in your application. -broadcast.Add(queue) // add your queue! -broadcast.Add(queue2) // and another! -``` - -With the above, we can now call `broadcast.Write` in our http handlers and have -all the events distributed to each queue. Because the events are queued, not -listener blocks another. - -### Extending - -For the most part, the above is sufficient for a lot of applications. However, -extending the above functionality can be done implementing your own `Sink`. The -behavior and semantics of the sink can be completely dependent on the -application requirements. The interface is provided below for reference: - -```go -type Sink { - Write(Event) error - Close() error -} -``` - -Application behavior can be controlled by how `Write` behaves. The examples -above are designed to queue the message and return as quickly as possible. -Other implementations may block until the event is committed to durable -storage. - -## Copyright and license - -Copyright © 2016 Docker, Inc. go-events is licensed under the Apache License, -Version 2.0. See [LICENSE](LICENSE) for the full license text. diff --git a/vendor/github.com/docker/go-events/SECURITY.md b/vendor/github.com/docker/go-events/SECURITY.md deleted file mode 100644 index 610eef2c9e..0000000000 --- a/vendor/github.com/docker/go-events/SECURITY.md +++ /dev/null @@ -1,36 +0,0 @@ -# Security Policy - -The maintainers of the Docker Events package take security seriously. If you discover -a security issue, please bring it to their attention right away! - -## Reporting a Vulnerability - -Please **DO NOT** file a public issue, instead send your report privately -to [security@docker.com](mailto:security@docker.com). - -Reporter(s) can expect a response within 72 hours, acknowledging the issue was -received. - -## Review Process - -After receiving the report, an initial triage and technical analysis is -performed to confirm the report and determine its scope. We may request -additional information in this stage of the process. - -Once a reviewer has confirmed the relevance of the report, a draft security -advisory will be created on GitHub. The draft advisory will be used to discuss -the issue with maintainers, the reporter(s), and where applicable, other -affected parties under embargo. - -If the vulnerability is accepted, a timeline for developing a patch, public -disclosure, and patch release will be determined. If there is an embargo period -on public disclosure before the patch release, the reporter(s) are expected to -participate in the discussion of the timeline and abide by agreed upon dates -for public disclosure. - -## Accreditation - -Security reports are greatly appreciated and we will publicly thank you, -although we will keep your name confidential if you request it. We also like to -send gifts - if you're into swag, make sure to let us know. We do not currently -offer a paid security bounty program at this time. diff --git a/vendor/github.com/docker/go-events/broadcast.go b/vendor/github.com/docker/go-events/broadcast.go deleted file mode 100644 index 5120078dfb..0000000000 --- a/vendor/github.com/docker/go-events/broadcast.go +++ /dev/null @@ -1,178 +0,0 @@ -package events - -import ( - "fmt" - "sync" - - "github.com/sirupsen/logrus" -) - -// Broadcaster sends events to multiple, reliable Sinks. The goal of this -// component is to dispatch events to configured endpoints. Reliability can be -// provided by wrapping incoming sinks. -type Broadcaster struct { - sinks []Sink - events chan Event - adds chan configureRequest - removes chan configureRequest - - shutdown chan struct{} - closed chan struct{} - once sync.Once -} - -// NewBroadcaster appends one or more sinks to the list of sinks. The -// broadcaster behavior will be affected by the properties of the sink. -// Generally, the sink should accept all messages and deal with reliability on -// its own. Use of EventQueue and RetryingSink should be used here. -func NewBroadcaster(sinks ...Sink) *Broadcaster { - b := Broadcaster{ - sinks: sinks, - events: make(chan Event), - adds: make(chan configureRequest), - removes: make(chan configureRequest), - shutdown: make(chan struct{}), - closed: make(chan struct{}), - } - - // Start the broadcaster - go b.run() - - return &b -} - -// Write accepts an event to be dispatched to all sinks. This method will never -// fail and should never block (hopefully!). The caller cedes the memory to the -// broadcaster and should not modify it after calling write. -func (b *Broadcaster) Write(event Event) error { - select { - case b.events <- event: - case <-b.closed: - return ErrSinkClosed - } - return nil -} - -// Add the sink to the broadcaster. -// -// The provided sink must be comparable with equality. Typically, this just -// works with a regular pointer type. -func (b *Broadcaster) Add(sink Sink) error { - return b.configure(b.adds, sink) -} - -// Remove the provided sink. -func (b *Broadcaster) Remove(sink Sink) error { - return b.configure(b.removes, sink) -} - -type configureRequest struct { - sink Sink - response chan error -} - -func (b *Broadcaster) configure(ch chan configureRequest, sink Sink) error { - response := make(chan error, 1) - - for { - select { - case ch <- configureRequest{ - sink: sink, - response: response}: - ch = nil - case err := <-response: - return err - case <-b.closed: - return ErrSinkClosed - } - } -} - -// Close the broadcaster, ensuring that all messages are flushed to the -// underlying sink before returning. -func (b *Broadcaster) Close() error { - b.once.Do(func() { - close(b.shutdown) - }) - - <-b.closed - return nil -} - -// run is the main broadcast loop, started when the broadcaster is created. -// Under normal conditions, it waits for events on the event channel. After -// Close is called, this goroutine will exit. -func (b *Broadcaster) run() { - defer close(b.closed) - remove := func(target Sink) { - for i, sink := range b.sinks { - if sink == target { - b.sinks = append(b.sinks[:i], b.sinks[i+1:]...) - break - } - } - } - - for { - select { - case event := <-b.events: - for _, sink := range b.sinks { - if err := sink.Write(event); err != nil { - if err == ErrSinkClosed { - // remove closed sinks - remove(sink) - continue - } - logrus.WithField("event", event).WithField("events.sink", sink).WithError(err). - Errorf("broadcaster: dropping event") - } - } - case request := <-b.adds: - // while we have to iterate for add/remove, common iteration for - // send is faster against slice. - - var found bool - for _, sink := range b.sinks { - if request.sink == sink { - found = true - break - } - } - - if !found { - b.sinks = append(b.sinks, request.sink) - } - // b.sinks[request.sink] = struct{}{} - request.response <- nil - case request := <-b.removes: - remove(request.sink) - request.response <- nil - case <-b.shutdown: - // close all the underlying sinks - for _, sink := range b.sinks { - if err := sink.Close(); err != nil && err != ErrSinkClosed { - logrus.WithField("events.sink", sink).WithError(err). - Errorf("broadcaster: closing sink failed") - } - } - return - } - } -} - -func (b *Broadcaster) String() string { - // Serialize copy of this broadcaster without the sync.Once, to avoid - // a data race. - - b2 := map[string]interface{}{ - "sinks": b.sinks, - "events": b.events, - "adds": b.adds, - "removes": b.removes, - - "shutdown": b.shutdown, - "closed": b.closed, - } - - return fmt.Sprint(b2) -} diff --git a/vendor/github.com/docker/go-events/channel.go b/vendor/github.com/docker/go-events/channel.go deleted file mode 100644 index 802cf51ffe..0000000000 --- a/vendor/github.com/docker/go-events/channel.go +++ /dev/null @@ -1,61 +0,0 @@ -package events - -import ( - "fmt" - "sync" -) - -// Channel provides a sink that can be listened on. The writer and channel -// listener must operate in separate goroutines. -// -// Consumers should listen on Channel.C until Closed is closed. -type Channel struct { - C chan Event - - closed chan struct{} - once sync.Once -} - -// NewChannel returns a channel. If buffer is zero, the channel is -// unbuffered. -func NewChannel(buffer int) *Channel { - return &Channel{ - C: make(chan Event, buffer), - closed: make(chan struct{}), - } -} - -// Done returns a channel that will always proceed once the sink is closed. -func (ch *Channel) Done() chan struct{} { - return ch.closed -} - -// Write the event to the channel. Must be called in a separate goroutine from -// the listener. -func (ch *Channel) Write(event Event) error { - select { - case ch.C <- event: - return nil - case <-ch.closed: - return ErrSinkClosed - } -} - -// Close the channel sink. -func (ch *Channel) Close() error { - ch.once.Do(func() { - close(ch.closed) - }) - - return nil -} - -func (ch *Channel) String() string { - // Serialize a copy of the Channel that doesn't contain the sync.Once, - // to avoid a data race. - ch2 := map[string]interface{}{ - "C": ch.C, - "closed": ch.closed, - } - return fmt.Sprint(ch2) -} diff --git a/vendor/github.com/docker/go-events/errors.go b/vendor/github.com/docker/go-events/errors.go deleted file mode 100644 index 56db7c2510..0000000000 --- a/vendor/github.com/docker/go-events/errors.go +++ /dev/null @@ -1,10 +0,0 @@ -package events - -import "fmt" - -var ( - // ErrSinkClosed is returned if a write is issued to a sink that has been - // closed. If encountered, the error should be considered terminal and - // retries will not be successful. - ErrSinkClosed = fmt.Errorf("events: sink closed") -) diff --git a/vendor/github.com/docker/go-events/event.go b/vendor/github.com/docker/go-events/event.go deleted file mode 100644 index f0f1d9ea5f..0000000000 --- a/vendor/github.com/docker/go-events/event.go +++ /dev/null @@ -1,15 +0,0 @@ -package events - -// Event marks items that can be sent as events. -type Event interface{} - -// Sink accepts and sends events. -type Sink interface { - // Write an event to the Sink. If no error is returned, the caller will - // assume that all events have been committed to the sink. If an error is - // received, the caller may retry sending the event. - Write(event Event) error - - // Close the sink, possibly waiting for pending events to flush. - Close() error -} diff --git a/vendor/github.com/docker/go-events/filter.go b/vendor/github.com/docker/go-events/filter.go deleted file mode 100644 index e6c0eb69dd..0000000000 --- a/vendor/github.com/docker/go-events/filter.go +++ /dev/null @@ -1,52 +0,0 @@ -package events - -// Matcher matches events. -type Matcher interface { - Match(event Event) bool -} - -// MatcherFunc implements matcher with just a function. -type MatcherFunc func(event Event) bool - -// Match calls the wrapped function. -func (fn MatcherFunc) Match(event Event) bool { - return fn(event) -} - -// Filter provides an event sink that sends only events that are accepted by a -// Matcher. No methods on filter are goroutine safe. -type Filter struct { - dst Sink - matcher Matcher - closed bool -} - -// NewFilter returns a new filter that will send to events to dst that return -// true for Matcher. -func NewFilter(dst Sink, matcher Matcher) Sink { - return &Filter{dst: dst, matcher: matcher} -} - -// Write an event to the filter. -func (f *Filter) Write(event Event) error { - if f.closed { - return ErrSinkClosed - } - - if f.matcher.Match(event) { - return f.dst.Write(event) - } - - return nil -} - -// Close the filter and allow no more events to pass through. -func (f *Filter) Close() error { - // TODO(stevvooe): Not all sinks should have Close. - if f.closed { - return nil - } - - f.closed = true - return f.dst.Close() -} diff --git a/vendor/github.com/docker/go-events/queue.go b/vendor/github.com/docker/go-events/queue.go deleted file mode 100644 index 4bb770afc2..0000000000 --- a/vendor/github.com/docker/go-events/queue.go +++ /dev/null @@ -1,111 +0,0 @@ -package events - -import ( - "container/list" - "sync" - - "github.com/sirupsen/logrus" -) - -// Queue accepts all messages into a queue for asynchronous consumption -// by a sink. It is unbounded and thread safe but the sink must be reliable or -// events will be dropped. -type Queue struct { - dst Sink - events *list.List - cond *sync.Cond - mu sync.Mutex - closed bool -} - -// NewQueue returns a queue to the provided Sink dst. -func NewQueue(dst Sink) *Queue { - eq := Queue{ - dst: dst, - events: list.New(), - } - - eq.cond = sync.NewCond(&eq.mu) - go eq.run() - return &eq -} - -// Write accepts the events into the queue, only failing if the queue has -// been closed. -func (eq *Queue) Write(event Event) error { - eq.mu.Lock() - defer eq.mu.Unlock() - - if eq.closed { - return ErrSinkClosed - } - - eq.events.PushBack(event) - eq.cond.Signal() // signal waiters - - return nil -} - -// Close shutsdown the event queue, flushing -func (eq *Queue) Close() error { - eq.mu.Lock() - defer eq.mu.Unlock() - - if eq.closed { - return nil - } - - // set closed flag - eq.closed = true - eq.cond.Signal() // signal flushes queue - eq.cond.Wait() // wait for signal from last flush - return eq.dst.Close() -} - -// run is the main goroutine to flush events to the target sink. -func (eq *Queue) run() { - for { - event := eq.next() - - if event == nil { - return // nil block means event queue is closed. - } - - if err := eq.dst.Write(event); err != nil { - // TODO(aaronl): Dropping events could be bad depending - // on the application. We should have a way of - // communicating this condition. However, logging - // at a log level above debug may not be appropriate. - // Eventually, go-events should not use logrus at all, - // and should bubble up conditions like this through - // error values. - logrus.WithFields(logrus.Fields{ - "event": event, - "sink": eq.dst, - }).WithError(err).Debug("eventqueue: dropped event") - } - } -} - -// next encompasses the critical section of the run loop. When the queue is -// empty, it will block on the condition. If new data arrives, it will wake -// and return a block. When closed, a nil slice will be returned. -func (eq *Queue) next() Event { - eq.mu.Lock() - defer eq.mu.Unlock() - - for eq.events.Len() < 1 { - if eq.closed { - eq.cond.Broadcast() - return nil - } - - eq.cond.Wait() - } - - front := eq.events.Front() - block := front.Value.(Event) - eq.events.Remove(front) - - return block -} diff --git a/vendor/github.com/docker/go-events/retry.go b/vendor/github.com/docker/go-events/retry.go deleted file mode 100644 index b7f0a54225..0000000000 --- a/vendor/github.com/docker/go-events/retry.go +++ /dev/null @@ -1,260 +0,0 @@ -package events - -import ( - "fmt" - "math/rand" - "sync" - "sync/atomic" - "time" - - "github.com/sirupsen/logrus" -) - -// RetryingSink retries the write until success or an ErrSinkClosed is -// returned. Underlying sink must have p > 0 of succeeding or the sink will -// block. Retry is configured with a RetryStrategy. Concurrent calls to a -// retrying sink are serialized through the sink, meaning that if one is -// in-flight, another will not proceed. -type RetryingSink struct { - sink Sink - strategy RetryStrategy - closed chan struct{} - once sync.Once -} - -// NewRetryingSink returns a sink that will retry writes to a sink, backing -// off on failure. Parameters threshold and backoff adjust the behavior of the -// circuit breaker. -func NewRetryingSink(sink Sink, strategy RetryStrategy) *RetryingSink { - rs := &RetryingSink{ - sink: sink, - strategy: strategy, - closed: make(chan struct{}), - } - - return rs -} - -// Write attempts to flush the events to the downstream sink until it succeeds -// or the sink is closed. -func (rs *RetryingSink) Write(event Event) error { - logger := logrus.WithField("event", event) - -retry: - select { - case <-rs.closed: - return ErrSinkClosed - default: - } - - if backoff := rs.strategy.Proceed(event); backoff > 0 { - select { - case <-time.After(backoff): - // TODO(stevvooe): This branch holds up the next try. Before, we - // would simply break to the "retry" label and then possibly wait - // again. However, this requires all retry strategies to have a - // large probability of probing the sync for success, rather than - // just backing off and sending the request. - case <-rs.closed: - return ErrSinkClosed - } - } - - if err := rs.sink.Write(event); err != nil { - if err == ErrSinkClosed { - // terminal! - return err - } - - logger := logger.WithError(err) // shadow!! - - if rs.strategy.Failure(event, err) { - logger.Errorf("retryingsink: dropped event") - return nil - } - - logger.Errorf("retryingsink: error writing event, retrying") - goto retry - } - - rs.strategy.Success(event) - return nil -} - -// Close closes the sink and the underlying sink. -func (rs *RetryingSink) Close() error { - rs.once.Do(func() { - close(rs.closed) - }) - - return nil -} - -func (rs *RetryingSink) String() string { - // Serialize a copy of the RetryingSink without the sync.Once, to avoid - // a data race. - rs2 := map[string]interface{}{ - "sink": rs.sink, - "strategy": rs.strategy, - "closed": rs.closed, - } - return fmt.Sprint(rs2) -} - -// RetryStrategy defines a strategy for retrying event sink writes. -// -// All methods should be goroutine safe. -type RetryStrategy interface { - // Proceed is called before every event send. If proceed returns a - // positive, non-zero integer, the retryer will back off by the provided - // duration. - // - // An event is provided, by may be ignored. - Proceed(event Event) time.Duration - - // Failure reports a failure to the strategy. If this method returns true, - // the event should be dropped. - Failure(event Event, err error) bool - - // Success should be called when an event is sent successfully. - Success(event Event) -} - -// Breaker implements a circuit breaker retry strategy. -// -// The current implementation never drops events. -type Breaker struct { - threshold int - recent int - last time.Time - backoff time.Duration // time after which we retry after failure. - mu sync.Mutex -} - -var _ RetryStrategy = &Breaker{} - -// NewBreaker returns a breaker that will backoff after the threshold has been -// tripped. A Breaker is thread safe and may be shared by many goroutines. -func NewBreaker(threshold int, backoff time.Duration) *Breaker { - return &Breaker{ - threshold: threshold, - backoff: backoff, - } -} - -// Proceed checks the failures against the threshold. -func (b *Breaker) Proceed(event Event) time.Duration { - b.mu.Lock() - defer b.mu.Unlock() - - if b.recent < b.threshold { - return 0 - } - - return b.last.Add(b.backoff).Sub(time.Now()) -} - -// Success resets the breaker. -func (b *Breaker) Success(event Event) { - b.mu.Lock() - defer b.mu.Unlock() - - b.recent = 0 - b.last = time.Time{} -} - -// Failure records the failure and latest failure time. -func (b *Breaker) Failure(event Event, err error) bool { - b.mu.Lock() - defer b.mu.Unlock() - - b.recent++ - b.last = time.Now().UTC() - return false // never drop events. -} - -var ( - // DefaultExponentialBackoffConfig provides a default configuration for - // exponential backoff. - DefaultExponentialBackoffConfig = ExponentialBackoffConfig{ - Base: time.Second, - Factor: time.Second, - Max: 20 * time.Second, - } -) - -// ExponentialBackoffConfig configures backoff parameters. -// -// Note that these parameters operate on the upper bound for choosing a random -// value. For example, at Base=1s, a random value in [0,1s) will be chosen for -// the backoff value. -type ExponentialBackoffConfig struct { - // Base is the minimum bound for backing off after failure. - Base time.Duration - - // Factor sets the amount of time by which the backoff grows with each - // failure. - Factor time.Duration - - // Max is the absolute maxiumum bound for a single backoff. - Max time.Duration -} - -// ExponentialBackoff implements random backoff with exponentially increasing -// bounds as the number consecutive failures increase. -type ExponentialBackoff struct { - failures uint64 // consecutive failure counter (needs to be 64-bit aligned) - config ExponentialBackoffConfig -} - -// NewExponentialBackoff returns an exponential backoff strategy with the -// desired config. If config is nil, the default is returned. -func NewExponentialBackoff(config ExponentialBackoffConfig) *ExponentialBackoff { - return &ExponentialBackoff{ - config: config, - } -} - -// Proceed returns the next randomly bound exponential backoff time. -func (b *ExponentialBackoff) Proceed(event Event) time.Duration { - return b.backoff(atomic.LoadUint64(&b.failures)) -} - -// Success resets the failures counter. -func (b *ExponentialBackoff) Success(event Event) { - atomic.StoreUint64(&b.failures, 0) -} - -// Failure increments the failure counter. -func (b *ExponentialBackoff) Failure(event Event, err error) bool { - atomic.AddUint64(&b.failures, 1) - return false -} - -// backoff calculates the amount of time to wait based on the number of -// consecutive failures. -func (b *ExponentialBackoff) backoff(failures uint64) time.Duration { - if failures <= 0 { - // proceed normally when there are no failures. - return 0 - } - - factor := b.config.Factor - if factor <= 0 { - factor = DefaultExponentialBackoffConfig.Factor - } - - backoff := b.config.Base + factor*time.Duration(1<<(failures-1)) - - max := b.config.Max - if max <= 0 { - max = DefaultExponentialBackoffConfig.Max - } - - if backoff > max || backoff < 0 { - backoff = max - } - - // Choose a uniformly distributed value from [0, backoff). - return time.Duration(rand.Int63n(int64(backoff))) -} diff --git a/vendor/github.com/docker/go-events/vendor.mod b/vendor/github.com/docker/go-events/vendor.mod deleted file mode 100644 index 66a2cd9e5c..0000000000 --- a/vendor/github.com/docker/go-events/vendor.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/docker/go-events - -go 1.13 - -require github.com/sirupsen/logrus v1.9.3 diff --git a/vendor/github.com/docker/go-events/vendor.sum b/vendor/github.com/docker/go-events/vendor.sum deleted file mode 100644 index 9243c28735..0000000000 --- a/vendor/github.com/docker/go-events/vendor.sum +++ /dev/null @@ -1,16 +0,0 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= -github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/vendor/github.com/gogo/protobuf/gogoproto/Makefile b/vendor/github.com/gogo/protobuf/gogoproto/Makefile deleted file mode 100644 index 0b4659b731..0000000000 --- a/vendor/github.com/gogo/protobuf/gogoproto/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -# Protocol Buffers for Go with Gadgets -# -# Copyright (c) 2013, The GoGo Authors. All rights reserved. -# http://github.com/gogo/protobuf -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -regenerate: - go install github.com/gogo/protobuf/protoc-gen-gogo - protoc --gogo_out=Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:../../../../ --proto_path=../../../../:../protobuf/:. *.proto - -restore: - cp gogo.pb.golden gogo.pb.go - -preserve: - cp gogo.pb.go gogo.pb.golden diff --git a/vendor/github.com/gogo/protobuf/gogoproto/doc.go b/vendor/github.com/gogo/protobuf/gogoproto/doc.go deleted file mode 100644 index 081c86fa8e..0000000000 --- a/vendor/github.com/gogo/protobuf/gogoproto/doc.go +++ /dev/null @@ -1,169 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -/* -Package gogoproto provides extensions for protocol buffers to achieve: - - - fast marshalling and unmarshalling. - - peace of mind by optionally generating test and benchmark code. - - more canonical Go structures. - - less typing by optionally generating extra helper code. - - goprotobuf compatibility - -More Canonical Go Structures - -A lot of time working with a goprotobuf struct will lead you to a place where you create another struct that is easier to work with and then have a function to copy the values between the two structs. -You might also find that basic structs that started their life as part of an API need to be sent over the wire. With gob, you could just send it. With goprotobuf, you need to make a parallel struct. -Gogoprotobuf tries to fix these problems with the nullable, embed, customtype and customname field extensions. - - - nullable, if false, a field is generated without a pointer (see warning below). - - embed, if true, the field is generated as an embedded field. - - customtype, It works with the Marshal and Unmarshal methods, to allow you to have your own types in your struct, but marshal to bytes. For example, custom.Uuid or custom.Fixed128 - - customname (beta), Changes the generated fieldname. This is especially useful when generated methods conflict with fieldnames. - - casttype (beta), Changes the generated fieldtype. All generated code assumes that this type is castable to the protocol buffer field type. It does not work for structs or enums. - - castkey (beta), Changes the generated fieldtype for a map key. All generated code assumes that this type is castable to the protocol buffer field type. Only supported on maps. - - castvalue (beta), Changes the generated fieldtype for a map value. All generated code assumes that this type is castable to the protocol buffer field type. Only supported on maps. - -Warning about nullable: According to the Protocol Buffer specification, you should be able to tell whether a field is set or unset. With the option nullable=false this feature is lost, since your non-nullable fields will always be set. It can be seen as a layer on top of Protocol Buffers, where before and after marshalling all non-nullable fields are set and they cannot be unset. - -Let us look at: - - github.com/gogo/protobuf/test/example/example.proto - -for a quicker overview. - -The following message: - - package test; - - import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - - message A { - optional string Description = 1 [(gogoproto.nullable) = false]; - optional int64 Number = 2 [(gogoproto.nullable) = false]; - optional bytes Id = 3 [(gogoproto.customtype) = "github.com/gogo/protobuf/test/custom.Uuid", (gogoproto.nullable) = false]; - } - -Will generate a go struct which looks a lot like this: - - type A struct { - Description string - Number int64 - Id github_com_gogo_protobuf_test_custom.Uuid - } - -You will see there are no pointers, since all fields are non-nullable. -You will also see a custom type which marshals to a string. -Be warned it is your responsibility to test your custom types thoroughly. -You should think of every possible empty and nil case for your marshaling, unmarshaling and size methods. - -Next we will embed the message A in message B. - - message B { - optional A A = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; - repeated bytes G = 2 [(gogoproto.customtype) = "github.com/gogo/protobuf/test/custom.Uint128", (gogoproto.nullable) = false]; - } - -See below that A is embedded in B. - - type B struct { - A - G []github_com_gogo_protobuf_test_custom.Uint128 - } - -Also see the repeated custom type. - - type Uint128 [2]uint64 - -Next we will create a custom name for one of our fields. - - message C { - optional int64 size = 1 [(gogoproto.customname) = "MySize"]; - } - -See below that the field's name is MySize and not Size. - - type C struct { - MySize *int64 - } - -The is useful when having a protocol buffer message with a field name which conflicts with a generated method. -As an example, having a field name size and using the sizer plugin to generate a Size method will cause a go compiler error. -Using customname you can fix this error without changing the field name. -This is typically useful when working with a protocol buffer that was designed before these methods and/or the go language were avialable. - -Gogoprotobuf also has some more subtle changes, these could be changed back: - - - the generated package name for imports do not have the extra /filename.pb, - but are actually the imports specified in the .proto file. - -Gogoprotobuf also has lost some features which should be brought back with time: - - - Marshalling and unmarshalling with reflect and without the unsafe package, - this requires work in pointer_reflect.go - -Why does nullable break protocol buffer specifications: - -The protocol buffer specification states, somewhere, that you should be able to tell whether a -field is set or unset. With the option nullable=false this feature is lost, -since your non-nullable fields will always be set. It can be seen as a layer on top of -protocol buffers, where before and after marshalling all non-nullable fields are set -and they cannot be unset. - -Goprotobuf Compatibility: - -Gogoprotobuf is compatible with Goprotobuf, because it is compatible with protocol buffers. -Gogoprotobuf generates the same code as goprotobuf if no extensions are used. -The enumprefix, getters and stringer extensions can be used to remove some of the unnecessary code generated by goprotobuf: - - - gogoproto_import, if false, the generated code imports github.com/golang/protobuf/proto instead of github.com/gogo/protobuf/proto. - - goproto_enum_prefix, if false, generates the enum constant names without the messagetype prefix - - goproto_enum_stringer (experimental), if false, the enum is generated without the default string method, this is useful for rather using enum_stringer, or allowing you to write your own string method. - - goproto_getters, if false, the message is generated without get methods, this is useful when you would rather want to use face - - goproto_stringer, if false, the message is generated without the default string method, this is useful for rather using stringer, or allowing you to write your own string method. - - goproto_extensions_map (beta), if false, the extensions field is generated as type []byte instead of type map[int32]proto.Extension - - goproto_unrecognized (beta), if false, XXX_unrecognized field is not generated. This is useful in conjunction with gogoproto.nullable=false, to generate structures completely devoid of pointers and reduce GC pressure at the cost of losing information about unrecognized fields. - - goproto_registration (beta), if true, the generated files will register all messages and types against both gogo/protobuf and golang/protobuf. This is necessary when using third-party packages which read registrations from golang/protobuf (such as the grpc-gateway). - -Less Typing and Peace of Mind is explained in their specific plugin folders godoc: - - - github.com/gogo/protobuf/plugin/ - -If you do not use any of these extension the code that is generated -will be the same as if goprotobuf has generated it. - -The most complete way to see examples is to look at - - github.com/gogo/protobuf/test/thetest.proto - -Gogoprototest is a seperate project, -because we want to keep gogoprotobuf independent of goprotobuf, -but we still want to test it thoroughly. - -*/ -package gogoproto diff --git a/vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go b/vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go deleted file mode 100644 index 1e91766aee..0000000000 --- a/vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go +++ /dev/null @@ -1,874 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: gogo.proto - -package gogoproto - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -var E_GoprotoEnumPrefix = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.EnumOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 62001, - Name: "gogoproto.goproto_enum_prefix", - Tag: "varint,62001,opt,name=goproto_enum_prefix", - Filename: "gogo.proto", -} - -var E_GoprotoEnumStringer = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.EnumOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 62021, - Name: "gogoproto.goproto_enum_stringer", - Tag: "varint,62021,opt,name=goproto_enum_stringer", - Filename: "gogo.proto", -} - -var E_EnumStringer = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.EnumOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 62022, - Name: "gogoproto.enum_stringer", - Tag: "varint,62022,opt,name=enum_stringer", - Filename: "gogo.proto", -} - -var E_EnumCustomname = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.EnumOptions)(nil), - ExtensionType: (*string)(nil), - Field: 62023, - Name: "gogoproto.enum_customname", - Tag: "bytes,62023,opt,name=enum_customname", - Filename: "gogo.proto", -} - -var E_Enumdecl = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.EnumOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 62024, - Name: "gogoproto.enumdecl", - Tag: "varint,62024,opt,name=enumdecl", - Filename: "gogo.proto", -} - -var E_EnumvalueCustomname = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.EnumValueOptions)(nil), - ExtensionType: (*string)(nil), - Field: 66001, - Name: "gogoproto.enumvalue_customname", - Tag: "bytes,66001,opt,name=enumvalue_customname", - Filename: "gogo.proto", -} - -var E_GoprotoGettersAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63001, - Name: "gogoproto.goproto_getters_all", - Tag: "varint,63001,opt,name=goproto_getters_all", - Filename: "gogo.proto", -} - -var E_GoprotoEnumPrefixAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63002, - Name: "gogoproto.goproto_enum_prefix_all", - Tag: "varint,63002,opt,name=goproto_enum_prefix_all", - Filename: "gogo.proto", -} - -var E_GoprotoStringerAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63003, - Name: "gogoproto.goproto_stringer_all", - Tag: "varint,63003,opt,name=goproto_stringer_all", - Filename: "gogo.proto", -} - -var E_VerboseEqualAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63004, - Name: "gogoproto.verbose_equal_all", - Tag: "varint,63004,opt,name=verbose_equal_all", - Filename: "gogo.proto", -} - -var E_FaceAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63005, - Name: "gogoproto.face_all", - Tag: "varint,63005,opt,name=face_all", - Filename: "gogo.proto", -} - -var E_GostringAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63006, - Name: "gogoproto.gostring_all", - Tag: "varint,63006,opt,name=gostring_all", - Filename: "gogo.proto", -} - -var E_PopulateAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63007, - Name: "gogoproto.populate_all", - Tag: "varint,63007,opt,name=populate_all", - Filename: "gogo.proto", -} - -var E_StringerAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63008, - Name: "gogoproto.stringer_all", - Tag: "varint,63008,opt,name=stringer_all", - Filename: "gogo.proto", -} - -var E_OnlyoneAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63009, - Name: "gogoproto.onlyone_all", - Tag: "varint,63009,opt,name=onlyone_all", - Filename: "gogo.proto", -} - -var E_EqualAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63013, - Name: "gogoproto.equal_all", - Tag: "varint,63013,opt,name=equal_all", - Filename: "gogo.proto", -} - -var E_DescriptionAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63014, - Name: "gogoproto.description_all", - Tag: "varint,63014,opt,name=description_all", - Filename: "gogo.proto", -} - -var E_TestgenAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63015, - Name: "gogoproto.testgen_all", - Tag: "varint,63015,opt,name=testgen_all", - Filename: "gogo.proto", -} - -var E_BenchgenAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63016, - Name: "gogoproto.benchgen_all", - Tag: "varint,63016,opt,name=benchgen_all", - Filename: "gogo.proto", -} - -var E_MarshalerAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63017, - Name: "gogoproto.marshaler_all", - Tag: "varint,63017,opt,name=marshaler_all", - Filename: "gogo.proto", -} - -var E_UnmarshalerAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63018, - Name: "gogoproto.unmarshaler_all", - Tag: "varint,63018,opt,name=unmarshaler_all", - Filename: "gogo.proto", -} - -var E_StableMarshalerAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63019, - Name: "gogoproto.stable_marshaler_all", - Tag: "varint,63019,opt,name=stable_marshaler_all", - Filename: "gogo.proto", -} - -var E_SizerAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63020, - Name: "gogoproto.sizer_all", - Tag: "varint,63020,opt,name=sizer_all", - Filename: "gogo.proto", -} - -var E_GoprotoEnumStringerAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63021, - Name: "gogoproto.goproto_enum_stringer_all", - Tag: "varint,63021,opt,name=goproto_enum_stringer_all", - Filename: "gogo.proto", -} - -var E_EnumStringerAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63022, - Name: "gogoproto.enum_stringer_all", - Tag: "varint,63022,opt,name=enum_stringer_all", - Filename: "gogo.proto", -} - -var E_UnsafeMarshalerAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63023, - Name: "gogoproto.unsafe_marshaler_all", - Tag: "varint,63023,opt,name=unsafe_marshaler_all", - Filename: "gogo.proto", -} - -var E_UnsafeUnmarshalerAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63024, - Name: "gogoproto.unsafe_unmarshaler_all", - Tag: "varint,63024,opt,name=unsafe_unmarshaler_all", - Filename: "gogo.proto", -} - -var E_GoprotoExtensionsMapAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63025, - Name: "gogoproto.goproto_extensions_map_all", - Tag: "varint,63025,opt,name=goproto_extensions_map_all", - Filename: "gogo.proto", -} - -var E_GoprotoUnrecognizedAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63026, - Name: "gogoproto.goproto_unrecognized_all", - Tag: "varint,63026,opt,name=goproto_unrecognized_all", - Filename: "gogo.proto", -} - -var E_GogoprotoImport = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63027, - Name: "gogoproto.gogoproto_import", - Tag: "varint,63027,opt,name=gogoproto_import", - Filename: "gogo.proto", -} - -var E_ProtosizerAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63028, - Name: "gogoproto.protosizer_all", - Tag: "varint,63028,opt,name=protosizer_all", - Filename: "gogo.proto", -} - -var E_CompareAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63029, - Name: "gogoproto.compare_all", - Tag: "varint,63029,opt,name=compare_all", - Filename: "gogo.proto", -} - -var E_TypedeclAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63030, - Name: "gogoproto.typedecl_all", - Tag: "varint,63030,opt,name=typedecl_all", - Filename: "gogo.proto", -} - -var E_EnumdeclAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63031, - Name: "gogoproto.enumdecl_all", - Tag: "varint,63031,opt,name=enumdecl_all", - Filename: "gogo.proto", -} - -var E_GoprotoRegistration = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63032, - Name: "gogoproto.goproto_registration", - Tag: "varint,63032,opt,name=goproto_registration", - Filename: "gogo.proto", -} - -var E_MessagenameAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63033, - Name: "gogoproto.messagename_all", - Tag: "varint,63033,opt,name=messagename_all", - Filename: "gogo.proto", -} - -var E_GoprotoSizecacheAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63034, - Name: "gogoproto.goproto_sizecache_all", - Tag: "varint,63034,opt,name=goproto_sizecache_all", - Filename: "gogo.proto", -} - -var E_GoprotoUnkeyedAll = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63035, - Name: "gogoproto.goproto_unkeyed_all", - Tag: "varint,63035,opt,name=goproto_unkeyed_all", - Filename: "gogo.proto", -} - -var E_GoprotoGetters = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64001, - Name: "gogoproto.goproto_getters", - Tag: "varint,64001,opt,name=goproto_getters", - Filename: "gogo.proto", -} - -var E_GoprotoStringer = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64003, - Name: "gogoproto.goproto_stringer", - Tag: "varint,64003,opt,name=goproto_stringer", - Filename: "gogo.proto", -} - -var E_VerboseEqual = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64004, - Name: "gogoproto.verbose_equal", - Tag: "varint,64004,opt,name=verbose_equal", - Filename: "gogo.proto", -} - -var E_Face = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64005, - Name: "gogoproto.face", - Tag: "varint,64005,opt,name=face", - Filename: "gogo.proto", -} - -var E_Gostring = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64006, - Name: "gogoproto.gostring", - Tag: "varint,64006,opt,name=gostring", - Filename: "gogo.proto", -} - -var E_Populate = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64007, - Name: "gogoproto.populate", - Tag: "varint,64007,opt,name=populate", - Filename: "gogo.proto", -} - -var E_Stringer = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 67008, - Name: "gogoproto.stringer", - Tag: "varint,67008,opt,name=stringer", - Filename: "gogo.proto", -} - -var E_Onlyone = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64009, - Name: "gogoproto.onlyone", - Tag: "varint,64009,opt,name=onlyone", - Filename: "gogo.proto", -} - -var E_Equal = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64013, - Name: "gogoproto.equal", - Tag: "varint,64013,opt,name=equal", - Filename: "gogo.proto", -} - -var E_Description = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64014, - Name: "gogoproto.description", - Tag: "varint,64014,opt,name=description", - Filename: "gogo.proto", -} - -var E_Testgen = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64015, - Name: "gogoproto.testgen", - Tag: "varint,64015,opt,name=testgen", - Filename: "gogo.proto", -} - -var E_Benchgen = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64016, - Name: "gogoproto.benchgen", - Tag: "varint,64016,opt,name=benchgen", - Filename: "gogo.proto", -} - -var E_Marshaler = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64017, - Name: "gogoproto.marshaler", - Tag: "varint,64017,opt,name=marshaler", - Filename: "gogo.proto", -} - -var E_Unmarshaler = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64018, - Name: "gogoproto.unmarshaler", - Tag: "varint,64018,opt,name=unmarshaler", - Filename: "gogo.proto", -} - -var E_StableMarshaler = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64019, - Name: "gogoproto.stable_marshaler", - Tag: "varint,64019,opt,name=stable_marshaler", - Filename: "gogo.proto", -} - -var E_Sizer = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64020, - Name: "gogoproto.sizer", - Tag: "varint,64020,opt,name=sizer", - Filename: "gogo.proto", -} - -var E_UnsafeMarshaler = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64023, - Name: "gogoproto.unsafe_marshaler", - Tag: "varint,64023,opt,name=unsafe_marshaler", - Filename: "gogo.proto", -} - -var E_UnsafeUnmarshaler = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64024, - Name: "gogoproto.unsafe_unmarshaler", - Tag: "varint,64024,opt,name=unsafe_unmarshaler", - Filename: "gogo.proto", -} - -var E_GoprotoExtensionsMap = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64025, - Name: "gogoproto.goproto_extensions_map", - Tag: "varint,64025,opt,name=goproto_extensions_map", - Filename: "gogo.proto", -} - -var E_GoprotoUnrecognized = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64026, - Name: "gogoproto.goproto_unrecognized", - Tag: "varint,64026,opt,name=goproto_unrecognized", - Filename: "gogo.proto", -} - -var E_Protosizer = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64028, - Name: "gogoproto.protosizer", - Tag: "varint,64028,opt,name=protosizer", - Filename: "gogo.proto", -} - -var E_Compare = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64029, - Name: "gogoproto.compare", - Tag: "varint,64029,opt,name=compare", - Filename: "gogo.proto", -} - -var E_Typedecl = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64030, - Name: "gogoproto.typedecl", - Tag: "varint,64030,opt,name=typedecl", - Filename: "gogo.proto", -} - -var E_Messagename = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64033, - Name: "gogoproto.messagename", - Tag: "varint,64033,opt,name=messagename", - Filename: "gogo.proto", -} - -var E_GoprotoSizecache = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64034, - Name: "gogoproto.goproto_sizecache", - Tag: "varint,64034,opt,name=goproto_sizecache", - Filename: "gogo.proto", -} - -var E_GoprotoUnkeyed = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64035, - Name: "gogoproto.goproto_unkeyed", - Tag: "varint,64035,opt,name=goproto_unkeyed", - Filename: "gogo.proto", -} - -var E_Nullable = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65001, - Name: "gogoproto.nullable", - Tag: "varint,65001,opt,name=nullable", - Filename: "gogo.proto", -} - -var E_Embed = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65002, - Name: "gogoproto.embed", - Tag: "varint,65002,opt,name=embed", - Filename: "gogo.proto", -} - -var E_Customtype = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65003, - Name: "gogoproto.customtype", - Tag: "bytes,65003,opt,name=customtype", - Filename: "gogo.proto", -} - -var E_Customname = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65004, - Name: "gogoproto.customname", - Tag: "bytes,65004,opt,name=customname", - Filename: "gogo.proto", -} - -var E_Jsontag = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65005, - Name: "gogoproto.jsontag", - Tag: "bytes,65005,opt,name=jsontag", - Filename: "gogo.proto", -} - -var E_Moretags = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65006, - Name: "gogoproto.moretags", - Tag: "bytes,65006,opt,name=moretags", - Filename: "gogo.proto", -} - -var E_Casttype = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65007, - Name: "gogoproto.casttype", - Tag: "bytes,65007,opt,name=casttype", - Filename: "gogo.proto", -} - -var E_Castkey = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65008, - Name: "gogoproto.castkey", - Tag: "bytes,65008,opt,name=castkey", - Filename: "gogo.proto", -} - -var E_Castvalue = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65009, - Name: "gogoproto.castvalue", - Tag: "bytes,65009,opt,name=castvalue", - Filename: "gogo.proto", -} - -var E_Stdtime = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65010, - Name: "gogoproto.stdtime", - Tag: "varint,65010,opt,name=stdtime", - Filename: "gogo.proto", -} - -var E_Stdduration = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65011, - Name: "gogoproto.stdduration", - Tag: "varint,65011,opt,name=stdduration", - Filename: "gogo.proto", -} - -var E_Wktpointer = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65012, - Name: "gogoproto.wktpointer", - Tag: "varint,65012,opt,name=wktpointer", - Filename: "gogo.proto", -} - -func init() { - proto.RegisterExtension(E_GoprotoEnumPrefix) - proto.RegisterExtension(E_GoprotoEnumStringer) - proto.RegisterExtension(E_EnumStringer) - proto.RegisterExtension(E_EnumCustomname) - proto.RegisterExtension(E_Enumdecl) - proto.RegisterExtension(E_EnumvalueCustomname) - proto.RegisterExtension(E_GoprotoGettersAll) - proto.RegisterExtension(E_GoprotoEnumPrefixAll) - proto.RegisterExtension(E_GoprotoStringerAll) - proto.RegisterExtension(E_VerboseEqualAll) - proto.RegisterExtension(E_FaceAll) - proto.RegisterExtension(E_GostringAll) - proto.RegisterExtension(E_PopulateAll) - proto.RegisterExtension(E_StringerAll) - proto.RegisterExtension(E_OnlyoneAll) - proto.RegisterExtension(E_EqualAll) - proto.RegisterExtension(E_DescriptionAll) - proto.RegisterExtension(E_TestgenAll) - proto.RegisterExtension(E_BenchgenAll) - proto.RegisterExtension(E_MarshalerAll) - proto.RegisterExtension(E_UnmarshalerAll) - proto.RegisterExtension(E_StableMarshalerAll) - proto.RegisterExtension(E_SizerAll) - proto.RegisterExtension(E_GoprotoEnumStringerAll) - proto.RegisterExtension(E_EnumStringerAll) - proto.RegisterExtension(E_UnsafeMarshalerAll) - proto.RegisterExtension(E_UnsafeUnmarshalerAll) - proto.RegisterExtension(E_GoprotoExtensionsMapAll) - proto.RegisterExtension(E_GoprotoUnrecognizedAll) - proto.RegisterExtension(E_GogoprotoImport) - proto.RegisterExtension(E_ProtosizerAll) - proto.RegisterExtension(E_CompareAll) - proto.RegisterExtension(E_TypedeclAll) - proto.RegisterExtension(E_EnumdeclAll) - proto.RegisterExtension(E_GoprotoRegistration) - proto.RegisterExtension(E_MessagenameAll) - proto.RegisterExtension(E_GoprotoSizecacheAll) - proto.RegisterExtension(E_GoprotoUnkeyedAll) - proto.RegisterExtension(E_GoprotoGetters) - proto.RegisterExtension(E_GoprotoStringer) - proto.RegisterExtension(E_VerboseEqual) - proto.RegisterExtension(E_Face) - proto.RegisterExtension(E_Gostring) - proto.RegisterExtension(E_Populate) - proto.RegisterExtension(E_Stringer) - proto.RegisterExtension(E_Onlyone) - proto.RegisterExtension(E_Equal) - proto.RegisterExtension(E_Description) - proto.RegisterExtension(E_Testgen) - proto.RegisterExtension(E_Benchgen) - proto.RegisterExtension(E_Marshaler) - proto.RegisterExtension(E_Unmarshaler) - proto.RegisterExtension(E_StableMarshaler) - proto.RegisterExtension(E_Sizer) - proto.RegisterExtension(E_UnsafeMarshaler) - proto.RegisterExtension(E_UnsafeUnmarshaler) - proto.RegisterExtension(E_GoprotoExtensionsMap) - proto.RegisterExtension(E_GoprotoUnrecognized) - proto.RegisterExtension(E_Protosizer) - proto.RegisterExtension(E_Compare) - proto.RegisterExtension(E_Typedecl) - proto.RegisterExtension(E_Messagename) - proto.RegisterExtension(E_GoprotoSizecache) - proto.RegisterExtension(E_GoprotoUnkeyed) - proto.RegisterExtension(E_Nullable) - proto.RegisterExtension(E_Embed) - proto.RegisterExtension(E_Customtype) - proto.RegisterExtension(E_Customname) - proto.RegisterExtension(E_Jsontag) - proto.RegisterExtension(E_Moretags) - proto.RegisterExtension(E_Casttype) - proto.RegisterExtension(E_Castkey) - proto.RegisterExtension(E_Castvalue) - proto.RegisterExtension(E_Stdtime) - proto.RegisterExtension(E_Stdduration) - proto.RegisterExtension(E_Wktpointer) -} - -func init() { proto.RegisterFile("gogo.proto", fileDescriptor_592445b5231bc2b9) } - -var fileDescriptor_592445b5231bc2b9 = []byte{ - // 1328 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x98, 0x49, 0x6f, 0x1c, 0x45, - 0x14, 0x80, 0x85, 0x48, 0x64, 0x4f, 0x79, 0x8b, 0xc7, 0xc6, 0x84, 0x08, 0x44, 0xe0, 0xc4, 0xc9, - 0x3e, 0x45, 0x28, 0x65, 0x45, 0x96, 0x63, 0x39, 0x56, 0x10, 0x0e, 0xc6, 0x89, 0xc3, 0x76, 0x18, - 0xf5, 0xf4, 0x94, 0xdb, 0x8d, 0xbb, 0xbb, 0x9a, 0xee, 0xea, 0x10, 0xe7, 0x86, 0xc2, 0x22, 0x84, - 0xd8, 0x91, 0x20, 0x21, 0x09, 0x04, 0xc4, 0xbe, 0x86, 0x7d, 0xb9, 0x70, 0x61, 0xb9, 0xf2, 0x1f, - 0xb8, 0x00, 0x66, 0xf7, 0xcd, 0x17, 0xf4, 0xba, 0xdf, 0xeb, 0xa9, 0x69, 0x8f, 0x54, 0x35, 0xb7, - 0xf6, 0xb8, 0xbe, 0x6f, 0xaa, 0xdf, 0xeb, 0x7a, 0xef, 0x4d, 0x33, 0xe6, 0x49, 0x4f, 0x4e, 0xc6, - 0x89, 0x54, 0xb2, 0x5e, 0x83, 0xeb, 0xfc, 0x72, 0xdf, 0x7e, 0x4f, 0x4a, 0x2f, 0x10, 0x53, 0xf9, - 0x5f, 0xcd, 0x6c, 0x75, 0xaa, 0x25, 0x52, 0x37, 0xf1, 0x63, 0x25, 0x93, 0x62, 0x31, 0x3f, 0xc6, - 0xc6, 0x70, 0x71, 0x43, 0x44, 0x59, 0xd8, 0x88, 0x13, 0xb1, 0xea, 0x9f, 0xae, 0x5f, 0x3f, 0x59, - 0x90, 0x93, 0x44, 0x4e, 0xce, 0x47, 0x59, 0x78, 0x47, 0xac, 0x7c, 0x19, 0xa5, 0x7b, 0xaf, 0xfc, - 0x72, 0xf5, 0xfe, 0xab, 0x6e, 0xe9, 0x5f, 0x1e, 0x45, 0x14, 0xfe, 0xb7, 0x94, 0x83, 0x7c, 0x99, - 0x5d, 0xd3, 0xe1, 0x4b, 0x55, 0xe2, 0x47, 0x9e, 0x48, 0x0c, 0xc6, 0xef, 0xd1, 0x38, 0xa6, 0x19, - 0x8f, 0x23, 0xca, 0xe7, 0xd8, 0x50, 0x2f, 0xae, 0x1f, 0xd0, 0x35, 0x28, 0x74, 0xc9, 0x02, 0x1b, - 0xc9, 0x25, 0x6e, 0x96, 0x2a, 0x19, 0x46, 0x4e, 0x28, 0x0c, 0x9a, 0x1f, 0x73, 0x4d, 0x6d, 0x79, - 0x18, 0xb0, 0xb9, 0x92, 0xe2, 0x9c, 0xf5, 0xc3, 0x27, 0x2d, 0xe1, 0x06, 0x06, 0xc3, 0x4f, 0xb8, - 0x91, 0x72, 0x3d, 0x3f, 0xc9, 0xc6, 0xe1, 0xfa, 0x94, 0x13, 0x64, 0x42, 0xdf, 0xc9, 0x4d, 0x5d, - 0x3d, 0x27, 0x61, 0x19, 0xc9, 0x7e, 0x3e, 0xbb, 0x2b, 0xdf, 0xce, 0x58, 0x29, 0xd0, 0xf6, 0xa4, - 0x65, 0xd1, 0x13, 0x4a, 0x89, 0x24, 0x6d, 0x38, 0x41, 0xb7, 0xed, 0x1d, 0xf1, 0x83, 0xd2, 0x78, - 0x6e, 0xb3, 0x33, 0x8b, 0x0b, 0x05, 0x39, 0x1b, 0x04, 0x7c, 0x85, 0x5d, 0xdb, 0xe5, 0xa9, 0xb0, - 0x70, 0x9e, 0x47, 0xe7, 0xf8, 0x8e, 0x27, 0x03, 0xb4, 0x4b, 0x8c, 0x3e, 0x2f, 0x73, 0x69, 0xe1, - 0x7c, 0x19, 0x9d, 0x75, 0x64, 0x29, 0xa5, 0x60, 0xbc, 0x8d, 0x8d, 0x9e, 0x12, 0x49, 0x53, 0xa6, - 0xa2, 0x21, 0x1e, 0xc8, 0x9c, 0xc0, 0x42, 0x77, 0x01, 0x75, 0x23, 0x08, 0xce, 0x03, 0x07, 0xae, - 0x83, 0xac, 0x7f, 0xd5, 0x71, 0x85, 0x85, 0xe2, 0x22, 0x2a, 0xfa, 0x60, 0x3d, 0xa0, 0xb3, 0x6c, - 0xd0, 0x93, 0xc5, 0x2d, 0x59, 0xe0, 0x97, 0x10, 0x1f, 0x20, 0x06, 0x15, 0xb1, 0x8c, 0xb3, 0xc0, - 0x51, 0x36, 0x3b, 0x78, 0x85, 0x14, 0xc4, 0xa0, 0xa2, 0x87, 0xb0, 0xbe, 0x4a, 0x8a, 0x54, 0x8b, - 0xe7, 0x0c, 0x1b, 0x90, 0x51, 0xb0, 0x21, 0x23, 0x9b, 0x4d, 0x5c, 0x46, 0x03, 0x43, 0x04, 0x04, - 0xd3, 0xac, 0x66, 0x9b, 0x88, 0x37, 0x36, 0xe9, 0x78, 0x50, 0x06, 0x16, 0xd8, 0x08, 0x15, 0x28, - 0x5f, 0x46, 0x16, 0x8a, 0x37, 0x51, 0x31, 0xac, 0x61, 0x78, 0x1b, 0x4a, 0xa4, 0xca, 0x13, 0x36, - 0x92, 0xb7, 0xe8, 0x36, 0x10, 0xc1, 0x50, 0x36, 0x45, 0xe4, 0xae, 0xd9, 0x19, 0xde, 0xa6, 0x50, - 0x12, 0x03, 0x8a, 0x39, 0x36, 0x14, 0x3a, 0x49, 0xba, 0xe6, 0x04, 0x56, 0xe9, 0x78, 0x07, 0x1d, - 0x83, 0x25, 0x84, 0x11, 0xc9, 0xa2, 0x5e, 0x34, 0xef, 0x52, 0x44, 0x34, 0x0c, 0x8f, 0x5e, 0xaa, - 0x9c, 0x66, 0x20, 0x1a, 0xbd, 0xd8, 0xde, 0xa3, 0xa3, 0x57, 0xb0, 0x8b, 0xba, 0x71, 0x9a, 0xd5, - 0x52, 0xff, 0x8c, 0x95, 0xe6, 0x7d, 0xca, 0x74, 0x0e, 0x00, 0x7c, 0x0f, 0xbb, 0xae, 0x6b, 0x9b, - 0xb0, 0x90, 0x7d, 0x80, 0xb2, 0x89, 0x2e, 0xad, 0x02, 0x4b, 0x42, 0xaf, 0xca, 0x0f, 0xa9, 0x24, - 0x88, 0x8a, 0x6b, 0x89, 0x8d, 0x67, 0x51, 0xea, 0xac, 0xf6, 0x16, 0xb5, 0x8f, 0x28, 0x6a, 0x05, - 0xdb, 0x11, 0xb5, 0x13, 0x6c, 0x02, 0x8d, 0xbd, 0xe5, 0xf5, 0x63, 0x2a, 0xac, 0x05, 0xbd, 0xd2, - 0x99, 0xdd, 0xfb, 0xd8, 0xbe, 0x32, 0x9c, 0xa7, 0x95, 0x88, 0x52, 0x60, 0x1a, 0xa1, 0x13, 0x5b, - 0x98, 0xaf, 0xa0, 0x99, 0x2a, 0xfe, 0x7c, 0x29, 0x58, 0x74, 0x62, 0x90, 0xdf, 0xcd, 0xf6, 0x92, - 0x3c, 0x8b, 0x12, 0xe1, 0x4a, 0x2f, 0xf2, 0xcf, 0x88, 0x96, 0x85, 0xfa, 0x93, 0x4a, 0xaa, 0x56, - 0x34, 0x1c, 0xcc, 0x47, 0xd9, 0x9e, 0x72, 0x56, 0x69, 0xf8, 0x61, 0x2c, 0x13, 0x65, 0x30, 0x7e, - 0x4a, 0x99, 0x2a, 0xb9, 0xa3, 0x39, 0xc6, 0xe7, 0xd9, 0x70, 0xfe, 0xa7, 0xed, 0x23, 0xf9, 0x19, - 0x8a, 0x86, 0xda, 0x14, 0x16, 0x0e, 0x57, 0x86, 0xb1, 0x93, 0xd8, 0xd4, 0xbf, 0xcf, 0xa9, 0x70, - 0x20, 0x82, 0x85, 0x43, 0x6d, 0xc4, 0x02, 0xba, 0xbd, 0x85, 0xe1, 0x0b, 0x2a, 0x1c, 0xc4, 0xa0, - 0x82, 0x06, 0x06, 0x0b, 0xc5, 0x97, 0xa4, 0x20, 0x06, 0x14, 0x77, 0xb6, 0x1b, 0x6d, 0x22, 0x3c, - 0x3f, 0x55, 0x89, 0x03, 0xab, 0x0d, 0xaa, 0xaf, 0x36, 0x3b, 0x87, 0xb0, 0x65, 0x0d, 0x85, 0x4a, - 0x14, 0x8a, 0x34, 0x75, 0x3c, 0x01, 0x13, 0x87, 0xc5, 0xc6, 0xbe, 0xa6, 0x4a, 0xa4, 0x61, 0xb0, - 0x37, 0x6d, 0x42, 0x84, 0xb0, 0xbb, 0x8e, 0xbb, 0x66, 0xa3, 0xfb, 0xa6, 0xb2, 0xb9, 0xe3, 0xc4, - 0x82, 0x53, 0x9b, 0x7f, 0xb2, 0x68, 0x5d, 0x6c, 0x58, 0x3d, 0x9d, 0xdf, 0x56, 0xe6, 0x9f, 0x95, - 0x82, 0x2c, 0x6a, 0xc8, 0x48, 0x65, 0x9e, 0xaa, 0xdf, 0xb8, 0xc3, 0xb5, 0x58, 0xdc, 0x17, 0xe9, - 0x1e, 0xda, 0xc2, 0xfb, 0xed, 0x1c, 0xa7, 0xf8, 0xed, 0xf0, 0x90, 0x77, 0x0e, 0x3d, 0x66, 0xd9, - 0xd9, 0xad, 0xf2, 0x39, 0xef, 0x98, 0x79, 0xf8, 0x11, 0x36, 0xd4, 0x31, 0xf0, 0x98, 0x55, 0x0f, - 0xa3, 0x6a, 0x50, 0x9f, 0x77, 0xf8, 0x01, 0xb6, 0x0b, 0x86, 0x17, 0x33, 0xfe, 0x08, 0xe2, 0xf9, - 0x72, 0x7e, 0x88, 0xf5, 0xd3, 0xd0, 0x62, 0x46, 0x1f, 0x45, 0xb4, 0x44, 0x00, 0xa7, 0x81, 0xc5, - 0x8c, 0x3f, 0x46, 0x38, 0x21, 0x80, 0xdb, 0x87, 0xf0, 0xbb, 0x27, 0x76, 0x61, 0xd3, 0xa1, 0xd8, - 0x4d, 0xb3, 0x3e, 0x9c, 0x54, 0xcc, 0xf4, 0xe3, 0xf8, 0xe5, 0x44, 0xf0, 0x5b, 0xd9, 0x6e, 0xcb, - 0x80, 0x3f, 0x89, 0x68, 0xb1, 0x9e, 0xcf, 0xb1, 0x01, 0x6d, 0x3a, 0x31, 0xe3, 0x4f, 0x21, 0xae, - 0x53, 0xb0, 0x75, 0x9c, 0x4e, 0xcc, 0x82, 0xa7, 0x69, 0xeb, 0x48, 0x40, 0xd8, 0x68, 0x30, 0x31, - 0xd3, 0xcf, 0x50, 0xd4, 0x09, 0xe1, 0x33, 0xac, 0x56, 0x36, 0x1b, 0x33, 0xff, 0x2c, 0xf2, 0x6d, - 0x06, 0x22, 0xa0, 0x35, 0x3b, 0xb3, 0xe2, 0x39, 0x8a, 0x80, 0x46, 0xc1, 0x31, 0xaa, 0x0e, 0x30, - 0x66, 0xd3, 0xf3, 0x74, 0x8c, 0x2a, 0xf3, 0x0b, 0x64, 0x33, 0xaf, 0xf9, 0x66, 0xc5, 0x0b, 0x94, - 0xcd, 0x7c, 0x3d, 0x6c, 0xa3, 0x3a, 0x11, 0x98, 0x1d, 0x2f, 0xd2, 0x36, 0x2a, 0x03, 0x01, 0x5f, - 0x62, 0xf5, 0x9d, 0xd3, 0x80, 0xd9, 0xf7, 0x12, 0xfa, 0x46, 0x77, 0x0c, 0x03, 0xfc, 0x2e, 0x36, - 0xd1, 0x7d, 0x12, 0x30, 0x5b, 0xcf, 0x6d, 0x55, 0x7e, 0xbb, 0xe9, 0x83, 0x00, 0x3f, 0xd1, 0x6e, - 0x29, 0xfa, 0x14, 0x60, 0xd6, 0x9e, 0xdf, 0xea, 0x2c, 0xdc, 0xfa, 0x10, 0xc0, 0x67, 0x19, 0x6b, - 0x37, 0x60, 0xb3, 0xeb, 0x02, 0xba, 0x34, 0x08, 0x8e, 0x06, 0xf6, 0x5f, 0x33, 0x7f, 0x91, 0x8e, - 0x06, 0x12, 0x70, 0x34, 0xa8, 0xf5, 0x9a, 0xe9, 0x4b, 0x74, 0x34, 0x08, 0x81, 0x27, 0x5b, 0xeb, - 0x6e, 0x66, 0xc3, 0x65, 0x7a, 0xb2, 0x35, 0x8a, 0x1f, 0x63, 0xa3, 0x3b, 0x1a, 0xa2, 0x59, 0xf5, - 0x1a, 0xaa, 0xf6, 0x54, 0xfb, 0xa1, 0xde, 0xbc, 0xb0, 0x19, 0x9a, 0x6d, 0xaf, 0x57, 0x9a, 0x17, - 0xf6, 0x42, 0x3e, 0xcd, 0xfa, 0xa3, 0x2c, 0x08, 0xe0, 0xf0, 0xd4, 0x6f, 0xe8, 0xd2, 0x4d, 0x45, - 0xd0, 0x22, 0xc5, 0xaf, 0xdb, 0x18, 0x1d, 0x02, 0xf8, 0x01, 0xb6, 0x5b, 0x84, 0x4d, 0xd1, 0x32, - 0x91, 0xbf, 0x6d, 0x53, 0xc1, 0x84, 0xd5, 0x7c, 0x86, 0xb1, 0xe2, 0xd5, 0x08, 0x84, 0xd9, 0xc4, - 0xfe, 0xbe, 0x5d, 0xbc, 0xa5, 0xd1, 0x90, 0xb6, 0x20, 0x4f, 0x8a, 0x41, 0xb0, 0xd9, 0x29, 0xc8, - 0x33, 0x72, 0x90, 0xf5, 0xdd, 0x9f, 0xca, 0x48, 0x39, 0x9e, 0x89, 0xfe, 0x03, 0x69, 0x5a, 0x0f, - 0x01, 0x0b, 0x65, 0x22, 0x94, 0xe3, 0xa5, 0x26, 0xf6, 0x4f, 0x64, 0x4b, 0x00, 0x60, 0xd7, 0x49, - 0x95, 0xcd, 0x7d, 0xff, 0x45, 0x30, 0x01, 0xb0, 0x69, 0xb8, 0x5e, 0x17, 0x1b, 0x26, 0xf6, 0x6f, - 0xda, 0x34, 0xae, 0xe7, 0x87, 0x58, 0x0d, 0x2e, 0xf3, 0xb7, 0x4a, 0x26, 0xf8, 0x1f, 0x84, 0xdb, - 0x04, 0x7c, 0x73, 0xaa, 0x5a, 0xca, 0x37, 0x07, 0xfb, 0x5f, 0xcc, 0x34, 0xad, 0xe7, 0xb3, 0x6c, - 0x20, 0x55, 0xad, 0x56, 0x86, 0xf3, 0xa9, 0x01, 0xff, 0x6f, 0xbb, 0x7c, 0x65, 0x51, 0x32, 0x90, - 0xed, 0x07, 0xd7, 0x55, 0x2c, 0xfd, 0x48, 0x89, 0xc4, 0x64, 0xd8, 0x42, 0x83, 0x86, 0x1c, 0x9e, - 0x67, 0x63, 0xae, 0x0c, 0xab, 0xdc, 0x61, 0xb6, 0x20, 0x17, 0xe4, 0x52, 0x5e, 0x67, 0xee, 0xbd, - 0xd9, 0xf3, 0xd5, 0x5a, 0xd6, 0x9c, 0x74, 0x65, 0x38, 0x05, 0xbf, 0x3c, 0xda, 0x2f, 0x54, 0xcb, - 0xdf, 0x21, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x9c, 0xaf, 0x70, 0x4e, 0x83, 0x15, 0x00, 0x00, -} diff --git a/vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.golden b/vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.golden deleted file mode 100644 index f6502e4b90..0000000000 --- a/vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.golden +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by protoc-gen-go. -// source: gogo.proto -// DO NOT EDIT! - -package gogoproto - -import proto "github.com/gogo/protobuf/proto" -import json "encoding/json" -import math "math" -import google_protobuf "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" - -// Reference proto, json, and math imports to suppress error if they are not otherwise used. -var _ = proto.Marshal -var _ = &json.SyntaxError{} -var _ = math.Inf - -var E_Nullable = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 51235, - Name: "gogoproto.nullable", - Tag: "varint,51235,opt,name=nullable", -} - -var E_Embed = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 51236, - Name: "gogoproto.embed", - Tag: "varint,51236,opt,name=embed", -} - -var E_Customtype = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 51237, - Name: "gogoproto.customtype", - Tag: "bytes,51237,opt,name=customtype", -} - -func init() { - proto.RegisterExtension(E_Nullable) - proto.RegisterExtension(E_Embed) - proto.RegisterExtension(E_Customtype) -} diff --git a/vendor/github.com/gogo/protobuf/gogoproto/gogo.proto b/vendor/github.com/gogo/protobuf/gogoproto/gogo.proto deleted file mode 100644 index b80c85653f..0000000000 --- a/vendor/github.com/gogo/protobuf/gogoproto/gogo.proto +++ /dev/null @@ -1,144 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto2"; -package gogoproto; - -import "google/protobuf/descriptor.proto"; - -option java_package = "com.google.protobuf"; -option java_outer_classname = "GoGoProtos"; -option go_package = "github.com/gogo/protobuf/gogoproto"; - -extend google.protobuf.EnumOptions { - optional bool goproto_enum_prefix = 62001; - optional bool goproto_enum_stringer = 62021; - optional bool enum_stringer = 62022; - optional string enum_customname = 62023; - optional bool enumdecl = 62024; -} - -extend google.protobuf.EnumValueOptions { - optional string enumvalue_customname = 66001; -} - -extend google.protobuf.FileOptions { - optional bool goproto_getters_all = 63001; - optional bool goproto_enum_prefix_all = 63002; - optional bool goproto_stringer_all = 63003; - optional bool verbose_equal_all = 63004; - optional bool face_all = 63005; - optional bool gostring_all = 63006; - optional bool populate_all = 63007; - optional bool stringer_all = 63008; - optional bool onlyone_all = 63009; - - optional bool equal_all = 63013; - optional bool description_all = 63014; - optional bool testgen_all = 63015; - optional bool benchgen_all = 63016; - optional bool marshaler_all = 63017; - optional bool unmarshaler_all = 63018; - optional bool stable_marshaler_all = 63019; - - optional bool sizer_all = 63020; - - optional bool goproto_enum_stringer_all = 63021; - optional bool enum_stringer_all = 63022; - - optional bool unsafe_marshaler_all = 63023; - optional bool unsafe_unmarshaler_all = 63024; - - optional bool goproto_extensions_map_all = 63025; - optional bool goproto_unrecognized_all = 63026; - optional bool gogoproto_import = 63027; - optional bool protosizer_all = 63028; - optional bool compare_all = 63029; - optional bool typedecl_all = 63030; - optional bool enumdecl_all = 63031; - - optional bool goproto_registration = 63032; - optional bool messagename_all = 63033; - - optional bool goproto_sizecache_all = 63034; - optional bool goproto_unkeyed_all = 63035; -} - -extend google.protobuf.MessageOptions { - optional bool goproto_getters = 64001; - optional bool goproto_stringer = 64003; - optional bool verbose_equal = 64004; - optional bool face = 64005; - optional bool gostring = 64006; - optional bool populate = 64007; - optional bool stringer = 67008; - optional bool onlyone = 64009; - - optional bool equal = 64013; - optional bool description = 64014; - optional bool testgen = 64015; - optional bool benchgen = 64016; - optional bool marshaler = 64017; - optional bool unmarshaler = 64018; - optional bool stable_marshaler = 64019; - - optional bool sizer = 64020; - - optional bool unsafe_marshaler = 64023; - optional bool unsafe_unmarshaler = 64024; - - optional bool goproto_extensions_map = 64025; - optional bool goproto_unrecognized = 64026; - - optional bool protosizer = 64028; - optional bool compare = 64029; - - optional bool typedecl = 64030; - - optional bool messagename = 64033; - - optional bool goproto_sizecache = 64034; - optional bool goproto_unkeyed = 64035; -} - -extend google.protobuf.FieldOptions { - optional bool nullable = 65001; - optional bool embed = 65002; - optional string customtype = 65003; - optional string customname = 65004; - optional string jsontag = 65005; - optional string moretags = 65006; - optional string casttype = 65007; - optional string castkey = 65008; - optional string castvalue = 65009; - - optional bool stdtime = 65010; - optional bool stdduration = 65011; - optional bool wktpointer = 65012; - -} diff --git a/vendor/github.com/gogo/protobuf/gogoproto/helper.go b/vendor/github.com/gogo/protobuf/gogoproto/helper.go deleted file mode 100644 index 390d4e4be6..0000000000 --- a/vendor/github.com/gogo/protobuf/gogoproto/helper.go +++ /dev/null @@ -1,415 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package gogoproto - -import google_protobuf "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" -import proto "github.com/gogo/protobuf/proto" - -func IsEmbed(field *google_protobuf.FieldDescriptorProto) bool { - return proto.GetBoolExtension(field.Options, E_Embed, false) -} - -func IsNullable(field *google_protobuf.FieldDescriptorProto) bool { - return proto.GetBoolExtension(field.Options, E_Nullable, true) -} - -func IsStdTime(field *google_protobuf.FieldDescriptorProto) bool { - return proto.GetBoolExtension(field.Options, E_Stdtime, false) -} - -func IsStdDuration(field *google_protobuf.FieldDescriptorProto) bool { - return proto.GetBoolExtension(field.Options, E_Stdduration, false) -} - -func IsStdDouble(field *google_protobuf.FieldDescriptorProto) bool { - return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.DoubleValue" -} - -func IsStdFloat(field *google_protobuf.FieldDescriptorProto) bool { - return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.FloatValue" -} - -func IsStdInt64(field *google_protobuf.FieldDescriptorProto) bool { - return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.Int64Value" -} - -func IsStdUInt64(field *google_protobuf.FieldDescriptorProto) bool { - return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.UInt64Value" -} - -func IsStdInt32(field *google_protobuf.FieldDescriptorProto) bool { - return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.Int32Value" -} - -func IsStdUInt32(field *google_protobuf.FieldDescriptorProto) bool { - return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.UInt32Value" -} - -func IsStdBool(field *google_protobuf.FieldDescriptorProto) bool { - return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.BoolValue" -} - -func IsStdString(field *google_protobuf.FieldDescriptorProto) bool { - return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.StringValue" -} - -func IsStdBytes(field *google_protobuf.FieldDescriptorProto) bool { - return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.BytesValue" -} - -func IsStdType(field *google_protobuf.FieldDescriptorProto) bool { - return (IsStdTime(field) || IsStdDuration(field) || - IsStdDouble(field) || IsStdFloat(field) || - IsStdInt64(field) || IsStdUInt64(field) || - IsStdInt32(field) || IsStdUInt32(field) || - IsStdBool(field) || - IsStdString(field) || IsStdBytes(field)) -} - -func IsWktPtr(field *google_protobuf.FieldDescriptorProto) bool { - return proto.GetBoolExtension(field.Options, E_Wktpointer, false) -} - -func NeedsNilCheck(proto3 bool, field *google_protobuf.FieldDescriptorProto) bool { - nullable := IsNullable(field) - if field.IsMessage() || IsCustomType(field) { - return nullable - } - if proto3 { - return false - } - return nullable || *field.Type == google_protobuf.FieldDescriptorProto_TYPE_BYTES -} - -func IsCustomType(field *google_protobuf.FieldDescriptorProto) bool { - typ := GetCustomType(field) - if len(typ) > 0 { - return true - } - return false -} - -func IsCastType(field *google_protobuf.FieldDescriptorProto) bool { - typ := GetCastType(field) - if len(typ) > 0 { - return true - } - return false -} - -func IsCastKey(field *google_protobuf.FieldDescriptorProto) bool { - typ := GetCastKey(field) - if len(typ) > 0 { - return true - } - return false -} - -func IsCastValue(field *google_protobuf.FieldDescriptorProto) bool { - typ := GetCastValue(field) - if len(typ) > 0 { - return true - } - return false -} - -func HasEnumDecl(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool { - return proto.GetBoolExtension(enum.Options, E_Enumdecl, proto.GetBoolExtension(file.Options, E_EnumdeclAll, true)) -} - -func HasTypeDecl(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Typedecl, proto.GetBoolExtension(file.Options, E_TypedeclAll, true)) -} - -func GetCustomType(field *google_protobuf.FieldDescriptorProto) string { - if field == nil { - return "" - } - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_Customtype) - if err == nil && v.(*string) != nil { - return *(v.(*string)) - } - } - return "" -} - -func GetCastType(field *google_protobuf.FieldDescriptorProto) string { - if field == nil { - return "" - } - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_Casttype) - if err == nil && v.(*string) != nil { - return *(v.(*string)) - } - } - return "" -} - -func GetCastKey(field *google_protobuf.FieldDescriptorProto) string { - if field == nil { - return "" - } - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_Castkey) - if err == nil && v.(*string) != nil { - return *(v.(*string)) - } - } - return "" -} - -func GetCastValue(field *google_protobuf.FieldDescriptorProto) string { - if field == nil { - return "" - } - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_Castvalue) - if err == nil && v.(*string) != nil { - return *(v.(*string)) - } - } - return "" -} - -func IsCustomName(field *google_protobuf.FieldDescriptorProto) bool { - name := GetCustomName(field) - if len(name) > 0 { - return true - } - return false -} - -func IsEnumCustomName(field *google_protobuf.EnumDescriptorProto) bool { - name := GetEnumCustomName(field) - if len(name) > 0 { - return true - } - return false -} - -func IsEnumValueCustomName(field *google_protobuf.EnumValueDescriptorProto) bool { - name := GetEnumValueCustomName(field) - if len(name) > 0 { - return true - } - return false -} - -func GetCustomName(field *google_protobuf.FieldDescriptorProto) string { - if field == nil { - return "" - } - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_Customname) - if err == nil && v.(*string) != nil { - return *(v.(*string)) - } - } - return "" -} - -func GetEnumCustomName(field *google_protobuf.EnumDescriptorProto) string { - if field == nil { - return "" - } - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_EnumCustomname) - if err == nil && v.(*string) != nil { - return *(v.(*string)) - } - } - return "" -} - -func GetEnumValueCustomName(field *google_protobuf.EnumValueDescriptorProto) string { - if field == nil { - return "" - } - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_EnumvalueCustomname) - if err == nil && v.(*string) != nil { - return *(v.(*string)) - } - } - return "" -} - -func GetJsonTag(field *google_protobuf.FieldDescriptorProto) *string { - if field == nil { - return nil - } - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_Jsontag) - if err == nil && v.(*string) != nil { - return (v.(*string)) - } - } - return nil -} - -func GetMoreTags(field *google_protobuf.FieldDescriptorProto) *string { - if field == nil { - return nil - } - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_Moretags) - if err == nil && v.(*string) != nil { - return (v.(*string)) - } - } - return nil -} - -type EnableFunc func(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool - -func EnabledGoEnumPrefix(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool { - return proto.GetBoolExtension(enum.Options, E_GoprotoEnumPrefix, proto.GetBoolExtension(file.Options, E_GoprotoEnumPrefixAll, true)) -} - -func EnabledGoStringer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_GoprotoStringer, proto.GetBoolExtension(file.Options, E_GoprotoStringerAll, true)) -} - -func HasGoGetters(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_GoprotoGetters, proto.GetBoolExtension(file.Options, E_GoprotoGettersAll, true)) -} - -func IsUnion(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Onlyone, proto.GetBoolExtension(file.Options, E_OnlyoneAll, false)) -} - -func HasGoString(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Gostring, proto.GetBoolExtension(file.Options, E_GostringAll, false)) -} - -func HasEqual(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Equal, proto.GetBoolExtension(file.Options, E_EqualAll, false)) -} - -func HasVerboseEqual(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_VerboseEqual, proto.GetBoolExtension(file.Options, E_VerboseEqualAll, false)) -} - -func IsStringer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Stringer, proto.GetBoolExtension(file.Options, E_StringerAll, false)) -} - -func IsFace(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Face, proto.GetBoolExtension(file.Options, E_FaceAll, false)) -} - -func HasDescription(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Description, proto.GetBoolExtension(file.Options, E_DescriptionAll, false)) -} - -func HasPopulate(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Populate, proto.GetBoolExtension(file.Options, E_PopulateAll, false)) -} - -func HasTestGen(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Testgen, proto.GetBoolExtension(file.Options, E_TestgenAll, false)) -} - -func HasBenchGen(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Benchgen, proto.GetBoolExtension(file.Options, E_BenchgenAll, false)) -} - -func IsMarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Marshaler, proto.GetBoolExtension(file.Options, E_MarshalerAll, false)) -} - -func IsUnmarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Unmarshaler, proto.GetBoolExtension(file.Options, E_UnmarshalerAll, false)) -} - -func IsStableMarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_StableMarshaler, proto.GetBoolExtension(file.Options, E_StableMarshalerAll, false)) -} - -func IsSizer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Sizer, proto.GetBoolExtension(file.Options, E_SizerAll, false)) -} - -func IsProtoSizer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Protosizer, proto.GetBoolExtension(file.Options, E_ProtosizerAll, false)) -} - -func IsGoEnumStringer(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool { - return proto.GetBoolExtension(enum.Options, E_GoprotoEnumStringer, proto.GetBoolExtension(file.Options, E_GoprotoEnumStringerAll, true)) -} - -func IsEnumStringer(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool { - return proto.GetBoolExtension(enum.Options, E_EnumStringer, proto.GetBoolExtension(file.Options, E_EnumStringerAll, false)) -} - -func IsUnsafeMarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_UnsafeMarshaler, proto.GetBoolExtension(file.Options, E_UnsafeMarshalerAll, false)) -} - -func IsUnsafeUnmarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_UnsafeUnmarshaler, proto.GetBoolExtension(file.Options, E_UnsafeUnmarshalerAll, false)) -} - -func HasExtensionsMap(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_GoprotoExtensionsMap, proto.GetBoolExtension(file.Options, E_GoprotoExtensionsMapAll, true)) -} - -func HasUnrecognized(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_GoprotoUnrecognized, proto.GetBoolExtension(file.Options, E_GoprotoUnrecognizedAll, true)) -} - -func IsProto3(file *google_protobuf.FileDescriptorProto) bool { - return file.GetSyntax() == "proto3" -} - -func ImportsGoGoProto(file *google_protobuf.FileDescriptorProto) bool { - return proto.GetBoolExtension(file.Options, E_GogoprotoImport, true) -} - -func HasCompare(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Compare, proto.GetBoolExtension(file.Options, E_CompareAll, false)) -} - -func RegistersGolangProto(file *google_protobuf.FileDescriptorProto) bool { - return proto.GetBoolExtension(file.Options, E_GoprotoRegistration, false) -} - -func HasMessageName(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Messagename, proto.GetBoolExtension(file.Options, E_MessagenameAll, false)) -} - -func HasSizecache(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_GoprotoSizecache, proto.GetBoolExtension(file.Options, E_GoprotoSizecacheAll, true)) -} - -func HasUnkeyed(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_GoprotoUnkeyed, proto.GetBoolExtension(file.Options, E_GoprotoUnkeyedAll, true)) -} diff --git a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/Makefile b/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/Makefile deleted file mode 100644 index 3496dc99d5..0000000000 --- a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -# Go support for Protocol Buffers - Google's data interchange format -# -# Copyright 2010 The Go Authors. All rights reserved. -# https://github.com/golang/protobuf -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -regenerate: - go install github.com/gogo/protobuf/protoc-gen-gogo - go install github.com/gogo/protobuf/protoc-gen-gostring - protoc --gogo_out=. -I=../../protobuf/google/protobuf ../../protobuf/google/protobuf/descriptor.proto - protoc --gostring_out=. -I=../../protobuf/google/protobuf ../../protobuf/google/protobuf/descriptor.proto diff --git a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.go b/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.go deleted file mode 100644 index a85bf1984c..0000000000 --- a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.go +++ /dev/null @@ -1,118 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2016 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Package descriptor provides functions for obtaining protocol buffer -// descriptors for generated Go types. -// -// These functions cannot go in package proto because they depend on the -// generated protobuf descriptor messages, which themselves depend on proto. -package descriptor - -import ( - "bytes" - "compress/gzip" - "fmt" - "io/ioutil" - - "github.com/gogo/protobuf/proto" -) - -// extractFile extracts a FileDescriptorProto from a gzip'd buffer. -func extractFile(gz []byte) (*FileDescriptorProto, error) { - r, err := gzip.NewReader(bytes.NewReader(gz)) - if err != nil { - return nil, fmt.Errorf("failed to open gzip reader: %v", err) - } - defer r.Close() - - b, err := ioutil.ReadAll(r) - if err != nil { - return nil, fmt.Errorf("failed to uncompress descriptor: %v", err) - } - - fd := new(FileDescriptorProto) - if err := proto.Unmarshal(b, fd); err != nil { - return nil, fmt.Errorf("malformed FileDescriptorProto: %v", err) - } - - return fd, nil -} - -// Message is a proto.Message with a method to return its descriptor. -// -// Message types generated by the protocol compiler always satisfy -// the Message interface. -type Message interface { - proto.Message - Descriptor() ([]byte, []int) -} - -// ForMessage returns a FileDescriptorProto and a DescriptorProto from within it -// describing the given message. -func ForMessage(msg Message) (fd *FileDescriptorProto, md *DescriptorProto) { - gz, path := msg.Descriptor() - fd, err := extractFile(gz) - if err != nil { - panic(fmt.Sprintf("invalid FileDescriptorProto for %T: %v", msg, err)) - } - - md = fd.MessageType[path[0]] - for _, i := range path[1:] { - md = md.NestedType[i] - } - return fd, md -} - -// Is this field a scalar numeric type? -func (field *FieldDescriptorProto) IsScalar() bool { - if field.Type == nil { - return false - } - switch *field.Type { - case FieldDescriptorProto_TYPE_DOUBLE, - FieldDescriptorProto_TYPE_FLOAT, - FieldDescriptorProto_TYPE_INT64, - FieldDescriptorProto_TYPE_UINT64, - FieldDescriptorProto_TYPE_INT32, - FieldDescriptorProto_TYPE_FIXED64, - FieldDescriptorProto_TYPE_FIXED32, - FieldDescriptorProto_TYPE_BOOL, - FieldDescriptorProto_TYPE_UINT32, - FieldDescriptorProto_TYPE_ENUM, - FieldDescriptorProto_TYPE_SFIXED32, - FieldDescriptorProto_TYPE_SFIXED64, - FieldDescriptorProto_TYPE_SINT32, - FieldDescriptorProto_TYPE_SINT64: - return true - default: - return false - } -} diff --git a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go b/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go deleted file mode 100644 index 18b2a3318a..0000000000 --- a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go +++ /dev/null @@ -1,2865 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: descriptor.proto - -package descriptor - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type FieldDescriptorProto_Type int32 - -const ( - // 0 is reserved for errors. - // Order is weird for historical reasons. - FieldDescriptorProto_TYPE_DOUBLE FieldDescriptorProto_Type = 1 - FieldDescriptorProto_TYPE_FLOAT FieldDescriptorProto_Type = 2 - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - // negative values are likely. - FieldDescriptorProto_TYPE_INT64 FieldDescriptorProto_Type = 3 - FieldDescriptorProto_TYPE_UINT64 FieldDescriptorProto_Type = 4 - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - // negative values are likely. - FieldDescriptorProto_TYPE_INT32 FieldDescriptorProto_Type = 5 - FieldDescriptorProto_TYPE_FIXED64 FieldDescriptorProto_Type = 6 - FieldDescriptorProto_TYPE_FIXED32 FieldDescriptorProto_Type = 7 - FieldDescriptorProto_TYPE_BOOL FieldDescriptorProto_Type = 8 - FieldDescriptorProto_TYPE_STRING FieldDescriptorProto_Type = 9 - // Tag-delimited aggregate. - // Group type is deprecated and not supported in proto3. However, Proto3 - // implementations should still be able to parse the group wire format and - // treat group fields as unknown fields. - FieldDescriptorProto_TYPE_GROUP FieldDescriptorProto_Type = 10 - FieldDescriptorProto_TYPE_MESSAGE FieldDescriptorProto_Type = 11 - // New in version 2. - FieldDescriptorProto_TYPE_BYTES FieldDescriptorProto_Type = 12 - FieldDescriptorProto_TYPE_UINT32 FieldDescriptorProto_Type = 13 - FieldDescriptorProto_TYPE_ENUM FieldDescriptorProto_Type = 14 - FieldDescriptorProto_TYPE_SFIXED32 FieldDescriptorProto_Type = 15 - FieldDescriptorProto_TYPE_SFIXED64 FieldDescriptorProto_Type = 16 - FieldDescriptorProto_TYPE_SINT32 FieldDescriptorProto_Type = 17 - FieldDescriptorProto_TYPE_SINT64 FieldDescriptorProto_Type = 18 -) - -var FieldDescriptorProto_Type_name = map[int32]string{ - 1: "TYPE_DOUBLE", - 2: "TYPE_FLOAT", - 3: "TYPE_INT64", - 4: "TYPE_UINT64", - 5: "TYPE_INT32", - 6: "TYPE_FIXED64", - 7: "TYPE_FIXED32", - 8: "TYPE_BOOL", - 9: "TYPE_STRING", - 10: "TYPE_GROUP", - 11: "TYPE_MESSAGE", - 12: "TYPE_BYTES", - 13: "TYPE_UINT32", - 14: "TYPE_ENUM", - 15: "TYPE_SFIXED32", - 16: "TYPE_SFIXED64", - 17: "TYPE_SINT32", - 18: "TYPE_SINT64", -} - -var FieldDescriptorProto_Type_value = map[string]int32{ - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18, -} - -func (x FieldDescriptorProto_Type) Enum() *FieldDescriptorProto_Type { - p := new(FieldDescriptorProto_Type) - *p = x - return p -} - -func (x FieldDescriptorProto_Type) String() string { - return proto.EnumName(FieldDescriptorProto_Type_name, int32(x)) -} - -func (x *FieldDescriptorProto_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Type_value, data, "FieldDescriptorProto_Type") - if err != nil { - return err - } - *x = FieldDescriptorProto_Type(value) - return nil -} - -func (FieldDescriptorProto_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{4, 0} -} - -type FieldDescriptorProto_Label int32 - -const ( - // 0 is reserved for errors - FieldDescriptorProto_LABEL_OPTIONAL FieldDescriptorProto_Label = 1 - FieldDescriptorProto_LABEL_REQUIRED FieldDescriptorProto_Label = 2 - FieldDescriptorProto_LABEL_REPEATED FieldDescriptorProto_Label = 3 -) - -var FieldDescriptorProto_Label_name = map[int32]string{ - 1: "LABEL_OPTIONAL", - 2: "LABEL_REQUIRED", - 3: "LABEL_REPEATED", -} - -var FieldDescriptorProto_Label_value = map[string]int32{ - "LABEL_OPTIONAL": 1, - "LABEL_REQUIRED": 2, - "LABEL_REPEATED": 3, -} - -func (x FieldDescriptorProto_Label) Enum() *FieldDescriptorProto_Label { - p := new(FieldDescriptorProto_Label) - *p = x - return p -} - -func (x FieldDescriptorProto_Label) String() string { - return proto.EnumName(FieldDescriptorProto_Label_name, int32(x)) -} - -func (x *FieldDescriptorProto_Label) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Label_value, data, "FieldDescriptorProto_Label") - if err != nil { - return err - } - *x = FieldDescriptorProto_Label(value) - return nil -} - -func (FieldDescriptorProto_Label) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{4, 1} -} - -// Generated classes can be optimized for speed or code size. -type FileOptions_OptimizeMode int32 - -const ( - FileOptions_SPEED FileOptions_OptimizeMode = 1 - // etc. - FileOptions_CODE_SIZE FileOptions_OptimizeMode = 2 - FileOptions_LITE_RUNTIME FileOptions_OptimizeMode = 3 -) - -var FileOptions_OptimizeMode_name = map[int32]string{ - 1: "SPEED", - 2: "CODE_SIZE", - 3: "LITE_RUNTIME", -} - -var FileOptions_OptimizeMode_value = map[string]int32{ - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3, -} - -func (x FileOptions_OptimizeMode) Enum() *FileOptions_OptimizeMode { - p := new(FileOptions_OptimizeMode) - *p = x - return p -} - -func (x FileOptions_OptimizeMode) String() string { - return proto.EnumName(FileOptions_OptimizeMode_name, int32(x)) -} - -func (x *FileOptions_OptimizeMode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FileOptions_OptimizeMode_value, data, "FileOptions_OptimizeMode") - if err != nil { - return err - } - *x = FileOptions_OptimizeMode(value) - return nil -} - -func (FileOptions_OptimizeMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{10, 0} -} - -type FieldOptions_CType int32 - -const ( - // Default mode. - FieldOptions_STRING FieldOptions_CType = 0 - FieldOptions_CORD FieldOptions_CType = 1 - FieldOptions_STRING_PIECE FieldOptions_CType = 2 -) - -var FieldOptions_CType_name = map[int32]string{ - 0: "STRING", - 1: "CORD", - 2: "STRING_PIECE", -} - -var FieldOptions_CType_value = map[string]int32{ - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2, -} - -func (x FieldOptions_CType) Enum() *FieldOptions_CType { - p := new(FieldOptions_CType) - *p = x - return p -} - -func (x FieldOptions_CType) String() string { - return proto.EnumName(FieldOptions_CType_name, int32(x)) -} - -func (x *FieldOptions_CType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FieldOptions_CType_value, data, "FieldOptions_CType") - if err != nil { - return err - } - *x = FieldOptions_CType(value) - return nil -} - -func (FieldOptions_CType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{12, 0} -} - -type FieldOptions_JSType int32 - -const ( - // Use the default type. - FieldOptions_JS_NORMAL FieldOptions_JSType = 0 - // Use JavaScript strings. - FieldOptions_JS_STRING FieldOptions_JSType = 1 - // Use JavaScript numbers. - FieldOptions_JS_NUMBER FieldOptions_JSType = 2 -) - -var FieldOptions_JSType_name = map[int32]string{ - 0: "JS_NORMAL", - 1: "JS_STRING", - 2: "JS_NUMBER", -} - -var FieldOptions_JSType_value = map[string]int32{ - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2, -} - -func (x FieldOptions_JSType) Enum() *FieldOptions_JSType { - p := new(FieldOptions_JSType) - *p = x - return p -} - -func (x FieldOptions_JSType) String() string { - return proto.EnumName(FieldOptions_JSType_name, int32(x)) -} - -func (x *FieldOptions_JSType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FieldOptions_JSType_value, data, "FieldOptions_JSType") - if err != nil { - return err - } - *x = FieldOptions_JSType(value) - return nil -} - -func (FieldOptions_JSType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{12, 1} -} - -// Is this method side-effect-free (or safe in HTTP parlance), or idempotent, -// or neither? HTTP based RPC implementation may choose GET verb for safe -// methods, and PUT verb for idempotent methods instead of the default POST. -type MethodOptions_IdempotencyLevel int32 - -const ( - MethodOptions_IDEMPOTENCY_UNKNOWN MethodOptions_IdempotencyLevel = 0 - MethodOptions_NO_SIDE_EFFECTS MethodOptions_IdempotencyLevel = 1 - MethodOptions_IDEMPOTENT MethodOptions_IdempotencyLevel = 2 -) - -var MethodOptions_IdempotencyLevel_name = map[int32]string{ - 0: "IDEMPOTENCY_UNKNOWN", - 1: "NO_SIDE_EFFECTS", - 2: "IDEMPOTENT", -} - -var MethodOptions_IdempotencyLevel_value = map[string]int32{ - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2, -} - -func (x MethodOptions_IdempotencyLevel) Enum() *MethodOptions_IdempotencyLevel { - p := new(MethodOptions_IdempotencyLevel) - *p = x - return p -} - -func (x MethodOptions_IdempotencyLevel) String() string { - return proto.EnumName(MethodOptions_IdempotencyLevel_name, int32(x)) -} - -func (x *MethodOptions_IdempotencyLevel) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(MethodOptions_IdempotencyLevel_value, data, "MethodOptions_IdempotencyLevel") - if err != nil { - return err - } - *x = MethodOptions_IdempotencyLevel(value) - return nil -} - -func (MethodOptions_IdempotencyLevel) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{17, 0} -} - -// The protocol compiler can output a FileDescriptorSet containing the .proto -// files it parses. -type FileDescriptorSet struct { - File []*FileDescriptorProto `protobuf:"bytes,1,rep,name=file" json:"file,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FileDescriptorSet) Reset() { *m = FileDescriptorSet{} } -func (m *FileDescriptorSet) String() string { return proto.CompactTextString(m) } -func (*FileDescriptorSet) ProtoMessage() {} -func (*FileDescriptorSet) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{0} -} -func (m *FileDescriptorSet) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FileDescriptorSet.Unmarshal(m, b) -} -func (m *FileDescriptorSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FileDescriptorSet.Marshal(b, m, deterministic) -} -func (m *FileDescriptorSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileDescriptorSet.Merge(m, src) -} -func (m *FileDescriptorSet) XXX_Size() int { - return xxx_messageInfo_FileDescriptorSet.Size(m) -} -func (m *FileDescriptorSet) XXX_DiscardUnknown() { - xxx_messageInfo_FileDescriptorSet.DiscardUnknown(m) -} - -var xxx_messageInfo_FileDescriptorSet proto.InternalMessageInfo - -func (m *FileDescriptorSet) GetFile() []*FileDescriptorProto { - if m != nil { - return m.File - } - return nil -} - -// Describes a complete .proto file. -type FileDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Package *string `protobuf:"bytes,2,opt,name=package" json:"package,omitempty"` - // Names of files imported by this file. - Dependency []string `protobuf:"bytes,3,rep,name=dependency" json:"dependency,omitempty"` - // Indexes of the public imported files in the dependency list above. - PublicDependency []int32 `protobuf:"varint,10,rep,name=public_dependency,json=publicDependency" json:"public_dependency,omitempty"` - // Indexes of the weak imported files in the dependency list. - // For Google-internal migration only. Do not use. - WeakDependency []int32 `protobuf:"varint,11,rep,name=weak_dependency,json=weakDependency" json:"weak_dependency,omitempty"` - // All top-level definitions in this file. - MessageType []*DescriptorProto `protobuf:"bytes,4,rep,name=message_type,json=messageType" json:"message_type,omitempty"` - EnumType []*EnumDescriptorProto `protobuf:"bytes,5,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"` - Service []*ServiceDescriptorProto `protobuf:"bytes,6,rep,name=service" json:"service,omitempty"` - Extension []*FieldDescriptorProto `protobuf:"bytes,7,rep,name=extension" json:"extension,omitempty"` - Options *FileOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"` - // This field contains optional information about the original source code. - // You may safely remove this entire field without harming runtime - // functionality of the descriptors -- the information is needed only by - // development tools. - SourceCodeInfo *SourceCodeInfo `protobuf:"bytes,9,opt,name=source_code_info,json=sourceCodeInfo" json:"source_code_info,omitempty"` - // The syntax of the proto file. - // The supported values are "proto2" and "proto3". - Syntax *string `protobuf:"bytes,12,opt,name=syntax" json:"syntax,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FileDescriptorProto) Reset() { *m = FileDescriptorProto{} } -func (m *FileDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*FileDescriptorProto) ProtoMessage() {} -func (*FileDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{1} -} -func (m *FileDescriptorProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FileDescriptorProto.Unmarshal(m, b) -} -func (m *FileDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FileDescriptorProto.Marshal(b, m, deterministic) -} -func (m *FileDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileDescriptorProto.Merge(m, src) -} -func (m *FileDescriptorProto) XXX_Size() int { - return xxx_messageInfo_FileDescriptorProto.Size(m) -} -func (m *FileDescriptorProto) XXX_DiscardUnknown() { - xxx_messageInfo_FileDescriptorProto.DiscardUnknown(m) -} - -var xxx_messageInfo_FileDescriptorProto proto.InternalMessageInfo - -func (m *FileDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *FileDescriptorProto) GetPackage() string { - if m != nil && m.Package != nil { - return *m.Package - } - return "" -} - -func (m *FileDescriptorProto) GetDependency() []string { - if m != nil { - return m.Dependency - } - return nil -} - -func (m *FileDescriptorProto) GetPublicDependency() []int32 { - if m != nil { - return m.PublicDependency - } - return nil -} - -func (m *FileDescriptorProto) GetWeakDependency() []int32 { - if m != nil { - return m.WeakDependency - } - return nil -} - -func (m *FileDescriptorProto) GetMessageType() []*DescriptorProto { - if m != nil { - return m.MessageType - } - return nil -} - -func (m *FileDescriptorProto) GetEnumType() []*EnumDescriptorProto { - if m != nil { - return m.EnumType - } - return nil -} - -func (m *FileDescriptorProto) GetService() []*ServiceDescriptorProto { - if m != nil { - return m.Service - } - return nil -} - -func (m *FileDescriptorProto) GetExtension() []*FieldDescriptorProto { - if m != nil { - return m.Extension - } - return nil -} - -func (m *FileDescriptorProto) GetOptions() *FileOptions { - if m != nil { - return m.Options - } - return nil -} - -func (m *FileDescriptorProto) GetSourceCodeInfo() *SourceCodeInfo { - if m != nil { - return m.SourceCodeInfo - } - return nil -} - -func (m *FileDescriptorProto) GetSyntax() string { - if m != nil && m.Syntax != nil { - return *m.Syntax - } - return "" -} - -// Describes a message type. -type DescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Field []*FieldDescriptorProto `protobuf:"bytes,2,rep,name=field" json:"field,omitempty"` - Extension []*FieldDescriptorProto `protobuf:"bytes,6,rep,name=extension" json:"extension,omitempty"` - NestedType []*DescriptorProto `protobuf:"bytes,3,rep,name=nested_type,json=nestedType" json:"nested_type,omitempty"` - EnumType []*EnumDescriptorProto `protobuf:"bytes,4,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"` - ExtensionRange []*DescriptorProto_ExtensionRange `protobuf:"bytes,5,rep,name=extension_range,json=extensionRange" json:"extension_range,omitempty"` - OneofDecl []*OneofDescriptorProto `protobuf:"bytes,8,rep,name=oneof_decl,json=oneofDecl" json:"oneof_decl,omitempty"` - Options *MessageOptions `protobuf:"bytes,7,opt,name=options" json:"options,omitempty"` - ReservedRange []*DescriptorProto_ReservedRange `protobuf:"bytes,9,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"` - // Reserved field names, which may not be used by fields in the same message. - // A given name may only be reserved once. - ReservedName []string `protobuf:"bytes,10,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescriptorProto) Reset() { *m = DescriptorProto{} } -func (m *DescriptorProto) String() string { return proto.CompactTextString(m) } -func (*DescriptorProto) ProtoMessage() {} -func (*DescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{2} -} -func (m *DescriptorProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescriptorProto.Unmarshal(m, b) -} -func (m *DescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescriptorProto.Marshal(b, m, deterministic) -} -func (m *DescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescriptorProto.Merge(m, src) -} -func (m *DescriptorProto) XXX_Size() int { - return xxx_messageInfo_DescriptorProto.Size(m) -} -func (m *DescriptorProto) XXX_DiscardUnknown() { - xxx_messageInfo_DescriptorProto.DiscardUnknown(m) -} - -var xxx_messageInfo_DescriptorProto proto.InternalMessageInfo - -func (m *DescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *DescriptorProto) GetField() []*FieldDescriptorProto { - if m != nil { - return m.Field - } - return nil -} - -func (m *DescriptorProto) GetExtension() []*FieldDescriptorProto { - if m != nil { - return m.Extension - } - return nil -} - -func (m *DescriptorProto) GetNestedType() []*DescriptorProto { - if m != nil { - return m.NestedType - } - return nil -} - -func (m *DescriptorProto) GetEnumType() []*EnumDescriptorProto { - if m != nil { - return m.EnumType - } - return nil -} - -func (m *DescriptorProto) GetExtensionRange() []*DescriptorProto_ExtensionRange { - if m != nil { - return m.ExtensionRange - } - return nil -} - -func (m *DescriptorProto) GetOneofDecl() []*OneofDescriptorProto { - if m != nil { - return m.OneofDecl - } - return nil -} - -func (m *DescriptorProto) GetOptions() *MessageOptions { - if m != nil { - return m.Options - } - return nil -} - -func (m *DescriptorProto) GetReservedRange() []*DescriptorProto_ReservedRange { - if m != nil { - return m.ReservedRange - } - return nil -} - -func (m *DescriptorProto) GetReservedName() []string { - if m != nil { - return m.ReservedName - } - return nil -} - -type DescriptorProto_ExtensionRange struct { - Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` - End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` - Options *ExtensionRangeOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescriptorProto_ExtensionRange) Reset() { *m = DescriptorProto_ExtensionRange{} } -func (m *DescriptorProto_ExtensionRange) String() string { return proto.CompactTextString(m) } -func (*DescriptorProto_ExtensionRange) ProtoMessage() {} -func (*DescriptorProto_ExtensionRange) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{2, 0} -} -func (m *DescriptorProto_ExtensionRange) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescriptorProto_ExtensionRange.Unmarshal(m, b) -} -func (m *DescriptorProto_ExtensionRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescriptorProto_ExtensionRange.Marshal(b, m, deterministic) -} -func (m *DescriptorProto_ExtensionRange) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescriptorProto_ExtensionRange.Merge(m, src) -} -func (m *DescriptorProto_ExtensionRange) XXX_Size() int { - return xxx_messageInfo_DescriptorProto_ExtensionRange.Size(m) -} -func (m *DescriptorProto_ExtensionRange) XXX_DiscardUnknown() { - xxx_messageInfo_DescriptorProto_ExtensionRange.DiscardUnknown(m) -} - -var xxx_messageInfo_DescriptorProto_ExtensionRange proto.InternalMessageInfo - -func (m *DescriptorProto_ExtensionRange) GetStart() int32 { - if m != nil && m.Start != nil { - return *m.Start - } - return 0 -} - -func (m *DescriptorProto_ExtensionRange) GetEnd() int32 { - if m != nil && m.End != nil { - return *m.End - } - return 0 -} - -func (m *DescriptorProto_ExtensionRange) GetOptions() *ExtensionRangeOptions { - if m != nil { - return m.Options - } - return nil -} - -// Range of reserved tag numbers. Reserved tag numbers may not be used by -// fields or extension ranges in the same message. Reserved ranges may -// not overlap. -type DescriptorProto_ReservedRange struct { - Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` - End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescriptorProto_ReservedRange) Reset() { *m = DescriptorProto_ReservedRange{} } -func (m *DescriptorProto_ReservedRange) String() string { return proto.CompactTextString(m) } -func (*DescriptorProto_ReservedRange) ProtoMessage() {} -func (*DescriptorProto_ReservedRange) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{2, 1} -} -func (m *DescriptorProto_ReservedRange) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescriptorProto_ReservedRange.Unmarshal(m, b) -} -func (m *DescriptorProto_ReservedRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescriptorProto_ReservedRange.Marshal(b, m, deterministic) -} -func (m *DescriptorProto_ReservedRange) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescriptorProto_ReservedRange.Merge(m, src) -} -func (m *DescriptorProto_ReservedRange) XXX_Size() int { - return xxx_messageInfo_DescriptorProto_ReservedRange.Size(m) -} -func (m *DescriptorProto_ReservedRange) XXX_DiscardUnknown() { - xxx_messageInfo_DescriptorProto_ReservedRange.DiscardUnknown(m) -} - -var xxx_messageInfo_DescriptorProto_ReservedRange proto.InternalMessageInfo - -func (m *DescriptorProto_ReservedRange) GetStart() int32 { - if m != nil && m.Start != nil { - return *m.Start - } - return 0 -} - -func (m *DescriptorProto_ReservedRange) GetEnd() int32 { - if m != nil && m.End != nil { - return *m.End - } - return 0 -} - -type ExtensionRangeOptions struct { - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ExtensionRangeOptions) Reset() { *m = ExtensionRangeOptions{} } -func (m *ExtensionRangeOptions) String() string { return proto.CompactTextString(m) } -func (*ExtensionRangeOptions) ProtoMessage() {} -func (*ExtensionRangeOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{3} -} - -var extRange_ExtensionRangeOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*ExtensionRangeOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_ExtensionRangeOptions -} - -func (m *ExtensionRangeOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExtensionRangeOptions.Unmarshal(m, b) -} -func (m *ExtensionRangeOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExtensionRangeOptions.Marshal(b, m, deterministic) -} -func (m *ExtensionRangeOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExtensionRangeOptions.Merge(m, src) -} -func (m *ExtensionRangeOptions) XXX_Size() int { - return xxx_messageInfo_ExtensionRangeOptions.Size(m) -} -func (m *ExtensionRangeOptions) XXX_DiscardUnknown() { - xxx_messageInfo_ExtensionRangeOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_ExtensionRangeOptions proto.InternalMessageInfo - -func (m *ExtensionRangeOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -// Describes a field within a message. -type FieldDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Number *int32 `protobuf:"varint,3,opt,name=number" json:"number,omitempty"` - Label *FieldDescriptorProto_Label `protobuf:"varint,4,opt,name=label,enum=google.protobuf.FieldDescriptorProto_Label" json:"label,omitempty"` - // If type_name is set, this need not be set. If both this and type_name - // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - Type *FieldDescriptorProto_Type `protobuf:"varint,5,opt,name=type,enum=google.protobuf.FieldDescriptorProto_Type" json:"type,omitempty"` - // For message and enum types, this is the name of the type. If the name - // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - // rules are used to find the type (i.e. first the nested types within this - // message are searched, then within the parent, on up to the root - // namespace). - TypeName *string `protobuf:"bytes,6,opt,name=type_name,json=typeName" json:"type_name,omitempty"` - // For extensions, this is the name of the type being extended. It is - // resolved in the same manner as type_name. - Extendee *string `protobuf:"bytes,2,opt,name=extendee" json:"extendee,omitempty"` - // For numeric types, contains the original text representation of the value. - // For booleans, "true" or "false". - // For strings, contains the default text contents (not escaped in any way). - // For bytes, contains the C escaped value. All bytes >= 128 are escaped. - // TODO(kenton): Base-64 encode? - DefaultValue *string `protobuf:"bytes,7,opt,name=default_value,json=defaultValue" json:"default_value,omitempty"` - // If set, gives the index of a oneof in the containing type's oneof_decl - // list. This field is a member of that oneof. - OneofIndex *int32 `protobuf:"varint,9,opt,name=oneof_index,json=oneofIndex" json:"oneof_index,omitempty"` - // JSON name of this field. The value is set by protocol compiler. If the - // user has set a "json_name" option on this field, that option's value - // will be used. Otherwise, it's deduced from the field's name by converting - // it to camelCase. - JsonName *string `protobuf:"bytes,10,opt,name=json_name,json=jsonName" json:"json_name,omitempty"` - Options *FieldOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FieldDescriptorProto) Reset() { *m = FieldDescriptorProto{} } -func (m *FieldDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*FieldDescriptorProto) ProtoMessage() {} -func (*FieldDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{4} -} -func (m *FieldDescriptorProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FieldDescriptorProto.Unmarshal(m, b) -} -func (m *FieldDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FieldDescriptorProto.Marshal(b, m, deterministic) -} -func (m *FieldDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldDescriptorProto.Merge(m, src) -} -func (m *FieldDescriptorProto) XXX_Size() int { - return xxx_messageInfo_FieldDescriptorProto.Size(m) -} -func (m *FieldDescriptorProto) XXX_DiscardUnknown() { - xxx_messageInfo_FieldDescriptorProto.DiscardUnknown(m) -} - -var xxx_messageInfo_FieldDescriptorProto proto.InternalMessageInfo - -func (m *FieldDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *FieldDescriptorProto) GetNumber() int32 { - if m != nil && m.Number != nil { - return *m.Number - } - return 0 -} - -func (m *FieldDescriptorProto) GetLabel() FieldDescriptorProto_Label { - if m != nil && m.Label != nil { - return *m.Label - } - return FieldDescriptorProto_LABEL_OPTIONAL -} - -func (m *FieldDescriptorProto) GetType() FieldDescriptorProto_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return FieldDescriptorProto_TYPE_DOUBLE -} - -func (m *FieldDescriptorProto) GetTypeName() string { - if m != nil && m.TypeName != nil { - return *m.TypeName - } - return "" -} - -func (m *FieldDescriptorProto) GetExtendee() string { - if m != nil && m.Extendee != nil { - return *m.Extendee - } - return "" -} - -func (m *FieldDescriptorProto) GetDefaultValue() string { - if m != nil && m.DefaultValue != nil { - return *m.DefaultValue - } - return "" -} - -func (m *FieldDescriptorProto) GetOneofIndex() int32 { - if m != nil && m.OneofIndex != nil { - return *m.OneofIndex - } - return 0 -} - -func (m *FieldDescriptorProto) GetJsonName() string { - if m != nil && m.JsonName != nil { - return *m.JsonName - } - return "" -} - -func (m *FieldDescriptorProto) GetOptions() *FieldOptions { - if m != nil { - return m.Options - } - return nil -} - -// Describes a oneof. -type OneofDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Options *OneofOptions `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OneofDescriptorProto) Reset() { *m = OneofDescriptorProto{} } -func (m *OneofDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*OneofDescriptorProto) ProtoMessage() {} -func (*OneofDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{5} -} -func (m *OneofDescriptorProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OneofDescriptorProto.Unmarshal(m, b) -} -func (m *OneofDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OneofDescriptorProto.Marshal(b, m, deterministic) -} -func (m *OneofDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_OneofDescriptorProto.Merge(m, src) -} -func (m *OneofDescriptorProto) XXX_Size() int { - return xxx_messageInfo_OneofDescriptorProto.Size(m) -} -func (m *OneofDescriptorProto) XXX_DiscardUnknown() { - xxx_messageInfo_OneofDescriptorProto.DiscardUnknown(m) -} - -var xxx_messageInfo_OneofDescriptorProto proto.InternalMessageInfo - -func (m *OneofDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *OneofDescriptorProto) GetOptions() *OneofOptions { - if m != nil { - return m.Options - } - return nil -} - -// Describes an enum type. -type EnumDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Value []*EnumValueDescriptorProto `protobuf:"bytes,2,rep,name=value" json:"value,omitempty"` - Options *EnumOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` - // Range of reserved numeric values. Reserved numeric values may not be used - // by enum values in the same enum declaration. Reserved ranges may not - // overlap. - ReservedRange []*EnumDescriptorProto_EnumReservedRange `protobuf:"bytes,4,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"` - // Reserved enum value names, which may not be reused. A given name may only - // be reserved once. - ReservedName []string `protobuf:"bytes,5,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EnumDescriptorProto) Reset() { *m = EnumDescriptorProto{} } -func (m *EnumDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*EnumDescriptorProto) ProtoMessage() {} -func (*EnumDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{6} -} -func (m *EnumDescriptorProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EnumDescriptorProto.Unmarshal(m, b) -} -func (m *EnumDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EnumDescriptorProto.Marshal(b, m, deterministic) -} -func (m *EnumDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnumDescriptorProto.Merge(m, src) -} -func (m *EnumDescriptorProto) XXX_Size() int { - return xxx_messageInfo_EnumDescriptorProto.Size(m) -} -func (m *EnumDescriptorProto) XXX_DiscardUnknown() { - xxx_messageInfo_EnumDescriptorProto.DiscardUnknown(m) -} - -var xxx_messageInfo_EnumDescriptorProto proto.InternalMessageInfo - -func (m *EnumDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *EnumDescriptorProto) GetValue() []*EnumValueDescriptorProto { - if m != nil { - return m.Value - } - return nil -} - -func (m *EnumDescriptorProto) GetOptions() *EnumOptions { - if m != nil { - return m.Options - } - return nil -} - -func (m *EnumDescriptorProto) GetReservedRange() []*EnumDescriptorProto_EnumReservedRange { - if m != nil { - return m.ReservedRange - } - return nil -} - -func (m *EnumDescriptorProto) GetReservedName() []string { - if m != nil { - return m.ReservedName - } - return nil -} - -// Range of reserved numeric values. Reserved values may not be used by -// entries in the same enum. Reserved ranges may not overlap. -// -// Note that this is distinct from DescriptorProto.ReservedRange in that it -// is inclusive such that it can appropriately represent the entire int32 -// domain. -type EnumDescriptorProto_EnumReservedRange struct { - Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` - End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EnumDescriptorProto_EnumReservedRange) Reset() { *m = EnumDescriptorProto_EnumReservedRange{} } -func (m *EnumDescriptorProto_EnumReservedRange) String() string { return proto.CompactTextString(m) } -func (*EnumDescriptorProto_EnumReservedRange) ProtoMessage() {} -func (*EnumDescriptorProto_EnumReservedRange) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{6, 0} -} -func (m *EnumDescriptorProto_EnumReservedRange) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Unmarshal(m, b) -} -func (m *EnumDescriptorProto_EnumReservedRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Marshal(b, m, deterministic) -} -func (m *EnumDescriptorProto_EnumReservedRange) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Merge(m, src) -} -func (m *EnumDescriptorProto_EnumReservedRange) XXX_Size() int { - return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Size(m) -} -func (m *EnumDescriptorProto_EnumReservedRange) XXX_DiscardUnknown() { - xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.DiscardUnknown(m) -} - -var xxx_messageInfo_EnumDescriptorProto_EnumReservedRange proto.InternalMessageInfo - -func (m *EnumDescriptorProto_EnumReservedRange) GetStart() int32 { - if m != nil && m.Start != nil { - return *m.Start - } - return 0 -} - -func (m *EnumDescriptorProto_EnumReservedRange) GetEnd() int32 { - if m != nil && m.End != nil { - return *m.End - } - return 0 -} - -// Describes a value within an enum. -type EnumValueDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Number *int32 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"` - Options *EnumValueOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EnumValueDescriptorProto) Reset() { *m = EnumValueDescriptorProto{} } -func (m *EnumValueDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*EnumValueDescriptorProto) ProtoMessage() {} -func (*EnumValueDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{7} -} -func (m *EnumValueDescriptorProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EnumValueDescriptorProto.Unmarshal(m, b) -} -func (m *EnumValueDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EnumValueDescriptorProto.Marshal(b, m, deterministic) -} -func (m *EnumValueDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnumValueDescriptorProto.Merge(m, src) -} -func (m *EnumValueDescriptorProto) XXX_Size() int { - return xxx_messageInfo_EnumValueDescriptorProto.Size(m) -} -func (m *EnumValueDescriptorProto) XXX_DiscardUnknown() { - xxx_messageInfo_EnumValueDescriptorProto.DiscardUnknown(m) -} - -var xxx_messageInfo_EnumValueDescriptorProto proto.InternalMessageInfo - -func (m *EnumValueDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *EnumValueDescriptorProto) GetNumber() int32 { - if m != nil && m.Number != nil { - return *m.Number - } - return 0 -} - -func (m *EnumValueDescriptorProto) GetOptions() *EnumValueOptions { - if m != nil { - return m.Options - } - return nil -} - -// Describes a service. -type ServiceDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Method []*MethodDescriptorProto `protobuf:"bytes,2,rep,name=method" json:"method,omitempty"` - Options *ServiceOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ServiceDescriptorProto) Reset() { *m = ServiceDescriptorProto{} } -func (m *ServiceDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*ServiceDescriptorProto) ProtoMessage() {} -func (*ServiceDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{8} -} -func (m *ServiceDescriptorProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ServiceDescriptorProto.Unmarshal(m, b) -} -func (m *ServiceDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ServiceDescriptorProto.Marshal(b, m, deterministic) -} -func (m *ServiceDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceDescriptorProto.Merge(m, src) -} -func (m *ServiceDescriptorProto) XXX_Size() int { - return xxx_messageInfo_ServiceDescriptorProto.Size(m) -} -func (m *ServiceDescriptorProto) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceDescriptorProto.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceDescriptorProto proto.InternalMessageInfo - -func (m *ServiceDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *ServiceDescriptorProto) GetMethod() []*MethodDescriptorProto { - if m != nil { - return m.Method - } - return nil -} - -func (m *ServiceDescriptorProto) GetOptions() *ServiceOptions { - if m != nil { - return m.Options - } - return nil -} - -// Describes a method of a service. -type MethodDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // Input and output type names. These are resolved in the same way as - // FieldDescriptorProto.type_name, but must refer to a message type. - InputType *string `protobuf:"bytes,2,opt,name=input_type,json=inputType" json:"input_type,omitempty"` - OutputType *string `protobuf:"bytes,3,opt,name=output_type,json=outputType" json:"output_type,omitempty"` - Options *MethodOptions `protobuf:"bytes,4,opt,name=options" json:"options,omitempty"` - // Identifies if client streams multiple client messages - ClientStreaming *bool `protobuf:"varint,5,opt,name=client_streaming,json=clientStreaming,def=0" json:"client_streaming,omitempty"` - // Identifies if server streams multiple server messages - ServerStreaming *bool `protobuf:"varint,6,opt,name=server_streaming,json=serverStreaming,def=0" json:"server_streaming,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MethodDescriptorProto) Reset() { *m = MethodDescriptorProto{} } -func (m *MethodDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*MethodDescriptorProto) ProtoMessage() {} -func (*MethodDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{9} -} -func (m *MethodDescriptorProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MethodDescriptorProto.Unmarshal(m, b) -} -func (m *MethodDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MethodDescriptorProto.Marshal(b, m, deterministic) -} -func (m *MethodDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_MethodDescriptorProto.Merge(m, src) -} -func (m *MethodDescriptorProto) XXX_Size() int { - return xxx_messageInfo_MethodDescriptorProto.Size(m) -} -func (m *MethodDescriptorProto) XXX_DiscardUnknown() { - xxx_messageInfo_MethodDescriptorProto.DiscardUnknown(m) -} - -var xxx_messageInfo_MethodDescriptorProto proto.InternalMessageInfo - -const Default_MethodDescriptorProto_ClientStreaming bool = false -const Default_MethodDescriptorProto_ServerStreaming bool = false - -func (m *MethodDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *MethodDescriptorProto) GetInputType() string { - if m != nil && m.InputType != nil { - return *m.InputType - } - return "" -} - -func (m *MethodDescriptorProto) GetOutputType() string { - if m != nil && m.OutputType != nil { - return *m.OutputType - } - return "" -} - -func (m *MethodDescriptorProto) GetOptions() *MethodOptions { - if m != nil { - return m.Options - } - return nil -} - -func (m *MethodDescriptorProto) GetClientStreaming() bool { - if m != nil && m.ClientStreaming != nil { - return *m.ClientStreaming - } - return Default_MethodDescriptorProto_ClientStreaming -} - -func (m *MethodDescriptorProto) GetServerStreaming() bool { - if m != nil && m.ServerStreaming != nil { - return *m.ServerStreaming - } - return Default_MethodDescriptorProto_ServerStreaming -} - -type FileOptions struct { - // Sets the Java package where classes generated from this .proto will be - // placed. By default, the proto package is used, but this is often - // inappropriate because proto packages do not normally start with backwards - // domain names. - JavaPackage *string `protobuf:"bytes,1,opt,name=java_package,json=javaPackage" json:"java_package,omitempty"` - // If set, all the classes from the .proto file are wrapped in a single - // outer class with the given name. This applies to both Proto1 - // (equivalent to the old "--one_java_file" option) and Proto2 (where - // a .proto always translates to a single class, but you may want to - // explicitly choose the class name). - JavaOuterClassname *string `protobuf:"bytes,8,opt,name=java_outer_classname,json=javaOuterClassname" json:"java_outer_classname,omitempty"` - // If set true, then the Java code generator will generate a separate .java - // file for each top-level message, enum, and service defined in the .proto - // file. Thus, these types will *not* be nested inside the outer class - // named by java_outer_classname. However, the outer class will still be - // generated to contain the file's getDescriptor() method as well as any - // top-level extensions defined in the file. - JavaMultipleFiles *bool `protobuf:"varint,10,opt,name=java_multiple_files,json=javaMultipleFiles,def=0" json:"java_multiple_files,omitempty"` - // This option does nothing. - JavaGenerateEqualsAndHash *bool `protobuf:"varint,20,opt,name=java_generate_equals_and_hash,json=javaGenerateEqualsAndHash" json:"java_generate_equals_and_hash,omitempty"` // Deprecated: Do not use. - // If set true, then the Java2 code generator will generate code that - // throws an exception whenever an attempt is made to assign a non-UTF-8 - // byte sequence to a string field. - // Message reflection will do the same. - // However, an extension field still accepts non-UTF-8 byte sequences. - // This option has no effect on when used with the lite runtime. - JavaStringCheckUtf8 *bool `protobuf:"varint,27,opt,name=java_string_check_utf8,json=javaStringCheckUtf8,def=0" json:"java_string_check_utf8,omitempty"` - OptimizeFor *FileOptions_OptimizeMode `protobuf:"varint,9,opt,name=optimize_for,json=optimizeFor,enum=google.protobuf.FileOptions_OptimizeMode,def=1" json:"optimize_for,omitempty"` - // Sets the Go package where structs generated from this .proto will be - // placed. If omitted, the Go package will be derived from the following: - // - The basename of the package import path, if provided. - // - Otherwise, the package statement in the .proto file, if present. - // - Otherwise, the basename of the .proto file, without extension. - GoPackage *string `protobuf:"bytes,11,opt,name=go_package,json=goPackage" json:"go_package,omitempty"` - // Should generic services be generated in each language? "Generic" services - // are not specific to any particular RPC system. They are generated by the - // main code generators in each language (without additional plugins). - // Generic services were the only kind of service generation supported by - // early versions of google.protobuf. - // - // Generic services are now considered deprecated in favor of using plugins - // that generate code specific to your particular RPC system. Therefore, - // these default to false. Old code which depends on generic services should - // explicitly set them to true. - CcGenericServices *bool `protobuf:"varint,16,opt,name=cc_generic_services,json=ccGenericServices,def=0" json:"cc_generic_services,omitempty"` - JavaGenericServices *bool `protobuf:"varint,17,opt,name=java_generic_services,json=javaGenericServices,def=0" json:"java_generic_services,omitempty"` - PyGenericServices *bool `protobuf:"varint,18,opt,name=py_generic_services,json=pyGenericServices,def=0" json:"py_generic_services,omitempty"` - PhpGenericServices *bool `protobuf:"varint,42,opt,name=php_generic_services,json=phpGenericServices,def=0" json:"php_generic_services,omitempty"` - // Is this file deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for everything in the file, or it will be completely ignored; in the very - // least, this is a formalization for deprecating files. - Deprecated *bool `protobuf:"varint,23,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // Enables the use of arenas for the proto messages in this file. This applies - // only to generated classes for C++. - CcEnableArenas *bool `protobuf:"varint,31,opt,name=cc_enable_arenas,json=ccEnableArenas,def=0" json:"cc_enable_arenas,omitempty"` - // Sets the objective c class prefix which is prepended to all objective c - // generated classes from this .proto. There is no default. - ObjcClassPrefix *string `protobuf:"bytes,36,opt,name=objc_class_prefix,json=objcClassPrefix" json:"objc_class_prefix,omitempty"` - // Namespace for generated classes; defaults to the package. - CsharpNamespace *string `protobuf:"bytes,37,opt,name=csharp_namespace,json=csharpNamespace" json:"csharp_namespace,omitempty"` - // By default Swift generators will take the proto package and CamelCase it - // replacing '.' with underscore and use that to prefix the types/symbols - // defined. When this options is provided, they will use this value instead - // to prefix the types/symbols defined. - SwiftPrefix *string `protobuf:"bytes,39,opt,name=swift_prefix,json=swiftPrefix" json:"swift_prefix,omitempty"` - // Sets the php class prefix which is prepended to all php generated classes - // from this .proto. Default is empty. - PhpClassPrefix *string `protobuf:"bytes,40,opt,name=php_class_prefix,json=phpClassPrefix" json:"php_class_prefix,omitempty"` - // Use this option to change the namespace of php generated classes. Default - // is empty. When this option is empty, the package name will be used for - // determining the namespace. - PhpNamespace *string `protobuf:"bytes,41,opt,name=php_namespace,json=phpNamespace" json:"php_namespace,omitempty"` - // Use this option to change the namespace of php generated metadata classes. - // Default is empty. When this option is empty, the proto file name will be - // used for determining the namespace. - PhpMetadataNamespace *string `protobuf:"bytes,44,opt,name=php_metadata_namespace,json=phpMetadataNamespace" json:"php_metadata_namespace,omitempty"` - // Use this option to change the package of ruby generated classes. Default - // is empty. When this option is not set, the package name will be used for - // determining the ruby package. - RubyPackage *string `protobuf:"bytes,45,opt,name=ruby_package,json=rubyPackage" json:"ruby_package,omitempty"` - // The parser stores options it doesn't recognize here. - // See the documentation for the "Options" section above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FileOptions) Reset() { *m = FileOptions{} } -func (m *FileOptions) String() string { return proto.CompactTextString(m) } -func (*FileOptions) ProtoMessage() {} -func (*FileOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{10} -} - -var extRange_FileOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*FileOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_FileOptions -} - -func (m *FileOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FileOptions.Unmarshal(m, b) -} -func (m *FileOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FileOptions.Marshal(b, m, deterministic) -} -func (m *FileOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileOptions.Merge(m, src) -} -func (m *FileOptions) XXX_Size() int { - return xxx_messageInfo_FileOptions.Size(m) -} -func (m *FileOptions) XXX_DiscardUnknown() { - xxx_messageInfo_FileOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_FileOptions proto.InternalMessageInfo - -const Default_FileOptions_JavaMultipleFiles bool = false -const Default_FileOptions_JavaStringCheckUtf8 bool = false -const Default_FileOptions_OptimizeFor FileOptions_OptimizeMode = FileOptions_SPEED -const Default_FileOptions_CcGenericServices bool = false -const Default_FileOptions_JavaGenericServices bool = false -const Default_FileOptions_PyGenericServices bool = false -const Default_FileOptions_PhpGenericServices bool = false -const Default_FileOptions_Deprecated bool = false -const Default_FileOptions_CcEnableArenas bool = false - -func (m *FileOptions) GetJavaPackage() string { - if m != nil && m.JavaPackage != nil { - return *m.JavaPackage - } - return "" -} - -func (m *FileOptions) GetJavaOuterClassname() string { - if m != nil && m.JavaOuterClassname != nil { - return *m.JavaOuterClassname - } - return "" -} - -func (m *FileOptions) GetJavaMultipleFiles() bool { - if m != nil && m.JavaMultipleFiles != nil { - return *m.JavaMultipleFiles - } - return Default_FileOptions_JavaMultipleFiles -} - -// Deprecated: Do not use. -func (m *FileOptions) GetJavaGenerateEqualsAndHash() bool { - if m != nil && m.JavaGenerateEqualsAndHash != nil { - return *m.JavaGenerateEqualsAndHash - } - return false -} - -func (m *FileOptions) GetJavaStringCheckUtf8() bool { - if m != nil && m.JavaStringCheckUtf8 != nil { - return *m.JavaStringCheckUtf8 - } - return Default_FileOptions_JavaStringCheckUtf8 -} - -func (m *FileOptions) GetOptimizeFor() FileOptions_OptimizeMode { - if m != nil && m.OptimizeFor != nil { - return *m.OptimizeFor - } - return Default_FileOptions_OptimizeFor -} - -func (m *FileOptions) GetGoPackage() string { - if m != nil && m.GoPackage != nil { - return *m.GoPackage - } - return "" -} - -func (m *FileOptions) GetCcGenericServices() bool { - if m != nil && m.CcGenericServices != nil { - return *m.CcGenericServices - } - return Default_FileOptions_CcGenericServices -} - -func (m *FileOptions) GetJavaGenericServices() bool { - if m != nil && m.JavaGenericServices != nil { - return *m.JavaGenericServices - } - return Default_FileOptions_JavaGenericServices -} - -func (m *FileOptions) GetPyGenericServices() bool { - if m != nil && m.PyGenericServices != nil { - return *m.PyGenericServices - } - return Default_FileOptions_PyGenericServices -} - -func (m *FileOptions) GetPhpGenericServices() bool { - if m != nil && m.PhpGenericServices != nil { - return *m.PhpGenericServices - } - return Default_FileOptions_PhpGenericServices -} - -func (m *FileOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_FileOptions_Deprecated -} - -func (m *FileOptions) GetCcEnableArenas() bool { - if m != nil && m.CcEnableArenas != nil { - return *m.CcEnableArenas - } - return Default_FileOptions_CcEnableArenas -} - -func (m *FileOptions) GetObjcClassPrefix() string { - if m != nil && m.ObjcClassPrefix != nil { - return *m.ObjcClassPrefix - } - return "" -} - -func (m *FileOptions) GetCsharpNamespace() string { - if m != nil && m.CsharpNamespace != nil { - return *m.CsharpNamespace - } - return "" -} - -func (m *FileOptions) GetSwiftPrefix() string { - if m != nil && m.SwiftPrefix != nil { - return *m.SwiftPrefix - } - return "" -} - -func (m *FileOptions) GetPhpClassPrefix() string { - if m != nil && m.PhpClassPrefix != nil { - return *m.PhpClassPrefix - } - return "" -} - -func (m *FileOptions) GetPhpNamespace() string { - if m != nil && m.PhpNamespace != nil { - return *m.PhpNamespace - } - return "" -} - -func (m *FileOptions) GetPhpMetadataNamespace() string { - if m != nil && m.PhpMetadataNamespace != nil { - return *m.PhpMetadataNamespace - } - return "" -} - -func (m *FileOptions) GetRubyPackage() string { - if m != nil && m.RubyPackage != nil { - return *m.RubyPackage - } - return "" -} - -func (m *FileOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type MessageOptions struct { - // Set true to use the old proto1 MessageSet wire format for extensions. - // This is provided for backwards-compatibility with the MessageSet wire - // format. You should not use this for any other reason: It's less - // efficient, has fewer features, and is more complicated. - // - // The message must be defined exactly as follows: - // message Foo { - // option message_set_wire_format = true; - // extensions 4 to max; - // } - // Note that the message cannot have any defined fields; MessageSets only - // have extensions. - // - // All extensions of your type must be singular messages; e.g. they cannot - // be int32s, enums, or repeated messages. - // - // Because this is an option, the above two restrictions are not enforced by - // the protocol compiler. - MessageSetWireFormat *bool `protobuf:"varint,1,opt,name=message_set_wire_format,json=messageSetWireFormat,def=0" json:"message_set_wire_format,omitempty"` - // Disables the generation of the standard "descriptor()" accessor, which can - // conflict with a field of the same name. This is meant to make migration - // from proto1 easier; new code should avoid fields named "descriptor". - NoStandardDescriptorAccessor *bool `protobuf:"varint,2,opt,name=no_standard_descriptor_accessor,json=noStandardDescriptorAccessor,def=0" json:"no_standard_descriptor_accessor,omitempty"` - // Is this message deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the message, or it will be completely ignored; in the very least, - // this is a formalization for deprecating messages. - Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // Whether the message is an automatically generated map entry type for the - // maps field. - // - // For maps fields: - // map map_field = 1; - // The parsed descriptor looks like: - // message MapFieldEntry { - // option map_entry = true; - // optional KeyType key = 1; - // optional ValueType value = 2; - // } - // repeated MapFieldEntry map_field = 1; - // - // Implementations may choose not to generate the map_entry=true message, but - // use a native map in the target language to hold the keys and values. - // The reflection APIs in such implementations still need to work as - // if the field is a repeated message field. - // - // NOTE: Do not set the option in .proto files. Always use the maps syntax - // instead. The option should only be implicitly set by the proto compiler - // parser. - MapEntry *bool `protobuf:"varint,7,opt,name=map_entry,json=mapEntry" json:"map_entry,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageOptions) Reset() { *m = MessageOptions{} } -func (m *MessageOptions) String() string { return proto.CompactTextString(m) } -func (*MessageOptions) ProtoMessage() {} -func (*MessageOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{11} -} - -var extRange_MessageOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*MessageOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_MessageOptions -} - -func (m *MessageOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageOptions.Unmarshal(m, b) -} -func (m *MessageOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageOptions.Marshal(b, m, deterministic) -} -func (m *MessageOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageOptions.Merge(m, src) -} -func (m *MessageOptions) XXX_Size() int { - return xxx_messageInfo_MessageOptions.Size(m) -} -func (m *MessageOptions) XXX_DiscardUnknown() { - xxx_messageInfo_MessageOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageOptions proto.InternalMessageInfo - -const Default_MessageOptions_MessageSetWireFormat bool = false -const Default_MessageOptions_NoStandardDescriptorAccessor bool = false -const Default_MessageOptions_Deprecated bool = false - -func (m *MessageOptions) GetMessageSetWireFormat() bool { - if m != nil && m.MessageSetWireFormat != nil { - return *m.MessageSetWireFormat - } - return Default_MessageOptions_MessageSetWireFormat -} - -func (m *MessageOptions) GetNoStandardDescriptorAccessor() bool { - if m != nil && m.NoStandardDescriptorAccessor != nil { - return *m.NoStandardDescriptorAccessor - } - return Default_MessageOptions_NoStandardDescriptorAccessor -} - -func (m *MessageOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_MessageOptions_Deprecated -} - -func (m *MessageOptions) GetMapEntry() bool { - if m != nil && m.MapEntry != nil { - return *m.MapEntry - } - return false -} - -func (m *MessageOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type FieldOptions struct { - // The ctype option instructs the C++ code generator to use a different - // representation of the field than it normally would. See the specific - // options below. This option is not yet implemented in the open source - // release -- sorry, we'll try to include it in a future version! - Ctype *FieldOptions_CType `protobuf:"varint,1,opt,name=ctype,enum=google.protobuf.FieldOptions_CType,def=0" json:"ctype,omitempty"` - // The packed option can be enabled for repeated primitive fields to enable - // a more efficient representation on the wire. Rather than repeatedly - // writing the tag and type for each element, the entire array is encoded as - // a single length-delimited blob. In proto3, only explicit setting it to - // false will avoid using packed encoding. - Packed *bool `protobuf:"varint,2,opt,name=packed" json:"packed,omitempty"` - // The jstype option determines the JavaScript type used for values of the - // field. The option is permitted only for 64 bit integral and fixed types - // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - // is represented as JavaScript string, which avoids loss of precision that - // can happen when a large value is converted to a floating point JavaScript. - // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - // use the JavaScript "number" type. The behavior of the default option - // JS_NORMAL is implementation dependent. - // - // This option is an enum to permit additional types to be added, e.g. - // goog.math.Integer. - Jstype *FieldOptions_JSType `protobuf:"varint,6,opt,name=jstype,enum=google.protobuf.FieldOptions_JSType,def=0" json:"jstype,omitempty"` - // Should this field be parsed lazily? Lazy applies only to message-type - // fields. It means that when the outer message is initially parsed, the - // inner message's contents will not be parsed but instead stored in encoded - // form. The inner message will actually be parsed when it is first accessed. - // - // This is only a hint. Implementations are free to choose whether to use - // eager or lazy parsing regardless of the value of this option. However, - // setting this option true suggests that the protocol author believes that - // using lazy parsing on this field is worth the additional bookkeeping - // overhead typically needed to implement it. - // - // This option does not affect the public interface of any generated code; - // all method signatures remain the same. Furthermore, thread-safety of the - // interface is not affected by this option; const methods remain safe to - // call from multiple threads concurrently, while non-const methods continue - // to require exclusive access. - // - // - // Note that implementations may choose not to check required fields within - // a lazy sub-message. That is, calling IsInitialized() on the outer message - // may return true even if the inner message has missing required fields. - // This is necessary because otherwise the inner message would have to be - // parsed in order to perform the check, defeating the purpose of lazy - // parsing. An implementation which chooses not to check required fields - // must be consistent about it. That is, for any particular sub-message, the - // implementation must either *always* check its required fields, or *never* - // check its required fields, regardless of whether or not the message has - // been parsed. - Lazy *bool `protobuf:"varint,5,opt,name=lazy,def=0" json:"lazy,omitempty"` - // Is this field deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for accessors, or it will be completely ignored; in the very least, this - // is a formalization for deprecating fields. - Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // For Google-internal migration only. Do not use. - Weak *bool `protobuf:"varint,10,opt,name=weak,def=0" json:"weak,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FieldOptions) Reset() { *m = FieldOptions{} } -func (m *FieldOptions) String() string { return proto.CompactTextString(m) } -func (*FieldOptions) ProtoMessage() {} -func (*FieldOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{12} -} - -var extRange_FieldOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*FieldOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_FieldOptions -} - -func (m *FieldOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FieldOptions.Unmarshal(m, b) -} -func (m *FieldOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FieldOptions.Marshal(b, m, deterministic) -} -func (m *FieldOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldOptions.Merge(m, src) -} -func (m *FieldOptions) XXX_Size() int { - return xxx_messageInfo_FieldOptions.Size(m) -} -func (m *FieldOptions) XXX_DiscardUnknown() { - xxx_messageInfo_FieldOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_FieldOptions proto.InternalMessageInfo - -const Default_FieldOptions_Ctype FieldOptions_CType = FieldOptions_STRING -const Default_FieldOptions_Jstype FieldOptions_JSType = FieldOptions_JS_NORMAL -const Default_FieldOptions_Lazy bool = false -const Default_FieldOptions_Deprecated bool = false -const Default_FieldOptions_Weak bool = false - -func (m *FieldOptions) GetCtype() FieldOptions_CType { - if m != nil && m.Ctype != nil { - return *m.Ctype - } - return Default_FieldOptions_Ctype -} - -func (m *FieldOptions) GetPacked() bool { - if m != nil && m.Packed != nil { - return *m.Packed - } - return false -} - -func (m *FieldOptions) GetJstype() FieldOptions_JSType { - if m != nil && m.Jstype != nil { - return *m.Jstype - } - return Default_FieldOptions_Jstype -} - -func (m *FieldOptions) GetLazy() bool { - if m != nil && m.Lazy != nil { - return *m.Lazy - } - return Default_FieldOptions_Lazy -} - -func (m *FieldOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_FieldOptions_Deprecated -} - -func (m *FieldOptions) GetWeak() bool { - if m != nil && m.Weak != nil { - return *m.Weak - } - return Default_FieldOptions_Weak -} - -func (m *FieldOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type OneofOptions struct { - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OneofOptions) Reset() { *m = OneofOptions{} } -func (m *OneofOptions) String() string { return proto.CompactTextString(m) } -func (*OneofOptions) ProtoMessage() {} -func (*OneofOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{13} -} - -var extRange_OneofOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*OneofOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_OneofOptions -} - -func (m *OneofOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OneofOptions.Unmarshal(m, b) -} -func (m *OneofOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OneofOptions.Marshal(b, m, deterministic) -} -func (m *OneofOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_OneofOptions.Merge(m, src) -} -func (m *OneofOptions) XXX_Size() int { - return xxx_messageInfo_OneofOptions.Size(m) -} -func (m *OneofOptions) XXX_DiscardUnknown() { - xxx_messageInfo_OneofOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_OneofOptions proto.InternalMessageInfo - -func (m *OneofOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type EnumOptions struct { - // Set this option to true to allow mapping different tag names to the same - // value. - AllowAlias *bool `protobuf:"varint,2,opt,name=allow_alias,json=allowAlias" json:"allow_alias,omitempty"` - // Is this enum deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum, or it will be completely ignored; in the very least, this - // is a formalization for deprecating enums. - Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EnumOptions) Reset() { *m = EnumOptions{} } -func (m *EnumOptions) String() string { return proto.CompactTextString(m) } -func (*EnumOptions) ProtoMessage() {} -func (*EnumOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{14} -} - -var extRange_EnumOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*EnumOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_EnumOptions -} - -func (m *EnumOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EnumOptions.Unmarshal(m, b) -} -func (m *EnumOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EnumOptions.Marshal(b, m, deterministic) -} -func (m *EnumOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnumOptions.Merge(m, src) -} -func (m *EnumOptions) XXX_Size() int { - return xxx_messageInfo_EnumOptions.Size(m) -} -func (m *EnumOptions) XXX_DiscardUnknown() { - xxx_messageInfo_EnumOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_EnumOptions proto.InternalMessageInfo - -const Default_EnumOptions_Deprecated bool = false - -func (m *EnumOptions) GetAllowAlias() bool { - if m != nil && m.AllowAlias != nil { - return *m.AllowAlias - } - return false -} - -func (m *EnumOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_EnumOptions_Deprecated -} - -func (m *EnumOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type EnumValueOptions struct { - // Is this enum value deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum value, or it will be completely ignored; in the very least, - // this is a formalization for deprecating enum values. - Deprecated *bool `protobuf:"varint,1,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EnumValueOptions) Reset() { *m = EnumValueOptions{} } -func (m *EnumValueOptions) String() string { return proto.CompactTextString(m) } -func (*EnumValueOptions) ProtoMessage() {} -func (*EnumValueOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{15} -} - -var extRange_EnumValueOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*EnumValueOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_EnumValueOptions -} - -func (m *EnumValueOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EnumValueOptions.Unmarshal(m, b) -} -func (m *EnumValueOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EnumValueOptions.Marshal(b, m, deterministic) -} -func (m *EnumValueOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnumValueOptions.Merge(m, src) -} -func (m *EnumValueOptions) XXX_Size() int { - return xxx_messageInfo_EnumValueOptions.Size(m) -} -func (m *EnumValueOptions) XXX_DiscardUnknown() { - xxx_messageInfo_EnumValueOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_EnumValueOptions proto.InternalMessageInfo - -const Default_EnumValueOptions_Deprecated bool = false - -func (m *EnumValueOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_EnumValueOptions_Deprecated -} - -func (m *EnumValueOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type ServiceOptions struct { - // Is this service deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the service, or it will be completely ignored; in the very least, - // this is a formalization for deprecating services. - Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ServiceOptions) Reset() { *m = ServiceOptions{} } -func (m *ServiceOptions) String() string { return proto.CompactTextString(m) } -func (*ServiceOptions) ProtoMessage() {} -func (*ServiceOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{16} -} - -var extRange_ServiceOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*ServiceOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_ServiceOptions -} - -func (m *ServiceOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ServiceOptions.Unmarshal(m, b) -} -func (m *ServiceOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ServiceOptions.Marshal(b, m, deterministic) -} -func (m *ServiceOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceOptions.Merge(m, src) -} -func (m *ServiceOptions) XXX_Size() int { - return xxx_messageInfo_ServiceOptions.Size(m) -} -func (m *ServiceOptions) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceOptions proto.InternalMessageInfo - -const Default_ServiceOptions_Deprecated bool = false - -func (m *ServiceOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_ServiceOptions_Deprecated -} - -func (m *ServiceOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type MethodOptions struct { - // Is this method deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the method, or it will be completely ignored; in the very least, - // this is a formalization for deprecating methods. - Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - IdempotencyLevel *MethodOptions_IdempotencyLevel `protobuf:"varint,34,opt,name=idempotency_level,json=idempotencyLevel,enum=google.protobuf.MethodOptions_IdempotencyLevel,def=0" json:"idempotency_level,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MethodOptions) Reset() { *m = MethodOptions{} } -func (m *MethodOptions) String() string { return proto.CompactTextString(m) } -func (*MethodOptions) ProtoMessage() {} -func (*MethodOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{17} -} - -var extRange_MethodOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*MethodOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_MethodOptions -} - -func (m *MethodOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MethodOptions.Unmarshal(m, b) -} -func (m *MethodOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MethodOptions.Marshal(b, m, deterministic) -} -func (m *MethodOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_MethodOptions.Merge(m, src) -} -func (m *MethodOptions) XXX_Size() int { - return xxx_messageInfo_MethodOptions.Size(m) -} -func (m *MethodOptions) XXX_DiscardUnknown() { - xxx_messageInfo_MethodOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_MethodOptions proto.InternalMessageInfo - -const Default_MethodOptions_Deprecated bool = false -const Default_MethodOptions_IdempotencyLevel MethodOptions_IdempotencyLevel = MethodOptions_IDEMPOTENCY_UNKNOWN - -func (m *MethodOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_MethodOptions_Deprecated -} - -func (m *MethodOptions) GetIdempotencyLevel() MethodOptions_IdempotencyLevel { - if m != nil && m.IdempotencyLevel != nil { - return *m.IdempotencyLevel - } - return Default_MethodOptions_IdempotencyLevel -} - -func (m *MethodOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -// A message representing a option the parser does not recognize. This only -// appears in options protos created by the compiler::Parser class. -// DescriptorPool resolves these when building Descriptor objects. Therefore, -// options protos in descriptor objects (e.g. returned by Descriptor::options(), -// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions -// in them. -type UninterpretedOption struct { - Name []*UninterpretedOption_NamePart `protobuf:"bytes,2,rep,name=name" json:"name,omitempty"` - // The value of the uninterpreted option, in whatever type the tokenizer - // identified it as during parsing. Exactly one of these should be set. - IdentifierValue *string `protobuf:"bytes,3,opt,name=identifier_value,json=identifierValue" json:"identifier_value,omitempty"` - PositiveIntValue *uint64 `protobuf:"varint,4,opt,name=positive_int_value,json=positiveIntValue" json:"positive_int_value,omitempty"` - NegativeIntValue *int64 `protobuf:"varint,5,opt,name=negative_int_value,json=negativeIntValue" json:"negative_int_value,omitempty"` - DoubleValue *float64 `protobuf:"fixed64,6,opt,name=double_value,json=doubleValue" json:"double_value,omitempty"` - StringValue []byte `protobuf:"bytes,7,opt,name=string_value,json=stringValue" json:"string_value,omitempty"` - AggregateValue *string `protobuf:"bytes,8,opt,name=aggregate_value,json=aggregateValue" json:"aggregate_value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UninterpretedOption) Reset() { *m = UninterpretedOption{} } -func (m *UninterpretedOption) String() string { return proto.CompactTextString(m) } -func (*UninterpretedOption) ProtoMessage() {} -func (*UninterpretedOption) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{18} -} -func (m *UninterpretedOption) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UninterpretedOption.Unmarshal(m, b) -} -func (m *UninterpretedOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UninterpretedOption.Marshal(b, m, deterministic) -} -func (m *UninterpretedOption) XXX_Merge(src proto.Message) { - xxx_messageInfo_UninterpretedOption.Merge(m, src) -} -func (m *UninterpretedOption) XXX_Size() int { - return xxx_messageInfo_UninterpretedOption.Size(m) -} -func (m *UninterpretedOption) XXX_DiscardUnknown() { - xxx_messageInfo_UninterpretedOption.DiscardUnknown(m) -} - -var xxx_messageInfo_UninterpretedOption proto.InternalMessageInfo - -func (m *UninterpretedOption) GetName() []*UninterpretedOption_NamePart { - if m != nil { - return m.Name - } - return nil -} - -func (m *UninterpretedOption) GetIdentifierValue() string { - if m != nil && m.IdentifierValue != nil { - return *m.IdentifierValue - } - return "" -} - -func (m *UninterpretedOption) GetPositiveIntValue() uint64 { - if m != nil && m.PositiveIntValue != nil { - return *m.PositiveIntValue - } - return 0 -} - -func (m *UninterpretedOption) GetNegativeIntValue() int64 { - if m != nil && m.NegativeIntValue != nil { - return *m.NegativeIntValue - } - return 0 -} - -func (m *UninterpretedOption) GetDoubleValue() float64 { - if m != nil && m.DoubleValue != nil { - return *m.DoubleValue - } - return 0 -} - -func (m *UninterpretedOption) GetStringValue() []byte { - if m != nil { - return m.StringValue - } - return nil -} - -func (m *UninterpretedOption) GetAggregateValue() string { - if m != nil && m.AggregateValue != nil { - return *m.AggregateValue - } - return "" -} - -// The name of the uninterpreted option. Each string represents a segment in -// a dot-separated name. is_extension is true iff a segment represents an -// extension (denoted with parentheses in options specs in .proto files). -// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents -// "foo.(bar.baz).qux". -type UninterpretedOption_NamePart struct { - NamePart *string `protobuf:"bytes,1,req,name=name_part,json=namePart" json:"name_part,omitempty"` - IsExtension *bool `protobuf:"varint,2,req,name=is_extension,json=isExtension" json:"is_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UninterpretedOption_NamePart) Reset() { *m = UninterpretedOption_NamePart{} } -func (m *UninterpretedOption_NamePart) String() string { return proto.CompactTextString(m) } -func (*UninterpretedOption_NamePart) ProtoMessage() {} -func (*UninterpretedOption_NamePart) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{18, 0} -} -func (m *UninterpretedOption_NamePart) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UninterpretedOption_NamePart.Unmarshal(m, b) -} -func (m *UninterpretedOption_NamePart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UninterpretedOption_NamePart.Marshal(b, m, deterministic) -} -func (m *UninterpretedOption_NamePart) XXX_Merge(src proto.Message) { - xxx_messageInfo_UninterpretedOption_NamePart.Merge(m, src) -} -func (m *UninterpretedOption_NamePart) XXX_Size() int { - return xxx_messageInfo_UninterpretedOption_NamePart.Size(m) -} -func (m *UninterpretedOption_NamePart) XXX_DiscardUnknown() { - xxx_messageInfo_UninterpretedOption_NamePart.DiscardUnknown(m) -} - -var xxx_messageInfo_UninterpretedOption_NamePart proto.InternalMessageInfo - -func (m *UninterpretedOption_NamePart) GetNamePart() string { - if m != nil && m.NamePart != nil { - return *m.NamePart - } - return "" -} - -func (m *UninterpretedOption_NamePart) GetIsExtension() bool { - if m != nil && m.IsExtension != nil { - return *m.IsExtension - } - return false -} - -// Encapsulates information about the original source file from which a -// FileDescriptorProto was generated. -type SourceCodeInfo struct { - // A Location identifies a piece of source code in a .proto file which - // corresponds to a particular definition. This information is intended - // to be useful to IDEs, code indexers, documentation generators, and similar - // tools. - // - // For example, say we have a file like: - // message Foo { - // optional string foo = 1; - // } - // Let's look at just the field definition: - // optional string foo = 1; - // ^ ^^ ^^ ^ ^^^ - // a bc de f ghi - // We have the following locations: - // span path represents - // [a,i) [ 4, 0, 2, 0 ] The whole field definition. - // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - // - // Notes: - // - A location may refer to a repeated field itself (i.e. not to any - // particular index within it). This is used whenever a set of elements are - // logically enclosed in a single code segment. For example, an entire - // extend block (possibly containing multiple extension definitions) will - // have an outer location whose path refers to the "extensions" repeated - // field without an index. - // - Multiple locations may have the same path. This happens when a single - // logical declaration is spread out across multiple places. The most - // obvious example is the "extend" block again -- there may be multiple - // extend blocks in the same scope, each of which will have the same path. - // - A location's span is not always a subset of its parent's span. For - // example, the "extendee" of an extension declaration appears at the - // beginning of the "extend" block and is shared by all extensions within - // the block. - // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendant. For example, a "group" defines - // both a type and a field in a single declaration. Thus, the locations - // corresponding to the type and field and their components will overlap. - // - Code which tries to interpret locations should probably be designed to - // ignore those that it doesn't understand, as more types of locations could - // be recorded in the future. - Location []*SourceCodeInfo_Location `protobuf:"bytes,1,rep,name=location" json:"location,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SourceCodeInfo) Reset() { *m = SourceCodeInfo{} } -func (m *SourceCodeInfo) String() string { return proto.CompactTextString(m) } -func (*SourceCodeInfo) ProtoMessage() {} -func (*SourceCodeInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{19} -} -func (m *SourceCodeInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SourceCodeInfo.Unmarshal(m, b) -} -func (m *SourceCodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SourceCodeInfo.Marshal(b, m, deterministic) -} -func (m *SourceCodeInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_SourceCodeInfo.Merge(m, src) -} -func (m *SourceCodeInfo) XXX_Size() int { - return xxx_messageInfo_SourceCodeInfo.Size(m) -} -func (m *SourceCodeInfo) XXX_DiscardUnknown() { - xxx_messageInfo_SourceCodeInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_SourceCodeInfo proto.InternalMessageInfo - -func (m *SourceCodeInfo) GetLocation() []*SourceCodeInfo_Location { - if m != nil { - return m.Location - } - return nil -} - -type SourceCodeInfo_Location struct { - // Identifies which part of the FileDescriptorProto was defined at this - // location. - // - // Each element is a field number or an index. They form a path from - // the root FileDescriptorProto to the place where the definition. For - // example, this path: - // [ 4, 3, 2, 7, 1 ] - // refers to: - // file.message_type(3) // 4, 3 - // .field(7) // 2, 7 - // .name() // 1 - // This is because FileDescriptorProto.message_type has field number 4: - // repeated DescriptorProto message_type = 4; - // and DescriptorProto.field has field number 2: - // repeated FieldDescriptorProto field = 2; - // and FieldDescriptorProto.name has field number 1: - // optional string name = 1; - // - // Thus, the above path gives the location of a field name. If we removed - // the last element: - // [ 4, 3, 2, 7 ] - // this path refers to the whole field declaration (from the beginning - // of the label to the terminating semicolon). - Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"` - // Always has exactly three or four elements: start line, start column, - // end line (optional, otherwise assumed same as start line), end column. - // These are packed into a single field for efficiency. Note that line - // and column numbers are zero-based -- typically you will want to add - // 1 to each before displaying to a user. - Span []int32 `protobuf:"varint,2,rep,packed,name=span" json:"span,omitempty"` - // If this SourceCodeInfo represents a complete declaration, these are any - // comments appearing before and after the declaration which appear to be - // attached to the declaration. - // - // A series of line comments appearing on consecutive lines, with no other - // tokens appearing on those lines, will be treated as a single comment. - // - // leading_detached_comments will keep paragraphs of comments that appear - // before (but not connected to) the current element. Each paragraph, - // separated by empty lines, will be one comment element in the repeated - // field. - // - // Only the comment content is provided; comment markers (e.g. //) are - // stripped out. For block comments, leading whitespace and an asterisk - // will be stripped from the beginning of each line other than the first. - // Newlines are included in the output. - // - // Examples: - // - // optional int32 foo = 1; // Comment attached to foo. - // // Comment attached to bar. - // optional int32 bar = 2; - // - // optional string baz = 3; - // // Comment attached to baz. - // // Another line attached to baz. - // - // // Comment attached to qux. - // // - // // Another line attached to qux. - // optional double qux = 4; - // - // // Detached comment for corge. This is not leading or trailing comments - // // to qux or corge because there are blank lines separating it from - // // both. - // - // // Detached comment for corge paragraph 2. - // - // optional string corge = 5; - // /* Block comment attached - // * to corge. Leading asterisks - // * will be removed. */ - // /* Block comment attached to - // * grault. */ - // optional int32 grault = 6; - // - // // ignored detached comments. - LeadingComments *string `protobuf:"bytes,3,opt,name=leading_comments,json=leadingComments" json:"leading_comments,omitempty"` - TrailingComments *string `protobuf:"bytes,4,opt,name=trailing_comments,json=trailingComments" json:"trailing_comments,omitempty"` - LeadingDetachedComments []string `protobuf:"bytes,6,rep,name=leading_detached_comments,json=leadingDetachedComments" json:"leading_detached_comments,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SourceCodeInfo_Location) Reset() { *m = SourceCodeInfo_Location{} } -func (m *SourceCodeInfo_Location) String() string { return proto.CompactTextString(m) } -func (*SourceCodeInfo_Location) ProtoMessage() {} -func (*SourceCodeInfo_Location) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{19, 0} -} -func (m *SourceCodeInfo_Location) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SourceCodeInfo_Location.Unmarshal(m, b) -} -func (m *SourceCodeInfo_Location) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SourceCodeInfo_Location.Marshal(b, m, deterministic) -} -func (m *SourceCodeInfo_Location) XXX_Merge(src proto.Message) { - xxx_messageInfo_SourceCodeInfo_Location.Merge(m, src) -} -func (m *SourceCodeInfo_Location) XXX_Size() int { - return xxx_messageInfo_SourceCodeInfo_Location.Size(m) -} -func (m *SourceCodeInfo_Location) XXX_DiscardUnknown() { - xxx_messageInfo_SourceCodeInfo_Location.DiscardUnknown(m) -} - -var xxx_messageInfo_SourceCodeInfo_Location proto.InternalMessageInfo - -func (m *SourceCodeInfo_Location) GetPath() []int32 { - if m != nil { - return m.Path - } - return nil -} - -func (m *SourceCodeInfo_Location) GetSpan() []int32 { - if m != nil { - return m.Span - } - return nil -} - -func (m *SourceCodeInfo_Location) GetLeadingComments() string { - if m != nil && m.LeadingComments != nil { - return *m.LeadingComments - } - return "" -} - -func (m *SourceCodeInfo_Location) GetTrailingComments() string { - if m != nil && m.TrailingComments != nil { - return *m.TrailingComments - } - return "" -} - -func (m *SourceCodeInfo_Location) GetLeadingDetachedComments() []string { - if m != nil { - return m.LeadingDetachedComments - } - return nil -} - -// Describes the relationship between generated code and its original source -// file. A GeneratedCodeInfo message is associated with only one generated -// source file, but may contain references to different source .proto files. -type GeneratedCodeInfo struct { - // An Annotation connects some span of text in generated code to an element - // of its generating .proto file. - Annotation []*GeneratedCodeInfo_Annotation `protobuf:"bytes,1,rep,name=annotation" json:"annotation,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GeneratedCodeInfo) Reset() { *m = GeneratedCodeInfo{} } -func (m *GeneratedCodeInfo) String() string { return proto.CompactTextString(m) } -func (*GeneratedCodeInfo) ProtoMessage() {} -func (*GeneratedCodeInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{20} -} -func (m *GeneratedCodeInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GeneratedCodeInfo.Unmarshal(m, b) -} -func (m *GeneratedCodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GeneratedCodeInfo.Marshal(b, m, deterministic) -} -func (m *GeneratedCodeInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_GeneratedCodeInfo.Merge(m, src) -} -func (m *GeneratedCodeInfo) XXX_Size() int { - return xxx_messageInfo_GeneratedCodeInfo.Size(m) -} -func (m *GeneratedCodeInfo) XXX_DiscardUnknown() { - xxx_messageInfo_GeneratedCodeInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_GeneratedCodeInfo proto.InternalMessageInfo - -func (m *GeneratedCodeInfo) GetAnnotation() []*GeneratedCodeInfo_Annotation { - if m != nil { - return m.Annotation - } - return nil -} - -type GeneratedCodeInfo_Annotation struct { - // Identifies the element in the original source .proto file. This field - // is formatted the same as SourceCodeInfo.Location.path. - Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"` - // Identifies the filesystem path to the original source .proto. - SourceFile *string `protobuf:"bytes,2,opt,name=source_file,json=sourceFile" json:"source_file,omitempty"` - // Identifies the starting offset in bytes in the generated code - // that relates to the identified object. - Begin *int32 `protobuf:"varint,3,opt,name=begin" json:"begin,omitempty"` - // Identifies the ending offset in bytes in the generated code that - // relates to the identified offset. The end offset should be one past - // the last relevant byte (so the length of the text = end - begin). - End *int32 `protobuf:"varint,4,opt,name=end" json:"end,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GeneratedCodeInfo_Annotation) Reset() { *m = GeneratedCodeInfo_Annotation{} } -func (m *GeneratedCodeInfo_Annotation) String() string { return proto.CompactTextString(m) } -func (*GeneratedCodeInfo_Annotation) ProtoMessage() {} -func (*GeneratedCodeInfo_Annotation) Descriptor() ([]byte, []int) { - return fileDescriptor_308767df5ffe18af, []int{20, 0} -} -func (m *GeneratedCodeInfo_Annotation) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GeneratedCodeInfo_Annotation.Unmarshal(m, b) -} -func (m *GeneratedCodeInfo_Annotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GeneratedCodeInfo_Annotation.Marshal(b, m, deterministic) -} -func (m *GeneratedCodeInfo_Annotation) XXX_Merge(src proto.Message) { - xxx_messageInfo_GeneratedCodeInfo_Annotation.Merge(m, src) -} -func (m *GeneratedCodeInfo_Annotation) XXX_Size() int { - return xxx_messageInfo_GeneratedCodeInfo_Annotation.Size(m) -} -func (m *GeneratedCodeInfo_Annotation) XXX_DiscardUnknown() { - xxx_messageInfo_GeneratedCodeInfo_Annotation.DiscardUnknown(m) -} - -var xxx_messageInfo_GeneratedCodeInfo_Annotation proto.InternalMessageInfo - -func (m *GeneratedCodeInfo_Annotation) GetPath() []int32 { - if m != nil { - return m.Path - } - return nil -} - -func (m *GeneratedCodeInfo_Annotation) GetSourceFile() string { - if m != nil && m.SourceFile != nil { - return *m.SourceFile - } - return "" -} - -func (m *GeneratedCodeInfo_Annotation) GetBegin() int32 { - if m != nil && m.Begin != nil { - return *m.Begin - } - return 0 -} - -func (m *GeneratedCodeInfo_Annotation) GetEnd() int32 { - if m != nil && m.End != nil { - return *m.End - } - return 0 -} - -func init() { - proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Type", FieldDescriptorProto_Type_name, FieldDescriptorProto_Type_value) - proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Label", FieldDescriptorProto_Label_name, FieldDescriptorProto_Label_value) - proto.RegisterEnum("google.protobuf.FileOptions_OptimizeMode", FileOptions_OptimizeMode_name, FileOptions_OptimizeMode_value) - proto.RegisterEnum("google.protobuf.FieldOptions_CType", FieldOptions_CType_name, FieldOptions_CType_value) - proto.RegisterEnum("google.protobuf.FieldOptions_JSType", FieldOptions_JSType_name, FieldOptions_JSType_value) - proto.RegisterEnum("google.protobuf.MethodOptions_IdempotencyLevel", MethodOptions_IdempotencyLevel_name, MethodOptions_IdempotencyLevel_value) - proto.RegisterType((*FileDescriptorSet)(nil), "google.protobuf.FileDescriptorSet") - proto.RegisterType((*FileDescriptorProto)(nil), "google.protobuf.FileDescriptorProto") - proto.RegisterType((*DescriptorProto)(nil), "google.protobuf.DescriptorProto") - proto.RegisterType((*DescriptorProto_ExtensionRange)(nil), "google.protobuf.DescriptorProto.ExtensionRange") - proto.RegisterType((*DescriptorProto_ReservedRange)(nil), "google.protobuf.DescriptorProto.ReservedRange") - proto.RegisterType((*ExtensionRangeOptions)(nil), "google.protobuf.ExtensionRangeOptions") - proto.RegisterType((*FieldDescriptorProto)(nil), "google.protobuf.FieldDescriptorProto") - proto.RegisterType((*OneofDescriptorProto)(nil), "google.protobuf.OneofDescriptorProto") - proto.RegisterType((*EnumDescriptorProto)(nil), "google.protobuf.EnumDescriptorProto") - proto.RegisterType((*EnumDescriptorProto_EnumReservedRange)(nil), "google.protobuf.EnumDescriptorProto.EnumReservedRange") - proto.RegisterType((*EnumValueDescriptorProto)(nil), "google.protobuf.EnumValueDescriptorProto") - proto.RegisterType((*ServiceDescriptorProto)(nil), "google.protobuf.ServiceDescriptorProto") - proto.RegisterType((*MethodDescriptorProto)(nil), "google.protobuf.MethodDescriptorProto") - proto.RegisterType((*FileOptions)(nil), "google.protobuf.FileOptions") - proto.RegisterType((*MessageOptions)(nil), "google.protobuf.MessageOptions") - proto.RegisterType((*FieldOptions)(nil), "google.protobuf.FieldOptions") - proto.RegisterType((*OneofOptions)(nil), "google.protobuf.OneofOptions") - proto.RegisterType((*EnumOptions)(nil), "google.protobuf.EnumOptions") - proto.RegisterType((*EnumValueOptions)(nil), "google.protobuf.EnumValueOptions") - proto.RegisterType((*ServiceOptions)(nil), "google.protobuf.ServiceOptions") - proto.RegisterType((*MethodOptions)(nil), "google.protobuf.MethodOptions") - proto.RegisterType((*UninterpretedOption)(nil), "google.protobuf.UninterpretedOption") - proto.RegisterType((*UninterpretedOption_NamePart)(nil), "google.protobuf.UninterpretedOption.NamePart") - proto.RegisterType((*SourceCodeInfo)(nil), "google.protobuf.SourceCodeInfo") - proto.RegisterType((*SourceCodeInfo_Location)(nil), "google.protobuf.SourceCodeInfo.Location") - proto.RegisterType((*GeneratedCodeInfo)(nil), "google.protobuf.GeneratedCodeInfo") - proto.RegisterType((*GeneratedCodeInfo_Annotation)(nil), "google.protobuf.GeneratedCodeInfo.Annotation") -} - -func init() { proto.RegisterFile("descriptor.proto", fileDescriptor_308767df5ffe18af) } - -var fileDescriptor_308767df5ffe18af = []byte{ - // 2522 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xcd, 0x6f, 0xdb, 0xc8, - 0x15, 0x5f, 0x7d, 0x5a, 0x7a, 0x92, 0x65, 0x7a, 0xec, 0x75, 0x18, 0xef, 0x47, 0x1c, 0xed, 0x66, - 0xe3, 0x24, 0xbb, 0xca, 0xc2, 0x49, 0x9c, 0xac, 0x53, 0x6c, 0x2b, 0x4b, 0x8c, 0x57, 0xa9, 0xbe, - 0x4a, 0xc9, 0xdd, 0x64, 0x8b, 0x82, 0x18, 0x93, 0x23, 0x89, 0x09, 0x45, 0x72, 0x49, 0x2a, 0x89, - 0x83, 0x1e, 0x02, 0xf4, 0x54, 0xa0, 0x7f, 0x40, 0x51, 0x14, 0x3d, 0xf4, 0xb2, 0x40, 0xff, 0x80, - 0x02, 0xed, 0xbd, 0xd7, 0x02, 0xbd, 0xf7, 0x50, 0xa0, 0x05, 0xda, 0x3f, 0xa1, 0xc7, 0x62, 0x66, - 0x48, 0x8a, 0xd4, 0x47, 0xe2, 0x5d, 0x20, 0xd9, 0x93, 0x3d, 0xef, 0xfd, 0xde, 0x9b, 0x37, 0x8f, - 0xbf, 0x79, 0xf3, 0x66, 0x04, 0x82, 0x46, 0x5c, 0xd5, 0xd1, 0x6d, 0xcf, 0x72, 0x2a, 0xb6, 0x63, - 0x79, 0x16, 0x5a, 0x1b, 0x5a, 0xd6, 0xd0, 0x20, 0x7c, 0x74, 0x32, 0x19, 0x94, 0x5b, 0xb0, 0x7e, - 0x4f, 0x37, 0x48, 0x3d, 0x04, 0xf6, 0x88, 0x87, 0xee, 0x40, 0x7a, 0xa0, 0x1b, 0x44, 0x4c, 0xec, - 0xa4, 0x76, 0x0b, 0x7b, 0x1f, 0x56, 0x66, 0x8c, 0x2a, 0x71, 0x8b, 0x2e, 0x15, 0xcb, 0xcc, 0xa2, - 0xfc, 0xef, 0x34, 0x6c, 0x2c, 0xd0, 0x22, 0x04, 0x69, 0x13, 0x8f, 0xa9, 0xc7, 0xc4, 0x6e, 0x5e, - 0x66, 0xff, 0x23, 0x11, 0x56, 0x6c, 0xac, 0x3e, 0xc6, 0x43, 0x22, 0x26, 0x99, 0x38, 0x18, 0xa2, - 0xf7, 0x01, 0x34, 0x62, 0x13, 0x53, 0x23, 0xa6, 0x7a, 0x2a, 0xa6, 0x76, 0x52, 0xbb, 0x79, 0x39, - 0x22, 0x41, 0xd7, 0x60, 0xdd, 0x9e, 0x9c, 0x18, 0xba, 0xaa, 0x44, 0x60, 0xb0, 0x93, 0xda, 0xcd, - 0xc8, 0x02, 0x57, 0xd4, 0xa7, 0xe0, 0xcb, 0xb0, 0xf6, 0x94, 0xe0, 0xc7, 0x51, 0x68, 0x81, 0x41, - 0x4b, 0x54, 0x1c, 0x01, 0xd6, 0xa0, 0x38, 0x26, 0xae, 0x8b, 0x87, 0x44, 0xf1, 0x4e, 0x6d, 0x22, - 0xa6, 0xd9, 0xea, 0x77, 0xe6, 0x56, 0x3f, 0xbb, 0xf2, 0x82, 0x6f, 0xd5, 0x3f, 0xb5, 0x09, 0xaa, - 0x42, 0x9e, 0x98, 0x93, 0x31, 0xf7, 0x90, 0x59, 0x92, 0x3f, 0xc9, 0x9c, 0x8c, 0x67, 0xbd, 0xe4, - 0xa8, 0x99, 0xef, 0x62, 0xc5, 0x25, 0xce, 0x13, 0x5d, 0x25, 0x62, 0x96, 0x39, 0xb8, 0x3c, 0xe7, - 0xa0, 0xc7, 0xf5, 0xb3, 0x3e, 0x02, 0x3b, 0x54, 0x83, 0x3c, 0x79, 0xe6, 0x11, 0xd3, 0xd5, 0x2d, - 0x53, 0x5c, 0x61, 0x4e, 0x2e, 0x2d, 0xf8, 0x8a, 0xc4, 0xd0, 0x66, 0x5d, 0x4c, 0xed, 0xd0, 0x3e, - 0xac, 0x58, 0xb6, 0xa7, 0x5b, 0xa6, 0x2b, 0xe6, 0x76, 0x12, 0xbb, 0x85, 0xbd, 0x77, 0x17, 0x12, - 0xa1, 0xc3, 0x31, 0x72, 0x00, 0x46, 0x0d, 0x10, 0x5c, 0x6b, 0xe2, 0xa8, 0x44, 0x51, 0x2d, 0x8d, - 0x28, 0xba, 0x39, 0xb0, 0xc4, 0x3c, 0x73, 0x70, 0x61, 0x7e, 0x21, 0x0c, 0x58, 0xb3, 0x34, 0xd2, - 0x30, 0x07, 0x96, 0x5c, 0x72, 0x63, 0x63, 0xb4, 0x05, 0x59, 0xf7, 0xd4, 0xf4, 0xf0, 0x33, 0xb1, - 0xc8, 0x18, 0xe2, 0x8f, 0xca, 0x7f, 0xce, 0xc2, 0xda, 0x59, 0x28, 0x76, 0x17, 0x32, 0x03, 0xba, - 0x4a, 0x31, 0xf9, 0x6d, 0x72, 0xc0, 0x6d, 0xe2, 0x49, 0xcc, 0x7e, 0xc7, 0x24, 0x56, 0xa1, 0x60, - 0x12, 0xd7, 0x23, 0x1a, 0x67, 0x44, 0xea, 0x8c, 0x9c, 0x02, 0x6e, 0x34, 0x4f, 0xa9, 0xf4, 0x77, - 0xa2, 0xd4, 0x03, 0x58, 0x0b, 0x43, 0x52, 0x1c, 0x6c, 0x0e, 0x03, 0x6e, 0x5e, 0x7f, 0x55, 0x24, - 0x15, 0x29, 0xb0, 0x93, 0xa9, 0x99, 0x5c, 0x22, 0xb1, 0x31, 0xaa, 0x03, 0x58, 0x26, 0xb1, 0x06, - 0x8a, 0x46, 0x54, 0x43, 0xcc, 0x2d, 0xc9, 0x52, 0x87, 0x42, 0xe6, 0xb2, 0x64, 0x71, 0xa9, 0x6a, - 0xa0, 0xcf, 0xa6, 0x54, 0x5b, 0x59, 0xc2, 0x94, 0x16, 0xdf, 0x64, 0x73, 0x6c, 0x3b, 0x86, 0x92, - 0x43, 0x28, 0xef, 0x89, 0xe6, 0xaf, 0x2c, 0xcf, 0x82, 0xa8, 0xbc, 0x72, 0x65, 0xb2, 0x6f, 0xc6, - 0x17, 0xb6, 0xea, 0x44, 0x87, 0xe8, 0x03, 0x08, 0x05, 0x0a, 0xa3, 0x15, 0xb0, 0x2a, 0x54, 0x0c, - 0x84, 0x6d, 0x3c, 0x26, 0xdb, 0xcf, 0xa1, 0x14, 0x4f, 0x0f, 0xda, 0x84, 0x8c, 0xeb, 0x61, 0xc7, - 0x63, 0x2c, 0xcc, 0xc8, 0x7c, 0x80, 0x04, 0x48, 0x11, 0x53, 0x63, 0x55, 0x2e, 0x23, 0xd3, 0x7f, - 0xd1, 0x8f, 0xa6, 0x0b, 0x4e, 0xb1, 0x05, 0x7f, 0x34, 0xff, 0x45, 0x63, 0x9e, 0x67, 0xd7, 0xbd, - 0x7d, 0x1b, 0x56, 0x63, 0x0b, 0x38, 0xeb, 0xd4, 0xe5, 0x5f, 0xc0, 0xdb, 0x0b, 0x5d, 0xa3, 0x07, - 0xb0, 0x39, 0x31, 0x75, 0xd3, 0x23, 0x8e, 0xed, 0x10, 0xca, 0x58, 0x3e, 0x95, 0xf8, 0x9f, 0x95, - 0x25, 0x9c, 0x3b, 0x8e, 0xa2, 0xb9, 0x17, 0x79, 0x63, 0x32, 0x2f, 0xbc, 0x9a, 0xcf, 0xfd, 0x77, - 0x45, 0x78, 0xf1, 0xe2, 0xc5, 0x8b, 0x64, 0xf9, 0x37, 0x59, 0xd8, 0x5c, 0xb4, 0x67, 0x16, 0x6e, - 0xdf, 0x2d, 0xc8, 0x9a, 0x93, 0xf1, 0x09, 0x71, 0x58, 0x92, 0x32, 0xb2, 0x3f, 0x42, 0x55, 0xc8, - 0x18, 0xf8, 0x84, 0x18, 0x62, 0x7a, 0x27, 0xb1, 0x5b, 0xda, 0xbb, 0x76, 0xa6, 0x5d, 0x59, 0x69, - 0x52, 0x13, 0x99, 0x5b, 0xa2, 0xcf, 0x21, 0xed, 0x97, 0x68, 0xea, 0xe1, 0xea, 0xd9, 0x3c, 0xd0, - 0xbd, 0x24, 0x33, 0x3b, 0xf4, 0x0e, 0xe4, 0xe9, 0x5f, 0xce, 0x8d, 0x2c, 0x8b, 0x39, 0x47, 0x05, - 0x94, 0x17, 0x68, 0x1b, 0x72, 0x6c, 0x9b, 0x68, 0x24, 0x38, 0xda, 0xc2, 0x31, 0x25, 0x96, 0x46, - 0x06, 0x78, 0x62, 0x78, 0xca, 0x13, 0x6c, 0x4c, 0x08, 0x23, 0x7c, 0x5e, 0x2e, 0xfa, 0xc2, 0x9f, - 0x52, 0x19, 0xba, 0x00, 0x05, 0xbe, 0xab, 0x74, 0x53, 0x23, 0xcf, 0x58, 0xf5, 0xcc, 0xc8, 0x7c, - 0xa3, 0x35, 0xa8, 0x84, 0x4e, 0xff, 0xc8, 0xb5, 0xcc, 0x80, 0x9a, 0x6c, 0x0a, 0x2a, 0x60, 0xd3, - 0xdf, 0x9e, 0x2d, 0xdc, 0xef, 0x2d, 0x5e, 0xde, 0x2c, 0xa7, 0xca, 0x7f, 0x4a, 0x42, 0x9a, 0xd5, - 0x8b, 0x35, 0x28, 0xf4, 0x1f, 0x76, 0x25, 0xa5, 0xde, 0x39, 0x3e, 0x6c, 0x4a, 0x42, 0x02, 0x95, - 0x00, 0x98, 0xe0, 0x5e, 0xb3, 0x53, 0xed, 0x0b, 0xc9, 0x70, 0xdc, 0x68, 0xf7, 0xf7, 0x6f, 0x0a, - 0xa9, 0xd0, 0xe0, 0x98, 0x0b, 0xd2, 0x51, 0xc0, 0x8d, 0x3d, 0x21, 0x83, 0x04, 0x28, 0x72, 0x07, - 0x8d, 0x07, 0x52, 0x7d, 0xff, 0xa6, 0x90, 0x8d, 0x4b, 0x6e, 0xec, 0x09, 0x2b, 0x68, 0x15, 0xf2, - 0x4c, 0x72, 0xd8, 0xe9, 0x34, 0x85, 0x5c, 0xe8, 0xb3, 0xd7, 0x97, 0x1b, 0xed, 0x23, 0x21, 0x1f, - 0xfa, 0x3c, 0x92, 0x3b, 0xc7, 0x5d, 0x01, 0x42, 0x0f, 0x2d, 0xa9, 0xd7, 0xab, 0x1e, 0x49, 0x42, - 0x21, 0x44, 0x1c, 0x3e, 0xec, 0x4b, 0x3d, 0xa1, 0x18, 0x0b, 0xeb, 0xc6, 0x9e, 0xb0, 0x1a, 0x4e, - 0x21, 0xb5, 0x8f, 0x5b, 0x42, 0x09, 0xad, 0xc3, 0x2a, 0x9f, 0x22, 0x08, 0x62, 0x6d, 0x46, 0xb4, - 0x7f, 0x53, 0x10, 0xa6, 0x81, 0x70, 0x2f, 0xeb, 0x31, 0xc1, 0xfe, 0x4d, 0x01, 0x95, 0x6b, 0x90, - 0x61, 0xec, 0x42, 0x08, 0x4a, 0xcd, 0xea, 0xa1, 0xd4, 0x54, 0x3a, 0xdd, 0x7e, 0xa3, 0xd3, 0xae, - 0x36, 0x85, 0xc4, 0x54, 0x26, 0x4b, 0x3f, 0x39, 0x6e, 0xc8, 0x52, 0x5d, 0x48, 0x46, 0x65, 0x5d, - 0xa9, 0xda, 0x97, 0xea, 0x42, 0xaa, 0xac, 0xc2, 0xe6, 0xa2, 0x3a, 0xb9, 0x70, 0x67, 0x44, 0x3e, - 0x71, 0x72, 0xc9, 0x27, 0x66, 0xbe, 0xe6, 0x3e, 0xf1, 0xbf, 0x92, 0xb0, 0xb1, 0xe0, 0xac, 0x58, - 0x38, 0xc9, 0x0f, 0x21, 0xc3, 0x29, 0xca, 0x4f, 0xcf, 0x2b, 0x0b, 0x0f, 0x1d, 0x46, 0xd8, 0xb9, - 0x13, 0x94, 0xd9, 0x45, 0x3b, 0x88, 0xd4, 0x92, 0x0e, 0x82, 0xba, 0x98, 0xab, 0xe9, 0x3f, 0x9f, - 0xab, 0xe9, 0xfc, 0xd8, 0xdb, 0x3f, 0xcb, 0xb1, 0xc7, 0x64, 0xdf, 0xae, 0xb6, 0x67, 0x16, 0xd4, - 0xf6, 0xbb, 0xb0, 0x3e, 0xe7, 0xe8, 0xcc, 0x35, 0xf6, 0x97, 0x09, 0x10, 0x97, 0x25, 0xe7, 0x15, - 0x95, 0x2e, 0x19, 0xab, 0x74, 0x77, 0x67, 0x33, 0x78, 0x71, 0xf9, 0x47, 0x98, 0xfb, 0xd6, 0xdf, - 0x24, 0x60, 0x6b, 0x71, 0xa7, 0xb8, 0x30, 0x86, 0xcf, 0x21, 0x3b, 0x26, 0xde, 0xc8, 0x0a, 0xba, - 0xa5, 0x8f, 0x16, 0x9c, 0xc1, 0x54, 0x3d, 0xfb, 0xb1, 0x7d, 0xab, 0xe8, 0x21, 0x9e, 0x5a, 0xd6, - 0xee, 0xf1, 0x68, 0xe6, 0x22, 0xfd, 0x55, 0x12, 0xde, 0x5e, 0xe8, 0x7c, 0x61, 0xa0, 0xef, 0x01, - 0xe8, 0xa6, 0x3d, 0xf1, 0x78, 0x47, 0xc4, 0x0b, 0x6c, 0x9e, 0x49, 0x58, 0xf1, 0xa2, 0xc5, 0x73, - 0xe2, 0x85, 0xfa, 0x14, 0xd3, 0x03, 0x17, 0x31, 0xc0, 0x9d, 0x69, 0xa0, 0x69, 0x16, 0xe8, 0xfb, - 0x4b, 0x56, 0x3a, 0x47, 0xcc, 0x4f, 0x41, 0x50, 0x0d, 0x9d, 0x98, 0x9e, 0xe2, 0x7a, 0x0e, 0xc1, - 0x63, 0xdd, 0x1c, 0xb2, 0x13, 0x24, 0x77, 0x90, 0x19, 0x60, 0xc3, 0x25, 0xf2, 0x1a, 0x57, 0xf7, - 0x02, 0x2d, 0xb5, 0x60, 0x04, 0x72, 0x22, 0x16, 0xd9, 0x98, 0x05, 0x57, 0x87, 0x16, 0xe5, 0x5f, - 0xe7, 0xa1, 0x10, 0xe9, 0xab, 0xd1, 0x45, 0x28, 0x3e, 0xc2, 0x4f, 0xb0, 0x12, 0xdc, 0x95, 0x78, - 0x26, 0x0a, 0x54, 0xd6, 0xf5, 0xef, 0x4b, 0x9f, 0xc2, 0x26, 0x83, 0x58, 0x13, 0x8f, 0x38, 0x8a, - 0x6a, 0x60, 0xd7, 0x65, 0x49, 0xcb, 0x31, 0x28, 0xa2, 0xba, 0x0e, 0x55, 0xd5, 0x02, 0x0d, 0xba, - 0x05, 0x1b, 0xcc, 0x62, 0x3c, 0x31, 0x3c, 0xdd, 0x36, 0x88, 0x42, 0x6f, 0x6f, 0x2e, 0x3b, 0x49, - 0xc2, 0xc8, 0xd6, 0x29, 0xa2, 0xe5, 0x03, 0x68, 0x44, 0x2e, 0xaa, 0xc3, 0x7b, 0xcc, 0x6c, 0x48, - 0x4c, 0xe2, 0x60, 0x8f, 0x28, 0xe4, 0xeb, 0x09, 0x36, 0x5c, 0x05, 0x9b, 0x9a, 0x32, 0xc2, 0xee, - 0x48, 0xdc, 0xa4, 0x0e, 0x0e, 0x93, 0x62, 0x42, 0x3e, 0x4f, 0x81, 0x47, 0x3e, 0x4e, 0x62, 0xb0, - 0xaa, 0xa9, 0x7d, 0x81, 0xdd, 0x11, 0x3a, 0x80, 0x2d, 0xe6, 0xc5, 0xf5, 0x1c, 0xdd, 0x1c, 0x2a, - 0xea, 0x88, 0xa8, 0x8f, 0x95, 0x89, 0x37, 0xb8, 0x23, 0xbe, 0x13, 0x9d, 0x9f, 0x45, 0xd8, 0x63, - 0x98, 0x1a, 0x85, 0x1c, 0x7b, 0x83, 0x3b, 0xa8, 0x07, 0x45, 0xfa, 0x31, 0xc6, 0xfa, 0x73, 0xa2, - 0x0c, 0x2c, 0x87, 0x1d, 0x8d, 0xa5, 0x05, 0xa5, 0x29, 0x92, 0xc1, 0x4a, 0xc7, 0x37, 0x68, 0x59, - 0x1a, 0x39, 0xc8, 0xf4, 0xba, 0x92, 0x54, 0x97, 0x0b, 0x81, 0x97, 0x7b, 0x96, 0x43, 0x09, 0x35, - 0xb4, 0xc2, 0x04, 0x17, 0x38, 0xa1, 0x86, 0x56, 0x90, 0xde, 0x5b, 0xb0, 0xa1, 0xaa, 0x7c, 0xcd, - 0xba, 0xaa, 0xf8, 0x77, 0x2c, 0x57, 0x14, 0x62, 0xc9, 0x52, 0xd5, 0x23, 0x0e, 0xf0, 0x39, 0xee, - 0xa2, 0xcf, 0xe0, 0xed, 0x69, 0xb2, 0xa2, 0x86, 0xeb, 0x73, 0xab, 0x9c, 0x35, 0xbd, 0x05, 0x1b, - 0xf6, 0xe9, 0xbc, 0x21, 0x8a, 0xcd, 0x68, 0x9f, 0xce, 0x9a, 0xdd, 0x86, 0x4d, 0x7b, 0x64, 0xcf, - 0xdb, 0x5d, 0x8d, 0xda, 0x21, 0x7b, 0x64, 0xcf, 0x1a, 0x5e, 0x62, 0x17, 0x6e, 0x87, 0xa8, 0xd8, - 0x23, 0x9a, 0x78, 0x2e, 0x0a, 0x8f, 0x28, 0xd0, 0x75, 0x10, 0x54, 0x55, 0x21, 0x26, 0x3e, 0x31, - 0x88, 0x82, 0x1d, 0x62, 0x62, 0x57, 0xbc, 0x10, 0x05, 0x97, 0x54, 0x55, 0x62, 0xda, 0x2a, 0x53, - 0xa2, 0xab, 0xb0, 0x6e, 0x9d, 0x3c, 0x52, 0x39, 0x25, 0x15, 0xdb, 0x21, 0x03, 0xfd, 0x99, 0xf8, - 0x21, 0xcb, 0xef, 0x1a, 0x55, 0x30, 0x42, 0x76, 0x99, 0x18, 0x5d, 0x01, 0x41, 0x75, 0x47, 0xd8, - 0xb1, 0x59, 0x4d, 0x76, 0x6d, 0xac, 0x12, 0xf1, 0x12, 0x87, 0x72, 0x79, 0x3b, 0x10, 0xd3, 0x2d, - 0xe1, 0x3e, 0xd5, 0x07, 0x5e, 0xe0, 0xf1, 0x32, 0xdf, 0x12, 0x4c, 0xe6, 0x7b, 0xdb, 0x05, 0x81, - 0xa6, 0x22, 0x36, 0xf1, 0x2e, 0x83, 0x95, 0xec, 0x91, 0x1d, 0x9d, 0xf7, 0x03, 0x58, 0xa5, 0xc8, - 0xe9, 0xa4, 0x57, 0x78, 0x43, 0x66, 0x8f, 0x22, 0x33, 0xde, 0x84, 0x2d, 0x0a, 0x1a, 0x13, 0x0f, - 0x6b, 0xd8, 0xc3, 0x11, 0xf4, 0xc7, 0x0c, 0x4d, 0xf3, 0xde, 0xf2, 0x95, 0xb1, 0x38, 0x9d, 0xc9, - 0xc9, 0x69, 0xc8, 0xac, 0x4f, 0x78, 0x9c, 0x54, 0x16, 0x70, 0xeb, 0xb5, 0x35, 0xdd, 0xe5, 0x03, - 0x28, 0x46, 0x89, 0x8f, 0xf2, 0xc0, 0xa9, 0x2f, 0x24, 0x68, 0x17, 0x54, 0xeb, 0xd4, 0x69, 0xff, - 0xf2, 0x95, 0x24, 0x24, 0x69, 0x1f, 0xd5, 0x6c, 0xf4, 0x25, 0x45, 0x3e, 0x6e, 0xf7, 0x1b, 0x2d, - 0x49, 0x48, 0x45, 0x1b, 0xf6, 0xbf, 0x26, 0xa1, 0x14, 0xbf, 0x7b, 0xa1, 0x1f, 0xc0, 0xb9, 0xe0, - 0xa1, 0xc4, 0x25, 0x9e, 0xf2, 0x54, 0x77, 0xd8, 0x5e, 0x1c, 0x63, 0x7e, 0x2e, 0x86, 0x6c, 0xd8, - 0xf4, 0x51, 0x3d, 0xe2, 0x7d, 0xa9, 0x3b, 0x74, 0xa7, 0x8d, 0xb1, 0x87, 0x9a, 0x70, 0xc1, 0xb4, - 0x14, 0xd7, 0xc3, 0xa6, 0x86, 0x1d, 0x4d, 0x99, 0x3e, 0x51, 0x29, 0x58, 0x55, 0x89, 0xeb, 0x5a, - 0xfc, 0x0c, 0x0c, 0xbd, 0xbc, 0x6b, 0x5a, 0x3d, 0x1f, 0x3c, 0x3d, 0x1c, 0xaa, 0x3e, 0x74, 0x86, - 0xb9, 0xa9, 0x65, 0xcc, 0x7d, 0x07, 0xf2, 0x63, 0x6c, 0x2b, 0xc4, 0xf4, 0x9c, 0x53, 0xd6, 0x71, - 0xe7, 0xe4, 0xdc, 0x18, 0xdb, 0x12, 0x1d, 0xbf, 0x99, 0x8b, 0xcf, 0x3f, 0x52, 0x50, 0x8c, 0x76, - 0xdd, 0xf4, 0x12, 0xa3, 0xb2, 0x03, 0x2a, 0xc1, 0x4a, 0xd8, 0x07, 0x2f, 0xed, 0xd1, 0x2b, 0x35, - 0x7a, 0x72, 0x1d, 0x64, 0x79, 0x2f, 0x2c, 0x73, 0x4b, 0xda, 0x35, 0x50, 0x6a, 0x11, 0xde, 0x7b, - 0xe4, 0x64, 0x7f, 0x84, 0x8e, 0x20, 0xfb, 0xc8, 0x65, 0xbe, 0xb3, 0xcc, 0xf7, 0x87, 0x2f, 0xf7, - 0x7d, 0xbf, 0xc7, 0x9c, 0xe7, 0xef, 0xf7, 0x94, 0x76, 0x47, 0x6e, 0x55, 0x9b, 0xb2, 0x6f, 0x8e, - 0xce, 0x43, 0xda, 0xc0, 0xcf, 0x4f, 0xe3, 0x67, 0x1c, 0x13, 0x9d, 0x35, 0xf1, 0xe7, 0x21, 0xfd, - 0x94, 0xe0, 0xc7, 0xf1, 0x93, 0x85, 0x89, 0x5e, 0x23, 0xf5, 0xaf, 0x43, 0x86, 0xe5, 0x0b, 0x01, - 0xf8, 0x19, 0x13, 0xde, 0x42, 0x39, 0x48, 0xd7, 0x3a, 0x32, 0xa5, 0xbf, 0x00, 0x45, 0x2e, 0x55, - 0xba, 0x0d, 0xa9, 0x26, 0x09, 0xc9, 0xf2, 0x2d, 0xc8, 0xf2, 0x24, 0xd0, 0xad, 0x11, 0xa6, 0x41, - 0x78, 0xcb, 0x1f, 0xfa, 0x3e, 0x12, 0x81, 0xf6, 0xb8, 0x75, 0x28, 0xc9, 0x42, 0x32, 0xfa, 0x79, - 0x5d, 0x28, 0x46, 0x1b, 0xee, 0x37, 0xc3, 0xa9, 0xbf, 0x24, 0xa0, 0x10, 0x69, 0xa0, 0x69, 0xe7, - 0x83, 0x0d, 0xc3, 0x7a, 0xaa, 0x60, 0x43, 0xc7, 0xae, 0x4f, 0x0a, 0x60, 0xa2, 0x2a, 0x95, 0x9c, - 0xf5, 0xa3, 0xbd, 0x91, 0xe0, 0x7f, 0x9f, 0x00, 0x61, 0xb6, 0x77, 0x9d, 0x09, 0x30, 0xf1, 0xbd, - 0x06, 0xf8, 0xbb, 0x04, 0x94, 0xe2, 0x0d, 0xeb, 0x4c, 0x78, 0x17, 0xbf, 0xd7, 0xf0, 0xfe, 0x99, - 0x84, 0xd5, 0x58, 0x9b, 0x7a, 0xd6, 0xe8, 0xbe, 0x86, 0x75, 0x5d, 0x23, 0x63, 0xdb, 0xf2, 0x88, - 0xa9, 0x9e, 0x2a, 0x06, 0x79, 0x42, 0x0c, 0xb1, 0xcc, 0x0a, 0xc5, 0xf5, 0x97, 0x37, 0xc2, 0x95, - 0xc6, 0xd4, 0xae, 0x49, 0xcd, 0x0e, 0x36, 0x1a, 0x75, 0xa9, 0xd5, 0xed, 0xf4, 0xa5, 0x76, 0xed, - 0xa1, 0x72, 0xdc, 0xfe, 0x71, 0xbb, 0xf3, 0x65, 0x5b, 0x16, 0xf4, 0x19, 0xd8, 0x6b, 0xdc, 0xea, - 0x5d, 0x10, 0x66, 0x83, 0x42, 0xe7, 0x60, 0x51, 0x58, 0xc2, 0x5b, 0x68, 0x03, 0xd6, 0xda, 0x1d, - 0xa5, 0xd7, 0xa8, 0x4b, 0x8a, 0x74, 0xef, 0x9e, 0x54, 0xeb, 0xf7, 0xf8, 0xd3, 0x46, 0x88, 0xee, - 0xc7, 0x37, 0xf5, 0x6f, 0x53, 0xb0, 0xb1, 0x20, 0x12, 0x54, 0xf5, 0x2f, 0x25, 0xfc, 0x9e, 0xf4, - 0xc9, 0x59, 0xa2, 0xaf, 0xd0, 0xae, 0xa0, 0x8b, 0x1d, 0xcf, 0xbf, 0xc3, 0x5c, 0x01, 0x9a, 0x25, - 0xd3, 0xd3, 0x07, 0x3a, 0x71, 0xfc, 0x97, 0x20, 0x7e, 0x53, 0x59, 0x9b, 0xca, 0xf9, 0x63, 0xd0, - 0xc7, 0x80, 0x6c, 0xcb, 0xd5, 0x3d, 0xfd, 0x09, 0x51, 0x74, 0x33, 0x78, 0x36, 0xa2, 0x37, 0x97, - 0xb4, 0x2c, 0x04, 0x9a, 0x86, 0xe9, 0x85, 0x68, 0x93, 0x0c, 0xf1, 0x0c, 0x9a, 0x16, 0xf0, 0x94, - 0x2c, 0x04, 0x9a, 0x10, 0x7d, 0x11, 0x8a, 0x9a, 0x35, 0xa1, 0xed, 0x1c, 0xc7, 0xd1, 0xf3, 0x22, - 0x21, 0x17, 0xb8, 0x2c, 0x84, 0xf8, 0x8d, 0xfa, 0xf4, 0xbd, 0xaa, 0x28, 0x17, 0xb8, 0x8c, 0x43, - 0x2e, 0xc3, 0x1a, 0x1e, 0x0e, 0x1d, 0xea, 0x3c, 0x70, 0xc4, 0xaf, 0x1e, 0xa5, 0x50, 0xcc, 0x80, - 0xdb, 0xf7, 0x21, 0x17, 0xe4, 0x81, 0x1e, 0xc9, 0x34, 0x13, 0x8a, 0xcd, 0xef, 0xd3, 0xc9, 0xdd, - 0xbc, 0x9c, 0x33, 0x03, 0xe5, 0x45, 0x28, 0xea, 0xae, 0x32, 0x7d, 0x7e, 0x4f, 0xee, 0x24, 0x77, - 0x73, 0x72, 0x41, 0x77, 0xc3, 0xa7, 0xcb, 0xf2, 0x37, 0x49, 0x28, 0xc5, 0x7f, 0x3e, 0x40, 0x75, - 0xc8, 0x19, 0x96, 0x8a, 0x19, 0xb5, 0xf8, 0x6f, 0x57, 0xbb, 0xaf, 0xf8, 0xc5, 0xa1, 0xd2, 0xf4, - 0xf1, 0x72, 0x68, 0xb9, 0xfd, 0xb7, 0x04, 0xe4, 0x02, 0x31, 0xda, 0x82, 0xb4, 0x8d, 0xbd, 0x11, - 0x73, 0x97, 0x39, 0x4c, 0x0a, 0x09, 0x99, 0x8d, 0xa9, 0xdc, 0xb5, 0xb1, 0xc9, 0x28, 0xe0, 0xcb, - 0xe9, 0x98, 0x7e, 0x57, 0x83, 0x60, 0x8d, 0xdd, 0x6b, 0xac, 0xf1, 0x98, 0x98, 0x9e, 0x1b, 0x7c, - 0x57, 0x5f, 0x5e, 0xf3, 0xc5, 0xe8, 0x1a, 0xac, 0x7b, 0x0e, 0xd6, 0x8d, 0x18, 0x36, 0xcd, 0xb0, - 0x42, 0xa0, 0x08, 0xc1, 0x07, 0x70, 0x3e, 0xf0, 0xab, 0x11, 0x0f, 0xab, 0x23, 0xa2, 0x4d, 0x8d, - 0xb2, 0xec, 0xfd, 0xe2, 0x9c, 0x0f, 0xa8, 0xfb, 0xfa, 0xc0, 0xb6, 0xfc, 0xf7, 0x04, 0xac, 0x07, - 0x37, 0x31, 0x2d, 0x4c, 0x56, 0x0b, 0x00, 0x9b, 0xa6, 0xe5, 0x45, 0xd3, 0x35, 0x4f, 0xe5, 0x39, - 0xbb, 0x4a, 0x35, 0x34, 0x92, 0x23, 0x0e, 0xb6, 0xc7, 0x00, 0x53, 0xcd, 0xd2, 0xb4, 0x5d, 0x80, - 0x82, 0xff, 0xdb, 0x10, 0xfb, 0x81, 0x91, 0xdf, 0xdd, 0x81, 0x8b, 0xe8, 0x95, 0x0d, 0x6d, 0x42, - 0xe6, 0x84, 0x0c, 0x75, 0xd3, 0x7f, 0xf1, 0xe5, 0x83, 0xe0, 0x85, 0x25, 0x1d, 0xbe, 0xb0, 0x1c, - 0xfe, 0x0c, 0x36, 0x54, 0x6b, 0x3c, 0x1b, 0xee, 0xa1, 0x30, 0xf3, 0x7e, 0xe0, 0x7e, 0x91, 0xf8, - 0x0a, 0xa6, 0x2d, 0xe6, 0xff, 0x12, 0x89, 0x3f, 0x24, 0x53, 0x47, 0xdd, 0xc3, 0x3f, 0x26, 0xb7, - 0x8f, 0xb8, 0x69, 0x37, 0x58, 0xa9, 0x4c, 0x06, 0x06, 0x51, 0x69, 0xf4, 0xff, 0x0f, 0x00, 0x00, - 0xff, 0xff, 0x88, 0x17, 0xc1, 0xbe, 0x38, 0x1d, 0x00, 0x00, -} diff --git a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go b/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go deleted file mode 100644 index 165b2110df..0000000000 --- a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go +++ /dev/null @@ -1,752 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: descriptor.proto - -package descriptor - -import ( - fmt "fmt" - github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" - proto "github.com/gogo/protobuf/proto" - math "math" - reflect "reflect" - sort "sort" - strconv "strconv" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -func (this *FileDescriptorSet) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&descriptor.FileDescriptorSet{") - if this.File != nil { - s = append(s, "File: "+fmt.Sprintf("%#v", this.File)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FileDescriptorProto) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 16) - s = append(s, "&descriptor.FileDescriptorProto{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") - } - if this.Package != nil { - s = append(s, "Package: "+valueToGoStringDescriptor(this.Package, "string")+",\n") - } - if this.Dependency != nil { - s = append(s, "Dependency: "+fmt.Sprintf("%#v", this.Dependency)+",\n") - } - if this.PublicDependency != nil { - s = append(s, "PublicDependency: "+fmt.Sprintf("%#v", this.PublicDependency)+",\n") - } - if this.WeakDependency != nil { - s = append(s, "WeakDependency: "+fmt.Sprintf("%#v", this.WeakDependency)+",\n") - } - if this.MessageType != nil { - s = append(s, "MessageType: "+fmt.Sprintf("%#v", this.MessageType)+",\n") - } - if this.EnumType != nil { - s = append(s, "EnumType: "+fmt.Sprintf("%#v", this.EnumType)+",\n") - } - if this.Service != nil { - s = append(s, "Service: "+fmt.Sprintf("%#v", this.Service)+",\n") - } - if this.Extension != nil { - s = append(s, "Extension: "+fmt.Sprintf("%#v", this.Extension)+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.SourceCodeInfo != nil { - s = append(s, "SourceCodeInfo: "+fmt.Sprintf("%#v", this.SourceCodeInfo)+",\n") - } - if this.Syntax != nil { - s = append(s, "Syntax: "+valueToGoStringDescriptor(this.Syntax, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DescriptorProto) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 14) - s = append(s, "&descriptor.DescriptorProto{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") - } - if this.Field != nil { - s = append(s, "Field: "+fmt.Sprintf("%#v", this.Field)+",\n") - } - if this.Extension != nil { - s = append(s, "Extension: "+fmt.Sprintf("%#v", this.Extension)+",\n") - } - if this.NestedType != nil { - s = append(s, "NestedType: "+fmt.Sprintf("%#v", this.NestedType)+",\n") - } - if this.EnumType != nil { - s = append(s, "EnumType: "+fmt.Sprintf("%#v", this.EnumType)+",\n") - } - if this.ExtensionRange != nil { - s = append(s, "ExtensionRange: "+fmt.Sprintf("%#v", this.ExtensionRange)+",\n") - } - if this.OneofDecl != nil { - s = append(s, "OneofDecl: "+fmt.Sprintf("%#v", this.OneofDecl)+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.ReservedRange != nil { - s = append(s, "ReservedRange: "+fmt.Sprintf("%#v", this.ReservedRange)+",\n") - } - if this.ReservedName != nil { - s = append(s, "ReservedName: "+fmt.Sprintf("%#v", this.ReservedName)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DescriptorProto_ExtensionRange) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&descriptor.DescriptorProto_ExtensionRange{") - if this.Start != nil { - s = append(s, "Start: "+valueToGoStringDescriptor(this.Start, "int32")+",\n") - } - if this.End != nil { - s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DescriptorProto_ReservedRange) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&descriptor.DescriptorProto_ReservedRange{") - if this.Start != nil { - s = append(s, "Start: "+valueToGoStringDescriptor(this.Start, "int32")+",\n") - } - if this.End != nil { - s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ExtensionRangeOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&descriptor.ExtensionRangeOptions{") - if this.UninterpretedOption != nil { - s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") - } - s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FieldDescriptorProto) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 14) - s = append(s, "&descriptor.FieldDescriptorProto{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") - } - if this.Number != nil { - s = append(s, "Number: "+valueToGoStringDescriptor(this.Number, "int32")+",\n") - } - if this.Label != nil { - s = append(s, "Label: "+valueToGoStringDescriptor(this.Label, "FieldDescriptorProto_Label")+",\n") - } - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringDescriptor(this.Type, "FieldDescriptorProto_Type")+",\n") - } - if this.TypeName != nil { - s = append(s, "TypeName: "+valueToGoStringDescriptor(this.TypeName, "string")+",\n") - } - if this.Extendee != nil { - s = append(s, "Extendee: "+valueToGoStringDescriptor(this.Extendee, "string")+",\n") - } - if this.DefaultValue != nil { - s = append(s, "DefaultValue: "+valueToGoStringDescriptor(this.DefaultValue, "string")+",\n") - } - if this.OneofIndex != nil { - s = append(s, "OneofIndex: "+valueToGoStringDescriptor(this.OneofIndex, "int32")+",\n") - } - if this.JsonName != nil { - s = append(s, "JsonName: "+valueToGoStringDescriptor(this.JsonName, "string")+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *OneofDescriptorProto) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&descriptor.OneofDescriptorProto{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *EnumDescriptorProto) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&descriptor.EnumDescriptorProto{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") - } - if this.Value != nil { - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.ReservedRange != nil { - s = append(s, "ReservedRange: "+fmt.Sprintf("%#v", this.ReservedRange)+",\n") - } - if this.ReservedName != nil { - s = append(s, "ReservedName: "+fmt.Sprintf("%#v", this.ReservedName)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *EnumDescriptorProto_EnumReservedRange) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&descriptor.EnumDescriptorProto_EnumReservedRange{") - if this.Start != nil { - s = append(s, "Start: "+valueToGoStringDescriptor(this.Start, "int32")+",\n") - } - if this.End != nil { - s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *EnumValueDescriptorProto) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&descriptor.EnumValueDescriptorProto{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") - } - if this.Number != nil { - s = append(s, "Number: "+valueToGoStringDescriptor(this.Number, "int32")+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ServiceDescriptorProto) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&descriptor.ServiceDescriptorProto{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") - } - if this.Method != nil { - s = append(s, "Method: "+fmt.Sprintf("%#v", this.Method)+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *MethodDescriptorProto) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 10) - s = append(s, "&descriptor.MethodDescriptorProto{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") - } - if this.InputType != nil { - s = append(s, "InputType: "+valueToGoStringDescriptor(this.InputType, "string")+",\n") - } - if this.OutputType != nil { - s = append(s, "OutputType: "+valueToGoStringDescriptor(this.OutputType, "string")+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.ClientStreaming != nil { - s = append(s, "ClientStreaming: "+valueToGoStringDescriptor(this.ClientStreaming, "bool")+",\n") - } - if this.ServerStreaming != nil { - s = append(s, "ServerStreaming: "+valueToGoStringDescriptor(this.ServerStreaming, "bool")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FileOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 25) - s = append(s, "&descriptor.FileOptions{") - if this.JavaPackage != nil { - s = append(s, "JavaPackage: "+valueToGoStringDescriptor(this.JavaPackage, "string")+",\n") - } - if this.JavaOuterClassname != nil { - s = append(s, "JavaOuterClassname: "+valueToGoStringDescriptor(this.JavaOuterClassname, "string")+",\n") - } - if this.JavaMultipleFiles != nil { - s = append(s, "JavaMultipleFiles: "+valueToGoStringDescriptor(this.JavaMultipleFiles, "bool")+",\n") - } - if this.JavaGenerateEqualsAndHash != nil { - s = append(s, "JavaGenerateEqualsAndHash: "+valueToGoStringDescriptor(this.JavaGenerateEqualsAndHash, "bool")+",\n") - } - if this.JavaStringCheckUtf8 != nil { - s = append(s, "JavaStringCheckUtf8: "+valueToGoStringDescriptor(this.JavaStringCheckUtf8, "bool")+",\n") - } - if this.OptimizeFor != nil { - s = append(s, "OptimizeFor: "+valueToGoStringDescriptor(this.OptimizeFor, "FileOptions_OptimizeMode")+",\n") - } - if this.GoPackage != nil { - s = append(s, "GoPackage: "+valueToGoStringDescriptor(this.GoPackage, "string")+",\n") - } - if this.CcGenericServices != nil { - s = append(s, "CcGenericServices: "+valueToGoStringDescriptor(this.CcGenericServices, "bool")+",\n") - } - if this.JavaGenericServices != nil { - s = append(s, "JavaGenericServices: "+valueToGoStringDescriptor(this.JavaGenericServices, "bool")+",\n") - } - if this.PyGenericServices != nil { - s = append(s, "PyGenericServices: "+valueToGoStringDescriptor(this.PyGenericServices, "bool")+",\n") - } - if this.PhpGenericServices != nil { - s = append(s, "PhpGenericServices: "+valueToGoStringDescriptor(this.PhpGenericServices, "bool")+",\n") - } - if this.Deprecated != nil { - s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") - } - if this.CcEnableArenas != nil { - s = append(s, "CcEnableArenas: "+valueToGoStringDescriptor(this.CcEnableArenas, "bool")+",\n") - } - if this.ObjcClassPrefix != nil { - s = append(s, "ObjcClassPrefix: "+valueToGoStringDescriptor(this.ObjcClassPrefix, "string")+",\n") - } - if this.CsharpNamespace != nil { - s = append(s, "CsharpNamespace: "+valueToGoStringDescriptor(this.CsharpNamespace, "string")+",\n") - } - if this.SwiftPrefix != nil { - s = append(s, "SwiftPrefix: "+valueToGoStringDescriptor(this.SwiftPrefix, "string")+",\n") - } - if this.PhpClassPrefix != nil { - s = append(s, "PhpClassPrefix: "+valueToGoStringDescriptor(this.PhpClassPrefix, "string")+",\n") - } - if this.PhpNamespace != nil { - s = append(s, "PhpNamespace: "+valueToGoStringDescriptor(this.PhpNamespace, "string")+",\n") - } - if this.PhpMetadataNamespace != nil { - s = append(s, "PhpMetadataNamespace: "+valueToGoStringDescriptor(this.PhpMetadataNamespace, "string")+",\n") - } - if this.RubyPackage != nil { - s = append(s, "RubyPackage: "+valueToGoStringDescriptor(this.RubyPackage, "string")+",\n") - } - if this.UninterpretedOption != nil { - s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") - } - s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *MessageOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&descriptor.MessageOptions{") - if this.MessageSetWireFormat != nil { - s = append(s, "MessageSetWireFormat: "+valueToGoStringDescriptor(this.MessageSetWireFormat, "bool")+",\n") - } - if this.NoStandardDescriptorAccessor != nil { - s = append(s, "NoStandardDescriptorAccessor: "+valueToGoStringDescriptor(this.NoStandardDescriptorAccessor, "bool")+",\n") - } - if this.Deprecated != nil { - s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") - } - if this.MapEntry != nil { - s = append(s, "MapEntry: "+valueToGoStringDescriptor(this.MapEntry, "bool")+",\n") - } - if this.UninterpretedOption != nil { - s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") - } - s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FieldOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&descriptor.FieldOptions{") - if this.Ctype != nil { - s = append(s, "Ctype: "+valueToGoStringDescriptor(this.Ctype, "FieldOptions_CType")+",\n") - } - if this.Packed != nil { - s = append(s, "Packed: "+valueToGoStringDescriptor(this.Packed, "bool")+",\n") - } - if this.Jstype != nil { - s = append(s, "Jstype: "+valueToGoStringDescriptor(this.Jstype, "FieldOptions_JSType")+",\n") - } - if this.Lazy != nil { - s = append(s, "Lazy: "+valueToGoStringDescriptor(this.Lazy, "bool")+",\n") - } - if this.Deprecated != nil { - s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") - } - if this.Weak != nil { - s = append(s, "Weak: "+valueToGoStringDescriptor(this.Weak, "bool")+",\n") - } - if this.UninterpretedOption != nil { - s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") - } - s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *OneofOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&descriptor.OneofOptions{") - if this.UninterpretedOption != nil { - s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") - } - s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *EnumOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&descriptor.EnumOptions{") - if this.AllowAlias != nil { - s = append(s, "AllowAlias: "+valueToGoStringDescriptor(this.AllowAlias, "bool")+",\n") - } - if this.Deprecated != nil { - s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") - } - if this.UninterpretedOption != nil { - s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") - } - s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *EnumValueOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&descriptor.EnumValueOptions{") - if this.Deprecated != nil { - s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") - } - if this.UninterpretedOption != nil { - s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") - } - s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ServiceOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&descriptor.ServiceOptions{") - if this.Deprecated != nil { - s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") - } - if this.UninterpretedOption != nil { - s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") - } - s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *MethodOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&descriptor.MethodOptions{") - if this.Deprecated != nil { - s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") - } - if this.IdempotencyLevel != nil { - s = append(s, "IdempotencyLevel: "+valueToGoStringDescriptor(this.IdempotencyLevel, "MethodOptions_IdempotencyLevel")+",\n") - } - if this.UninterpretedOption != nil { - s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") - } - s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UninterpretedOption) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&descriptor.UninterpretedOption{") - if this.Name != nil { - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - } - if this.IdentifierValue != nil { - s = append(s, "IdentifierValue: "+valueToGoStringDescriptor(this.IdentifierValue, "string")+",\n") - } - if this.PositiveIntValue != nil { - s = append(s, "PositiveIntValue: "+valueToGoStringDescriptor(this.PositiveIntValue, "uint64")+",\n") - } - if this.NegativeIntValue != nil { - s = append(s, "NegativeIntValue: "+valueToGoStringDescriptor(this.NegativeIntValue, "int64")+",\n") - } - if this.DoubleValue != nil { - s = append(s, "DoubleValue: "+valueToGoStringDescriptor(this.DoubleValue, "float64")+",\n") - } - if this.StringValue != nil { - s = append(s, "StringValue: "+valueToGoStringDescriptor(this.StringValue, "byte")+",\n") - } - if this.AggregateValue != nil { - s = append(s, "AggregateValue: "+valueToGoStringDescriptor(this.AggregateValue, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UninterpretedOption_NamePart) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&descriptor.UninterpretedOption_NamePart{") - if this.NamePart != nil { - s = append(s, "NamePart: "+valueToGoStringDescriptor(this.NamePart, "string")+",\n") - } - if this.IsExtension != nil { - s = append(s, "IsExtension: "+valueToGoStringDescriptor(this.IsExtension, "bool")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SourceCodeInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&descriptor.SourceCodeInfo{") - if this.Location != nil { - s = append(s, "Location: "+fmt.Sprintf("%#v", this.Location)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SourceCodeInfo_Location) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&descriptor.SourceCodeInfo_Location{") - if this.Path != nil { - s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") - } - if this.Span != nil { - s = append(s, "Span: "+fmt.Sprintf("%#v", this.Span)+",\n") - } - if this.LeadingComments != nil { - s = append(s, "LeadingComments: "+valueToGoStringDescriptor(this.LeadingComments, "string")+",\n") - } - if this.TrailingComments != nil { - s = append(s, "TrailingComments: "+valueToGoStringDescriptor(this.TrailingComments, "string")+",\n") - } - if this.LeadingDetachedComments != nil { - s = append(s, "LeadingDetachedComments: "+fmt.Sprintf("%#v", this.LeadingDetachedComments)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *GeneratedCodeInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&descriptor.GeneratedCodeInfo{") - if this.Annotation != nil { - s = append(s, "Annotation: "+fmt.Sprintf("%#v", this.Annotation)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *GeneratedCodeInfo_Annotation) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&descriptor.GeneratedCodeInfo_Annotation{") - if this.Path != nil { - s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") - } - if this.SourceFile != nil { - s = append(s, "SourceFile: "+valueToGoStringDescriptor(this.SourceFile, "string")+",\n") - } - if this.Begin != nil { - s = append(s, "Begin: "+valueToGoStringDescriptor(this.Begin, "int32")+",\n") - } - if this.End != nil { - s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringDescriptor(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringDescriptor(m github_com_gogo_protobuf_proto.Message) string { - e := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(m) - if e == nil { - return "nil" - } - s := "proto.NewUnsafeXXX_InternalExtensions(map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) - } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) - } - s += strings.Join(ss, ",") + "})" - return s -} diff --git a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/helper.go b/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/helper.go deleted file mode 100644 index e0846a357d..0000000000 --- a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/helper.go +++ /dev/null @@ -1,390 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package descriptor - -import ( - "strings" -) - -func (msg *DescriptorProto) GetMapFields() (*FieldDescriptorProto, *FieldDescriptorProto) { - if !msg.GetOptions().GetMapEntry() { - return nil, nil - } - return msg.GetField()[0], msg.GetField()[1] -} - -func dotToUnderscore(r rune) rune { - if r == '.' { - return '_' - } - return r -} - -func (field *FieldDescriptorProto) WireType() (wire int) { - switch *field.Type { - case FieldDescriptorProto_TYPE_DOUBLE: - return 1 - case FieldDescriptorProto_TYPE_FLOAT: - return 5 - case FieldDescriptorProto_TYPE_INT64: - return 0 - case FieldDescriptorProto_TYPE_UINT64: - return 0 - case FieldDescriptorProto_TYPE_INT32: - return 0 - case FieldDescriptorProto_TYPE_UINT32: - return 0 - case FieldDescriptorProto_TYPE_FIXED64: - return 1 - case FieldDescriptorProto_TYPE_FIXED32: - return 5 - case FieldDescriptorProto_TYPE_BOOL: - return 0 - case FieldDescriptorProto_TYPE_STRING: - return 2 - case FieldDescriptorProto_TYPE_GROUP: - return 2 - case FieldDescriptorProto_TYPE_MESSAGE: - return 2 - case FieldDescriptorProto_TYPE_BYTES: - return 2 - case FieldDescriptorProto_TYPE_ENUM: - return 0 - case FieldDescriptorProto_TYPE_SFIXED32: - return 5 - case FieldDescriptorProto_TYPE_SFIXED64: - return 1 - case FieldDescriptorProto_TYPE_SINT32: - return 0 - case FieldDescriptorProto_TYPE_SINT64: - return 0 - } - panic("unreachable") -} - -func (field *FieldDescriptorProto) GetKeyUint64() (x uint64) { - packed := field.IsPacked() - wireType := field.WireType() - fieldNumber := field.GetNumber() - if packed { - wireType = 2 - } - x = uint64(uint32(fieldNumber)<<3 | uint32(wireType)) - return x -} - -func (field *FieldDescriptorProto) GetKey3Uint64() (x uint64) { - packed := field.IsPacked3() - wireType := field.WireType() - fieldNumber := field.GetNumber() - if packed { - wireType = 2 - } - x = uint64(uint32(fieldNumber)<<3 | uint32(wireType)) - return x -} - -func (field *FieldDescriptorProto) GetKey() []byte { - x := field.GetKeyUint64() - i := 0 - keybuf := make([]byte, 0) - for i = 0; x > 127; i++ { - keybuf = append(keybuf, 0x80|uint8(x&0x7F)) - x >>= 7 - } - keybuf = append(keybuf, uint8(x)) - return keybuf -} - -func (field *FieldDescriptorProto) GetKey3() []byte { - x := field.GetKey3Uint64() - i := 0 - keybuf := make([]byte, 0) - for i = 0; x > 127; i++ { - keybuf = append(keybuf, 0x80|uint8(x&0x7F)) - x >>= 7 - } - keybuf = append(keybuf, uint8(x)) - return keybuf -} - -func (desc *FileDescriptorSet) GetField(packageName, messageName, fieldName string) *FieldDescriptorProto { - msg := desc.GetMessage(packageName, messageName) - if msg == nil { - return nil - } - for _, field := range msg.GetField() { - if field.GetName() == fieldName { - return field - } - } - return nil -} - -func (file *FileDescriptorProto) GetMessage(typeName string) *DescriptorProto { - for _, msg := range file.GetMessageType() { - if msg.GetName() == typeName { - return msg - } - nes := file.GetNestedMessage(msg, strings.TrimPrefix(typeName, msg.GetName()+".")) - if nes != nil { - return nes - } - } - return nil -} - -func (file *FileDescriptorProto) GetNestedMessage(msg *DescriptorProto, typeName string) *DescriptorProto { - for _, nes := range msg.GetNestedType() { - if nes.GetName() == typeName { - return nes - } - res := file.GetNestedMessage(nes, strings.TrimPrefix(typeName, nes.GetName()+".")) - if res != nil { - return res - } - } - return nil -} - -func (desc *FileDescriptorSet) GetMessage(packageName string, typeName string) *DescriptorProto { - for _, file := range desc.GetFile() { - if strings.Map(dotToUnderscore, file.GetPackage()) != strings.Map(dotToUnderscore, packageName) { - continue - } - for _, msg := range file.GetMessageType() { - if msg.GetName() == typeName { - return msg - } - } - for _, msg := range file.GetMessageType() { - for _, nes := range msg.GetNestedType() { - if nes.GetName() == typeName { - return nes - } - if msg.GetName()+"."+nes.GetName() == typeName { - return nes - } - } - } - } - return nil -} - -func (desc *FileDescriptorSet) IsProto3(packageName string, typeName string) bool { - for _, file := range desc.GetFile() { - if strings.Map(dotToUnderscore, file.GetPackage()) != strings.Map(dotToUnderscore, packageName) { - continue - } - for _, msg := range file.GetMessageType() { - if msg.GetName() == typeName { - return file.GetSyntax() == "proto3" - } - } - for _, msg := range file.GetMessageType() { - for _, nes := range msg.GetNestedType() { - if nes.GetName() == typeName { - return file.GetSyntax() == "proto3" - } - if msg.GetName()+"."+nes.GetName() == typeName { - return file.GetSyntax() == "proto3" - } - } - } - } - return false -} - -func (msg *DescriptorProto) IsExtendable() bool { - return len(msg.GetExtensionRange()) > 0 -} - -func (desc *FileDescriptorSet) FindExtension(packageName string, typeName string, fieldName string) (extPackageName string, field *FieldDescriptorProto) { - parent := desc.GetMessage(packageName, typeName) - if parent == nil { - return "", nil - } - if !parent.IsExtendable() { - return "", nil - } - extendee := "." + packageName + "." + typeName - for _, file := range desc.GetFile() { - for _, ext := range file.GetExtension() { - if strings.Map(dotToUnderscore, file.GetPackage()) == strings.Map(dotToUnderscore, packageName) { - if !(ext.GetExtendee() == typeName || ext.GetExtendee() == extendee) { - continue - } - } else { - if ext.GetExtendee() != extendee { - continue - } - } - if ext.GetName() == fieldName { - return file.GetPackage(), ext - } - } - } - return "", nil -} - -func (desc *FileDescriptorSet) FindExtensionByFieldNumber(packageName string, typeName string, fieldNum int32) (extPackageName string, field *FieldDescriptorProto) { - parent := desc.GetMessage(packageName, typeName) - if parent == nil { - return "", nil - } - if !parent.IsExtendable() { - return "", nil - } - extendee := "." + packageName + "." + typeName - for _, file := range desc.GetFile() { - for _, ext := range file.GetExtension() { - if strings.Map(dotToUnderscore, file.GetPackage()) == strings.Map(dotToUnderscore, packageName) { - if !(ext.GetExtendee() == typeName || ext.GetExtendee() == extendee) { - continue - } - } else { - if ext.GetExtendee() != extendee { - continue - } - } - if ext.GetNumber() == fieldNum { - return file.GetPackage(), ext - } - } - } - return "", nil -} - -func (desc *FileDescriptorSet) FindMessage(packageName string, typeName string, fieldName string) (msgPackageName string, msgName string) { - parent := desc.GetMessage(packageName, typeName) - if parent == nil { - return "", "" - } - field := parent.GetFieldDescriptor(fieldName) - if field == nil { - var extPackageName string - extPackageName, field = desc.FindExtension(packageName, typeName, fieldName) - if field == nil { - return "", "" - } - packageName = extPackageName - } - typeNames := strings.Split(field.GetTypeName(), ".") - if len(typeNames) == 1 { - msg := desc.GetMessage(packageName, typeName) - if msg == nil { - return "", "" - } - return packageName, msg.GetName() - } - if len(typeNames) > 2 { - for i := 1; i < len(typeNames)-1; i++ { - packageName = strings.Join(typeNames[1:len(typeNames)-i], ".") - typeName = strings.Join(typeNames[len(typeNames)-i:], ".") - msg := desc.GetMessage(packageName, typeName) - if msg != nil { - typeNames := strings.Split(msg.GetName(), ".") - if len(typeNames) == 1 { - return packageName, msg.GetName() - } - return strings.Join(typeNames[1:len(typeNames)-1], "."), typeNames[len(typeNames)-1] - } - } - } - return "", "" -} - -func (msg *DescriptorProto) GetFieldDescriptor(fieldName string) *FieldDescriptorProto { - for _, field := range msg.GetField() { - if field.GetName() == fieldName { - return field - } - } - return nil -} - -func (desc *FileDescriptorSet) GetEnum(packageName string, typeName string) *EnumDescriptorProto { - for _, file := range desc.GetFile() { - if strings.Map(dotToUnderscore, file.GetPackage()) != strings.Map(dotToUnderscore, packageName) { - continue - } - for _, enum := range file.GetEnumType() { - if enum.GetName() == typeName { - return enum - } - } - } - return nil -} - -func (f *FieldDescriptorProto) IsEnum() bool { - return *f.Type == FieldDescriptorProto_TYPE_ENUM -} - -func (f *FieldDescriptorProto) IsMessage() bool { - return *f.Type == FieldDescriptorProto_TYPE_MESSAGE -} - -func (f *FieldDescriptorProto) IsBytes() bool { - return *f.Type == FieldDescriptorProto_TYPE_BYTES -} - -func (f *FieldDescriptorProto) IsRepeated() bool { - return f.Label != nil && *f.Label == FieldDescriptorProto_LABEL_REPEATED -} - -func (f *FieldDescriptorProto) IsString() bool { - return *f.Type == FieldDescriptorProto_TYPE_STRING -} - -func (f *FieldDescriptorProto) IsBool() bool { - return *f.Type == FieldDescriptorProto_TYPE_BOOL -} - -func (f *FieldDescriptorProto) IsRequired() bool { - return f.Label != nil && *f.Label == FieldDescriptorProto_LABEL_REQUIRED -} - -func (f *FieldDescriptorProto) IsPacked() bool { - return f.Options != nil && f.GetOptions().GetPacked() -} - -func (f *FieldDescriptorProto) IsPacked3() bool { - if f.IsRepeated() && f.IsScalar() { - if f.Options == nil || f.GetOptions().Packed == nil { - return true - } - return f.Options != nil && f.GetOptions().GetPacked() - } - return false -} - -func (m *DescriptorProto) HasExtension() bool { - return len(m.ExtensionRange) > 0 -} diff --git a/vendor/github.com/gogo/protobuf/sortkeys/sortkeys.go b/vendor/github.com/gogo/protobuf/sortkeys/sortkeys.go deleted file mode 100644 index ceadde6a5e..0000000000 --- a/vendor/github.com/gogo/protobuf/sortkeys/sortkeys.go +++ /dev/null @@ -1,101 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package sortkeys - -import ( - "sort" -) - -func Strings(l []string) { - sort.Strings(l) -} - -func Float64s(l []float64) { - sort.Float64s(l) -} - -func Float32s(l []float32) { - sort.Sort(Float32Slice(l)) -} - -func Int64s(l []int64) { - sort.Sort(Int64Slice(l)) -} - -func Int32s(l []int32) { - sort.Sort(Int32Slice(l)) -} - -func Uint64s(l []uint64) { - sort.Sort(Uint64Slice(l)) -} - -func Uint32s(l []uint32) { - sort.Sort(Uint32Slice(l)) -} - -func Bools(l []bool) { - sort.Sort(BoolSlice(l)) -} - -type BoolSlice []bool - -func (p BoolSlice) Len() int { return len(p) } -func (p BoolSlice) Less(i, j int) bool { return p[j] } -func (p BoolSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -type Int64Slice []int64 - -func (p Int64Slice) Len() int { return len(p) } -func (p Int64Slice) Less(i, j int) bool { return p[i] < p[j] } -func (p Int64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -type Int32Slice []int32 - -func (p Int32Slice) Len() int { return len(p) } -func (p Int32Slice) Less(i, j int) bool { return p[i] < p[j] } -func (p Int32Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -type Uint64Slice []uint64 - -func (p Uint64Slice) Len() int { return len(p) } -func (p Uint64Slice) Less(i, j int) bool { return p[i] < p[j] } -func (p Uint64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -type Uint32Slice []uint32 - -func (p Uint32Slice) Len() int { return len(p) } -func (p Uint32Slice) Less(i, j int) bool { return p[i] < p[j] } -func (p Uint32Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -type Float32Slice []float32 - -func (p Float32Slice) Len() int { return len(p) } -func (p Float32Slice) Less(i, j int) bool { return p[i] < p[j] } -func (p Float32Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } diff --git a/vendor/github.com/gogo/protobuf/types/any.go b/vendor/github.com/gogo/protobuf/types/any.go deleted file mode 100644 index df4787de37..0000000000 --- a/vendor/github.com/gogo/protobuf/types/any.go +++ /dev/null @@ -1,140 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2016 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package types - -// This file implements functions to marshal proto.Message to/from -// google.protobuf.Any message. - -import ( - "fmt" - "reflect" - "strings" - - "github.com/gogo/protobuf/proto" -) - -const googleApis = "type.googleapis.com/" - -// AnyMessageName returns the name of the message contained in a google.protobuf.Any message. -// -// Note that regular type assertions should be done using the Is -// function. AnyMessageName is provided for less common use cases like filtering a -// sequence of Any messages based on a set of allowed message type names. -func AnyMessageName(any *Any) (string, error) { - if any == nil { - return "", fmt.Errorf("message is nil") - } - slash := strings.LastIndex(any.TypeUrl, "/") - if slash < 0 { - return "", fmt.Errorf("message type url %q is invalid", any.TypeUrl) - } - return any.TypeUrl[slash+1:], nil -} - -// MarshalAny takes the protocol buffer and encodes it into google.protobuf.Any. -func MarshalAny(pb proto.Message) (*Any, error) { - value, err := proto.Marshal(pb) - if err != nil { - return nil, err - } - return &Any{TypeUrl: googleApis + proto.MessageName(pb), Value: value}, nil -} - -// DynamicAny is a value that can be passed to UnmarshalAny to automatically -// allocate a proto.Message for the type specified in a google.protobuf.Any -// message. The allocated message is stored in the embedded proto.Message. -// -// Example: -// -// var x ptypes.DynamicAny -// if err := ptypes.UnmarshalAny(a, &x); err != nil { ... } -// fmt.Printf("unmarshaled message: %v", x.Message) -type DynamicAny struct { - proto.Message -} - -// Empty returns a new proto.Message of the type specified in a -// google.protobuf.Any message. It returns an error if corresponding message -// type isn't linked in. -func EmptyAny(any *Any) (proto.Message, error) { - aname, err := AnyMessageName(any) - if err != nil { - return nil, err - } - - t := proto.MessageType(aname) - if t == nil { - return nil, fmt.Errorf("any: message type %q isn't linked in", aname) - } - return reflect.New(t.Elem()).Interface().(proto.Message), nil -} - -// UnmarshalAny parses the protocol buffer representation in a google.protobuf.Any -// message and places the decoded result in pb. It returns an error if type of -// contents of Any message does not match type of pb message. -// -// pb can be a proto.Message, or a *DynamicAny. -func UnmarshalAny(any *Any, pb proto.Message) error { - if d, ok := pb.(*DynamicAny); ok { - if d.Message == nil { - var err error - d.Message, err = EmptyAny(any) - if err != nil { - return err - } - } - return UnmarshalAny(any, d.Message) - } - - aname, err := AnyMessageName(any) - if err != nil { - return err - } - - mname := proto.MessageName(pb) - if aname != mname { - return fmt.Errorf("mismatched message type: got %q want %q", aname, mname) - } - return proto.Unmarshal(any.Value, pb) -} - -// Is returns true if any value contains a given message type. -func Is(any *Any, pb proto.Message) bool { - // The following is equivalent to AnyMessageName(any) == proto.MessageName(pb), - // but it avoids scanning TypeUrl for the slash. - if any == nil { - return false - } - name := proto.MessageName(pb) - prefix := len(any.TypeUrl) - len(name) - return prefix >= 1 && any.TypeUrl[prefix-1] == '/' && any.TypeUrl[prefix:] == name -} diff --git a/vendor/github.com/gogo/protobuf/types/any.pb.go b/vendor/github.com/gogo/protobuf/types/any.pb.go deleted file mode 100644 index e3d4d9490f..0000000000 --- a/vendor/github.com/gogo/protobuf/types/any.pb.go +++ /dev/null @@ -1,694 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: google/protobuf/any.proto - -package types - -import ( - bytes "bytes" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := ptypes.MarshalAny(foo) -// ... -// foo := &pb.Foo{} -// if err := ptypes.UnmarshalAny(any, foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -// -type Any struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - // - TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` - // Must be a valid serialized protocol buffer of the above specified type. - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Any) Reset() { *m = Any{} } -func (*Any) ProtoMessage() {} -func (*Any) Descriptor() ([]byte, []int) { - return fileDescriptor_b53526c13ae22eb4, []int{0} -} -func (*Any) XXX_WellKnownType() string { return "Any" } -func (m *Any) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Any.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Any) XXX_Merge(src proto.Message) { - xxx_messageInfo_Any.Merge(m, src) -} -func (m *Any) XXX_Size() int { - return m.Size() -} -func (m *Any) XXX_DiscardUnknown() { - xxx_messageInfo_Any.DiscardUnknown(m) -} - -var xxx_messageInfo_Any proto.InternalMessageInfo - -func (m *Any) GetTypeUrl() string { - if m != nil { - return m.TypeUrl - } - return "" -} - -func (m *Any) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (*Any) XXX_MessageName() string { - return "google.protobuf.Any" -} -func init() { - proto.RegisterType((*Any)(nil), "google.protobuf.Any") -} - -func init() { proto.RegisterFile("google/protobuf/any.proto", fileDescriptor_b53526c13ae22eb4) } - -var fileDescriptor_b53526c13ae22eb4 = []byte{ - // 211 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xcf, 0xcf, 0x4f, - 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0xd4, - 0x03, 0x73, 0x84, 0xf8, 0x21, 0x52, 0x7a, 0x30, 0x29, 0x25, 0x33, 0x2e, 0x66, 0xc7, 0xbc, 0x4a, - 0x21, 0x49, 0x2e, 0x8e, 0x92, 0xca, 0x82, 0xd4, 0xf8, 0xd2, 0xa2, 0x1c, 0x09, 0x46, 0x05, 0x46, - 0x0d, 0xce, 0x20, 0x76, 0x10, 0x3f, 0xb4, 0x28, 0x47, 0x48, 0x84, 0x8b, 0xb5, 0x2c, 0x31, 0xa7, - 0x34, 0x55, 0x82, 0x49, 0x81, 0x51, 0x83, 0x27, 0x08, 0xc2, 0x71, 0xaa, 0xbf, 0xf1, 0x50, 0x8e, - 0xe1, 0xc3, 0x43, 0x39, 0xc6, 0x1f, 0x0f, 0xe5, 0x18, 0x1b, 0x1e, 0xc9, 0x31, 0xae, 0x78, 0x24, - 0xc7, 0x78, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0xbe, 0x78, - 0x24, 0xc7, 0xf0, 0x01, 0x24, 0xfe, 0x58, 0x8e, 0xf1, 0xc4, 0x63, 0x39, 0x46, 0x2e, 0xe1, 0xe4, - 0xfc, 0x5c, 0x3d, 0x34, 0xeb, 0x9d, 0x38, 0x1c, 0xf3, 0x2a, 0x03, 0x40, 0x9c, 0x00, 0xc6, 0x28, - 0x56, 0x90, 0x8d, 0xc5, 0x8b, 0x98, 0x98, 0xdd, 0x03, 0x9c, 0x56, 0x31, 0xc9, 0xb9, 0x43, 0x94, - 0x06, 0x40, 0x95, 0xea, 0x85, 0xa7, 0xe6, 0xe4, 0x78, 0xe7, 0xe5, 0x97, 0xe7, 0x85, 0x80, 0x94, - 0x25, 0xb1, 0x81, 0xcd, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb7, 0x81, 0x82, 0xd3, 0xed, - 0x00, 0x00, 0x00, -} - -func (this *Any) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Any) - if !ok { - that2, ok := that.(Any) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.TypeUrl != that1.TypeUrl { - if this.TypeUrl < that1.TypeUrl { - return -1 - } - return 1 - } - if c := bytes.Compare(this.Value, that1.Value); c != 0 { - return c - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *Any) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Any) - if !ok { - that2, ok := that.(Any) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TypeUrl != that1.TypeUrl { - return false - } - if !bytes.Equal(this.Value, that1.Value) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Any) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&types.Any{") - s = append(s, "TypeUrl: "+fmt.Sprintf("%#v", this.TypeUrl)+",\n") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringAny(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *Any) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Any) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Any) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintAny(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.TypeUrl) > 0 { - i -= len(m.TypeUrl) - copy(dAtA[i:], m.TypeUrl) - i = encodeVarintAny(dAtA, i, uint64(len(m.TypeUrl))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintAny(dAtA []byte, offset int, v uint64) int { - offset -= sovAny(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func NewPopulatedAny(r randyAny, easy bool) *Any { - this := &Any{} - this.TypeUrl = string(randStringAny(r)) - v1 := r.Intn(100) - this.Value = make([]byte, v1) - for i := 0; i < v1; i++ { - this.Value[i] = byte(r.Intn(256)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedAny(r, 3) - } - return this -} - -type randyAny interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneAny(r randyAny) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringAny(r randyAny) string { - v2 := r.Intn(100) - tmps := make([]rune, v2) - for i := 0; i < v2; i++ { - tmps[i] = randUTF8RuneAny(r) - } - return string(tmps) -} -func randUnrecognizedAny(r randyAny, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldAny(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldAny(dAtA []byte, r randyAny, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateAny(dAtA, uint64(key)) - v3 := r.Int63() - if r.Intn(2) == 0 { - v3 *= -1 - } - dAtA = encodeVarintPopulateAny(dAtA, uint64(v3)) - case 1: - dAtA = encodeVarintPopulateAny(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateAny(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateAny(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateAny(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateAny(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} -func (m *Any) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TypeUrl) - if l > 0 { - n += 1 + l + sovAny(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovAny(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovAny(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozAny(x uint64) (n int) { - return sovAny(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Any) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Any{`, - `TypeUrl:` + fmt.Sprintf("%v", this.TypeUrl) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringAny(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Any) Unmarshal(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 ErrIntOverflowAny - } - 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: Any: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Any: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TypeUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAny - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAny - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAny - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TypeUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAny - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAny - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAny - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAny(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAny - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipAny(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAny - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAny - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAny - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthAny - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupAny - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthAny - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthAny = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAny = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupAny = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/gogo/protobuf/types/api.pb.go b/vendor/github.com/gogo/protobuf/types/api.pb.go deleted file mode 100644 index 83e8869206..0000000000 --- a/vendor/github.com/gogo/protobuf/types/api.pb.go +++ /dev/null @@ -1,2134 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: google/protobuf/api.proto - -package types - -import ( - bytes "bytes" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Api is a light-weight descriptor for an API Interface. -// -// Interfaces are also described as "protocol buffer services" in some contexts, -// such as by the "service" keyword in a .proto file, but they are different -// from API Services, which represent a concrete implementation of an interface -// as opposed to simply a description of methods and bindings. They are also -// sometimes simply referred to as "APIs" in other contexts, such as the name of -// this message itself. See https://cloud.google.com/apis/design/glossary for -// detailed terminology. -type Api struct { - // The fully qualified name of this interface, including package name - // followed by the interface's simple name. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // The methods of this interface, in unspecified order. - Methods []*Method `protobuf:"bytes,2,rep,name=methods,proto3" json:"methods,omitempty"` - // Any metadata attached to the interface. - Options []*Option `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` - // A version string for this interface. If specified, must have the form - // `major-version.minor-version`, as in `1.10`. If the minor version is - // omitted, it defaults to zero. If the entire version field is empty, the - // major version is derived from the package name, as outlined below. If the - // field is not empty, the version in the package name will be verified to be - // consistent with what is provided here. - // - // The versioning schema uses [semantic - // versioning](http://semver.org) where the major version number - // indicates a breaking change and the minor version an additive, - // non-breaking change. Both version numbers are signals to users - // what to expect from different versions, and should be carefully - // chosen based on the product plan. - // - // The major version is also reflected in the package name of the - // interface, which must end in `v`, as in - // `google.feature.v1`. For major versions 0 and 1, the suffix can - // be omitted. Zero major versions must only be used for - // experimental, non-GA interfaces. - // - // - Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` - // Source context for the protocol buffer service represented by this - // message. - SourceContext *SourceContext `protobuf:"bytes,5,opt,name=source_context,json=sourceContext,proto3" json:"source_context,omitempty"` - // Included interfaces. See [Mixin][]. - Mixins []*Mixin `protobuf:"bytes,6,rep,name=mixins,proto3" json:"mixins,omitempty"` - // The source syntax of the service. - Syntax Syntax `protobuf:"varint,7,opt,name=syntax,proto3,enum=google.protobuf.Syntax" json:"syntax,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Api) Reset() { *m = Api{} } -func (*Api) ProtoMessage() {} -func (*Api) Descriptor() ([]byte, []int) { - return fileDescriptor_a2ec32096296c143, []int{0} -} -func (m *Api) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Api) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Api.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Api) XXX_Merge(src proto.Message) { - xxx_messageInfo_Api.Merge(m, src) -} -func (m *Api) XXX_Size() int { - return m.Size() -} -func (m *Api) XXX_DiscardUnknown() { - xxx_messageInfo_Api.DiscardUnknown(m) -} - -var xxx_messageInfo_Api proto.InternalMessageInfo - -func (m *Api) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Api) GetMethods() []*Method { - if m != nil { - return m.Methods - } - return nil -} - -func (m *Api) GetOptions() []*Option { - if m != nil { - return m.Options - } - return nil -} - -func (m *Api) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *Api) GetSourceContext() *SourceContext { - if m != nil { - return m.SourceContext - } - return nil -} - -func (m *Api) GetMixins() []*Mixin { - if m != nil { - return m.Mixins - } - return nil -} - -func (m *Api) GetSyntax() Syntax { - if m != nil { - return m.Syntax - } - return Syntax_SYNTAX_PROTO2 -} - -func (*Api) XXX_MessageName() string { - return "google.protobuf.Api" -} - -// Method represents a method of an API interface. -type Method struct { - // The simple name of this method. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // A URL of the input message type. - RequestTypeUrl string `protobuf:"bytes,2,opt,name=request_type_url,json=requestTypeUrl,proto3" json:"request_type_url,omitempty"` - // If true, the request is streamed. - RequestStreaming bool `protobuf:"varint,3,opt,name=request_streaming,json=requestStreaming,proto3" json:"request_streaming,omitempty"` - // The URL of the output message type. - ResponseTypeUrl string `protobuf:"bytes,4,opt,name=response_type_url,json=responseTypeUrl,proto3" json:"response_type_url,omitempty"` - // If true, the response is streamed. - ResponseStreaming bool `protobuf:"varint,5,opt,name=response_streaming,json=responseStreaming,proto3" json:"response_streaming,omitempty"` - // Any metadata attached to the method. - Options []*Option `protobuf:"bytes,6,rep,name=options,proto3" json:"options,omitempty"` - // The source syntax of this method. - Syntax Syntax `protobuf:"varint,7,opt,name=syntax,proto3,enum=google.protobuf.Syntax" json:"syntax,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Method) Reset() { *m = Method{} } -func (*Method) ProtoMessage() {} -func (*Method) Descriptor() ([]byte, []int) { - return fileDescriptor_a2ec32096296c143, []int{1} -} -func (m *Method) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Method) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Method.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Method) XXX_Merge(src proto.Message) { - xxx_messageInfo_Method.Merge(m, src) -} -func (m *Method) XXX_Size() int { - return m.Size() -} -func (m *Method) XXX_DiscardUnknown() { - xxx_messageInfo_Method.DiscardUnknown(m) -} - -var xxx_messageInfo_Method proto.InternalMessageInfo - -func (m *Method) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Method) GetRequestTypeUrl() string { - if m != nil { - return m.RequestTypeUrl - } - return "" -} - -func (m *Method) GetRequestStreaming() bool { - if m != nil { - return m.RequestStreaming - } - return false -} - -func (m *Method) GetResponseTypeUrl() string { - if m != nil { - return m.ResponseTypeUrl - } - return "" -} - -func (m *Method) GetResponseStreaming() bool { - if m != nil { - return m.ResponseStreaming - } - return false -} - -func (m *Method) GetOptions() []*Option { - if m != nil { - return m.Options - } - return nil -} - -func (m *Method) GetSyntax() Syntax { - if m != nil { - return m.Syntax - } - return Syntax_SYNTAX_PROTO2 -} - -func (*Method) XXX_MessageName() string { - return "google.protobuf.Method" -} - -// Declares an API Interface to be included in this interface. The including -// interface must redeclare all the methods from the included interface, but -// documentation and options are inherited as follows: -// -// - If after comment and whitespace stripping, the documentation -// string of the redeclared method is empty, it will be inherited -// from the original method. -// -// - Each annotation belonging to the service config (http, -// visibility) which is not set in the redeclared method will be -// inherited. -// -// - If an http annotation is inherited, the path pattern will be -// modified as follows. Any version prefix will be replaced by the -// version of the including interface plus the [root][] path if -// specified. -// -// Example of a simple mixin: -// -// package google.acl.v1; -// service AccessControl { -// // Get the underlying ACL object. -// rpc GetAcl(GetAclRequest) returns (Acl) { -// option (google.api.http).get = "/v1/{resource=**}:getAcl"; -// } -// } -// -// package google.storage.v2; -// service Storage { -// rpc GetAcl(GetAclRequest) returns (Acl); -// -// // Get a data record. -// rpc GetData(GetDataRequest) returns (Data) { -// option (google.api.http).get = "/v2/{resource=**}"; -// } -// } -// -// Example of a mixin configuration: -// -// apis: -// - name: google.storage.v2.Storage -// mixins: -// - name: google.acl.v1.AccessControl -// -// The mixin construct implies that all methods in `AccessControl` are -// also declared with same name and request/response types in -// `Storage`. A documentation generator or annotation processor will -// see the effective `Storage.GetAcl` method after inherting -// documentation and annotations as follows: -// -// service Storage { -// // Get the underlying ACL object. -// rpc GetAcl(GetAclRequest) returns (Acl) { -// option (google.api.http).get = "/v2/{resource=**}:getAcl"; -// } -// ... -// } -// -// Note how the version in the path pattern changed from `v1` to `v2`. -// -// If the `root` field in the mixin is specified, it should be a -// relative path under which inherited HTTP paths are placed. Example: -// -// apis: -// - name: google.storage.v2.Storage -// mixins: -// - name: google.acl.v1.AccessControl -// root: acls -// -// This implies the following inherited HTTP annotation: -// -// service Storage { -// // Get the underlying ACL object. -// rpc GetAcl(GetAclRequest) returns (Acl) { -// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; -// } -// ... -// } -type Mixin struct { - // The fully qualified name of the interface which is included. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // If non-empty specifies a path under which inherited HTTP paths - // are rooted. - Root string `protobuf:"bytes,2,opt,name=root,proto3" json:"root,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Mixin) Reset() { *m = Mixin{} } -func (*Mixin) ProtoMessage() {} -func (*Mixin) Descriptor() ([]byte, []int) { - return fileDescriptor_a2ec32096296c143, []int{2} -} -func (m *Mixin) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Mixin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Mixin.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Mixin) XXX_Merge(src proto.Message) { - xxx_messageInfo_Mixin.Merge(m, src) -} -func (m *Mixin) XXX_Size() int { - return m.Size() -} -func (m *Mixin) XXX_DiscardUnknown() { - xxx_messageInfo_Mixin.DiscardUnknown(m) -} - -var xxx_messageInfo_Mixin proto.InternalMessageInfo - -func (m *Mixin) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Mixin) GetRoot() string { - if m != nil { - return m.Root - } - return "" -} - -func (*Mixin) XXX_MessageName() string { - return "google.protobuf.Mixin" -} -func init() { - proto.RegisterType((*Api)(nil), "google.protobuf.Api") - proto.RegisterType((*Method)(nil), "google.protobuf.Method") - proto.RegisterType((*Mixin)(nil), "google.protobuf.Mixin") -} - -func init() { proto.RegisterFile("google/protobuf/api.proto", fileDescriptor_a2ec32096296c143) } - -var fileDescriptor_a2ec32096296c143 = []byte{ - // 467 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0x31, 0x6f, 0x13, 0x31, - 0x14, 0xc7, 0xeb, 0xbb, 0xe4, 0x52, 0x5c, 0x91, 0x82, 0x91, 0xc0, 0x64, 0xb0, 0x4e, 0x15, 0xc3, - 0x09, 0xc4, 0x45, 0x94, 0x4f, 0xd0, 0x20, 0xd4, 0x01, 0x21, 0xa2, 0x0b, 0x08, 0x89, 0x25, 0x4a, - 0x83, 0x09, 0x96, 0xee, 0x6c, 0x63, 0x3b, 0x90, 0x4c, 0xf0, 0x59, 0x98, 0x10, 0x23, 0xdf, 0x80, - 0xad, 0x23, 0x23, 0x23, 0xb9, 0x2e, 0x8c, 0x1d, 0x19, 0x91, 0x7d, 0xe7, 0xa6, 0x5c, 0x83, 0x04, - 0x9b, 0xdf, 0xfb, 0xff, 0xfc, 0xf7, 0x7b, 0x7f, 0xc3, 0x9b, 0x33, 0x21, 0x66, 0x39, 0xed, 0x4b, - 0x25, 0x8c, 0x38, 0x9a, 0xbf, 0xea, 0x4f, 0x24, 0x4b, 0x5d, 0x81, 0x76, 0x2b, 0x29, 0xf5, 0x52, - 0xef, 0x56, 0x93, 0xd5, 0x62, 0xae, 0xa6, 0x74, 0x3c, 0x15, 0xdc, 0xd0, 0x85, 0xa9, 0xc0, 0x5e, - 0xaf, 0x49, 0x99, 0xa5, 0xac, 0x4d, 0xf6, 0xbe, 0x06, 0x30, 0x3c, 0x90, 0x0c, 0x21, 0xd8, 0xe2, - 0x93, 0x82, 0x62, 0x10, 0x83, 0xe4, 0x52, 0xe6, 0xce, 0xe8, 0x1e, 0xec, 0x14, 0xd4, 0xbc, 0x16, - 0x2f, 0x35, 0x0e, 0xe2, 0x30, 0xd9, 0xd9, 0xbf, 0x91, 0x36, 0x06, 0x48, 0x1f, 0x3b, 0x3d, 0xf3, - 0x9c, 0xbd, 0x22, 0xa4, 0x61, 0x82, 0x6b, 0x1c, 0xfe, 0xe5, 0xca, 0x13, 0xa7, 0x67, 0x9e, 0x43, - 0x18, 0x76, 0xde, 0x52, 0xa5, 0x99, 0xe0, 0xb8, 0xe5, 0x1e, 0xf7, 0x25, 0x7a, 0x08, 0xbb, 0x7f, - 0xee, 0x83, 0xdb, 0x31, 0x48, 0x76, 0xf6, 0xc9, 0x05, 0xcf, 0x91, 0xc3, 0x1e, 0x54, 0x54, 0x76, - 0x59, 0x9f, 0x2f, 0x51, 0x0a, 0xa3, 0x82, 0x2d, 0x18, 0xd7, 0x38, 0x72, 0x23, 0x5d, 0xbf, 0xb8, - 0x85, 0x95, 0xb3, 0x9a, 0x42, 0x7d, 0x18, 0xe9, 0x25, 0x37, 0x93, 0x05, 0xee, 0xc4, 0x20, 0xe9, - 0x6e, 0x58, 0x61, 0xe4, 0xe4, 0xac, 0xc6, 0xf6, 0xbe, 0x04, 0x30, 0xaa, 0x82, 0xd8, 0x18, 0x63, - 0x02, 0xaf, 0x28, 0xfa, 0x66, 0x4e, 0xb5, 0x19, 0xdb, 0xe0, 0xc7, 0x73, 0x95, 0xe3, 0xc0, 0xe9, - 0xdd, 0xba, 0xff, 0x74, 0x29, 0xe9, 0x33, 0x95, 0xa3, 0x3b, 0xf0, 0xaa, 0x27, 0xb5, 0x51, 0x74, - 0x52, 0x30, 0x3e, 0xc3, 0x61, 0x0c, 0x92, 0xed, 0xcc, 0x5b, 0x8c, 0x7c, 0x1f, 0xdd, 0xb6, 0xb0, - 0x96, 0x82, 0x6b, 0xba, 0xf6, 0xad, 0x12, 0xdc, 0xf5, 0x82, 0x37, 0xbe, 0x0b, 0xd1, 0x19, 0xbb, - 0x76, 0x6e, 0x3b, 0xe7, 0x33, 0x97, 0xb5, 0xf5, 0xb9, 0x5f, 0x8c, 0xfe, 0xf1, 0x17, 0xff, 0x3b, - 0xb4, 0x3e, 0x6c, 0xbb, 0xd8, 0x37, 0x46, 0x86, 0x60, 0x4b, 0x09, 0x61, 0xea, 0x98, 0xdc, 0x79, - 0xf0, 0xfe, 0xfb, 0x8a, 0x6c, 0x9d, 0xae, 0x08, 0xf8, 0xb5, 0x22, 0xe0, 0x43, 0x49, 0xc0, 0xa7, - 0x92, 0x80, 0xe3, 0x92, 0x80, 0x6f, 0x25, 0x01, 0x3f, 0x4a, 0x02, 0x7e, 0x96, 0x64, 0xeb, 0xd4, - 0xf6, 0x4f, 0x08, 0x38, 0x3e, 0x21, 0x00, 0x5e, 0x9b, 0x8a, 0xa2, 0x39, 0xc6, 0x60, 0xfb, 0x40, - 0xb2, 0xa1, 0x2d, 0x86, 0xe0, 0x45, 0xdb, 0xe6, 0xa6, 0x3f, 0x06, 0xe1, 0xe1, 0x70, 0xf0, 0x39, - 0x20, 0x87, 0x15, 0x3a, 0xf4, 0x13, 0x3f, 0xa7, 0x79, 0xfe, 0x88, 0x8b, 0x77, 0xdc, 0xc6, 0xa8, - 0x8f, 0x22, 0xe7, 0x71, 0xff, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x64, 0x40, 0x40, 0xa1, - 0x03, 0x00, 0x00, -} - -func (this *Api) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Api) - if !ok { - that2, ok := that.(Api) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Name != that1.Name { - if this.Name < that1.Name { - return -1 - } - return 1 - } - if len(this.Methods) != len(that1.Methods) { - if len(this.Methods) < len(that1.Methods) { - return -1 - } - return 1 - } - for i := range this.Methods { - if c := this.Methods[i].Compare(that1.Methods[i]); c != 0 { - return c - } - } - if len(this.Options) != len(that1.Options) { - if len(this.Options) < len(that1.Options) { - return -1 - } - return 1 - } - for i := range this.Options { - if c := this.Options[i].Compare(that1.Options[i]); c != 0 { - return c - } - } - if this.Version != that1.Version { - if this.Version < that1.Version { - return -1 - } - return 1 - } - if c := this.SourceContext.Compare(that1.SourceContext); c != 0 { - return c - } - if len(this.Mixins) != len(that1.Mixins) { - if len(this.Mixins) < len(that1.Mixins) { - return -1 - } - return 1 - } - for i := range this.Mixins { - if c := this.Mixins[i].Compare(that1.Mixins[i]); c != 0 { - return c - } - } - if this.Syntax != that1.Syntax { - if this.Syntax < that1.Syntax { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *Method) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Method) - if !ok { - that2, ok := that.(Method) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Name != that1.Name { - if this.Name < that1.Name { - return -1 - } - return 1 - } - if this.RequestTypeUrl != that1.RequestTypeUrl { - if this.RequestTypeUrl < that1.RequestTypeUrl { - return -1 - } - return 1 - } - if this.RequestStreaming != that1.RequestStreaming { - if !this.RequestStreaming { - return -1 - } - return 1 - } - if this.ResponseTypeUrl != that1.ResponseTypeUrl { - if this.ResponseTypeUrl < that1.ResponseTypeUrl { - return -1 - } - return 1 - } - if this.ResponseStreaming != that1.ResponseStreaming { - if !this.ResponseStreaming { - return -1 - } - return 1 - } - if len(this.Options) != len(that1.Options) { - if len(this.Options) < len(that1.Options) { - return -1 - } - return 1 - } - for i := range this.Options { - if c := this.Options[i].Compare(that1.Options[i]); c != 0 { - return c - } - } - if this.Syntax != that1.Syntax { - if this.Syntax < that1.Syntax { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *Mixin) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Mixin) - if !ok { - that2, ok := that.(Mixin) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Name != that1.Name { - if this.Name < that1.Name { - return -1 - } - return 1 - } - if this.Root != that1.Root { - if this.Root < that1.Root { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *Api) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Api) - if !ok { - that2, ok := that.(Api) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if len(this.Methods) != len(that1.Methods) { - return false - } - for i := range this.Methods { - if !this.Methods[i].Equal(that1.Methods[i]) { - return false - } - } - if len(this.Options) != len(that1.Options) { - return false - } - for i := range this.Options { - if !this.Options[i].Equal(that1.Options[i]) { - return false - } - } - if this.Version != that1.Version { - return false - } - if !this.SourceContext.Equal(that1.SourceContext) { - return false - } - if len(this.Mixins) != len(that1.Mixins) { - return false - } - for i := range this.Mixins { - if !this.Mixins[i].Equal(that1.Mixins[i]) { - return false - } - } - if this.Syntax != that1.Syntax { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Method) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Method) - if !ok { - that2, ok := that.(Method) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.RequestTypeUrl != that1.RequestTypeUrl { - return false - } - if this.RequestStreaming != that1.RequestStreaming { - return false - } - if this.ResponseTypeUrl != that1.ResponseTypeUrl { - return false - } - if this.ResponseStreaming != that1.ResponseStreaming { - return false - } - if len(this.Options) != len(that1.Options) { - return false - } - for i := range this.Options { - if !this.Options[i].Equal(that1.Options[i]) { - return false - } - } - if this.Syntax != that1.Syntax { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Mixin) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Mixin) - if !ok { - that2, ok := that.(Mixin) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.Root != that1.Root { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Api) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&types.Api{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - if this.Methods != nil { - s = append(s, "Methods: "+fmt.Sprintf("%#v", this.Methods)+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - s = append(s, "Version: "+fmt.Sprintf("%#v", this.Version)+",\n") - if this.SourceContext != nil { - s = append(s, "SourceContext: "+fmt.Sprintf("%#v", this.SourceContext)+",\n") - } - if this.Mixins != nil { - s = append(s, "Mixins: "+fmt.Sprintf("%#v", this.Mixins)+",\n") - } - s = append(s, "Syntax: "+fmt.Sprintf("%#v", this.Syntax)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Method) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&types.Method{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "RequestTypeUrl: "+fmt.Sprintf("%#v", this.RequestTypeUrl)+",\n") - s = append(s, "RequestStreaming: "+fmt.Sprintf("%#v", this.RequestStreaming)+",\n") - s = append(s, "ResponseTypeUrl: "+fmt.Sprintf("%#v", this.ResponseTypeUrl)+",\n") - s = append(s, "ResponseStreaming: "+fmt.Sprintf("%#v", this.ResponseStreaming)+",\n") - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - s = append(s, "Syntax: "+fmt.Sprintf("%#v", this.Syntax)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Mixin) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&types.Mixin{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "Root: "+fmt.Sprintf("%#v", this.Root)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringApi(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *Api) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Api) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Api) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Syntax != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.Syntax)) - i-- - dAtA[i] = 0x38 - } - if len(m.Mixins) > 0 { - for iNdEx := len(m.Mixins) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Mixins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if m.SourceContext != nil { - { - size, err := m.SourceContext.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintApi(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x22 - } - if len(m.Options) > 0 { - for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Methods) > 0 { - for iNdEx := len(m.Methods) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Methods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Method) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Method) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Method) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Syntax != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.Syntax)) - i-- - dAtA[i] = 0x38 - } - if len(m.Options) > 0 { - for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if m.ResponseStreaming { - i-- - if m.ResponseStreaming { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if len(m.ResponseTypeUrl) > 0 { - i -= len(m.ResponseTypeUrl) - copy(dAtA[i:], m.ResponseTypeUrl) - i = encodeVarintApi(dAtA, i, uint64(len(m.ResponseTypeUrl))) - i-- - dAtA[i] = 0x22 - } - if m.RequestStreaming { - i-- - if m.RequestStreaming { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.RequestTypeUrl) > 0 { - i -= len(m.RequestTypeUrl) - copy(dAtA[i:], m.RequestTypeUrl) - i = encodeVarintApi(dAtA, i, uint64(len(m.RequestTypeUrl))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Mixin) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Mixin) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Mixin) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Root) > 0 { - i -= len(m.Root) - copy(dAtA[i:], m.Root) - i = encodeVarintApi(dAtA, i, uint64(len(m.Root))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintApi(dAtA []byte, offset int, v uint64) int { - offset -= sovApi(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func NewPopulatedApi(r randyApi, easy bool) *Api { - this := &Api{} - this.Name = string(randStringApi(r)) - if r.Intn(5) != 0 { - v1 := r.Intn(5) - this.Methods = make([]*Method, v1) - for i := 0; i < v1; i++ { - this.Methods[i] = NewPopulatedMethod(r, easy) - } - } - if r.Intn(5) != 0 { - v2 := r.Intn(5) - this.Options = make([]*Option, v2) - for i := 0; i < v2; i++ { - this.Options[i] = NewPopulatedOption(r, easy) - } - } - this.Version = string(randStringApi(r)) - if r.Intn(5) != 0 { - this.SourceContext = NewPopulatedSourceContext(r, easy) - } - if r.Intn(5) != 0 { - v3 := r.Intn(5) - this.Mixins = make([]*Mixin, v3) - for i := 0; i < v3; i++ { - this.Mixins[i] = NewPopulatedMixin(r, easy) - } - } - this.Syntax = Syntax([]int32{0, 1}[r.Intn(2)]) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedApi(r, 8) - } - return this -} - -func NewPopulatedMethod(r randyApi, easy bool) *Method { - this := &Method{} - this.Name = string(randStringApi(r)) - this.RequestTypeUrl = string(randStringApi(r)) - this.RequestStreaming = bool(bool(r.Intn(2) == 0)) - this.ResponseTypeUrl = string(randStringApi(r)) - this.ResponseStreaming = bool(bool(r.Intn(2) == 0)) - if r.Intn(5) != 0 { - v4 := r.Intn(5) - this.Options = make([]*Option, v4) - for i := 0; i < v4; i++ { - this.Options[i] = NewPopulatedOption(r, easy) - } - } - this.Syntax = Syntax([]int32{0, 1}[r.Intn(2)]) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedApi(r, 8) - } - return this -} - -func NewPopulatedMixin(r randyApi, easy bool) *Mixin { - this := &Mixin{} - this.Name = string(randStringApi(r)) - this.Root = string(randStringApi(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedApi(r, 3) - } - return this -} - -type randyApi interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneApi(r randyApi) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringApi(r randyApi) string { - v5 := r.Intn(100) - tmps := make([]rune, v5) - for i := 0; i < v5; i++ { - tmps[i] = randUTF8RuneApi(r) - } - return string(tmps) -} -func randUnrecognizedApi(r randyApi, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldApi(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldApi(dAtA []byte, r randyApi, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateApi(dAtA, uint64(key)) - v6 := r.Int63() - if r.Intn(2) == 0 { - v6 *= -1 - } - dAtA = encodeVarintPopulateApi(dAtA, uint64(v6)) - case 1: - dAtA = encodeVarintPopulateApi(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateApi(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateApi(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateApi(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateApi(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} -func (m *Api) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if len(m.Methods) > 0 { - for _, e := range m.Methods { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) - } - } - if len(m.Options) > 0 { - for _, e := range m.Options { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) - } - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if m.SourceContext != nil { - l = m.SourceContext.Size() - n += 1 + l + sovApi(uint64(l)) - } - if len(m.Mixins) > 0 { - for _, e := range m.Mixins { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) - } - } - if m.Syntax != 0 { - n += 1 + sovApi(uint64(m.Syntax)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Method) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.RequestTypeUrl) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if m.RequestStreaming { - n += 2 - } - l = len(m.ResponseTypeUrl) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if m.ResponseStreaming { - n += 2 - } - if len(m.Options) > 0 { - for _, e := range m.Options { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) - } - } - if m.Syntax != 0 { - n += 1 + sovApi(uint64(m.Syntax)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Mixin) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.Root) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovApi(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozApi(x uint64) (n int) { - return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Api) String() string { - if this == nil { - return "nil" - } - repeatedStringForMethods := "[]*Method{" - for _, f := range this.Methods { - repeatedStringForMethods += strings.Replace(f.String(), "Method", "Method", 1) + "," - } - repeatedStringForMethods += "}" - repeatedStringForOptions := "[]*Option{" - for _, f := range this.Options { - repeatedStringForOptions += strings.Replace(fmt.Sprintf("%v", f), "Option", "Option", 1) + "," - } - repeatedStringForOptions += "}" - repeatedStringForMixins := "[]*Mixin{" - for _, f := range this.Mixins { - repeatedStringForMixins += strings.Replace(f.String(), "Mixin", "Mixin", 1) + "," - } - repeatedStringForMixins += "}" - s := strings.Join([]string{`&Api{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Methods:` + repeatedStringForMethods + `,`, - `Options:` + repeatedStringForOptions + `,`, - `Version:` + fmt.Sprintf("%v", this.Version) + `,`, - `SourceContext:` + strings.Replace(fmt.Sprintf("%v", this.SourceContext), "SourceContext", "SourceContext", 1) + `,`, - `Mixins:` + repeatedStringForMixins + `,`, - `Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Method) String() string { - if this == nil { - return "nil" - } - repeatedStringForOptions := "[]*Option{" - for _, f := range this.Options { - repeatedStringForOptions += strings.Replace(fmt.Sprintf("%v", f), "Option", "Option", 1) + "," - } - repeatedStringForOptions += "}" - s := strings.Join([]string{`&Method{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `RequestTypeUrl:` + fmt.Sprintf("%v", this.RequestTypeUrl) + `,`, - `RequestStreaming:` + fmt.Sprintf("%v", this.RequestStreaming) + `,`, - `ResponseTypeUrl:` + fmt.Sprintf("%v", this.ResponseTypeUrl) + `,`, - `ResponseStreaming:` + fmt.Sprintf("%v", this.ResponseStreaming) + `,`, - `Options:` + repeatedStringForOptions + `,`, - `Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Mixin) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Mixin{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Root:` + fmt.Sprintf("%v", this.Root) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringApi(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Api) Unmarshal(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 ErrIntOverflowApi - } - 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: Api: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Api: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Methods", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Methods = append(m.Methods, &Method{}) - if err := m.Methods[len(m.Methods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Options = append(m.Options, &Option{}) - if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceContext", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SourceContext == nil { - m.SourceContext = &SourceContext{} - } - if err := m.SourceContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mixins", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Mixins = append(m.Mixins, &Mixin{}) - if err := m.Mixins[len(m.Mixins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Syntax", wireType) - } - m.Syntax = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Syntax |= Syntax(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Method) Unmarshal(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 ErrIntOverflowApi - } - 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: Method: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Method: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestTypeUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RequestTypeUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestStreaming", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.RequestStreaming = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponseTypeUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResponseTypeUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponseStreaming", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ResponseStreaming = bool(v != 0) - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Options = append(m.Options, &Option{}) - if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Syntax", wireType) - } - m.Syntax = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Syntax |= Syntax(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Mixin) Unmarshal(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 ErrIntOverflowApi - } - 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: Mixin: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Mixin: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Root", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Root = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipApi(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowApi - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowApi - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowApi - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthApi - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupApi - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthApi - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/gogo/protobuf/types/doc.go b/vendor/github.com/gogo/protobuf/types/doc.go deleted file mode 100644 index ff2810af1e..0000000000 --- a/vendor/github.com/gogo/protobuf/types/doc.go +++ /dev/null @@ -1,35 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2016 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -/* -Package types contains code for interacting with well-known types. -*/ -package types diff --git a/vendor/github.com/gogo/protobuf/types/duration.go b/vendor/github.com/gogo/protobuf/types/duration.go deleted file mode 100644 index 979b8e78a4..0000000000 --- a/vendor/github.com/gogo/protobuf/types/duration.go +++ /dev/null @@ -1,100 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2016 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package types - -// This file implements conversions between google.protobuf.Duration -// and time.Duration. - -import ( - "errors" - "fmt" - "time" -) - -const ( - // Range of a Duration in seconds, as specified in - // google/protobuf/duration.proto. This is about 10,000 years in seconds. - maxSeconds = int64(10000 * 365.25 * 24 * 60 * 60) - minSeconds = -maxSeconds -) - -// validateDuration determines whether the Duration is valid according to the -// definition in google/protobuf/duration.proto. A valid Duration -// may still be too large to fit into a time.Duration (the range of Duration -// is about 10,000 years, and the range of time.Duration is about 290). -func validateDuration(d *Duration) error { - if d == nil { - return errors.New("duration: nil Duration") - } - if d.Seconds < minSeconds || d.Seconds > maxSeconds { - return fmt.Errorf("duration: %#v: seconds out of range", d) - } - if d.Nanos <= -1e9 || d.Nanos >= 1e9 { - return fmt.Errorf("duration: %#v: nanos out of range", d) - } - // Seconds and Nanos must have the same sign, unless d.Nanos is zero. - if (d.Seconds < 0 && d.Nanos > 0) || (d.Seconds > 0 && d.Nanos < 0) { - return fmt.Errorf("duration: %#v: seconds and nanos have different signs", d) - } - return nil -} - -// DurationFromProto converts a Duration to a time.Duration. DurationFromProto -// returns an error if the Duration is invalid or is too large to be -// represented in a time.Duration. -func DurationFromProto(p *Duration) (time.Duration, error) { - if err := validateDuration(p); err != nil { - return 0, err - } - d := time.Duration(p.Seconds) * time.Second - if int64(d/time.Second) != p.Seconds { - return 0, fmt.Errorf("duration: %#v is out of range for time.Duration", p) - } - if p.Nanos != 0 { - d += time.Duration(p.Nanos) * time.Nanosecond - if (d < 0) != (p.Nanos < 0) { - return 0, fmt.Errorf("duration: %#v is out of range for time.Duration", p) - } - } - return d, nil -} - -// DurationProto converts a time.Duration to a Duration. -func DurationProto(d time.Duration) *Duration { - nanos := d.Nanoseconds() - secs := nanos / 1e9 - nanos -= secs * 1e9 - return &Duration{ - Seconds: secs, - Nanos: int32(nanos), - } -} diff --git a/vendor/github.com/gogo/protobuf/types/duration.pb.go b/vendor/github.com/gogo/protobuf/types/duration.pb.go deleted file mode 100644 index 4deafcb1ce..0000000000 --- a/vendor/github.com/gogo/protobuf/types/duration.pb.go +++ /dev/null @@ -1,517 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: google/protobuf/duration.proto - -package types - -import ( - bytes "bytes" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// A Duration represents a signed, fixed-length span of time represented -// as a count of seconds and fractions of seconds at nanosecond -// resolution. It is independent of any calendar and concepts like "day" -// or "month". It is related to Timestamp in that the difference between -// two Timestamp values is a Duration and it can be added or subtracted -// from a Timestamp. Range is approximately +-10,000 years. -// -// # Examples -// -// Example 1: Compute Duration from two Timestamps in pseudo code. -// -// Timestamp start = ...; -// Timestamp end = ...; -// Duration duration = ...; -// -// duration.seconds = end.seconds - start.seconds; -// duration.nanos = end.nanos - start.nanos; -// -// if (duration.seconds < 0 && duration.nanos > 0) { -// duration.seconds += 1; -// duration.nanos -= 1000000000; -// } else if (durations.seconds > 0 && duration.nanos < 0) { -// duration.seconds -= 1; -// duration.nanos += 1000000000; -// } -// -// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. -// -// Timestamp start = ...; -// Duration duration = ...; -// Timestamp end = ...; -// -// end.seconds = start.seconds + duration.seconds; -// end.nanos = start.nanos + duration.nanos; -// -// if (end.nanos < 0) { -// end.seconds -= 1; -// end.nanos += 1000000000; -// } else if (end.nanos >= 1000000000) { -// end.seconds += 1; -// end.nanos -= 1000000000; -// } -// -// Example 3: Compute Duration from datetime.timedelta in Python. -// -// td = datetime.timedelta(days=3, minutes=10) -// duration = Duration() -// duration.FromTimedelta(td) -// -// # JSON Mapping -// -// In JSON format, the Duration type is encoded as a string rather than an -// object, where the string ends in the suffix "s" (indicating seconds) and -// is preceded by the number of seconds, with nanoseconds expressed as -// fractional seconds. For example, 3 seconds with 0 nanoseconds should be -// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should -// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 -// microsecond should be expressed in JSON format as "3.000001s". -// -// -type Duration struct { - // Signed seconds of the span of time. Must be from -315,576,000,000 - // to +315,576,000,000 inclusive. Note: these bounds are computed from: - // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` - // Signed fractions of a second at nanosecond resolution of the span - // of time. Durations less than one second are represented with a 0 - // `seconds` field and a positive or negative `nanos` field. For durations - // of one second or more, a non-zero value for the `nanos` field must be - // of the same sign as the `seconds` field. Must be from -999,999,999 - // to +999,999,999 inclusive. - Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Duration) Reset() { *m = Duration{} } -func (*Duration) ProtoMessage() {} -func (*Duration) Descriptor() ([]byte, []int) { - return fileDescriptor_23597b2ebd7ac6c5, []int{0} -} -func (*Duration) XXX_WellKnownType() string { return "Duration" } -func (m *Duration) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Duration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Duration.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Duration) XXX_Merge(src proto.Message) { - xxx_messageInfo_Duration.Merge(m, src) -} -func (m *Duration) XXX_Size() int { - return m.Size() -} -func (m *Duration) XXX_DiscardUnknown() { - xxx_messageInfo_Duration.DiscardUnknown(m) -} - -var xxx_messageInfo_Duration proto.InternalMessageInfo - -func (m *Duration) GetSeconds() int64 { - if m != nil { - return m.Seconds - } - return 0 -} - -func (m *Duration) GetNanos() int32 { - if m != nil { - return m.Nanos - } - return 0 -} - -func (*Duration) XXX_MessageName() string { - return "google.protobuf.Duration" -} -func init() { - proto.RegisterType((*Duration)(nil), "google.protobuf.Duration") -} - -func init() { proto.RegisterFile("google/protobuf/duration.proto", fileDescriptor_23597b2ebd7ac6c5) } - -var fileDescriptor_23597b2ebd7ac6c5 = []byte{ - // 209 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xcf, 0xcf, 0x4f, - 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0x29, 0x2d, 0x4a, - 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x03, 0x8b, 0x08, 0xf1, 0x43, 0xe4, 0xf5, 0x60, 0xf2, 0x4a, 0x56, - 0x5c, 0x1c, 0x2e, 0x50, 0x25, 0x42, 0x12, 0x5c, 0xec, 0xc5, 0xa9, 0xc9, 0xf9, 0x79, 0x29, 0xc5, - 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xcc, 0x41, 0x30, 0xae, 0x90, 0x08, 0x17, 0x6b, 0x5e, 0x62, 0x5e, - 0x7e, 0xb1, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x84, 0xe3, 0x54, 0x7f, 0xe3, 0xa1, 0x1c, - 0xc3, 0x87, 0x87, 0x72, 0x8c, 0x2b, 0x1e, 0xc9, 0x31, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, - 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x2f, 0x1e, 0xc9, 0x31, 0x7c, 0x78, 0x24, 0xc7, 0xb8, 0xe2, - 0xb1, 0x1c, 0xe3, 0x89, 0xc7, 0x72, 0x8c, 0x5c, 0xc2, 0xc9, 0xf9, 0xb9, 0x7a, 0x68, 0x56, 0x3b, - 0xf1, 0xc2, 0x2c, 0x0e, 0x00, 0x89, 0x04, 0x30, 0x46, 0xb1, 0x96, 0x54, 0x16, 0xa4, 0x16, 0xff, - 0x60, 0x64, 0x5c, 0xc4, 0xc4, 0xec, 0x1e, 0xe0, 0xb4, 0x8a, 0x49, 0xce, 0x1d, 0xa2, 0x25, 0x00, - 0xaa, 0x45, 0x2f, 0x3c, 0x35, 0x27, 0xc7, 0x3b, 0x2f, 0xbf, 0x3c, 0x2f, 0x04, 0xa4, 0x32, 0x89, - 0x0d, 0x6c, 0x96, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x8a, 0x1c, 0x64, 0x4e, 0xf6, 0x00, 0x00, - 0x00, -} - -func (this *Duration) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Duration) - if !ok { - that2, ok := that.(Duration) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Seconds != that1.Seconds { - if this.Seconds < that1.Seconds { - return -1 - } - return 1 - } - if this.Nanos != that1.Nanos { - if this.Nanos < that1.Nanos { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *Duration) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Duration) - if !ok { - that2, ok := that.(Duration) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Seconds != that1.Seconds { - return false - } - if this.Nanos != that1.Nanos { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Duration) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&types.Duration{") - s = append(s, "Seconds: "+fmt.Sprintf("%#v", this.Seconds)+",\n") - s = append(s, "Nanos: "+fmt.Sprintf("%#v", this.Nanos)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringDuration(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *Duration) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Duration) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Duration) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Nanos != 0 { - i = encodeVarintDuration(dAtA, i, uint64(m.Nanos)) - i-- - dAtA[i] = 0x10 - } - if m.Seconds != 0 { - i = encodeVarintDuration(dAtA, i, uint64(m.Seconds)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintDuration(dAtA []byte, offset int, v uint64) int { - offset -= sovDuration(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Duration) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Seconds != 0 { - n += 1 + sovDuration(uint64(m.Seconds)) - } - if m.Nanos != 0 { - n += 1 + sovDuration(uint64(m.Nanos)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovDuration(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozDuration(x uint64) (n int) { - return sovDuration(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Duration) Unmarshal(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 ErrIntOverflowDuration - } - 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: Duration: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Duration: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Seconds", wireType) - } - m.Seconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDuration - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Seconds |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Nanos", wireType) - } - m.Nanos = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDuration - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Nanos |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipDuration(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDuration - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipDuration(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDuration - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDuration - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDuration - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthDuration - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupDuration - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthDuration - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthDuration = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDuration = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupDuration = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/gogo/protobuf/types/duration_gogo.go b/vendor/github.com/gogo/protobuf/types/duration_gogo.go deleted file mode 100644 index 90e7670e21..0000000000 --- a/vendor/github.com/gogo/protobuf/types/duration_gogo.go +++ /dev/null @@ -1,100 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2016, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package types - -import ( - "fmt" - "time" -) - -func NewPopulatedDuration(r interface { - Int63() int64 -}, easy bool) *Duration { - this := &Duration{} - maxSecs := time.Hour.Nanoseconds() / 1e9 - max := 2 * maxSecs - s := int64(r.Int63()) % max - s -= maxSecs - neg := int64(1) - if s < 0 { - neg = -1 - } - this.Seconds = s - this.Nanos = int32(neg * (r.Int63() % 1e9)) - return this -} - -func (d *Duration) String() string { - td, err := DurationFromProto(d) - if err != nil { - return fmt.Sprintf("(%v)", err) - } - return td.String() -} - -func NewPopulatedStdDuration(r interface { - Int63() int64 -}, easy bool) *time.Duration { - dur := NewPopulatedDuration(r, easy) - d, err := DurationFromProto(dur) - if err != nil { - return nil - } - return &d -} - -func SizeOfStdDuration(d time.Duration) int { - dur := DurationProto(d) - return dur.Size() -} - -func StdDurationMarshal(d time.Duration) ([]byte, error) { - size := SizeOfStdDuration(d) - buf := make([]byte, size) - _, err := StdDurationMarshalTo(d, buf) - return buf, err -} - -func StdDurationMarshalTo(d time.Duration, data []byte) (int, error) { - dur := DurationProto(d) - return dur.MarshalTo(data) -} - -func StdDurationUnmarshal(d *time.Duration, data []byte) error { - dur := &Duration{} - if err := dur.Unmarshal(data); err != nil { - return err - } - dd, err := DurationFromProto(dur) - if err != nil { - return err - } - *d = dd - return nil -} diff --git a/vendor/github.com/gogo/protobuf/types/empty.pb.go b/vendor/github.com/gogo/protobuf/types/empty.pb.go deleted file mode 100644 index 9e94748b3a..0000000000 --- a/vendor/github.com/gogo/protobuf/types/empty.pb.go +++ /dev/null @@ -1,462 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: google/protobuf/empty.proto - -package types - -import ( - bytes "bytes" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// A generic empty message that you can re-use to avoid defining duplicated -// empty messages in your APIs. A typical example is to use it as the request -// or the response type of an API method. For instance: -// -// service Foo { -// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); -// } -// -// The JSON representation for `Empty` is empty JSON object `{}`. -type Empty struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Empty) Reset() { *m = Empty{} } -func (*Empty) ProtoMessage() {} -func (*Empty) Descriptor() ([]byte, []int) { - return fileDescriptor_900544acb223d5b8, []int{0} -} -func (*Empty) XXX_WellKnownType() string { return "Empty" } -func (m *Empty) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Empty.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Empty) XXX_Merge(src proto.Message) { - xxx_messageInfo_Empty.Merge(m, src) -} -func (m *Empty) XXX_Size() int { - return m.Size() -} -func (m *Empty) XXX_DiscardUnknown() { - xxx_messageInfo_Empty.DiscardUnknown(m) -} - -var xxx_messageInfo_Empty proto.InternalMessageInfo - -func (*Empty) XXX_MessageName() string { - return "google.protobuf.Empty" -} -func init() { - proto.RegisterType((*Empty)(nil), "google.protobuf.Empty") -} - -func init() { proto.RegisterFile("google/protobuf/empty.proto", fileDescriptor_900544acb223d5b8) } - -var fileDescriptor_900544acb223d5b8 = []byte{ - // 176 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xcf, 0xcf, 0x4f, - 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcd, 0x2d, 0x28, - 0xa9, 0xd4, 0x03, 0x73, 0x85, 0xf8, 0x21, 0x92, 0x7a, 0x30, 0x49, 0x25, 0x76, 0x2e, 0x56, 0x57, - 0x90, 0xbc, 0x53, 0x0b, 0xe3, 0x8d, 0x87, 0x72, 0x0c, 0x1f, 0x1e, 0xca, 0x31, 0xfe, 0x78, 0x28, - 0xc7, 0xd8, 0xf0, 0x48, 0x8e, 0x71, 0xc5, 0x23, 0x39, 0xc6, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, - 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0xf1, 0xc5, 0x23, 0x39, 0x86, 0x0f, 0x20, 0xf1, 0xc7, 0x72, - 0x8c, 0x27, 0x1e, 0xcb, 0x31, 0x72, 0x09, 0x27, 0xe7, 0xe7, 0xea, 0xa1, 0x19, 0xe8, 0xc4, 0x05, - 0x36, 0x2e, 0x00, 0xc4, 0x0d, 0x60, 0x8c, 0x62, 0x2d, 0xa9, 0x2c, 0x48, 0x2d, 0xfe, 0xc1, 0xc8, - 0xb8, 0x88, 0x89, 0xd9, 0x3d, 0xc0, 0x69, 0x15, 0x93, 0x9c, 0x3b, 0x44, 0x7d, 0x00, 0x54, 0xbd, - 0x5e, 0x78, 0x6a, 0x4e, 0x8e, 0x77, 0x5e, 0x7e, 0x79, 0x5e, 0x08, 0x48, 0x65, 0x12, 0x1b, 0xd8, - 0x20, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x21, 0xbe, 0xb6, 0x31, 0xc6, 0x00, 0x00, 0x00, -} - -func (this *Empty) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Empty) - if !ok { - that2, ok := that.(Empty) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *Empty) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Empty) - if !ok { - that2, ok := that.(Empty) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Empty) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 4) - s = append(s, "&types.Empty{") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringEmpty(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *Empty) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Empty) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Empty) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func encodeVarintEmpty(dAtA []byte, offset int, v uint64) int { - offset -= sovEmpty(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func NewPopulatedEmpty(r randyEmpty, easy bool) *Empty { - this := &Empty{} - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedEmpty(r, 1) - } - return this -} - -type randyEmpty interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneEmpty(r randyEmpty) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringEmpty(r randyEmpty) string { - v1 := r.Intn(100) - tmps := make([]rune, v1) - for i := 0; i < v1; i++ { - tmps[i] = randUTF8RuneEmpty(r) - } - return string(tmps) -} -func randUnrecognizedEmpty(r randyEmpty, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldEmpty(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldEmpty(dAtA []byte, r randyEmpty, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateEmpty(dAtA, uint64(key)) - v2 := r.Int63() - if r.Intn(2) == 0 { - v2 *= -1 - } - dAtA = encodeVarintPopulateEmpty(dAtA, uint64(v2)) - case 1: - dAtA = encodeVarintPopulateEmpty(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateEmpty(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateEmpty(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateEmpty(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateEmpty(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} -func (m *Empty) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovEmpty(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEmpty(x uint64) (n int) { - return sovEmpty(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Empty) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Empty{`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringEmpty(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Empty) Unmarshal(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 ErrIntOverflowEmpty - } - 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: Empty: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Empty: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipEmpty(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEmpty - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEmpty(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEmpty - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEmpty - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEmpty - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthEmpty - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEmpty - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEmpty - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEmpty = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEmpty = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEmpty = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/gogo/protobuf/types/field_mask.pb.go b/vendor/github.com/gogo/protobuf/types/field_mask.pb.go deleted file mode 100644 index 6ae346d925..0000000000 --- a/vendor/github.com/gogo/protobuf/types/field_mask.pb.go +++ /dev/null @@ -1,738 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: google/protobuf/field_mask.proto - -package types - -import ( - bytes "bytes" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// `FieldMask` represents a set of symbolic field paths, for example: -// -// paths: "f.a" -// paths: "f.b.d" -// -// Here `f` represents a field in some root message, `a` and `b` -// fields in the message found in `f`, and `d` a field found in the -// message in `f.b`. -// -// Field masks are used to specify a subset of fields that should be -// returned by a get operation or modified by an update operation. -// Field masks also have a custom JSON encoding (see below). -// -// # Field Masks in Projections -// -// When used in the context of a projection, a response message or -// sub-message is filtered by the API to only contain those fields as -// specified in the mask. For example, if the mask in the previous -// example is applied to a response message as follows: -// -// f { -// a : 22 -// b { -// d : 1 -// x : 2 -// } -// y : 13 -// } -// z: 8 -// -// The result will not contain specific values for fields x,y and z -// (their value will be set to the default, and omitted in proto text -// output): -// -// -// f { -// a : 22 -// b { -// d : 1 -// } -// } -// -// A repeated field is not allowed except at the last position of a -// paths string. -// -// If a FieldMask object is not present in a get operation, the -// operation applies to all fields (as if a FieldMask of all fields -// had been specified). -// -// Note that a field mask does not necessarily apply to the -// top-level response message. In case of a REST get operation, the -// field mask applies directly to the response, but in case of a REST -// list operation, the mask instead applies to each individual message -// in the returned resource list. In case of a REST custom method, -// other definitions may be used. Where the mask applies will be -// clearly documented together with its declaration in the API. In -// any case, the effect on the returned resource/resources is required -// behavior for APIs. -// -// # Field Masks in Update Operations -// -// A field mask in update operations specifies which fields of the -// targeted resource are going to be updated. The API is required -// to only change the values of the fields as specified in the mask -// and leave the others untouched. If a resource is passed in to -// describe the updated values, the API ignores the values of all -// fields not covered by the mask. -// -// If a repeated field is specified for an update operation, new values will -// be appended to the existing repeated field in the target resource. Note that -// a repeated field is only allowed in the last position of a `paths` string. -// -// If a sub-message is specified in the last position of the field mask for an -// update operation, then new value will be merged into the existing sub-message -// in the target resource. -// -// For example, given the target message: -// -// f { -// b { -// d: 1 -// x: 2 -// } -// c: [1] -// } -// -// And an update message: -// -// f { -// b { -// d: 10 -// } -// c: [2] -// } -// -// then if the field mask is: -// -// paths: ["f.b", "f.c"] -// -// then the result will be: -// -// f { -// b { -// d: 10 -// x: 2 -// } -// c: [1, 2] -// } -// -// An implementation may provide options to override this default behavior for -// repeated and message fields. -// -// In order to reset a field's value to the default, the field must -// be in the mask and set to the default value in the provided resource. -// Hence, in order to reset all fields of a resource, provide a default -// instance of the resource and set all fields in the mask, or do -// not provide a mask as described below. -// -// If a field mask is not present on update, the operation applies to -// all fields (as if a field mask of all fields has been specified). -// Note that in the presence of schema evolution, this may mean that -// fields the client does not know and has therefore not filled into -// the request will be reset to their default. If this is unwanted -// behavior, a specific service may require a client to always specify -// a field mask, producing an error if not. -// -// As with get operations, the location of the resource which -// describes the updated values in the request message depends on the -// operation kind. In any case, the effect of the field mask is -// required to be honored by the API. -// -// ## Considerations for HTTP REST -// -// The HTTP kind of an update operation which uses a field mask must -// be set to PATCH instead of PUT in order to satisfy HTTP semantics -// (PUT must only be used for full updates). -// -// # JSON Encoding of Field Masks -// -// In JSON, a field mask is encoded as a single string where paths are -// separated by a comma. Fields name in each path are converted -// to/from lower-camel naming conventions. -// -// As an example, consider the following message declarations: -// -// message Profile { -// User user = 1; -// Photo photo = 2; -// } -// message User { -// string display_name = 1; -// string address = 2; -// } -// -// In proto a field mask for `Profile` may look as such: -// -// mask { -// paths: "user.display_name" -// paths: "photo" -// } -// -// In JSON, the same mask is represented as below: -// -// { -// mask: "user.displayName,photo" -// } -// -// # Field Masks and Oneof Fields -// -// Field masks treat fields in oneofs just as regular fields. Consider the -// following message: -// -// message SampleMessage { -// oneof test_oneof { -// string name = 4; -// SubMessage sub_message = 9; -// } -// } -// -// The field mask can be: -// -// mask { -// paths: "name" -// } -// -// Or: -// -// mask { -// paths: "sub_message" -// } -// -// Note that oneof type names ("test_oneof" in this case) cannot be used in -// paths. -// -// ## Field Mask Verification -// -// The implementation of any API method which has a FieldMask type field in the -// request should verify the included field paths, and return an -// `INVALID_ARGUMENT` error if any path is duplicated or unmappable. -type FieldMask struct { - // The set of field mask paths. - Paths []string `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FieldMask) Reset() { *m = FieldMask{} } -func (*FieldMask) ProtoMessage() {} -func (*FieldMask) Descriptor() ([]byte, []int) { - return fileDescriptor_5158202634f0da48, []int{0} -} -func (m *FieldMask) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FieldMask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FieldMask.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *FieldMask) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldMask.Merge(m, src) -} -func (m *FieldMask) XXX_Size() int { - return m.Size() -} -func (m *FieldMask) XXX_DiscardUnknown() { - xxx_messageInfo_FieldMask.DiscardUnknown(m) -} - -var xxx_messageInfo_FieldMask proto.InternalMessageInfo - -func (m *FieldMask) GetPaths() []string { - if m != nil { - return m.Paths - } - return nil -} - -func (*FieldMask) XXX_MessageName() string { - return "google.protobuf.FieldMask" -} -func init() { - proto.RegisterType((*FieldMask)(nil), "google.protobuf.FieldMask") -} - -func init() { proto.RegisterFile("google/protobuf/field_mask.proto", fileDescriptor_5158202634f0da48) } - -var fileDescriptor_5158202634f0da48 = []byte{ - // 203 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xcf, 0xcf, 0x4f, - 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcb, 0x4c, 0xcd, - 0x49, 0x89, 0xcf, 0x4d, 0x2c, 0xce, 0xd6, 0x03, 0x8b, 0x09, 0xf1, 0x43, 0x54, 0xe8, 0xc1, 0x54, - 0x28, 0x29, 0x72, 0x71, 0xba, 0x81, 0x14, 0xf9, 0x26, 0x16, 0x67, 0x0b, 0x89, 0x70, 0xb1, 0x16, - 0x24, 0x96, 0x64, 0x14, 0x4b, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x06, 0x41, 0x38, 0x4e, 0x1d, 0x8c, - 0x37, 0x1e, 0xca, 0x31, 0x7c, 0x78, 0x28, 0xc7, 0xf8, 0xe3, 0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39, - 0xc6, 0x15, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, - 0x39, 0xc6, 0x17, 0x8f, 0xe4, 0x18, 0x3e, 0x80, 0xc4, 0x1f, 0xcb, 0x31, 0x9e, 0x78, 0x2c, 0xc7, - 0xc8, 0x25, 0x9c, 0x9c, 0x9f, 0xab, 0x87, 0x66, 0x95, 0x13, 0x1f, 0xdc, 0xa2, 0x00, 0x90, 0x50, - 0x00, 0x63, 0x14, 0x6b, 0x49, 0x65, 0x41, 0x6a, 0xf1, 0x0f, 0x46, 0xc6, 0x45, 0x4c, 0xcc, 0xee, - 0x01, 0x4e, 0xab, 0x98, 0xe4, 0xdc, 0x21, 0x7a, 0x02, 0xa0, 0x7a, 0xf4, 0xc2, 0x53, 0x73, 0x72, - 0xbc, 0xf3, 0xf2, 0xcb, 0xf3, 0x42, 0x40, 0x2a, 0x93, 0xd8, 0xc0, 0x86, 0x19, 0x03, 0x02, 0x00, - 0x00, 0xff, 0xff, 0x43, 0xa0, 0x83, 0xd0, 0xe9, 0x00, 0x00, 0x00, -} - -func (this *FieldMask) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*FieldMask) - if !ok { - that2, ok := that.(FieldMask) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if len(this.Paths) != len(that1.Paths) { - if len(this.Paths) < len(that1.Paths) { - return -1 - } - return 1 - } - for i := range this.Paths { - if this.Paths[i] != that1.Paths[i] { - if this.Paths[i] < that1.Paths[i] { - return -1 - } - return 1 - } - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *FieldMask) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*FieldMask) - if !ok { - that2, ok := that.(FieldMask) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Paths) != len(that1.Paths) { - return false - } - for i := range this.Paths { - if this.Paths[i] != that1.Paths[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *FieldMask) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&types.FieldMask{") - s = append(s, "Paths: "+fmt.Sprintf("%#v", this.Paths)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringFieldMask(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *FieldMask) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *FieldMask) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FieldMask) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Paths) > 0 { - for iNdEx := len(m.Paths) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Paths[iNdEx]) - copy(dAtA[i:], m.Paths[iNdEx]) - i = encodeVarintFieldMask(dAtA, i, uint64(len(m.Paths[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintFieldMask(dAtA []byte, offset int, v uint64) int { - offset -= sovFieldMask(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func NewPopulatedFieldMask(r randyFieldMask, easy bool) *FieldMask { - this := &FieldMask{} - v1 := r.Intn(10) - this.Paths = make([]string, v1) - for i := 0; i < v1; i++ { - this.Paths[i] = string(randStringFieldMask(r)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedFieldMask(r, 2) - } - return this -} - -type randyFieldMask interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneFieldMask(r randyFieldMask) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringFieldMask(r randyFieldMask) string { - v2 := r.Intn(100) - tmps := make([]rune, v2) - for i := 0; i < v2; i++ { - tmps[i] = randUTF8RuneFieldMask(r) - } - return string(tmps) -} -func randUnrecognizedFieldMask(r randyFieldMask, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldFieldMask(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldFieldMask(dAtA []byte, r randyFieldMask, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateFieldMask(dAtA, uint64(key)) - v3 := r.Int63() - if r.Intn(2) == 0 { - v3 *= -1 - } - dAtA = encodeVarintPopulateFieldMask(dAtA, uint64(v3)) - case 1: - dAtA = encodeVarintPopulateFieldMask(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateFieldMask(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateFieldMask(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateFieldMask(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateFieldMask(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} -func (m *FieldMask) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Paths) > 0 { - for _, s := range m.Paths { - l = len(s) - n += 1 + l + sovFieldMask(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovFieldMask(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozFieldMask(x uint64) (n int) { - return sovFieldMask(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *FieldMask) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FieldMask{`, - `Paths:` + fmt.Sprintf("%v", this.Paths) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringFieldMask(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *FieldMask) Unmarshal(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 ErrIntOverflowFieldMask - } - 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: FieldMask: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FieldMask: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Paths", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFieldMask - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthFieldMask - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFieldMask - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Paths = append(m.Paths, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipFieldMask(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthFieldMask - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipFieldMask(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowFieldMask - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowFieldMask - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowFieldMask - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthFieldMask - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupFieldMask - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthFieldMask - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthFieldMask = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowFieldMask = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupFieldMask = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/gogo/protobuf/types/protosize.go b/vendor/github.com/gogo/protobuf/types/protosize.go deleted file mode 100644 index 3a2d1b7e11..0000000000 --- a/vendor/github.com/gogo/protobuf/types/protosize.go +++ /dev/null @@ -1,34 +0,0 @@ -package types - -func (m *Any) ProtoSize() (n int) { return m.Size() } -func (m *Api) ProtoSize() (n int) { return m.Size() } -func (m *Method) ProtoSize() (n int) { return m.Size() } -func (m *Mixin) ProtoSize() (n int) { return m.Size() } -func (m *Duration) ProtoSize() (n int) { return m.Size() } -func (m *Empty) ProtoSize() (n int) { return m.Size() } -func (m *FieldMask) ProtoSize() (n int) { return m.Size() } -func (m *SourceContext) ProtoSize() (n int) { return m.Size() } -func (m *Struct) ProtoSize() (n int) { return m.Size() } -func (m *Value) ProtoSize() (n int) { return m.Size() } -func (m *Value_NullValue) ProtoSize() (n int) { return m.Size() } -func (m *Value_NumberValue) ProtoSize() (n int) { return m.Size() } -func (m *Value_StringValue) ProtoSize() (n int) { return m.Size() } -func (m *Value_BoolValue) ProtoSize() (n int) { return m.Size() } -func (m *Value_StructValue) ProtoSize() (n int) { return m.Size() } -func (m *Value_ListValue) ProtoSize() (n int) { return m.Size() } -func (m *ListValue) ProtoSize() (n int) { return m.Size() } -func (m *Timestamp) ProtoSize() (n int) { return m.Size() } -func (m *Type) ProtoSize() (n int) { return m.Size() } -func (m *Field) ProtoSize() (n int) { return m.Size() } -func (m *Enum) ProtoSize() (n int) { return m.Size() } -func (m *EnumValue) ProtoSize() (n int) { return m.Size() } -func (m *Option) ProtoSize() (n int) { return m.Size() } -func (m *DoubleValue) ProtoSize() (n int) { return m.Size() } -func (m *FloatValue) ProtoSize() (n int) { return m.Size() } -func (m *Int64Value) ProtoSize() (n int) { return m.Size() } -func (m *UInt64Value) ProtoSize() (n int) { return m.Size() } -func (m *Int32Value) ProtoSize() (n int) { return m.Size() } -func (m *UInt32Value) ProtoSize() (n int) { return m.Size() } -func (m *BoolValue) ProtoSize() (n int) { return m.Size() } -func (m *StringValue) ProtoSize() (n int) { return m.Size() } -func (m *BytesValue) ProtoSize() (n int) { return m.Size() } diff --git a/vendor/github.com/gogo/protobuf/types/source_context.pb.go b/vendor/github.com/gogo/protobuf/types/source_context.pb.go deleted file mode 100644 index 8e6ce71b27..0000000000 --- a/vendor/github.com/gogo/protobuf/types/source_context.pb.go +++ /dev/null @@ -1,524 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: google/protobuf/source_context.proto - -package types - -import ( - bytes "bytes" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// `SourceContext` represents information about the source of a -// protobuf element, like the file in which it is defined. -type SourceContext struct { - // The path-qualified name of the .proto file that contained the associated - // protobuf element. For example: `"google/protobuf/source_context.proto"`. - FileName string `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SourceContext) Reset() { *m = SourceContext{} } -func (*SourceContext) ProtoMessage() {} -func (*SourceContext) Descriptor() ([]byte, []int) { - return fileDescriptor_b686cdb126d509db, []int{0} -} -func (m *SourceContext) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SourceContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SourceContext.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SourceContext) XXX_Merge(src proto.Message) { - xxx_messageInfo_SourceContext.Merge(m, src) -} -func (m *SourceContext) XXX_Size() int { - return m.Size() -} -func (m *SourceContext) XXX_DiscardUnknown() { - xxx_messageInfo_SourceContext.DiscardUnknown(m) -} - -var xxx_messageInfo_SourceContext proto.InternalMessageInfo - -func (m *SourceContext) GetFileName() string { - if m != nil { - return m.FileName - } - return "" -} - -func (*SourceContext) XXX_MessageName() string { - return "google.protobuf.SourceContext" -} -func init() { - proto.RegisterType((*SourceContext)(nil), "google.protobuf.SourceContext") -} - -func init() { - proto.RegisterFile("google/protobuf/source_context.proto", fileDescriptor_b686cdb126d509db) -} - -var fileDescriptor_b686cdb126d509db = []byte{ - // 212 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0xcf, 0xcf, 0x4f, - 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0xce, 0x2f, 0x2d, - 0x4a, 0x4e, 0x8d, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xad, 0x28, 0xd1, 0x03, 0x8b, 0x0b, 0xf1, 0x43, - 0x54, 0xe9, 0xc1, 0x54, 0x29, 0xe9, 0x70, 0xf1, 0x06, 0x83, 0x15, 0x3a, 0x43, 0xd4, 0x09, 0x49, - 0x73, 0x71, 0xa6, 0x65, 0xe6, 0xa4, 0xc6, 0xe7, 0x25, 0xe6, 0xa6, 0x4a, 0x30, 0x2a, 0x30, 0x6a, - 0x70, 0x06, 0x71, 0x80, 0x04, 0xfc, 0x12, 0x73, 0x53, 0x9d, 0x3a, 0x19, 0x6f, 0x3c, 0x94, 0x63, - 0xf8, 0xf0, 0x50, 0x8e, 0xf1, 0xc7, 0x43, 0x39, 0xc6, 0x86, 0x47, 0x72, 0x8c, 0x2b, 0x1e, 0xc9, - 0x31, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x2f, 0x1e, - 0xc9, 0x31, 0x7c, 0x00, 0x89, 0x3f, 0x96, 0x63, 0x3c, 0xf1, 0x58, 0x8e, 0x91, 0x4b, 0x38, 0x39, - 0x3f, 0x57, 0x0f, 0xcd, 0x56, 0x27, 0x21, 0x14, 0x3b, 0x03, 0x40, 0xc2, 0x01, 0x8c, 0x51, 0xac, - 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x8b, 0x98, 0x98, 0xdd, 0x03, 0x9c, 0x56, 0x31, 0xc9, 0xb9, 0x43, - 0x34, 0x05, 0x40, 0x35, 0xe9, 0x85, 0xa7, 0xe6, 0xe4, 0x78, 0xe7, 0xe5, 0x97, 0xe7, 0x85, 0x80, - 0x94, 0x25, 0xb1, 0x81, 0x4d, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x37, 0x2a, 0xa1, - 0xf9, 0x00, 0x00, 0x00, -} - -func (this *SourceContext) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*SourceContext) - if !ok { - that2, ok := that.(SourceContext) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.FileName != that1.FileName { - if this.FileName < that1.FileName { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *SourceContext) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*SourceContext) - if !ok { - that2, ok := that.(SourceContext) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.FileName != that1.FileName { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *SourceContext) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&types.SourceContext{") - s = append(s, "FileName: "+fmt.Sprintf("%#v", this.FileName)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringSourceContext(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *SourceContext) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SourceContext) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SourceContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.FileName) > 0 { - i -= len(m.FileName) - copy(dAtA[i:], m.FileName) - i = encodeVarintSourceContext(dAtA, i, uint64(len(m.FileName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintSourceContext(dAtA []byte, offset int, v uint64) int { - offset -= sovSourceContext(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func NewPopulatedSourceContext(r randySourceContext, easy bool) *SourceContext { - this := &SourceContext{} - this.FileName = string(randStringSourceContext(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedSourceContext(r, 2) - } - return this -} - -type randySourceContext interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneSourceContext(r randySourceContext) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringSourceContext(r randySourceContext) string { - v1 := r.Intn(100) - tmps := make([]rune, v1) - for i := 0; i < v1; i++ { - tmps[i] = randUTF8RuneSourceContext(r) - } - return string(tmps) -} -func randUnrecognizedSourceContext(r randySourceContext, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldSourceContext(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldSourceContext(dAtA []byte, r randySourceContext, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(key)) - v2 := r.Int63() - if r.Intn(2) == 0 { - v2 *= -1 - } - dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(v2)) - case 1: - dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateSourceContext(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} -func (m *SourceContext) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.FileName) - if l > 0 { - n += 1 + l + sovSourceContext(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovSourceContext(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSourceContext(x uint64) (n int) { - return sovSourceContext(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *SourceContext) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SourceContext{`, - `FileName:` + fmt.Sprintf("%v", this.FileName) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringSourceContext(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *SourceContext) Unmarshal(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 ErrIntOverflowSourceContext - } - 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: SourceContext: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SourceContext: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FileName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSourceContext - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSourceContext - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSourceContext - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FileName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSourceContext(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSourceContext - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSourceContext(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSourceContext - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSourceContext - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSourceContext - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthSourceContext - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSourceContext - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSourceContext - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthSourceContext = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSourceContext = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSourceContext = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/gogo/protobuf/types/struct.pb.go b/vendor/github.com/gogo/protobuf/types/struct.pb.go deleted file mode 100644 index c0457312e6..0000000000 --- a/vendor/github.com/gogo/protobuf/types/struct.pb.go +++ /dev/null @@ -1,2271 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: google/protobuf/struct.proto - -package types - -import ( - bytes "bytes" - encoding_binary "encoding/binary" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strconv "strconv" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// `NullValue` is a singleton enumeration to represent the null value for the -// `Value` type union. -// -// The JSON representation for `NullValue` is JSON `null`. -type NullValue int32 - -const ( - // Null value. - NullValue_NULL_VALUE NullValue = 0 -) - -var NullValue_name = map[int32]string{ - 0: "NULL_VALUE", -} - -var NullValue_value = map[string]int32{ - "NULL_VALUE": 0, -} - -func (NullValue) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_df322afd6c9fb402, []int{0} -} - -func (NullValue) XXX_WellKnownType() string { return "NullValue" } - -// `Struct` represents a structured data value, consisting of fields -// which map to dynamically typed values. In some languages, `Struct` -// might be supported by a native representation. For example, in -// scripting languages like JS a struct is represented as an -// object. The details of that representation are described together -// with the proto support for the language. -// -// The JSON representation for `Struct` is JSON object. -type Struct struct { - // Unordered map of dynamically typed values. - Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Struct) Reset() { *m = Struct{} } -func (*Struct) ProtoMessage() {} -func (*Struct) Descriptor() ([]byte, []int) { - return fileDescriptor_df322afd6c9fb402, []int{0} -} -func (*Struct) XXX_WellKnownType() string { return "Struct" } -func (m *Struct) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Struct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Struct.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Struct) XXX_Merge(src proto.Message) { - xxx_messageInfo_Struct.Merge(m, src) -} -func (m *Struct) XXX_Size() int { - return m.Size() -} -func (m *Struct) XXX_DiscardUnknown() { - xxx_messageInfo_Struct.DiscardUnknown(m) -} - -var xxx_messageInfo_Struct proto.InternalMessageInfo - -func (m *Struct) GetFields() map[string]*Value { - if m != nil { - return m.Fields - } - return nil -} - -func (*Struct) XXX_MessageName() string { - return "google.protobuf.Struct" -} - -// `Value` represents a dynamically typed value which can be either -// null, a number, a string, a boolean, a recursive struct value, or a -// list of values. A producer of value is expected to set one of that -// variants, absence of any variant indicates an error. -// -// The JSON representation for `Value` is JSON value. -type Value struct { - // The kind of value. - // - // Types that are valid to be assigned to Kind: - // *Value_NullValue - // *Value_NumberValue - // *Value_StringValue - // *Value_BoolValue - // *Value_StructValue - // *Value_ListValue - Kind isValue_Kind `protobuf_oneof:"kind"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Value) Reset() { *m = Value{} } -func (*Value) ProtoMessage() {} -func (*Value) Descriptor() ([]byte, []int) { - return fileDescriptor_df322afd6c9fb402, []int{1} -} -func (*Value) XXX_WellKnownType() string { return "Value" } -func (m *Value) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Value.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Value) XXX_Merge(src proto.Message) { - xxx_messageInfo_Value.Merge(m, src) -} -func (m *Value) XXX_Size() int { - return m.Size() -} -func (m *Value) XXX_DiscardUnknown() { - xxx_messageInfo_Value.DiscardUnknown(m) -} - -var xxx_messageInfo_Value proto.InternalMessageInfo - -type isValue_Kind interface { - isValue_Kind() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int - Compare(interface{}) int -} - -type Value_NullValue struct { - NullValue NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof" json:"null_value,omitempty"` -} -type Value_NumberValue struct { - NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,json=numberValue,proto3,oneof" json:"number_value,omitempty"` -} -type Value_StringValue struct { - StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,proto3,oneof" json:"string_value,omitempty"` -} -type Value_BoolValue struct { - BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,proto3,oneof" json:"bool_value,omitempty"` -} -type Value_StructValue struct { - StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,proto3,oneof" json:"struct_value,omitempty"` -} -type Value_ListValue struct { - ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,proto3,oneof" json:"list_value,omitempty"` -} - -func (*Value_NullValue) isValue_Kind() {} -func (*Value_NumberValue) isValue_Kind() {} -func (*Value_StringValue) isValue_Kind() {} -func (*Value_BoolValue) isValue_Kind() {} -func (*Value_StructValue) isValue_Kind() {} -func (*Value_ListValue) isValue_Kind() {} - -func (m *Value) GetKind() isValue_Kind { - if m != nil { - return m.Kind - } - return nil -} - -func (m *Value) GetNullValue() NullValue { - if x, ok := m.GetKind().(*Value_NullValue); ok { - return x.NullValue - } - return NullValue_NULL_VALUE -} - -func (m *Value) GetNumberValue() float64 { - if x, ok := m.GetKind().(*Value_NumberValue); ok { - return x.NumberValue - } - return 0 -} - -func (m *Value) GetStringValue() string { - if x, ok := m.GetKind().(*Value_StringValue); ok { - return x.StringValue - } - return "" -} - -func (m *Value) GetBoolValue() bool { - if x, ok := m.GetKind().(*Value_BoolValue); ok { - return x.BoolValue - } - return false -} - -func (m *Value) GetStructValue() *Struct { - if x, ok := m.GetKind().(*Value_StructValue); ok { - return x.StructValue - } - return nil -} - -func (m *Value) GetListValue() *ListValue { - if x, ok := m.GetKind().(*Value_ListValue); ok { - return x.ListValue - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Value) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Value_NullValue)(nil), - (*Value_NumberValue)(nil), - (*Value_StringValue)(nil), - (*Value_BoolValue)(nil), - (*Value_StructValue)(nil), - (*Value_ListValue)(nil), - } -} - -func (*Value) XXX_MessageName() string { - return "google.protobuf.Value" -} - -// `ListValue` is a wrapper around a repeated field of values. -// -// The JSON representation for `ListValue` is JSON array. -type ListValue struct { - // Repeated field of dynamically typed values. - Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListValue) Reset() { *m = ListValue{} } -func (*ListValue) ProtoMessage() {} -func (*ListValue) Descriptor() ([]byte, []int) { - return fileDescriptor_df322afd6c9fb402, []int{2} -} -func (*ListValue) XXX_WellKnownType() string { return "ListValue" } -func (m *ListValue) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListValue.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListValue.Merge(m, src) -} -func (m *ListValue) XXX_Size() int { - return m.Size() -} -func (m *ListValue) XXX_DiscardUnknown() { - xxx_messageInfo_ListValue.DiscardUnknown(m) -} - -var xxx_messageInfo_ListValue proto.InternalMessageInfo - -func (m *ListValue) GetValues() []*Value { - if m != nil { - return m.Values - } - return nil -} - -func (*ListValue) XXX_MessageName() string { - return "google.protobuf.ListValue" -} -func init() { - proto.RegisterEnum("google.protobuf.NullValue", NullValue_name, NullValue_value) - proto.RegisterType((*Struct)(nil), "google.protobuf.Struct") - proto.RegisterMapType((map[string]*Value)(nil), "google.protobuf.Struct.FieldsEntry") - proto.RegisterType((*Value)(nil), "google.protobuf.Value") - proto.RegisterType((*ListValue)(nil), "google.protobuf.ListValue") -} - -func init() { proto.RegisterFile("google/protobuf/struct.proto", fileDescriptor_df322afd6c9fb402) } - -var fileDescriptor_df322afd6c9fb402 = []byte{ - // 443 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xb1, 0x6f, 0xd3, 0x40, - 0x14, 0xc6, 0xfd, 0x9c, 0xc6, 0x22, 0xcf, 0xa8, 0x54, 0x87, 0x04, 0x51, 0x41, 0x47, 0x94, 0x2e, - 0x11, 0x42, 0xae, 0x14, 0x16, 0x44, 0x58, 0x88, 0x54, 0x5a, 0x89, 0xa8, 0x32, 0x86, 0x16, 0x89, - 0x25, 0xc2, 0xae, 0x1b, 0x59, 0xbd, 0xde, 0x55, 0xf6, 0x1d, 0x28, 0x1b, 0x0b, 0xff, 0x03, 0x33, - 0x13, 0x62, 0xe4, 0xaf, 0xe8, 0xc8, 0xc8, 0x48, 0xdc, 0x85, 0xb1, 0x63, 0x47, 0x74, 0x77, 0xb6, - 0x41, 0x8d, 0xb2, 0xf9, 0x7d, 0xf7, 0x7b, 0xdf, 0x7b, 0xdf, 0x33, 0xde, 0x9f, 0x09, 0x31, 0x63, - 0xe9, 0xf6, 0x59, 0x2e, 0xa4, 0x88, 0xd5, 0xf1, 0x76, 0x21, 0x73, 0x95, 0xc8, 0xc0, 0xd4, 0xe4, - 0x96, 0x7d, 0x0d, 0xea, 0xd7, 0xfe, 0x17, 0x40, 0xef, 0xb5, 0x21, 0xc8, 0x08, 0xbd, 0xe3, 0x2c, - 0x65, 0x47, 0x45, 0x17, 0x7a, 0xad, 0x81, 0x3f, 0xdc, 0x0a, 0xae, 0xc1, 0x81, 0x05, 0x83, 0x17, - 0x86, 0xda, 0xe1, 0x32, 0x9f, 0x47, 0x55, 0xcb, 0xe6, 0x2b, 0xf4, 0xff, 0x93, 0xc9, 0x06, 0xb6, - 0x4e, 0xd2, 0x79, 0x17, 0x7a, 0x30, 0xe8, 0x44, 0xfa, 0x93, 0x3c, 0xc2, 0xf6, 0x87, 0xf7, 0x4c, - 0xa5, 0x5d, 0xb7, 0x07, 0x03, 0x7f, 0x78, 0x67, 0xc9, 0xfc, 0x50, 0xbf, 0x46, 0x16, 0x7a, 0xea, - 0x3e, 0x81, 0xfe, 0x0f, 0x17, 0xdb, 0x46, 0x24, 0x23, 0x44, 0xae, 0x18, 0x9b, 0x5a, 0x03, 0x6d, - 0xba, 0x3e, 0xdc, 0x5c, 0x32, 0xd8, 0x57, 0x8c, 0x19, 0x7e, 0xcf, 0x89, 0x3a, 0xbc, 0x2e, 0xc8, - 0x16, 0xde, 0xe4, 0xea, 0x34, 0x4e, 0xf3, 0xe9, 0xbf, 0xf9, 0xb0, 0xe7, 0x44, 0xbe, 0x55, 0x1b, - 0xa8, 0x90, 0x79, 0xc6, 0x67, 0x15, 0xd4, 0xd2, 0x8b, 0x6b, 0xc8, 0xaa, 0x16, 0x7a, 0x80, 0x18, - 0x0b, 0x51, 0xaf, 0xb1, 0xd6, 0x83, 0xc1, 0x0d, 0x3d, 0x4a, 0x6b, 0x16, 0x78, 0x66, 0x5c, 0x54, - 0x22, 0x2b, 0xa4, 0x6d, 0xa2, 0xde, 0x5d, 0x71, 0xc7, 0xca, 0x5e, 0x25, 0xb2, 0x49, 0xc9, 0xb2, - 0xa2, 0xee, 0xf5, 0x4c, 0xef, 0x72, 0xca, 0x49, 0x56, 0xc8, 0x26, 0x25, 0xab, 0x8b, 0xb1, 0x87, - 0x6b, 0x27, 0x19, 0x3f, 0xea, 0x8f, 0xb0, 0xd3, 0x10, 0x24, 0x40, 0xcf, 0x98, 0xd5, 0x7f, 0x74, - 0xd5, 0xd1, 0x2b, 0xea, 0xe1, 0x3d, 0xec, 0x34, 0x47, 0x24, 0xeb, 0x88, 0xfb, 0x07, 0x93, 0xc9, - 0xf4, 0xf0, 0xf9, 0xe4, 0x60, 0x67, 0xc3, 0x19, 0x7f, 0x86, 0x5f, 0x0b, 0xea, 0x5c, 0x2e, 0x28, - 0x5c, 0x2d, 0x28, 0x7c, 0x2a, 0x29, 0x7c, 0x2b, 0x29, 0x9c, 0x97, 0x14, 0x7e, 0x96, 0x14, 0x7e, - 0x97, 0x14, 0xfe, 0x94, 0xd4, 0xb9, 0xd4, 0xfa, 0x05, 0x85, 0xf3, 0x0b, 0x0a, 0x78, 0x3b, 0x11, - 0xa7, 0xd7, 0x47, 0x8e, 0x7d, 0x9b, 0x3e, 0xd4, 0x75, 0x08, 0xef, 0xda, 0x72, 0x7e, 0x96, 0x16, - 0x57, 0x00, 0x5f, 0xdd, 0xd6, 0x6e, 0x38, 0xfe, 0xee, 0xd2, 0x5d, 0xdb, 0x10, 0xd6, 0x3b, 0xbe, - 0x4d, 0x19, 0x7b, 0xc9, 0xc5, 0x47, 0xfe, 0x46, 0x93, 0xb1, 0x67, 0x9c, 0x1e, 0xff, 0x0d, 0x00, - 0x00, 0xff, 0xff, 0x26, 0x30, 0xdb, 0xbe, 0xe9, 0x02, 0x00, 0x00, -} - -func (this *Struct) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Struct) - if !ok { - that2, ok := that.(Struct) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if len(this.Fields) != len(that1.Fields) { - if len(this.Fields) < len(that1.Fields) { - return -1 - } - return 1 - } - for i := range this.Fields { - if c := this.Fields[i].Compare(that1.Fields[i]); c != 0 { - return c - } - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *Value) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Value) - if !ok { - that2, ok := that.(Value) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if that1.Kind == nil { - if this.Kind != nil { - return 1 - } - } else if this.Kind == nil { - return -1 - } else { - thisType := -1 - switch this.Kind.(type) { - case *Value_NullValue: - thisType = 0 - case *Value_NumberValue: - thisType = 1 - case *Value_StringValue: - thisType = 2 - case *Value_BoolValue: - thisType = 3 - case *Value_StructValue: - thisType = 4 - case *Value_ListValue: - thisType = 5 - default: - panic(fmt.Sprintf("compare: unexpected type %T in oneof", this.Kind)) - } - that1Type := -1 - switch that1.Kind.(type) { - case *Value_NullValue: - that1Type = 0 - case *Value_NumberValue: - that1Type = 1 - case *Value_StringValue: - that1Type = 2 - case *Value_BoolValue: - that1Type = 3 - case *Value_StructValue: - that1Type = 4 - case *Value_ListValue: - that1Type = 5 - default: - panic(fmt.Sprintf("compare: unexpected type %T in oneof", that1.Kind)) - } - if thisType == that1Type { - if c := this.Kind.Compare(that1.Kind); c != 0 { - return c - } - } else if thisType < that1Type { - return -1 - } else if thisType > that1Type { - return 1 - } - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *Value_NullValue) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Value_NullValue) - if !ok { - that2, ok := that.(Value_NullValue) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.NullValue != that1.NullValue { - if this.NullValue < that1.NullValue { - return -1 - } - return 1 - } - return 0 -} -func (this *Value_NumberValue) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Value_NumberValue) - if !ok { - that2, ok := that.(Value_NumberValue) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.NumberValue != that1.NumberValue { - if this.NumberValue < that1.NumberValue { - return -1 - } - return 1 - } - return 0 -} -func (this *Value_StringValue) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Value_StringValue) - if !ok { - that2, ok := that.(Value_StringValue) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.StringValue != that1.StringValue { - if this.StringValue < that1.StringValue { - return -1 - } - return 1 - } - return 0 -} -func (this *Value_BoolValue) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Value_BoolValue) - if !ok { - that2, ok := that.(Value_BoolValue) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.BoolValue != that1.BoolValue { - if !this.BoolValue { - return -1 - } - return 1 - } - return 0 -} -func (this *Value_StructValue) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Value_StructValue) - if !ok { - that2, ok := that.(Value_StructValue) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if c := this.StructValue.Compare(that1.StructValue); c != 0 { - return c - } - return 0 -} -func (this *Value_ListValue) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Value_ListValue) - if !ok { - that2, ok := that.(Value_ListValue) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if c := this.ListValue.Compare(that1.ListValue); c != 0 { - return c - } - return 0 -} -func (this *ListValue) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*ListValue) - if !ok { - that2, ok := that.(ListValue) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if len(this.Values) != len(that1.Values) { - if len(this.Values) < len(that1.Values) { - return -1 - } - return 1 - } - for i := range this.Values { - if c := this.Values[i].Compare(that1.Values[i]); c != 0 { - return c - } - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (x NullValue) String() string { - s, ok := NullValue_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) -} -func (this *Struct) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Struct) - if !ok { - that2, ok := that.(Struct) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Fields) != len(that1.Fields) { - return false - } - for i := range this.Fields { - if !this.Fields[i].Equal(that1.Fields[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Value) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Value) - if !ok { - that2, ok := that.(Value) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if that1.Kind == nil { - if this.Kind != nil { - return false - } - } else if this.Kind == nil { - return false - } else if !this.Kind.Equal(that1.Kind) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Value_NullValue) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Value_NullValue) - if !ok { - that2, ok := that.(Value_NullValue) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.NullValue != that1.NullValue { - return false - } - return true -} -func (this *Value_NumberValue) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Value_NumberValue) - if !ok { - that2, ok := that.(Value_NumberValue) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.NumberValue != that1.NumberValue { - return false - } - return true -} -func (this *Value_StringValue) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Value_StringValue) - if !ok { - that2, ok := that.(Value_StringValue) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.StringValue != that1.StringValue { - return false - } - return true -} -func (this *Value_BoolValue) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Value_BoolValue) - if !ok { - that2, ok := that.(Value_BoolValue) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.BoolValue != that1.BoolValue { - return false - } - return true -} -func (this *Value_StructValue) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Value_StructValue) - if !ok { - that2, ok := that.(Value_StructValue) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.StructValue.Equal(that1.StructValue) { - return false - } - return true -} -func (this *Value_ListValue) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Value_ListValue) - if !ok { - that2, ok := that.(Value_ListValue) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.ListValue.Equal(that1.ListValue) { - return false - } - return true -} -func (this *ListValue) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ListValue) - if !ok { - that2, ok := that.(ListValue) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Values) != len(that1.Values) { - return false - } - for i := range this.Values { - if !this.Values[i].Equal(that1.Values[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Struct) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&types.Struct{") - keysForFields := make([]string, 0, len(this.Fields)) - for k := range this.Fields { - keysForFields = append(keysForFields, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForFields) - mapStringForFields := "map[string]*Value{" - for _, k := range keysForFields { - mapStringForFields += fmt.Sprintf("%#v: %#v,", k, this.Fields[k]) - } - mapStringForFields += "}" - if this.Fields != nil { - s = append(s, "Fields: "+mapStringForFields+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Value) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 10) - s = append(s, "&types.Value{") - if this.Kind != nil { - s = append(s, "Kind: "+fmt.Sprintf("%#v", this.Kind)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Value_NullValue) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&types.Value_NullValue{` + - `NullValue:` + fmt.Sprintf("%#v", this.NullValue) + `}`}, ", ") - return s -} -func (this *Value_NumberValue) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&types.Value_NumberValue{` + - `NumberValue:` + fmt.Sprintf("%#v", this.NumberValue) + `}`}, ", ") - return s -} -func (this *Value_StringValue) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&types.Value_StringValue{` + - `StringValue:` + fmt.Sprintf("%#v", this.StringValue) + `}`}, ", ") - return s -} -func (this *Value_BoolValue) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&types.Value_BoolValue{` + - `BoolValue:` + fmt.Sprintf("%#v", this.BoolValue) + `}`}, ", ") - return s -} -func (this *Value_StructValue) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&types.Value_StructValue{` + - `StructValue:` + fmt.Sprintf("%#v", this.StructValue) + `}`}, ", ") - return s -} -func (this *Value_ListValue) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&types.Value_ListValue{` + - `ListValue:` + fmt.Sprintf("%#v", this.ListValue) + `}`}, ", ") - return s -} -func (this *ListValue) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&types.ListValue{") - if this.Values != nil { - s = append(s, "Values: "+fmt.Sprintf("%#v", this.Values)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringStruct(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *Struct) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Struct) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Struct) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Fields) > 0 { - for k := range m.Fields { - v := m.Fields[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStruct(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintStruct(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintStruct(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Value) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Value) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Kind != nil { - { - size := m.Kind.Size() - i -= size - if _, err := m.Kind.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Value_NullValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Value_NullValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintStruct(dAtA, i, uint64(m.NullValue)) - i-- - dAtA[i] = 0x8 - return len(dAtA) - i, nil -} -func (m *Value_NumberValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Value_NumberValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.NumberValue)))) - i-- - dAtA[i] = 0x11 - return len(dAtA) - i, nil -} -func (m *Value_StringValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Value_StringValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.StringValue) - copy(dAtA[i:], m.StringValue) - i = encodeVarintStruct(dAtA, i, uint64(len(m.StringValue))) - i-- - dAtA[i] = 0x1a - return len(dAtA) - i, nil -} -func (m *Value_BoolValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Value_BoolValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i-- - if m.BoolValue { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - return len(dAtA) - i, nil -} -func (m *Value_StructValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Value_StructValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.StructValue != nil { - { - size, err := m.StructValue.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStruct(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func (m *Value_ListValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Value_ListValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ListValue != nil { - { - size, err := m.ListValue.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStruct(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - return len(dAtA) - i, nil -} -func (m *ListValue) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Values) > 0 { - for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Values[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStruct(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintStruct(dAtA []byte, offset int, v uint64) int { - offset -= sovStruct(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func NewPopulatedStruct(r randyStruct, easy bool) *Struct { - this := &Struct{} - if r.Intn(5) == 0 { - v1 := r.Intn(10) - this.Fields = make(map[string]*Value) - for i := 0; i < v1; i++ { - this.Fields[randStringStruct(r)] = NewPopulatedValue(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedStruct(r, 2) - } - return this -} - -func NewPopulatedValue(r randyStruct, easy bool) *Value { - this := &Value{} - oneofNumber_Kind := []int32{1, 2, 3, 4, 5, 6}[r.Intn(6)] - switch oneofNumber_Kind { - case 1: - this.Kind = NewPopulatedValue_NullValue(r, easy) - case 2: - this.Kind = NewPopulatedValue_NumberValue(r, easy) - case 3: - this.Kind = NewPopulatedValue_StringValue(r, easy) - case 4: - this.Kind = NewPopulatedValue_BoolValue(r, easy) - case 5: - this.Kind = NewPopulatedValue_StructValue(r, easy) - case 6: - this.Kind = NewPopulatedValue_ListValue(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedStruct(r, 7) - } - return this -} - -func NewPopulatedValue_NullValue(r randyStruct, easy bool) *Value_NullValue { - this := &Value_NullValue{} - this.NullValue = NullValue([]int32{0}[r.Intn(1)]) - return this -} -func NewPopulatedValue_NumberValue(r randyStruct, easy bool) *Value_NumberValue { - this := &Value_NumberValue{} - this.NumberValue = float64(r.Float64()) - if r.Intn(2) == 0 { - this.NumberValue *= -1 - } - return this -} -func NewPopulatedValue_StringValue(r randyStruct, easy bool) *Value_StringValue { - this := &Value_StringValue{} - this.StringValue = string(randStringStruct(r)) - return this -} -func NewPopulatedValue_BoolValue(r randyStruct, easy bool) *Value_BoolValue { - this := &Value_BoolValue{} - this.BoolValue = bool(bool(r.Intn(2) == 0)) - return this -} -func NewPopulatedValue_StructValue(r randyStruct, easy bool) *Value_StructValue { - this := &Value_StructValue{} - this.StructValue = NewPopulatedStruct(r, easy) - return this -} -func NewPopulatedValue_ListValue(r randyStruct, easy bool) *Value_ListValue { - this := &Value_ListValue{} - this.ListValue = NewPopulatedListValue(r, easy) - return this -} -func NewPopulatedListValue(r randyStruct, easy bool) *ListValue { - this := &ListValue{} - if r.Intn(5) == 0 { - v2 := r.Intn(5) - this.Values = make([]*Value, v2) - for i := 0; i < v2; i++ { - this.Values[i] = NewPopulatedValue(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedStruct(r, 2) - } - return this -} - -type randyStruct interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneStruct(r randyStruct) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringStruct(r randyStruct) string { - v3 := r.Intn(100) - tmps := make([]rune, v3) - for i := 0; i < v3; i++ { - tmps[i] = randUTF8RuneStruct(r) - } - return string(tmps) -} -func randUnrecognizedStruct(r randyStruct, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldStruct(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldStruct(dAtA []byte, r randyStruct, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateStruct(dAtA, uint64(key)) - v4 := r.Int63() - if r.Intn(2) == 0 { - v4 *= -1 - } - dAtA = encodeVarintPopulateStruct(dAtA, uint64(v4)) - case 1: - dAtA = encodeVarintPopulateStruct(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateStruct(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateStruct(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateStruct(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateStruct(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} -func (m *Struct) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Fields) > 0 { - for k, v := range m.Fields { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovStruct(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovStruct(uint64(len(k))) + l - n += mapEntrySize + 1 + sovStruct(uint64(mapEntrySize)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Value) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Kind != nil { - n += m.Kind.Size() - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Value_NullValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovStruct(uint64(m.NullValue)) - return n -} -func (m *Value_NumberValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 9 - return n -} -func (m *Value_StringValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.StringValue) - n += 1 + l + sovStruct(uint64(l)) - return n -} -func (m *Value_BoolValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 2 - return n -} -func (m *Value_StructValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StructValue != nil { - l = m.StructValue.Size() - n += 1 + l + sovStruct(uint64(l)) - } - return n -} -func (m *Value_ListValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ListValue != nil { - l = m.ListValue.Size() - n += 1 + l + sovStruct(uint64(l)) - } - return n -} -func (m *ListValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Values) > 0 { - for _, e := range m.Values { - l = e.Size() - n += 1 + l + sovStruct(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovStruct(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozStruct(x uint64) (n int) { - return sovStruct(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Struct) String() string { - if this == nil { - return "nil" - } - keysForFields := make([]string, 0, len(this.Fields)) - for k := range this.Fields { - keysForFields = append(keysForFields, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForFields) - mapStringForFields := "map[string]*Value{" - for _, k := range keysForFields { - mapStringForFields += fmt.Sprintf("%v: %v,", k, this.Fields[k]) - } - mapStringForFields += "}" - s := strings.Join([]string{`&Struct{`, - `Fields:` + mapStringForFields + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Value) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Value{`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Value_NullValue) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Value_NullValue{`, - `NullValue:` + fmt.Sprintf("%v", this.NullValue) + `,`, - `}`, - }, "") - return s -} -func (this *Value_NumberValue) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Value_NumberValue{`, - `NumberValue:` + fmt.Sprintf("%v", this.NumberValue) + `,`, - `}`, - }, "") - return s -} -func (this *Value_StringValue) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Value_StringValue{`, - `StringValue:` + fmt.Sprintf("%v", this.StringValue) + `,`, - `}`, - }, "") - return s -} -func (this *Value_BoolValue) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Value_BoolValue{`, - `BoolValue:` + fmt.Sprintf("%v", this.BoolValue) + `,`, - `}`, - }, "") - return s -} -func (this *Value_StructValue) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Value_StructValue{`, - `StructValue:` + strings.Replace(fmt.Sprintf("%v", this.StructValue), "Struct", "Struct", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Value_ListValue) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Value_ListValue{`, - `ListValue:` + strings.Replace(fmt.Sprintf("%v", this.ListValue), "ListValue", "ListValue", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ListValue) String() string { - if this == nil { - return "nil" - } - repeatedStringForValues := "[]*Value{" - for _, f := range this.Values { - repeatedStringForValues += strings.Replace(f.String(), "Value", "Value", 1) + "," - } - repeatedStringForValues += "}" - s := strings.Join([]string{`&ListValue{`, - `Values:` + repeatedStringForValues + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringStruct(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Struct) Unmarshal(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 ErrIntOverflowStruct - } - 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: Struct: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Struct: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStruct - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStruct - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStruct - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Fields == nil { - m.Fields = make(map[string]*Value) - } - var mapkey string - var mapvalue *Value - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStruct - } - 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 ErrIntOverflowStruct - } - 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 ErrInvalidLengthStruct - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthStruct - } - 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 ErrIntOverflowStruct - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthStruct - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthStruct - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &Value{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipStruct(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStruct - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Fields[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStruct(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStruct - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Value) Unmarshal(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 ErrIntOverflowStruct - } - 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: Value: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Value: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NullValue", wireType) - } - var v NullValue - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStruct - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= NullValue(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Kind = &Value_NullValue{v} - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field NumberValue", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Kind = &Value_NumberValue{float64(math.Float64frombits(v))} - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StringValue", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStruct - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthStruct - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStruct - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = &Value_StringValue{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BoolValue", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStruct - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Kind = &Value_BoolValue{b} - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StructValue", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStruct - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStruct - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStruct - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Struct{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Kind = &Value_StructValue{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListValue", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStruct - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStruct - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStruct - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ListValue{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Kind = &Value_ListValue{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStruct(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStruct - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListValue) Unmarshal(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 ErrIntOverflowStruct - } - 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: ListValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStruct - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStruct - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStruct - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Values = append(m.Values, &Value{}) - if err := m.Values[len(m.Values)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStruct(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStruct - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipStruct(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStruct - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStruct - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStruct - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthStruct - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupStruct - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthStruct - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthStruct = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStruct = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupStruct = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/gogo/protobuf/types/timestamp.go b/vendor/github.com/gogo/protobuf/types/timestamp.go deleted file mode 100644 index 232ada57ce..0000000000 --- a/vendor/github.com/gogo/protobuf/types/timestamp.go +++ /dev/null @@ -1,130 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2016 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package types - -// This file implements operations on google.protobuf.Timestamp. - -import ( - "errors" - "fmt" - "time" -) - -const ( - // Seconds field of the earliest valid Timestamp. - // This is time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC).Unix(). - minValidSeconds = -62135596800 - // Seconds field just after the latest valid Timestamp. - // This is time.Date(10000, 1, 1, 0, 0, 0, 0, time.UTC).Unix(). - maxValidSeconds = 253402300800 -) - -// validateTimestamp determines whether a Timestamp is valid. -// A valid timestamp represents a time in the range -// [0001-01-01, 10000-01-01) and has a Nanos field -// in the range [0, 1e9). -// -// If the Timestamp is valid, validateTimestamp returns nil. -// Otherwise, it returns an error that describes -// the problem. -// -// Every valid Timestamp can be represented by a time.Time, but the converse is not true. -func validateTimestamp(ts *Timestamp) error { - if ts == nil { - return errors.New("timestamp: nil Timestamp") - } - if ts.Seconds < minValidSeconds { - return fmt.Errorf("timestamp: %#v before 0001-01-01", ts) - } - if ts.Seconds >= maxValidSeconds { - return fmt.Errorf("timestamp: %#v after 10000-01-01", ts) - } - if ts.Nanos < 0 || ts.Nanos >= 1e9 { - return fmt.Errorf("timestamp: %#v: nanos not in range [0, 1e9)", ts) - } - return nil -} - -// TimestampFromProto converts a google.protobuf.Timestamp proto to a time.Time. -// It returns an error if the argument is invalid. -// -// Unlike most Go functions, if Timestamp returns an error, the first return value -// is not the zero time.Time. Instead, it is the value obtained from the -// time.Unix function when passed the contents of the Timestamp, in the UTC -// locale. This may or may not be a meaningful time; many invalid Timestamps -// do map to valid time.Times. -// -// A nil Timestamp returns an error. The first return value in that case is -// undefined. -func TimestampFromProto(ts *Timestamp) (time.Time, error) { - // Don't return the zero value on error, because corresponds to a valid - // timestamp. Instead return whatever time.Unix gives us. - var t time.Time - if ts == nil { - t = time.Unix(0, 0).UTC() // treat nil like the empty Timestamp - } else { - t = time.Unix(ts.Seconds, int64(ts.Nanos)).UTC() - } - return t, validateTimestamp(ts) -} - -// TimestampNow returns a google.protobuf.Timestamp for the current time. -func TimestampNow() *Timestamp { - ts, err := TimestampProto(time.Now()) - if err != nil { - panic("ptypes: time.Now() out of Timestamp range") - } - return ts -} - -// TimestampProto converts the time.Time to a google.protobuf.Timestamp proto. -// It returns an error if the resulting Timestamp is invalid. -func TimestampProto(t time.Time) (*Timestamp, error) { - ts := &Timestamp{ - Seconds: t.Unix(), - Nanos: int32(t.Nanosecond()), - } - if err := validateTimestamp(ts); err != nil { - return nil, err - } - return ts, nil -} - -// TimestampString returns the RFC 3339 string for valid Timestamps. For invalid -// Timestamps, it returns an error message in parentheses. -func TimestampString(ts *Timestamp) string { - t, err := TimestampFromProto(ts) - if err != nil { - return fmt.Sprintf("(%v)", err) - } - return t.Format(time.RFC3339Nano) -} diff --git a/vendor/github.com/gogo/protobuf/types/timestamp.pb.go b/vendor/github.com/gogo/protobuf/types/timestamp.pb.go deleted file mode 100644 index 45db7b3bb1..0000000000 --- a/vendor/github.com/gogo/protobuf/types/timestamp.pb.go +++ /dev/null @@ -1,539 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: google/protobuf/timestamp.proto - -package types - -import ( - bytes "bytes" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// A Timestamp represents a point in time independent of any time zone or local -// calendar, encoded as a count of seconds and fractions of seconds at -// nanosecond resolution. The count is relative to an epoch at UTC midnight on -// January 1, 1970, in the proleptic Gregorian calendar which extends the -// Gregorian calendar backwards to year one. -// -// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap -// second table is needed for interpretation, using a [24-hour linear -// smear](https://developers.google.com/time/smear). -// -// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By -// restricting to that range, we ensure that we can convert to and from [RFC -// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. -// -// # Examples -// -// Example 1: Compute Timestamp from POSIX `time()`. -// -// Timestamp timestamp; -// timestamp.set_seconds(time(NULL)); -// timestamp.set_nanos(0); -// -// Example 2: Compute Timestamp from POSIX `gettimeofday()`. -// -// struct timeval tv; -// gettimeofday(&tv, NULL); -// -// Timestamp timestamp; -// timestamp.set_seconds(tv.tv_sec); -// timestamp.set_nanos(tv.tv_usec * 1000); -// -// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. -// -// FILETIME ft; -// GetSystemTimeAsFileTime(&ft); -// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; -// -// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z -// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. -// Timestamp timestamp; -// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); -// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); -// -// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. -// -// long millis = System.currentTimeMillis(); -// -// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) -// .setNanos((int) ((millis % 1000) * 1000000)).build(); -// -// -// Example 5: Compute Timestamp from current time in Python. -// -// timestamp = Timestamp() -// timestamp.GetCurrentTime() -// -// # JSON Mapping -// -// In JSON format, the Timestamp type is encoded as a string in the -// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the -// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" -// where {year} is always expressed using four digits while {month}, {day}, -// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional -// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), -// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone -// is required. A proto3 JSON serializer should always use UTC (as indicated by -// "Z") when printing the Timestamp type and a proto3 JSON parser should be -// able to accept both UTC and other timezones (as indicated by an offset). -// -// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past -// 01:30 UTC on January 15, 2017. -// -// In JavaScript, one can convert a Date object to this format using the -// standard -// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) -// method. In Python, a standard `datetime.datetime` object can be converted -// to this format using -// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with -// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use -// the Joda Time's [`ISODateTimeFormat.dateTime()`]( -// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D -// ) to obtain a formatter capable of generating timestamps in this format. -// -// -type Timestamp struct { - // Represents seconds of UTC time since Unix epoch - // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - // 9999-12-31T23:59:59Z inclusive. - Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` - // Non-negative fractions of a second at nanosecond resolution. Negative - // second values with fractions must still have non-negative nanos values - // that count forward in time. Must be from 0 to 999,999,999 - // inclusive. - Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Timestamp) Reset() { *m = Timestamp{} } -func (*Timestamp) ProtoMessage() {} -func (*Timestamp) Descriptor() ([]byte, []int) { - return fileDescriptor_292007bbfe81227e, []int{0} -} -func (*Timestamp) XXX_WellKnownType() string { return "Timestamp" } -func (m *Timestamp) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Timestamp) XXX_Merge(src proto.Message) { - xxx_messageInfo_Timestamp.Merge(m, src) -} -func (m *Timestamp) XXX_Size() int { - return m.Size() -} -func (m *Timestamp) XXX_DiscardUnknown() { - xxx_messageInfo_Timestamp.DiscardUnknown(m) -} - -var xxx_messageInfo_Timestamp proto.InternalMessageInfo - -func (m *Timestamp) GetSeconds() int64 { - if m != nil { - return m.Seconds - } - return 0 -} - -func (m *Timestamp) GetNanos() int32 { - if m != nil { - return m.Nanos - } - return 0 -} - -func (*Timestamp) XXX_MessageName() string { - return "google.protobuf.Timestamp" -} -func init() { - proto.RegisterType((*Timestamp)(nil), "google.protobuf.Timestamp") -} - -func init() { proto.RegisterFile("google/protobuf/timestamp.proto", fileDescriptor_292007bbfe81227e) } - -var fileDescriptor_292007bbfe81227e = []byte{ - // 212 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xcf, 0xcf, 0x4f, - 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0xc9, 0xcc, 0x4d, - 0x2d, 0x2e, 0x49, 0xcc, 0x2d, 0xd0, 0x03, 0x0b, 0x09, 0xf1, 0x43, 0x14, 0xe8, 0xc1, 0x14, 0x28, - 0x59, 0x73, 0x71, 0x86, 0xc0, 0xd4, 0x08, 0x49, 0x70, 0xb1, 0x17, 0xa7, 0x26, 0xe7, 0xe7, 0xa5, - 0x14, 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0x30, 0x07, 0xc1, 0xb8, 0x42, 0x22, 0x5c, 0xac, 0x79, 0x89, - 0x79, 0xf9, 0xc5, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xac, 0x41, 0x10, 0x8e, 0x53, 0x03, 0xe3, 0x8d, - 0x87, 0x72, 0x0c, 0x1f, 0x1e, 0xca, 0x31, 0xae, 0x78, 0x24, 0xc7, 0x78, 0xe2, 0x91, 0x1c, 0xe3, - 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0xbe, 0x78, 0x24, 0xc7, 0xf0, 0xe1, 0x91, 0x1c, - 0xe3, 0x8a, 0xc7, 0x72, 0x8c, 0x27, 0x1e, 0xcb, 0x31, 0x72, 0x09, 0x27, 0xe7, 0xe7, 0xea, 0xa1, - 0x59, 0xee, 0xc4, 0x07, 0xb7, 0x3a, 0x00, 0x24, 0x14, 0xc0, 0x18, 0xc5, 0x5a, 0x52, 0x59, 0x90, - 0x5a, 0xfc, 0x83, 0x91, 0x71, 0x11, 0x13, 0xb3, 0x7b, 0x80, 0xd3, 0x2a, 0x26, 0x39, 0x77, 0x88, - 0x9e, 0x00, 0xa8, 0x1e, 0xbd, 0xf0, 0xd4, 0x9c, 0x1c, 0xef, 0xbc, 0xfc, 0xf2, 0xbc, 0x10, 0x90, - 0xca, 0x24, 0x36, 0xb0, 0x61, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x23, 0x83, 0xdd, - 0xfa, 0x00, 0x00, 0x00, -} - -func (this *Timestamp) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Timestamp) - if !ok { - that2, ok := that.(Timestamp) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Seconds != that1.Seconds { - if this.Seconds < that1.Seconds { - return -1 - } - return 1 - } - if this.Nanos != that1.Nanos { - if this.Nanos < that1.Nanos { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *Timestamp) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Timestamp) - if !ok { - that2, ok := that.(Timestamp) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Seconds != that1.Seconds { - return false - } - if this.Nanos != that1.Nanos { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Timestamp) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&types.Timestamp{") - s = append(s, "Seconds: "+fmt.Sprintf("%#v", this.Seconds)+",\n") - s = append(s, "Nanos: "+fmt.Sprintf("%#v", this.Nanos)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringTimestamp(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *Timestamp) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Timestamp) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Timestamp) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Nanos != 0 { - i = encodeVarintTimestamp(dAtA, i, uint64(m.Nanos)) - i-- - dAtA[i] = 0x10 - } - if m.Seconds != 0 { - i = encodeVarintTimestamp(dAtA, i, uint64(m.Seconds)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintTimestamp(dAtA []byte, offset int, v uint64) int { - offset -= sovTimestamp(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Timestamp) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Seconds != 0 { - n += 1 + sovTimestamp(uint64(m.Seconds)) - } - if m.Nanos != 0 { - n += 1 + sovTimestamp(uint64(m.Nanos)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovTimestamp(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTimestamp(x uint64) (n int) { - return sovTimestamp(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Timestamp) Unmarshal(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 ErrIntOverflowTimestamp - } - 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: Timestamp: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Timestamp: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Seconds", wireType) - } - m.Seconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTimestamp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Seconds |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Nanos", wireType) - } - m.Nanos = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTimestamp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Nanos |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTimestamp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTimestamp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTimestamp(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTimestamp - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTimestamp - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTimestamp - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTimestamp - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTimestamp - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTimestamp - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTimestamp = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTimestamp = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTimestamp = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/gogo/protobuf/types/timestamp_gogo.go b/vendor/github.com/gogo/protobuf/types/timestamp_gogo.go deleted file mode 100644 index e03fa13158..0000000000 --- a/vendor/github.com/gogo/protobuf/types/timestamp_gogo.go +++ /dev/null @@ -1,94 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2016, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package types - -import ( - "time" -) - -func NewPopulatedTimestamp(r interface { - Int63() int64 -}, easy bool) *Timestamp { - this := &Timestamp{} - ns := int64(r.Int63()) - this.Seconds = ns / 1e9 - this.Nanos = int32(ns % 1e9) - return this -} - -func (ts *Timestamp) String() string { - return TimestampString(ts) -} - -func NewPopulatedStdTime(r interface { - Int63() int64 -}, easy bool) *time.Time { - timestamp := NewPopulatedTimestamp(r, easy) - t, err := TimestampFromProto(timestamp) - if err != nil { - return nil - } - return &t -} - -func SizeOfStdTime(t time.Time) int { - ts, err := TimestampProto(t) - if err != nil { - return 0 - } - return ts.Size() -} - -func StdTimeMarshal(t time.Time) ([]byte, error) { - size := SizeOfStdTime(t) - buf := make([]byte, size) - _, err := StdTimeMarshalTo(t, buf) - return buf, err -} - -func StdTimeMarshalTo(t time.Time, data []byte) (int, error) { - ts, err := TimestampProto(t) - if err != nil { - return 0, err - } - return ts.MarshalTo(data) -} - -func StdTimeUnmarshal(t *time.Time, data []byte) error { - ts := &Timestamp{} - if err := ts.Unmarshal(data); err != nil { - return err - } - tt, err := TimestampFromProto(ts) - if err != nil { - return err - } - *t = tt - return nil -} diff --git a/vendor/github.com/gogo/protobuf/types/type.pb.go b/vendor/github.com/gogo/protobuf/types/type.pb.go deleted file mode 100644 index 791427bb22..0000000000 --- a/vendor/github.com/gogo/protobuf/types/type.pb.go +++ /dev/null @@ -1,3355 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: google/protobuf/type.proto - -package types - -import ( - bytes "bytes" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strconv "strconv" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// The syntax in which a protocol buffer element is defined. -type Syntax int32 - -const ( - // Syntax `proto2`. - Syntax_SYNTAX_PROTO2 Syntax = 0 - // Syntax `proto3`. - Syntax_SYNTAX_PROTO3 Syntax = 1 -) - -var Syntax_name = map[int32]string{ - 0: "SYNTAX_PROTO2", - 1: "SYNTAX_PROTO3", -} - -var Syntax_value = map[string]int32{ - "SYNTAX_PROTO2": 0, - "SYNTAX_PROTO3": 1, -} - -func (Syntax) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_dd271cc1e348c538, []int{0} -} - -// Basic field types. -type Field_Kind int32 - -const ( - // Field type unknown. - Field_TYPE_UNKNOWN Field_Kind = 0 - // Field type double. - Field_TYPE_DOUBLE Field_Kind = 1 - // Field type float. - Field_TYPE_FLOAT Field_Kind = 2 - // Field type int64. - Field_TYPE_INT64 Field_Kind = 3 - // Field type uint64. - Field_TYPE_UINT64 Field_Kind = 4 - // Field type int32. - Field_TYPE_INT32 Field_Kind = 5 - // Field type fixed64. - Field_TYPE_FIXED64 Field_Kind = 6 - // Field type fixed32. - Field_TYPE_FIXED32 Field_Kind = 7 - // Field type bool. - Field_TYPE_BOOL Field_Kind = 8 - // Field type string. - Field_TYPE_STRING Field_Kind = 9 - // Field type group. Proto2 syntax only, and deprecated. - Field_TYPE_GROUP Field_Kind = 10 - // Field type message. - Field_TYPE_MESSAGE Field_Kind = 11 - // Field type bytes. - Field_TYPE_BYTES Field_Kind = 12 - // Field type uint32. - Field_TYPE_UINT32 Field_Kind = 13 - // Field type enum. - Field_TYPE_ENUM Field_Kind = 14 - // Field type sfixed32. - Field_TYPE_SFIXED32 Field_Kind = 15 - // Field type sfixed64. - Field_TYPE_SFIXED64 Field_Kind = 16 - // Field type sint32. - Field_TYPE_SINT32 Field_Kind = 17 - // Field type sint64. - Field_TYPE_SINT64 Field_Kind = 18 -) - -var Field_Kind_name = map[int32]string{ - 0: "TYPE_UNKNOWN", - 1: "TYPE_DOUBLE", - 2: "TYPE_FLOAT", - 3: "TYPE_INT64", - 4: "TYPE_UINT64", - 5: "TYPE_INT32", - 6: "TYPE_FIXED64", - 7: "TYPE_FIXED32", - 8: "TYPE_BOOL", - 9: "TYPE_STRING", - 10: "TYPE_GROUP", - 11: "TYPE_MESSAGE", - 12: "TYPE_BYTES", - 13: "TYPE_UINT32", - 14: "TYPE_ENUM", - 15: "TYPE_SFIXED32", - 16: "TYPE_SFIXED64", - 17: "TYPE_SINT32", - 18: "TYPE_SINT64", -} - -var Field_Kind_value = map[string]int32{ - "TYPE_UNKNOWN": 0, - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18, -} - -func (Field_Kind) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_dd271cc1e348c538, []int{1, 0} -} - -// Whether a field is optional, required, or repeated. -type Field_Cardinality int32 - -const ( - // For fields with unknown cardinality. - Field_CARDINALITY_UNKNOWN Field_Cardinality = 0 - // For optional fields. - Field_CARDINALITY_OPTIONAL Field_Cardinality = 1 - // For required fields. Proto2 syntax only. - Field_CARDINALITY_REQUIRED Field_Cardinality = 2 - // For repeated fields. - Field_CARDINALITY_REPEATED Field_Cardinality = 3 -) - -var Field_Cardinality_name = map[int32]string{ - 0: "CARDINALITY_UNKNOWN", - 1: "CARDINALITY_OPTIONAL", - 2: "CARDINALITY_REQUIRED", - 3: "CARDINALITY_REPEATED", -} - -var Field_Cardinality_value = map[string]int32{ - "CARDINALITY_UNKNOWN": 0, - "CARDINALITY_OPTIONAL": 1, - "CARDINALITY_REQUIRED": 2, - "CARDINALITY_REPEATED": 3, -} - -func (Field_Cardinality) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_dd271cc1e348c538, []int{1, 1} -} - -// A protocol buffer message type. -type Type struct { - // The fully qualified message name. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // The list of fields. - Fields []*Field `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"` - // The list of types appearing in `oneof` definitions in this type. - Oneofs []string `protobuf:"bytes,3,rep,name=oneofs,proto3" json:"oneofs,omitempty"` - // The protocol buffer options. - Options []*Option `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"` - // The source context. - SourceContext *SourceContext `protobuf:"bytes,5,opt,name=source_context,json=sourceContext,proto3" json:"source_context,omitempty"` - // The source syntax. - Syntax Syntax `protobuf:"varint,6,opt,name=syntax,proto3,enum=google.protobuf.Syntax" json:"syntax,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Type) Reset() { *m = Type{} } -func (*Type) ProtoMessage() {} -func (*Type) Descriptor() ([]byte, []int) { - return fileDescriptor_dd271cc1e348c538, []int{0} -} -func (m *Type) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Type) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Type.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Type) XXX_Merge(src proto.Message) { - xxx_messageInfo_Type.Merge(m, src) -} -func (m *Type) XXX_Size() int { - return m.Size() -} -func (m *Type) XXX_DiscardUnknown() { - xxx_messageInfo_Type.DiscardUnknown(m) -} - -var xxx_messageInfo_Type proto.InternalMessageInfo - -func (m *Type) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Type) GetFields() []*Field { - if m != nil { - return m.Fields - } - return nil -} - -func (m *Type) GetOneofs() []string { - if m != nil { - return m.Oneofs - } - return nil -} - -func (m *Type) GetOptions() []*Option { - if m != nil { - return m.Options - } - return nil -} - -func (m *Type) GetSourceContext() *SourceContext { - if m != nil { - return m.SourceContext - } - return nil -} - -func (m *Type) GetSyntax() Syntax { - if m != nil { - return m.Syntax - } - return Syntax_SYNTAX_PROTO2 -} - -func (*Type) XXX_MessageName() string { - return "google.protobuf.Type" -} - -// A single field of a message type. -type Field struct { - // The field type. - Kind Field_Kind `protobuf:"varint,1,opt,name=kind,proto3,enum=google.protobuf.Field_Kind" json:"kind,omitempty"` - // The field cardinality. - Cardinality Field_Cardinality `protobuf:"varint,2,opt,name=cardinality,proto3,enum=google.protobuf.Field_Cardinality" json:"cardinality,omitempty"` - // The field number. - Number int32 `protobuf:"varint,3,opt,name=number,proto3" json:"number,omitempty"` - // The field name. - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - // The field type URL, without the scheme, for message or enumeration - // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. - TypeUrl string `protobuf:"bytes,6,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` - // The index of the field type in `Type.oneofs`, for message or enumeration - // types. The first type has index 1; zero means the type is not in the list. - OneofIndex int32 `protobuf:"varint,7,opt,name=oneof_index,json=oneofIndex,proto3" json:"oneof_index,omitempty"` - // Whether to use alternative packed wire representation. - Packed bool `protobuf:"varint,8,opt,name=packed,proto3" json:"packed,omitempty"` - // The protocol buffer options. - Options []*Option `protobuf:"bytes,9,rep,name=options,proto3" json:"options,omitempty"` - // The field JSON name. - JsonName string `protobuf:"bytes,10,opt,name=json_name,json=jsonName,proto3" json:"json_name,omitempty"` - // The string value of the default value of this field. Proto2 syntax only. - DefaultValue string `protobuf:"bytes,11,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Field) Reset() { *m = Field{} } -func (*Field) ProtoMessage() {} -func (*Field) Descriptor() ([]byte, []int) { - return fileDescriptor_dd271cc1e348c538, []int{1} -} -func (m *Field) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Field) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Field.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Field) XXX_Merge(src proto.Message) { - xxx_messageInfo_Field.Merge(m, src) -} -func (m *Field) XXX_Size() int { - return m.Size() -} -func (m *Field) XXX_DiscardUnknown() { - xxx_messageInfo_Field.DiscardUnknown(m) -} - -var xxx_messageInfo_Field proto.InternalMessageInfo - -func (m *Field) GetKind() Field_Kind { - if m != nil { - return m.Kind - } - return Field_TYPE_UNKNOWN -} - -func (m *Field) GetCardinality() Field_Cardinality { - if m != nil { - return m.Cardinality - } - return Field_CARDINALITY_UNKNOWN -} - -func (m *Field) GetNumber() int32 { - if m != nil { - return m.Number - } - return 0 -} - -func (m *Field) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Field) GetTypeUrl() string { - if m != nil { - return m.TypeUrl - } - return "" -} - -func (m *Field) GetOneofIndex() int32 { - if m != nil { - return m.OneofIndex - } - return 0 -} - -func (m *Field) GetPacked() bool { - if m != nil { - return m.Packed - } - return false -} - -func (m *Field) GetOptions() []*Option { - if m != nil { - return m.Options - } - return nil -} - -func (m *Field) GetJsonName() string { - if m != nil { - return m.JsonName - } - return "" -} - -func (m *Field) GetDefaultValue() string { - if m != nil { - return m.DefaultValue - } - return "" -} - -func (*Field) XXX_MessageName() string { - return "google.protobuf.Field" -} - -// Enum type definition. -type Enum struct { - // Enum type name. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Enum value definitions. - Enumvalue []*EnumValue `protobuf:"bytes,2,rep,name=enumvalue,proto3" json:"enumvalue,omitempty"` - // Protocol buffer options. - Options []*Option `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` - // The source context. - SourceContext *SourceContext `protobuf:"bytes,4,opt,name=source_context,json=sourceContext,proto3" json:"source_context,omitempty"` - // The source syntax. - Syntax Syntax `protobuf:"varint,5,opt,name=syntax,proto3,enum=google.protobuf.Syntax" json:"syntax,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Enum) Reset() { *m = Enum{} } -func (*Enum) ProtoMessage() {} -func (*Enum) Descriptor() ([]byte, []int) { - return fileDescriptor_dd271cc1e348c538, []int{2} -} -func (m *Enum) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Enum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Enum.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Enum) XXX_Merge(src proto.Message) { - xxx_messageInfo_Enum.Merge(m, src) -} -func (m *Enum) XXX_Size() int { - return m.Size() -} -func (m *Enum) XXX_DiscardUnknown() { - xxx_messageInfo_Enum.DiscardUnknown(m) -} - -var xxx_messageInfo_Enum proto.InternalMessageInfo - -func (m *Enum) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Enum) GetEnumvalue() []*EnumValue { - if m != nil { - return m.Enumvalue - } - return nil -} - -func (m *Enum) GetOptions() []*Option { - if m != nil { - return m.Options - } - return nil -} - -func (m *Enum) GetSourceContext() *SourceContext { - if m != nil { - return m.SourceContext - } - return nil -} - -func (m *Enum) GetSyntax() Syntax { - if m != nil { - return m.Syntax - } - return Syntax_SYNTAX_PROTO2 -} - -func (*Enum) XXX_MessageName() string { - return "google.protobuf.Enum" -} - -// Enum value definition. -type EnumValue struct { - // Enum value name. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Enum value number. - Number int32 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"` - // Protocol buffer options. - Options []*Option `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EnumValue) Reset() { *m = EnumValue{} } -func (*EnumValue) ProtoMessage() {} -func (*EnumValue) Descriptor() ([]byte, []int) { - return fileDescriptor_dd271cc1e348c538, []int{3} -} -func (m *EnumValue) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EnumValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EnumValue.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EnumValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnumValue.Merge(m, src) -} -func (m *EnumValue) XXX_Size() int { - return m.Size() -} -func (m *EnumValue) XXX_DiscardUnknown() { - xxx_messageInfo_EnumValue.DiscardUnknown(m) -} - -var xxx_messageInfo_EnumValue proto.InternalMessageInfo - -func (m *EnumValue) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *EnumValue) GetNumber() int32 { - if m != nil { - return m.Number - } - return 0 -} - -func (m *EnumValue) GetOptions() []*Option { - if m != nil { - return m.Options - } - return nil -} - -func (*EnumValue) XXX_MessageName() string { - return "google.protobuf.EnumValue" -} - -// A protocol buffer option, which can be attached to a message, field, -// enumeration, etc. -type Option struct { - // The option's name. For protobuf built-in options (options defined in - // descriptor.proto), this is the short name. For example, `"map_entry"`. - // For custom options, it should be the fully-qualified name. For example, - // `"google.api.http"`. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // The option's value packed in an Any message. If the value is a primitive, - // the corresponding wrapper type defined in google/protobuf/wrappers.proto - // should be used. If the value is an enum, it should be stored as an int32 - // value using the google.protobuf.Int32Value type. - Value *Any `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Option) Reset() { *m = Option{} } -func (*Option) ProtoMessage() {} -func (*Option) Descriptor() ([]byte, []int) { - return fileDescriptor_dd271cc1e348c538, []int{4} -} -func (m *Option) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Option) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Option.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Option) XXX_Merge(src proto.Message) { - xxx_messageInfo_Option.Merge(m, src) -} -func (m *Option) XXX_Size() int { - return m.Size() -} -func (m *Option) XXX_DiscardUnknown() { - xxx_messageInfo_Option.DiscardUnknown(m) -} - -var xxx_messageInfo_Option proto.InternalMessageInfo - -func (m *Option) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Option) GetValue() *Any { - if m != nil { - return m.Value - } - return nil -} - -func (*Option) XXX_MessageName() string { - return "google.protobuf.Option" -} -func init() { - proto.RegisterEnum("google.protobuf.Syntax", Syntax_name, Syntax_value) - proto.RegisterEnum("google.protobuf.Field_Kind", Field_Kind_name, Field_Kind_value) - proto.RegisterEnum("google.protobuf.Field_Cardinality", Field_Cardinality_name, Field_Cardinality_value) - proto.RegisterType((*Type)(nil), "google.protobuf.Type") - proto.RegisterType((*Field)(nil), "google.protobuf.Field") - proto.RegisterType((*Enum)(nil), "google.protobuf.Enum") - proto.RegisterType((*EnumValue)(nil), "google.protobuf.EnumValue") - proto.RegisterType((*Option)(nil), "google.protobuf.Option") -} - -func init() { proto.RegisterFile("google/protobuf/type.proto", fileDescriptor_dd271cc1e348c538) } - -var fileDescriptor_dd271cc1e348c538 = []byte{ - // 840 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x73, 0xda, 0x46, - 0x14, 0xf6, 0x0a, 0x21, 0xa3, 0x87, 0xc1, 0x9b, 0x4d, 0x26, 0x51, 0x9c, 0x19, 0x95, 0xa1, 0x3d, - 0x30, 0x39, 0xe0, 0x29, 0x78, 0x3c, 0xbd, 0x82, 0x91, 0x29, 0x63, 0x22, 0xa9, 0x8b, 0x68, 0xe2, - 0x5e, 0x18, 0x0c, 0x72, 0x86, 0x44, 0xac, 0x18, 0x24, 0x5a, 0x73, 0xeb, 0x4c, 0xcf, 0xfd, 0x27, - 0x7a, 0xea, 0xf4, 0xdc, 0x3f, 0xc2, 0xc7, 0x1e, 0x7b, 0xac, 0xc9, 0xa5, 0xc7, 0x1c, 0x73, 0x6b, - 0x67, 0x57, 0x20, 0x8b, 0x1f, 0x9d, 0x49, 0xdb, 0x1b, 0xef, 0xfb, 0xbe, 0xf7, 0x73, 0x9f, 0x1e, - 0x70, 0xf4, 0xda, 0xf7, 0x5f, 0x7b, 0xee, 0xf1, 0x64, 0xea, 0x87, 0xfe, 0xd5, 0xec, 0xfa, 0x38, - 0x9c, 0x4f, 0xdc, 0xb2, 0xb0, 0xc8, 0x61, 0xc4, 0x95, 0x57, 0xdc, 0xd1, 0xd3, 0x4d, 0x71, 0x9f, - 0xcd, 0x23, 0xf6, 0xe8, 0xb3, 0x4d, 0x2a, 0xf0, 0x67, 0xd3, 0x81, 0xdb, 0x1b, 0xf8, 0x2c, 0x74, - 0x6f, 0xc2, 0x48, 0x55, 0xfc, 0x51, 0x02, 0xd9, 0x99, 0x4f, 0x5c, 0x42, 0x40, 0x66, 0xfd, 0xb1, - 0xab, 0xa1, 0x02, 0x2a, 0xa9, 0x54, 0xfc, 0x26, 0x65, 0x50, 0xae, 0x47, 0xae, 0x37, 0x0c, 0x34, - 0xa9, 0x90, 0x2a, 0x65, 0x2b, 0x8f, 0xcb, 0x1b, 0xf9, 0xcb, 0xe7, 0x9c, 0xa6, 0x4b, 0x15, 0x79, - 0x0c, 0x8a, 0xcf, 0x5c, 0xff, 0x3a, 0xd0, 0x52, 0x85, 0x54, 0x49, 0xa5, 0x4b, 0x8b, 0x7c, 0x0e, - 0xfb, 0xfe, 0x24, 0x1c, 0xf9, 0x2c, 0xd0, 0x64, 0x11, 0xe8, 0xc9, 0x56, 0x20, 0x4b, 0xf0, 0x74, - 0xa5, 0x23, 0x06, 0xe4, 0xd7, 0xeb, 0xd5, 0xd2, 0x05, 0x54, 0xca, 0x56, 0xf4, 0x2d, 0xcf, 0x8e, - 0x90, 0x9d, 0x45, 0x2a, 0x9a, 0x0b, 0x92, 0x26, 0x39, 0x06, 0x25, 0x98, 0xb3, 0xb0, 0x7f, 0xa3, - 0x29, 0x05, 0x54, 0xca, 0xef, 0x48, 0xdc, 0x11, 0x34, 0x5d, 0xca, 0x8a, 0xbf, 0x2a, 0x90, 0x16, - 0x4d, 0x91, 0x63, 0x90, 0xdf, 0x8e, 0xd8, 0x50, 0x0c, 0x24, 0x5f, 0x79, 0xb6, 0xbb, 0xf5, 0xf2, - 0xc5, 0x88, 0x0d, 0xa9, 0x10, 0x92, 0x06, 0x64, 0x07, 0xfd, 0xe9, 0x70, 0xc4, 0xfa, 0xde, 0x28, - 0x9c, 0x6b, 0x92, 0xf0, 0x2b, 0xfe, 0x83, 0xdf, 0xd9, 0xbd, 0x92, 0x26, 0xdd, 0xf8, 0x0c, 0xd9, - 0x6c, 0x7c, 0xe5, 0x4e, 0xb5, 0x54, 0x01, 0x95, 0xd2, 0x74, 0x69, 0xc5, 0xef, 0x23, 0x27, 0xde, - 0xe7, 0x29, 0x64, 0xf8, 0x72, 0xf4, 0x66, 0x53, 0x4f, 0xf4, 0xa7, 0xd2, 0x7d, 0x6e, 0x77, 0xa7, - 0x1e, 0xf9, 0x04, 0xb2, 0x62, 0xf8, 0xbd, 0x11, 0x1b, 0xba, 0x37, 0xda, 0xbe, 0x88, 0x05, 0x02, - 0x6a, 0x71, 0x84, 0xe7, 0x99, 0xf4, 0x07, 0x6f, 0xdd, 0xa1, 0x96, 0x29, 0xa0, 0x52, 0x86, 0x2e, - 0xad, 0xe4, 0x5b, 0xa9, 0x1f, 0xf9, 0x56, 0xcf, 0x40, 0x7d, 0x13, 0xf8, 0xac, 0x27, 0xea, 0x03, - 0x51, 0x47, 0x86, 0x03, 0x26, 0xaf, 0xf1, 0x53, 0xc8, 0x0d, 0xdd, 0xeb, 0xfe, 0xcc, 0x0b, 0x7b, - 0xdf, 0xf6, 0xbd, 0x99, 0xab, 0x65, 0x85, 0xe0, 0x60, 0x09, 0x7e, 0xcd, 0xb1, 0xe2, 0xad, 0x04, - 0x32, 0x9f, 0x24, 0xc1, 0x70, 0xe0, 0x5c, 0xda, 0x46, 0xaf, 0x6b, 0x5e, 0x98, 0xd6, 0x4b, 0x13, - 0xef, 0x91, 0x43, 0xc8, 0x0a, 0xa4, 0x61, 0x75, 0xeb, 0x6d, 0x03, 0x23, 0x92, 0x07, 0x10, 0xc0, - 0x79, 0xdb, 0xaa, 0x39, 0x58, 0x8a, 0xed, 0x96, 0xe9, 0x9c, 0x9e, 0xe0, 0x54, 0xec, 0xd0, 0x8d, - 0x00, 0x39, 0x29, 0xa8, 0x56, 0x70, 0x3a, 0xce, 0x71, 0xde, 0x7a, 0x65, 0x34, 0x4e, 0x4f, 0xb0, - 0xb2, 0x8e, 0x54, 0x2b, 0x78, 0x9f, 0xe4, 0x40, 0x15, 0x48, 0xdd, 0xb2, 0xda, 0x38, 0x13, 0xc7, - 0xec, 0x38, 0xb4, 0x65, 0x36, 0xb1, 0x1a, 0xc7, 0x6c, 0x52, 0xab, 0x6b, 0x63, 0x88, 0x23, 0xbc, - 0x30, 0x3a, 0x9d, 0x5a, 0xd3, 0xc0, 0xd9, 0x58, 0x51, 0xbf, 0x74, 0x8c, 0x0e, 0x3e, 0x58, 0x2b, - 0xab, 0x5a, 0xc1, 0xb9, 0x38, 0x85, 0x61, 0x76, 0x5f, 0xe0, 0x3c, 0x79, 0x00, 0xb9, 0x28, 0xc5, - 0xaa, 0x88, 0xc3, 0x0d, 0xe8, 0xf4, 0x04, 0xe3, 0xfb, 0x42, 0xa2, 0x28, 0x0f, 0xd6, 0x80, 0xd3, - 0x13, 0x4c, 0x8a, 0x21, 0x64, 0x13, 0xbb, 0x45, 0x9e, 0xc0, 0xc3, 0xb3, 0x1a, 0x6d, 0xb4, 0xcc, - 0x5a, 0xbb, 0xe5, 0x5c, 0x26, 0xe6, 0xaa, 0xc1, 0xa3, 0x24, 0x61, 0xd9, 0x4e, 0xcb, 0x32, 0x6b, - 0x6d, 0x8c, 0x36, 0x19, 0x6a, 0x7c, 0xd5, 0x6d, 0x51, 0xa3, 0x81, 0xa5, 0x6d, 0xc6, 0x36, 0x6a, - 0x8e, 0xd1, 0xc0, 0xa9, 0xe2, 0x5f, 0x08, 0x64, 0x83, 0xcd, 0xc6, 0x3b, 0xcf, 0xc8, 0x17, 0xa0, - 0xba, 0x6c, 0x36, 0x8e, 0x9e, 0x3f, 0xba, 0x24, 0x47, 0x5b, 0x4b, 0xc5, 0xbd, 0xc5, 0x32, 0xd0, - 0x7b, 0x71, 0x72, 0x19, 0x53, 0xff, 0xf9, 0x70, 0xc8, 0xff, 0xef, 0x70, 0xa4, 0x3f, 0xee, 0x70, - 0xbc, 0x01, 0x35, 0x6e, 0x61, 0xe7, 0x14, 0xee, 0x3f, 0x6c, 0x69, 0xed, 0xc3, 0xfe, 0xf7, 0x3d, - 0x16, 0xbf, 0x04, 0x25, 0x82, 0x76, 0x26, 0x7a, 0x0e, 0xe9, 0xd5, 0xa8, 0x79, 0xe3, 0x8f, 0xb6, - 0xc2, 0xd5, 0xd8, 0x9c, 0x46, 0x92, 0xe7, 0x65, 0x50, 0xa2, 0x3e, 0xf8, 0xb2, 0x75, 0x2e, 0x4d, - 0xa7, 0xf6, 0xaa, 0x67, 0x53, 0xcb, 0xb1, 0x2a, 0x78, 0x6f, 0x13, 0xaa, 0x62, 0x54, 0xff, 0x01, - 0xfd, 0x7e, 0xa7, 0xef, 0xbd, 0xbf, 0xd3, 0xd1, 0x87, 0x3b, 0x1d, 0x7d, 0xbf, 0xd0, 0xd1, 0xcf, - 0x0b, 0x1d, 0xdd, 0x2e, 0x74, 0xf4, 0xdb, 0x42, 0x47, 0x7f, 0x2c, 0x74, 0xf4, 0xe7, 0x42, 0xdf, - 0x7b, 0xcf, 0xf1, 0x77, 0x3a, 0xba, 0x7d, 0xa7, 0x23, 0x78, 0x38, 0xf0, 0xc7, 0x9b, 0x25, 0xd4, - 0x55, 0xfe, 0x9f, 0x63, 0x73, 0xcb, 0x46, 0xdf, 0xa4, 0xf9, 0xd1, 0x0a, 0x3e, 0x20, 0xf4, 0x93, - 0x94, 0x6a, 0xda, 0xf5, 0x5f, 0x24, 0xbd, 0x19, 0xc9, 0xed, 0x55, 0xc5, 0x2f, 0x5d, 0xcf, 0xbb, - 0x60, 0xfe, 0x77, 0x8c, 0xbb, 0x05, 0x57, 0x8a, 0x88, 0x53, 0xfd, 0x3b, 0x00, 0x00, 0xff, 0xff, - 0xbc, 0x2a, 0x5e, 0x82, 0x2b, 0x07, 0x00, 0x00, -} - -func (this *Type) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Type) - if !ok { - that2, ok := that.(Type) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Name != that1.Name { - if this.Name < that1.Name { - return -1 - } - return 1 - } - if len(this.Fields) != len(that1.Fields) { - if len(this.Fields) < len(that1.Fields) { - return -1 - } - return 1 - } - for i := range this.Fields { - if c := this.Fields[i].Compare(that1.Fields[i]); c != 0 { - return c - } - } - if len(this.Oneofs) != len(that1.Oneofs) { - if len(this.Oneofs) < len(that1.Oneofs) { - return -1 - } - return 1 - } - for i := range this.Oneofs { - if this.Oneofs[i] != that1.Oneofs[i] { - if this.Oneofs[i] < that1.Oneofs[i] { - return -1 - } - return 1 - } - } - if len(this.Options) != len(that1.Options) { - if len(this.Options) < len(that1.Options) { - return -1 - } - return 1 - } - for i := range this.Options { - if c := this.Options[i].Compare(that1.Options[i]); c != 0 { - return c - } - } - if c := this.SourceContext.Compare(that1.SourceContext); c != 0 { - return c - } - if this.Syntax != that1.Syntax { - if this.Syntax < that1.Syntax { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *Field) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Field) - if !ok { - that2, ok := that.(Field) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Kind != that1.Kind { - if this.Kind < that1.Kind { - return -1 - } - return 1 - } - if this.Cardinality != that1.Cardinality { - if this.Cardinality < that1.Cardinality { - return -1 - } - return 1 - } - if this.Number != that1.Number { - if this.Number < that1.Number { - return -1 - } - return 1 - } - if this.Name != that1.Name { - if this.Name < that1.Name { - return -1 - } - return 1 - } - if this.TypeUrl != that1.TypeUrl { - if this.TypeUrl < that1.TypeUrl { - return -1 - } - return 1 - } - if this.OneofIndex != that1.OneofIndex { - if this.OneofIndex < that1.OneofIndex { - return -1 - } - return 1 - } - if this.Packed != that1.Packed { - if !this.Packed { - return -1 - } - return 1 - } - if len(this.Options) != len(that1.Options) { - if len(this.Options) < len(that1.Options) { - return -1 - } - return 1 - } - for i := range this.Options { - if c := this.Options[i].Compare(that1.Options[i]); c != 0 { - return c - } - } - if this.JsonName != that1.JsonName { - if this.JsonName < that1.JsonName { - return -1 - } - return 1 - } - if this.DefaultValue != that1.DefaultValue { - if this.DefaultValue < that1.DefaultValue { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *Enum) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Enum) - if !ok { - that2, ok := that.(Enum) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Name != that1.Name { - if this.Name < that1.Name { - return -1 - } - return 1 - } - if len(this.Enumvalue) != len(that1.Enumvalue) { - if len(this.Enumvalue) < len(that1.Enumvalue) { - return -1 - } - return 1 - } - for i := range this.Enumvalue { - if c := this.Enumvalue[i].Compare(that1.Enumvalue[i]); c != 0 { - return c - } - } - if len(this.Options) != len(that1.Options) { - if len(this.Options) < len(that1.Options) { - return -1 - } - return 1 - } - for i := range this.Options { - if c := this.Options[i].Compare(that1.Options[i]); c != 0 { - return c - } - } - if c := this.SourceContext.Compare(that1.SourceContext); c != 0 { - return c - } - if this.Syntax != that1.Syntax { - if this.Syntax < that1.Syntax { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *EnumValue) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*EnumValue) - if !ok { - that2, ok := that.(EnumValue) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Name != that1.Name { - if this.Name < that1.Name { - return -1 - } - return 1 - } - if this.Number != that1.Number { - if this.Number < that1.Number { - return -1 - } - return 1 - } - if len(this.Options) != len(that1.Options) { - if len(this.Options) < len(that1.Options) { - return -1 - } - return 1 - } - for i := range this.Options { - if c := this.Options[i].Compare(that1.Options[i]); c != 0 { - return c - } - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *Option) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Option) - if !ok { - that2, ok := that.(Option) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Name != that1.Name { - if this.Name < that1.Name { - return -1 - } - return 1 - } - if c := this.Value.Compare(that1.Value); c != 0 { - return c - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (x Syntax) String() string { - s, ok := Syntax_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) -} -func (x Field_Kind) String() string { - s, ok := Field_Kind_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) -} -func (x Field_Cardinality) String() string { - s, ok := Field_Cardinality_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) -} -func (this *Type) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Type) - if !ok { - that2, ok := that.(Type) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if len(this.Fields) != len(that1.Fields) { - return false - } - for i := range this.Fields { - if !this.Fields[i].Equal(that1.Fields[i]) { - return false - } - } - if len(this.Oneofs) != len(that1.Oneofs) { - return false - } - for i := range this.Oneofs { - if this.Oneofs[i] != that1.Oneofs[i] { - return false - } - } - if len(this.Options) != len(that1.Options) { - return false - } - for i := range this.Options { - if !this.Options[i].Equal(that1.Options[i]) { - return false - } - } - if !this.SourceContext.Equal(that1.SourceContext) { - return false - } - if this.Syntax != that1.Syntax { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Field) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Field) - if !ok { - that2, ok := that.(Field) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Kind != that1.Kind { - return false - } - if this.Cardinality != that1.Cardinality { - return false - } - if this.Number != that1.Number { - return false - } - if this.Name != that1.Name { - return false - } - if this.TypeUrl != that1.TypeUrl { - return false - } - if this.OneofIndex != that1.OneofIndex { - return false - } - if this.Packed != that1.Packed { - return false - } - if len(this.Options) != len(that1.Options) { - return false - } - for i := range this.Options { - if !this.Options[i].Equal(that1.Options[i]) { - return false - } - } - if this.JsonName != that1.JsonName { - return false - } - if this.DefaultValue != that1.DefaultValue { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Enum) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Enum) - if !ok { - that2, ok := that.(Enum) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if len(this.Enumvalue) != len(that1.Enumvalue) { - return false - } - for i := range this.Enumvalue { - if !this.Enumvalue[i].Equal(that1.Enumvalue[i]) { - return false - } - } - if len(this.Options) != len(that1.Options) { - return false - } - for i := range this.Options { - if !this.Options[i].Equal(that1.Options[i]) { - return false - } - } - if !this.SourceContext.Equal(that1.SourceContext) { - return false - } - if this.Syntax != that1.Syntax { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *EnumValue) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*EnumValue) - if !ok { - that2, ok := that.(EnumValue) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.Number != that1.Number { - return false - } - if len(this.Options) != len(that1.Options) { - return false - } - for i := range this.Options { - if !this.Options[i].Equal(that1.Options[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Option) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Option) - if !ok { - that2, ok := that.(Option) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if !this.Value.Equal(that1.Value) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Type) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 10) - s = append(s, "&types.Type{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - if this.Fields != nil { - s = append(s, "Fields: "+fmt.Sprintf("%#v", this.Fields)+",\n") - } - s = append(s, "Oneofs: "+fmt.Sprintf("%#v", this.Oneofs)+",\n") - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.SourceContext != nil { - s = append(s, "SourceContext: "+fmt.Sprintf("%#v", this.SourceContext)+",\n") - } - s = append(s, "Syntax: "+fmt.Sprintf("%#v", this.Syntax)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Field) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 14) - s = append(s, "&types.Field{") - s = append(s, "Kind: "+fmt.Sprintf("%#v", this.Kind)+",\n") - s = append(s, "Cardinality: "+fmt.Sprintf("%#v", this.Cardinality)+",\n") - s = append(s, "Number: "+fmt.Sprintf("%#v", this.Number)+",\n") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "TypeUrl: "+fmt.Sprintf("%#v", this.TypeUrl)+",\n") - s = append(s, "OneofIndex: "+fmt.Sprintf("%#v", this.OneofIndex)+",\n") - s = append(s, "Packed: "+fmt.Sprintf("%#v", this.Packed)+",\n") - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - s = append(s, "JsonName: "+fmt.Sprintf("%#v", this.JsonName)+",\n") - s = append(s, "DefaultValue: "+fmt.Sprintf("%#v", this.DefaultValue)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Enum) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&types.Enum{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - if this.Enumvalue != nil { - s = append(s, "Enumvalue: "+fmt.Sprintf("%#v", this.Enumvalue)+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.SourceContext != nil { - s = append(s, "SourceContext: "+fmt.Sprintf("%#v", this.SourceContext)+",\n") - } - s = append(s, "Syntax: "+fmt.Sprintf("%#v", this.Syntax)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *EnumValue) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&types.EnumValue{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "Number: "+fmt.Sprintf("%#v", this.Number)+",\n") - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Option) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&types.Option{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - if this.Value != nil { - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringType(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *Type) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Type) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Type) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Syntax != 0 { - i = encodeVarintType(dAtA, i, uint64(m.Syntax)) - i-- - dAtA[i] = 0x30 - } - if m.SourceContext != nil { - { - size, err := m.SourceContext.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintType(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.Options) > 0 { - for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintType(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Oneofs) > 0 { - for iNdEx := len(m.Oneofs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Oneofs[iNdEx]) - copy(dAtA[i:], m.Oneofs[iNdEx]) - i = encodeVarintType(dAtA, i, uint64(len(m.Oneofs[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.Fields) > 0 { - for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Fields[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintType(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintType(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Field) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Field) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Field) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.DefaultValue) > 0 { - i -= len(m.DefaultValue) - copy(dAtA[i:], m.DefaultValue) - i = encodeVarintType(dAtA, i, uint64(len(m.DefaultValue))) - i-- - dAtA[i] = 0x5a - } - if len(m.JsonName) > 0 { - i -= len(m.JsonName) - copy(dAtA[i:], m.JsonName) - i = encodeVarintType(dAtA, i, uint64(len(m.JsonName))) - i-- - dAtA[i] = 0x52 - } - if len(m.Options) > 0 { - for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintType(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - if m.Packed { - i-- - if m.Packed { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if m.OneofIndex != 0 { - i = encodeVarintType(dAtA, i, uint64(m.OneofIndex)) - i-- - dAtA[i] = 0x38 - } - if len(m.TypeUrl) > 0 { - i -= len(m.TypeUrl) - copy(dAtA[i:], m.TypeUrl) - i = encodeVarintType(dAtA, i, uint64(len(m.TypeUrl))) - i-- - dAtA[i] = 0x32 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintType(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x22 - } - if m.Number != 0 { - i = encodeVarintType(dAtA, i, uint64(m.Number)) - i-- - dAtA[i] = 0x18 - } - if m.Cardinality != 0 { - i = encodeVarintType(dAtA, i, uint64(m.Cardinality)) - i-- - dAtA[i] = 0x10 - } - if m.Kind != 0 { - i = encodeVarintType(dAtA, i, uint64(m.Kind)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Enum) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Enum) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Enum) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Syntax != 0 { - i = encodeVarintType(dAtA, i, uint64(m.Syntax)) - i-- - dAtA[i] = 0x28 - } - if m.SourceContext != nil { - { - size, err := m.SourceContext.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintType(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.Options) > 0 { - for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintType(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Enumvalue) > 0 { - for iNdEx := len(m.Enumvalue) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Enumvalue[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintType(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintType(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EnumValue) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EnumValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EnumValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Options) > 0 { - for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintType(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.Number != 0 { - i = encodeVarintType(dAtA, i, uint64(m.Number)) - i-- - dAtA[i] = 0x10 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintType(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Option) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Option) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Option) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Value != nil { - { - size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintType(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintType(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintType(dAtA []byte, offset int, v uint64) int { - offset -= sovType(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func NewPopulatedType(r randyType, easy bool) *Type { - this := &Type{} - this.Name = string(randStringType(r)) - if r.Intn(5) != 0 { - v1 := r.Intn(5) - this.Fields = make([]*Field, v1) - for i := 0; i < v1; i++ { - this.Fields[i] = NewPopulatedField(r, easy) - } - } - v2 := r.Intn(10) - this.Oneofs = make([]string, v2) - for i := 0; i < v2; i++ { - this.Oneofs[i] = string(randStringType(r)) - } - if r.Intn(5) != 0 { - v3 := r.Intn(5) - this.Options = make([]*Option, v3) - for i := 0; i < v3; i++ { - this.Options[i] = NewPopulatedOption(r, easy) - } - } - if r.Intn(5) != 0 { - this.SourceContext = NewPopulatedSourceContext(r, easy) - } - this.Syntax = Syntax([]int32{0, 1}[r.Intn(2)]) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedType(r, 7) - } - return this -} - -func NewPopulatedField(r randyType, easy bool) *Field { - this := &Field{} - this.Kind = Field_Kind([]int32{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18}[r.Intn(19)]) - this.Cardinality = Field_Cardinality([]int32{0, 1, 2, 3}[r.Intn(4)]) - this.Number = int32(r.Int31()) - if r.Intn(2) == 0 { - this.Number *= -1 - } - this.Name = string(randStringType(r)) - this.TypeUrl = string(randStringType(r)) - this.OneofIndex = int32(r.Int31()) - if r.Intn(2) == 0 { - this.OneofIndex *= -1 - } - this.Packed = bool(bool(r.Intn(2) == 0)) - if r.Intn(5) != 0 { - v4 := r.Intn(5) - this.Options = make([]*Option, v4) - for i := 0; i < v4; i++ { - this.Options[i] = NewPopulatedOption(r, easy) - } - } - this.JsonName = string(randStringType(r)) - this.DefaultValue = string(randStringType(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedType(r, 12) - } - return this -} - -func NewPopulatedEnum(r randyType, easy bool) *Enum { - this := &Enum{} - this.Name = string(randStringType(r)) - if r.Intn(5) != 0 { - v5 := r.Intn(5) - this.Enumvalue = make([]*EnumValue, v5) - for i := 0; i < v5; i++ { - this.Enumvalue[i] = NewPopulatedEnumValue(r, easy) - } - } - if r.Intn(5) != 0 { - v6 := r.Intn(5) - this.Options = make([]*Option, v6) - for i := 0; i < v6; i++ { - this.Options[i] = NewPopulatedOption(r, easy) - } - } - if r.Intn(5) != 0 { - this.SourceContext = NewPopulatedSourceContext(r, easy) - } - this.Syntax = Syntax([]int32{0, 1}[r.Intn(2)]) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedType(r, 6) - } - return this -} - -func NewPopulatedEnumValue(r randyType, easy bool) *EnumValue { - this := &EnumValue{} - this.Name = string(randStringType(r)) - this.Number = int32(r.Int31()) - if r.Intn(2) == 0 { - this.Number *= -1 - } - if r.Intn(5) != 0 { - v7 := r.Intn(5) - this.Options = make([]*Option, v7) - for i := 0; i < v7; i++ { - this.Options[i] = NewPopulatedOption(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedType(r, 4) - } - return this -} - -func NewPopulatedOption(r randyType, easy bool) *Option { - this := &Option{} - this.Name = string(randStringType(r)) - if r.Intn(5) != 0 { - this.Value = NewPopulatedAny(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedType(r, 3) - } - return this -} - -type randyType interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneType(r randyType) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringType(r randyType) string { - v8 := r.Intn(100) - tmps := make([]rune, v8) - for i := 0; i < v8; i++ { - tmps[i] = randUTF8RuneType(r) - } - return string(tmps) -} -func randUnrecognizedType(r randyType, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldType(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldType(dAtA []byte, r randyType, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateType(dAtA, uint64(key)) - v9 := r.Int63() - if r.Intn(2) == 0 { - v9 *= -1 - } - dAtA = encodeVarintPopulateType(dAtA, uint64(v9)) - case 1: - dAtA = encodeVarintPopulateType(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateType(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateType(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateType(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateType(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} -func (m *Type) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovType(uint64(l)) - } - if len(m.Fields) > 0 { - for _, e := range m.Fields { - l = e.Size() - n += 1 + l + sovType(uint64(l)) - } - } - if len(m.Oneofs) > 0 { - for _, s := range m.Oneofs { - l = len(s) - n += 1 + l + sovType(uint64(l)) - } - } - if len(m.Options) > 0 { - for _, e := range m.Options { - l = e.Size() - n += 1 + l + sovType(uint64(l)) - } - } - if m.SourceContext != nil { - l = m.SourceContext.Size() - n += 1 + l + sovType(uint64(l)) - } - if m.Syntax != 0 { - n += 1 + sovType(uint64(m.Syntax)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Field) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Kind != 0 { - n += 1 + sovType(uint64(m.Kind)) - } - if m.Cardinality != 0 { - n += 1 + sovType(uint64(m.Cardinality)) - } - if m.Number != 0 { - n += 1 + sovType(uint64(m.Number)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovType(uint64(l)) - } - l = len(m.TypeUrl) - if l > 0 { - n += 1 + l + sovType(uint64(l)) - } - if m.OneofIndex != 0 { - n += 1 + sovType(uint64(m.OneofIndex)) - } - if m.Packed { - n += 2 - } - if len(m.Options) > 0 { - for _, e := range m.Options { - l = e.Size() - n += 1 + l + sovType(uint64(l)) - } - } - l = len(m.JsonName) - if l > 0 { - n += 1 + l + sovType(uint64(l)) - } - l = len(m.DefaultValue) - if l > 0 { - n += 1 + l + sovType(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Enum) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovType(uint64(l)) - } - if len(m.Enumvalue) > 0 { - for _, e := range m.Enumvalue { - l = e.Size() - n += 1 + l + sovType(uint64(l)) - } - } - if len(m.Options) > 0 { - for _, e := range m.Options { - l = e.Size() - n += 1 + l + sovType(uint64(l)) - } - } - if m.SourceContext != nil { - l = m.SourceContext.Size() - n += 1 + l + sovType(uint64(l)) - } - if m.Syntax != 0 { - n += 1 + sovType(uint64(m.Syntax)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *EnumValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovType(uint64(l)) - } - if m.Number != 0 { - n += 1 + sovType(uint64(m.Number)) - } - if len(m.Options) > 0 { - for _, e := range m.Options { - l = e.Size() - n += 1 + l + sovType(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Option) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovType(uint64(l)) - } - if m.Value != nil { - l = m.Value.Size() - n += 1 + l + sovType(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovType(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozType(x uint64) (n int) { - return sovType(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Type) String() string { - if this == nil { - return "nil" - } - repeatedStringForFields := "[]*Field{" - for _, f := range this.Fields { - repeatedStringForFields += strings.Replace(f.String(), "Field", "Field", 1) + "," - } - repeatedStringForFields += "}" - repeatedStringForOptions := "[]*Option{" - for _, f := range this.Options { - repeatedStringForOptions += strings.Replace(f.String(), "Option", "Option", 1) + "," - } - repeatedStringForOptions += "}" - s := strings.Join([]string{`&Type{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Fields:` + repeatedStringForFields + `,`, - `Oneofs:` + fmt.Sprintf("%v", this.Oneofs) + `,`, - `Options:` + repeatedStringForOptions + `,`, - `SourceContext:` + strings.Replace(fmt.Sprintf("%v", this.SourceContext), "SourceContext", "SourceContext", 1) + `,`, - `Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Field) String() string { - if this == nil { - return "nil" - } - repeatedStringForOptions := "[]*Option{" - for _, f := range this.Options { - repeatedStringForOptions += strings.Replace(f.String(), "Option", "Option", 1) + "," - } - repeatedStringForOptions += "}" - s := strings.Join([]string{`&Field{`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `Cardinality:` + fmt.Sprintf("%v", this.Cardinality) + `,`, - `Number:` + fmt.Sprintf("%v", this.Number) + `,`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `TypeUrl:` + fmt.Sprintf("%v", this.TypeUrl) + `,`, - `OneofIndex:` + fmt.Sprintf("%v", this.OneofIndex) + `,`, - `Packed:` + fmt.Sprintf("%v", this.Packed) + `,`, - `Options:` + repeatedStringForOptions + `,`, - `JsonName:` + fmt.Sprintf("%v", this.JsonName) + `,`, - `DefaultValue:` + fmt.Sprintf("%v", this.DefaultValue) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Enum) String() string { - if this == nil { - return "nil" - } - repeatedStringForEnumvalue := "[]*EnumValue{" - for _, f := range this.Enumvalue { - repeatedStringForEnumvalue += strings.Replace(f.String(), "EnumValue", "EnumValue", 1) + "," - } - repeatedStringForEnumvalue += "}" - repeatedStringForOptions := "[]*Option{" - for _, f := range this.Options { - repeatedStringForOptions += strings.Replace(f.String(), "Option", "Option", 1) + "," - } - repeatedStringForOptions += "}" - s := strings.Join([]string{`&Enum{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Enumvalue:` + repeatedStringForEnumvalue + `,`, - `Options:` + repeatedStringForOptions + `,`, - `SourceContext:` + strings.Replace(fmt.Sprintf("%v", this.SourceContext), "SourceContext", "SourceContext", 1) + `,`, - `Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *EnumValue) String() string { - if this == nil { - return "nil" - } - repeatedStringForOptions := "[]*Option{" - for _, f := range this.Options { - repeatedStringForOptions += strings.Replace(f.String(), "Option", "Option", 1) + "," - } - repeatedStringForOptions += "}" - s := strings.Join([]string{`&EnumValue{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Number:` + fmt.Sprintf("%v", this.Number) + `,`, - `Options:` + repeatedStringForOptions + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Option) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Option{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Value:` + strings.Replace(fmt.Sprintf("%v", this.Value), "Any", "Any", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringType(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Type) Unmarshal(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 ErrIntOverflowType - } - 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: Type: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Type: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Fields = append(m.Fields, &Field{}) - if err := m.Fields[len(m.Fields)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Oneofs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Oneofs = append(m.Oneofs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Options = append(m.Options, &Option{}) - if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceContext", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SourceContext == nil { - m.SourceContext = &SourceContext{} - } - if err := m.SourceContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Syntax", wireType) - } - m.Syntax = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Syntax |= Syntax(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipType(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthType - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Field) Unmarshal(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 ErrIntOverflowType - } - 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: Field: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Field: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - m.Kind = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Kind |= Field_Kind(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Cardinality", wireType) - } - m.Cardinality = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Cardinality |= Field_Cardinality(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) - } - m.Number = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Number |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TypeUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TypeUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OneofIndex", wireType) - } - m.OneofIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.OneofIndex |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Packed", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Packed = bool(v != 0) - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Options = append(m.Options, &Option{}) - if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field JsonName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.JsonName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultValue", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DefaultValue = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipType(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthType - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Enum) Unmarshal(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 ErrIntOverflowType - } - 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: Enum: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Enum: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Enumvalue", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Enumvalue = append(m.Enumvalue, &EnumValue{}) - if err := m.Enumvalue[len(m.Enumvalue)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Options = append(m.Options, &Option{}) - if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceContext", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SourceContext == nil { - m.SourceContext = &SourceContext{} - } - if err := m.SourceContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Syntax", wireType) - } - m.Syntax = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Syntax |= Syntax(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipType(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthType - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EnumValue) Unmarshal(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 ErrIntOverflowType - } - 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: EnumValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EnumValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) - } - m.Number = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Number |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Options = append(m.Options, &Option{}) - if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipType(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthType - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Option) Unmarshal(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 ErrIntOverflowType - } - 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: Option: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Option: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowType - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthType - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthType - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Value == nil { - m.Value = &Any{} - } - if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipType(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthType - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipType(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowType - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowType - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowType - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthType - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupType - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthType - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthType = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowType = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupType = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/gogo/protobuf/types/wrappers.pb.go b/vendor/github.com/gogo/protobuf/types/wrappers.pb.go deleted file mode 100644 index 8d415420a7..0000000000 --- a/vendor/github.com/gogo/protobuf/types/wrappers.pb.go +++ /dev/null @@ -1,2703 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: google/protobuf/wrappers.proto - -package types - -import ( - bytes "bytes" - encoding_binary "encoding/binary" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Wrapper message for `double`. -// -// The JSON representation for `DoubleValue` is JSON number. -type DoubleValue struct { - // The double value. - Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DoubleValue) Reset() { *m = DoubleValue{} } -func (*DoubleValue) ProtoMessage() {} -func (*DoubleValue) Descriptor() ([]byte, []int) { - return fileDescriptor_5377b62bda767935, []int{0} -} -func (*DoubleValue) XXX_WellKnownType() string { return "DoubleValue" } -func (m *DoubleValue) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DoubleValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DoubleValue.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DoubleValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_DoubleValue.Merge(m, src) -} -func (m *DoubleValue) XXX_Size() int { - return m.Size() -} -func (m *DoubleValue) XXX_DiscardUnknown() { - xxx_messageInfo_DoubleValue.DiscardUnknown(m) -} - -var xxx_messageInfo_DoubleValue proto.InternalMessageInfo - -func (m *DoubleValue) GetValue() float64 { - if m != nil { - return m.Value - } - return 0 -} - -func (*DoubleValue) XXX_MessageName() string { - return "google.protobuf.DoubleValue" -} - -// Wrapper message for `float`. -// -// The JSON representation for `FloatValue` is JSON number. -type FloatValue struct { - // The float value. - Value float32 `protobuf:"fixed32,1,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FloatValue) Reset() { *m = FloatValue{} } -func (*FloatValue) ProtoMessage() {} -func (*FloatValue) Descriptor() ([]byte, []int) { - return fileDescriptor_5377b62bda767935, []int{1} -} -func (*FloatValue) XXX_WellKnownType() string { return "FloatValue" } -func (m *FloatValue) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FloatValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FloatValue.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *FloatValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_FloatValue.Merge(m, src) -} -func (m *FloatValue) XXX_Size() int { - return m.Size() -} -func (m *FloatValue) XXX_DiscardUnknown() { - xxx_messageInfo_FloatValue.DiscardUnknown(m) -} - -var xxx_messageInfo_FloatValue proto.InternalMessageInfo - -func (m *FloatValue) GetValue() float32 { - if m != nil { - return m.Value - } - return 0 -} - -func (*FloatValue) XXX_MessageName() string { - return "google.protobuf.FloatValue" -} - -// Wrapper message for `int64`. -// -// The JSON representation for `Int64Value` is JSON string. -type Int64Value struct { - // The int64 value. - Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Int64Value) Reset() { *m = Int64Value{} } -func (*Int64Value) ProtoMessage() {} -func (*Int64Value) Descriptor() ([]byte, []int) { - return fileDescriptor_5377b62bda767935, []int{2} -} -func (*Int64Value) XXX_WellKnownType() string { return "Int64Value" } -func (m *Int64Value) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Int64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Int64Value.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Int64Value) XXX_Merge(src proto.Message) { - xxx_messageInfo_Int64Value.Merge(m, src) -} -func (m *Int64Value) XXX_Size() int { - return m.Size() -} -func (m *Int64Value) XXX_DiscardUnknown() { - xxx_messageInfo_Int64Value.DiscardUnknown(m) -} - -var xxx_messageInfo_Int64Value proto.InternalMessageInfo - -func (m *Int64Value) GetValue() int64 { - if m != nil { - return m.Value - } - return 0 -} - -func (*Int64Value) XXX_MessageName() string { - return "google.protobuf.Int64Value" -} - -// Wrapper message for `uint64`. -// -// The JSON representation for `UInt64Value` is JSON string. -type UInt64Value struct { - // The uint64 value. - Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UInt64Value) Reset() { *m = UInt64Value{} } -func (*UInt64Value) ProtoMessage() {} -func (*UInt64Value) Descriptor() ([]byte, []int) { - return fileDescriptor_5377b62bda767935, []int{3} -} -func (*UInt64Value) XXX_WellKnownType() string { return "UInt64Value" } -func (m *UInt64Value) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UInt64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UInt64Value.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UInt64Value) XXX_Merge(src proto.Message) { - xxx_messageInfo_UInt64Value.Merge(m, src) -} -func (m *UInt64Value) XXX_Size() int { - return m.Size() -} -func (m *UInt64Value) XXX_DiscardUnknown() { - xxx_messageInfo_UInt64Value.DiscardUnknown(m) -} - -var xxx_messageInfo_UInt64Value proto.InternalMessageInfo - -func (m *UInt64Value) GetValue() uint64 { - if m != nil { - return m.Value - } - return 0 -} - -func (*UInt64Value) XXX_MessageName() string { - return "google.protobuf.UInt64Value" -} - -// Wrapper message for `int32`. -// -// The JSON representation for `Int32Value` is JSON number. -type Int32Value struct { - // The int32 value. - Value int32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Int32Value) Reset() { *m = Int32Value{} } -func (*Int32Value) ProtoMessage() {} -func (*Int32Value) Descriptor() ([]byte, []int) { - return fileDescriptor_5377b62bda767935, []int{4} -} -func (*Int32Value) XXX_WellKnownType() string { return "Int32Value" } -func (m *Int32Value) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Int32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Int32Value.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Int32Value) XXX_Merge(src proto.Message) { - xxx_messageInfo_Int32Value.Merge(m, src) -} -func (m *Int32Value) XXX_Size() int { - return m.Size() -} -func (m *Int32Value) XXX_DiscardUnknown() { - xxx_messageInfo_Int32Value.DiscardUnknown(m) -} - -var xxx_messageInfo_Int32Value proto.InternalMessageInfo - -func (m *Int32Value) GetValue() int32 { - if m != nil { - return m.Value - } - return 0 -} - -func (*Int32Value) XXX_MessageName() string { - return "google.protobuf.Int32Value" -} - -// Wrapper message for `uint32`. -// -// The JSON representation for `UInt32Value` is JSON number. -type UInt32Value struct { - // The uint32 value. - Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UInt32Value) Reset() { *m = UInt32Value{} } -func (*UInt32Value) ProtoMessage() {} -func (*UInt32Value) Descriptor() ([]byte, []int) { - return fileDescriptor_5377b62bda767935, []int{5} -} -func (*UInt32Value) XXX_WellKnownType() string { return "UInt32Value" } -func (m *UInt32Value) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UInt32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UInt32Value.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UInt32Value) XXX_Merge(src proto.Message) { - xxx_messageInfo_UInt32Value.Merge(m, src) -} -func (m *UInt32Value) XXX_Size() int { - return m.Size() -} -func (m *UInt32Value) XXX_DiscardUnknown() { - xxx_messageInfo_UInt32Value.DiscardUnknown(m) -} - -var xxx_messageInfo_UInt32Value proto.InternalMessageInfo - -func (m *UInt32Value) GetValue() uint32 { - if m != nil { - return m.Value - } - return 0 -} - -func (*UInt32Value) XXX_MessageName() string { - return "google.protobuf.UInt32Value" -} - -// Wrapper message for `bool`. -// -// The JSON representation for `BoolValue` is JSON `true` and `false`. -type BoolValue struct { - // The bool value. - Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BoolValue) Reset() { *m = BoolValue{} } -func (*BoolValue) ProtoMessage() {} -func (*BoolValue) Descriptor() ([]byte, []int) { - return fileDescriptor_5377b62bda767935, []int{6} -} -func (*BoolValue) XXX_WellKnownType() string { return "BoolValue" } -func (m *BoolValue) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BoolValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BoolValue.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *BoolValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_BoolValue.Merge(m, src) -} -func (m *BoolValue) XXX_Size() int { - return m.Size() -} -func (m *BoolValue) XXX_DiscardUnknown() { - xxx_messageInfo_BoolValue.DiscardUnknown(m) -} - -var xxx_messageInfo_BoolValue proto.InternalMessageInfo - -func (m *BoolValue) GetValue() bool { - if m != nil { - return m.Value - } - return false -} - -func (*BoolValue) XXX_MessageName() string { - return "google.protobuf.BoolValue" -} - -// Wrapper message for `string`. -// -// The JSON representation for `StringValue` is JSON string. -type StringValue struct { - // The string value. - Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StringValue) Reset() { *m = StringValue{} } -func (*StringValue) ProtoMessage() {} -func (*StringValue) Descriptor() ([]byte, []int) { - return fileDescriptor_5377b62bda767935, []int{7} -} -func (*StringValue) XXX_WellKnownType() string { return "StringValue" } -func (m *StringValue) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StringValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StringValue.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StringValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_StringValue.Merge(m, src) -} -func (m *StringValue) XXX_Size() int { - return m.Size() -} -func (m *StringValue) XXX_DiscardUnknown() { - xxx_messageInfo_StringValue.DiscardUnknown(m) -} - -var xxx_messageInfo_StringValue proto.InternalMessageInfo - -func (m *StringValue) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - -func (*StringValue) XXX_MessageName() string { - return "google.protobuf.StringValue" -} - -// Wrapper message for `bytes`. -// -// The JSON representation for `BytesValue` is JSON string. -type BytesValue struct { - // The bytes value. - Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BytesValue) Reset() { *m = BytesValue{} } -func (*BytesValue) ProtoMessage() {} -func (*BytesValue) Descriptor() ([]byte, []int) { - return fileDescriptor_5377b62bda767935, []int{8} -} -func (*BytesValue) XXX_WellKnownType() string { return "BytesValue" } -func (m *BytesValue) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BytesValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BytesValue.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *BytesValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_BytesValue.Merge(m, src) -} -func (m *BytesValue) XXX_Size() int { - return m.Size() -} -func (m *BytesValue) XXX_DiscardUnknown() { - xxx_messageInfo_BytesValue.DiscardUnknown(m) -} - -var xxx_messageInfo_BytesValue proto.InternalMessageInfo - -func (m *BytesValue) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (*BytesValue) XXX_MessageName() string { - return "google.protobuf.BytesValue" -} -func init() { - proto.RegisterType((*DoubleValue)(nil), "google.protobuf.DoubleValue") - proto.RegisterType((*FloatValue)(nil), "google.protobuf.FloatValue") - proto.RegisterType((*Int64Value)(nil), "google.protobuf.Int64Value") - proto.RegisterType((*UInt64Value)(nil), "google.protobuf.UInt64Value") - proto.RegisterType((*Int32Value)(nil), "google.protobuf.Int32Value") - proto.RegisterType((*UInt32Value)(nil), "google.protobuf.UInt32Value") - proto.RegisterType((*BoolValue)(nil), "google.protobuf.BoolValue") - proto.RegisterType((*StringValue)(nil), "google.protobuf.StringValue") - proto.RegisterType((*BytesValue)(nil), "google.protobuf.BytesValue") -} - -func init() { proto.RegisterFile("google/protobuf/wrappers.proto", fileDescriptor_5377b62bda767935) } - -var fileDescriptor_5377b62bda767935 = []byte{ - // 285 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xcf, 0xcf, 0x4f, - 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0x2f, 0x4a, 0x2c, - 0x28, 0x48, 0x2d, 0x2a, 0xd6, 0x03, 0x8b, 0x08, 0xf1, 0x43, 0xe4, 0xf5, 0x60, 0xf2, 0x4a, 0xca, - 0x5c, 0xdc, 0x2e, 0xf9, 0xa5, 0x49, 0x39, 0xa9, 0x61, 0x89, 0x39, 0xa5, 0xa9, 0x42, 0x22, 0x5c, - 0xac, 0x65, 0x20, 0x86, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x63, 0x10, 0x84, 0xa3, 0xa4, 0xc4, 0xc5, - 0xe5, 0x96, 0x93, 0x9f, 0x58, 0x82, 0x45, 0x0d, 0x13, 0x92, 0x1a, 0xcf, 0xbc, 0x12, 0x33, 0x13, - 0x2c, 0x6a, 0x98, 0x61, 0x6a, 0x94, 0xb9, 0xb8, 0x43, 0x71, 0x29, 0x62, 0x41, 0x35, 0xc8, 0xd8, - 0x08, 0x8b, 0x1a, 0x56, 0x34, 0x83, 0xb0, 0x2a, 0xe2, 0x85, 0x29, 0x52, 0xe4, 0xe2, 0x74, 0xca, - 0xcf, 0xcf, 0xc1, 0xa2, 0x84, 0x03, 0xc9, 0x9c, 0xe0, 0x92, 0xa2, 0xcc, 0xbc, 0x74, 0x2c, 0x8a, - 0x38, 0x91, 0x1c, 0xe4, 0x54, 0x59, 0x92, 0x5a, 0x8c, 0x45, 0x0d, 0x0f, 0x54, 0x8d, 0x53, 0x3b, - 0xe3, 0x8d, 0x87, 0x72, 0x0c, 0x1f, 0x1e, 0xca, 0x31, 0xfe, 0x78, 0x28, 0xc7, 0xd8, 0xf0, 0x48, - 0x8e, 0x71, 0xc5, 0x23, 0x39, 0xc6, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, - 0x48, 0x8e, 0xf1, 0xc5, 0x23, 0x39, 0x86, 0x0f, 0x20, 0xf1, 0xc7, 0x72, 0x8c, 0x27, 0x1e, 0xcb, - 0x31, 0x72, 0x09, 0x27, 0xe7, 0xe7, 0xea, 0xa1, 0x45, 0x87, 0x13, 0x6f, 0x38, 0x34, 0xbe, 0x02, - 0x40, 0x22, 0x01, 0x8c, 0x51, 0xac, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x3f, 0x18, 0x19, 0x17, 0x31, - 0x31, 0xbb, 0x07, 0x38, 0xad, 0x62, 0x92, 0x73, 0x87, 0x68, 0x09, 0x80, 0x6a, 0xd1, 0x0b, 0x4f, - 0xcd, 0xc9, 0xf1, 0xce, 0xcb, 0x2f, 0xcf, 0x0b, 0x01, 0xa9, 0x4c, 0x62, 0x03, 0x9b, 0x65, 0x0c, - 0x08, 0x00, 0x00, 0xff, 0xff, 0x31, 0x55, 0x64, 0x90, 0x0a, 0x02, 0x00, 0x00, -} - -func (this *DoubleValue) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*DoubleValue) - if !ok { - that2, ok := that.(DoubleValue) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Value != that1.Value { - if this.Value < that1.Value { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *FloatValue) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*FloatValue) - if !ok { - that2, ok := that.(FloatValue) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Value != that1.Value { - if this.Value < that1.Value { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *Int64Value) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Int64Value) - if !ok { - that2, ok := that.(Int64Value) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Value != that1.Value { - if this.Value < that1.Value { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *UInt64Value) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*UInt64Value) - if !ok { - that2, ok := that.(UInt64Value) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Value != that1.Value { - if this.Value < that1.Value { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *Int32Value) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Int32Value) - if !ok { - that2, ok := that.(Int32Value) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Value != that1.Value { - if this.Value < that1.Value { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *UInt32Value) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*UInt32Value) - if !ok { - that2, ok := that.(UInt32Value) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Value != that1.Value { - if this.Value < that1.Value { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *BoolValue) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*BoolValue) - if !ok { - that2, ok := that.(BoolValue) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Value != that1.Value { - if !this.Value { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *StringValue) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*StringValue) - if !ok { - that2, ok := that.(StringValue) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Value != that1.Value { - if this.Value < that1.Value { - return -1 - } - return 1 - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *BytesValue) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*BytesValue) - if !ok { - that2, ok := that.(BytesValue) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if c := bytes.Compare(this.Value, that1.Value); c != 0 { - return c - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *DoubleValue) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DoubleValue) - if !ok { - that2, ok := that.(DoubleValue) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Value != that1.Value { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *FloatValue) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*FloatValue) - if !ok { - that2, ok := that.(FloatValue) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Value != that1.Value { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Int64Value) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Int64Value) - if !ok { - that2, ok := that.(Int64Value) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Value != that1.Value { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *UInt64Value) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*UInt64Value) - if !ok { - that2, ok := that.(UInt64Value) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Value != that1.Value { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Int32Value) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Int32Value) - if !ok { - that2, ok := that.(Int32Value) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Value != that1.Value { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *UInt32Value) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*UInt32Value) - if !ok { - that2, ok := that.(UInt32Value) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Value != that1.Value { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *BoolValue) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*BoolValue) - if !ok { - that2, ok := that.(BoolValue) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Value != that1.Value { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *StringValue) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*StringValue) - if !ok { - that2, ok := that.(StringValue) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Value != that1.Value { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *BytesValue) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*BytesValue) - if !ok { - that2, ok := that.(BytesValue) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.Value, that1.Value) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *DoubleValue) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&types.DoubleValue{") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FloatValue) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&types.FloatValue{") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Int64Value) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&types.Int64Value{") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UInt64Value) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&types.UInt64Value{") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Int32Value) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&types.Int32Value{") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UInt32Value) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&types.UInt32Value{") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *BoolValue) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&types.BoolValue{") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *StringValue) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&types.StringValue{") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *BytesValue) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&types.BytesValue{") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringWrappers(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *DoubleValue) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DoubleValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Value != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i-- - dAtA[i] = 0x9 - } - return len(dAtA) - i, nil -} - -func (m *FloatValue) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *FloatValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FloatValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Value != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Value)))) - i-- - dAtA[i] = 0xd - } - return len(dAtA) - i, nil -} - -func (m *Int64Value) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Int64Value) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Int64Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Value != 0 { - i = encodeVarintWrappers(dAtA, i, uint64(m.Value)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *UInt64Value) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UInt64Value) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UInt64Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Value != 0 { - i = encodeVarintWrappers(dAtA, i, uint64(m.Value)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Int32Value) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Int32Value) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Int32Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Value != 0 { - i = encodeVarintWrappers(dAtA, i, uint64(m.Value)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *UInt32Value) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UInt32Value) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UInt32Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Value != 0 { - i = encodeVarintWrappers(dAtA, i, uint64(m.Value)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *BoolValue) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BoolValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BoolValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Value { - i-- - if m.Value { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *StringValue) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StringValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StringValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintWrappers(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *BytesValue) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BytesValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BytesValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintWrappers(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintWrappers(dAtA []byte, offset int, v uint64) int { - offset -= sovWrappers(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func NewPopulatedDoubleValue(r randyWrappers, easy bool) *DoubleValue { - this := &DoubleValue{} - this.Value = float64(r.Float64()) - if r.Intn(2) == 0 { - this.Value *= -1 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedWrappers(r, 2) - } - return this -} - -func NewPopulatedFloatValue(r randyWrappers, easy bool) *FloatValue { - this := &FloatValue{} - this.Value = float32(r.Float32()) - if r.Intn(2) == 0 { - this.Value *= -1 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedWrappers(r, 2) - } - return this -} - -func NewPopulatedInt64Value(r randyWrappers, easy bool) *Int64Value { - this := &Int64Value{} - this.Value = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Value *= -1 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedWrappers(r, 2) - } - return this -} - -func NewPopulatedUInt64Value(r randyWrappers, easy bool) *UInt64Value { - this := &UInt64Value{} - this.Value = uint64(uint64(r.Uint32())) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedWrappers(r, 2) - } - return this -} - -func NewPopulatedInt32Value(r randyWrappers, easy bool) *Int32Value { - this := &Int32Value{} - this.Value = int32(r.Int31()) - if r.Intn(2) == 0 { - this.Value *= -1 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedWrappers(r, 2) - } - return this -} - -func NewPopulatedUInt32Value(r randyWrappers, easy bool) *UInt32Value { - this := &UInt32Value{} - this.Value = uint32(r.Uint32()) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedWrappers(r, 2) - } - return this -} - -func NewPopulatedBoolValue(r randyWrappers, easy bool) *BoolValue { - this := &BoolValue{} - this.Value = bool(bool(r.Intn(2) == 0)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedWrappers(r, 2) - } - return this -} - -func NewPopulatedStringValue(r randyWrappers, easy bool) *StringValue { - this := &StringValue{} - this.Value = string(randStringWrappers(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedWrappers(r, 2) - } - return this -} - -func NewPopulatedBytesValue(r randyWrappers, easy bool) *BytesValue { - this := &BytesValue{} - v1 := r.Intn(100) - this.Value = make([]byte, v1) - for i := 0; i < v1; i++ { - this.Value[i] = byte(r.Intn(256)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedWrappers(r, 2) - } - return this -} - -type randyWrappers interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneWrappers(r randyWrappers) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringWrappers(r randyWrappers) string { - v2 := r.Intn(100) - tmps := make([]rune, v2) - for i := 0; i < v2; i++ { - tmps[i] = randUTF8RuneWrappers(r) - } - return string(tmps) -} -func randUnrecognizedWrappers(r randyWrappers, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldWrappers(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldWrappers(dAtA []byte, r randyWrappers, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateWrappers(dAtA, uint64(key)) - v3 := r.Int63() - if r.Intn(2) == 0 { - v3 *= -1 - } - dAtA = encodeVarintPopulateWrappers(dAtA, uint64(v3)) - case 1: - dAtA = encodeVarintPopulateWrappers(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateWrappers(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateWrappers(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateWrappers(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateWrappers(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} -func (m *DoubleValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != 0 { - n += 9 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *FloatValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != 0 { - n += 5 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Int64Value) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != 0 { - n += 1 + sovWrappers(uint64(m.Value)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *UInt64Value) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != 0 { - n += 1 + sovWrappers(uint64(m.Value)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Int32Value) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != 0 { - n += 1 + sovWrappers(uint64(m.Value)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *UInt32Value) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != 0 { - n += 1 + sovWrappers(uint64(m.Value)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *BoolValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *StringValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Value) - if l > 0 { - n += 1 + l + sovWrappers(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *BytesValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Value) - if l > 0 { - n += 1 + l + sovWrappers(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovWrappers(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozWrappers(x uint64) (n int) { - return sovWrappers(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *DoubleValue) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DoubleValue{`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *FloatValue) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FloatValue{`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Int64Value) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Int64Value{`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *UInt64Value) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UInt64Value{`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Int32Value) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Int32Value{`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *UInt32Value) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UInt32Value{`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *BoolValue) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&BoolValue{`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *StringValue) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StringValue{`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *BytesValue) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&BytesValue{`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringWrappers(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *DoubleValue) Unmarshal(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 ErrIntOverflowWrappers - } - 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: DoubleValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DoubleValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Value = float64(math.Float64frombits(v)) - default: - iNdEx = preIndex - skippy, err := skipWrappers(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FloatValue) Unmarshal(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 ErrIntOverflowWrappers - } - 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: FloatValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FloatValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.Value = float32(math.Float32frombits(v)) - default: - iNdEx = preIndex - skippy, err := skipWrappers(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Int64Value) Unmarshal(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 ErrIntOverflowWrappers - } - 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: Int64Value: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Int64Value: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - m.Value = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWrappers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Value |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipWrappers(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UInt64Value) Unmarshal(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 ErrIntOverflowWrappers - } - 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: UInt64Value: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UInt64Value: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - m.Value = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWrappers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Value |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipWrappers(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Int32Value) Unmarshal(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 ErrIntOverflowWrappers - } - 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: Int32Value: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Int32Value: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - m.Value = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWrappers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Value |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipWrappers(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UInt32Value) Unmarshal(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 ErrIntOverflowWrappers - } - 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: UInt32Value: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UInt32Value: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - m.Value = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWrappers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Value |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipWrappers(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BoolValue) Unmarshal(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 ErrIntOverflowWrappers - } - 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: BoolValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BoolValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWrappers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Value = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipWrappers(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StringValue) Unmarshal(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 ErrIntOverflowWrappers - } - 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: StringValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StringValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWrappers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWrappers - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWrappers - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipWrappers(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BytesValue) Unmarshal(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 ErrIntOverflowWrappers - } - 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: BytesValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BytesValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWrappers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthWrappers - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthWrappers - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipWrappers(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipWrappers(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowWrappers - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowWrappers - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowWrappers - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthWrappers - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupWrappers - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthWrappers - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthWrappers = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowWrappers = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupWrappers = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/gogo/protobuf/types/wrappers_gogo.go b/vendor/github.com/gogo/protobuf/types/wrappers_gogo.go deleted file mode 100644 index d905df3605..0000000000 --- a/vendor/github.com/gogo/protobuf/types/wrappers_gogo.go +++ /dev/null @@ -1,300 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2018, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package types - -func NewPopulatedStdDouble(r randyWrappers, easy bool) *float64 { - v := NewPopulatedDoubleValue(r, easy) - return &v.Value -} - -func SizeOfStdDouble(v float64) int { - pv := &DoubleValue{Value: v} - return pv.Size() -} - -func StdDoubleMarshal(v float64) ([]byte, error) { - size := SizeOfStdDouble(v) - buf := make([]byte, size) - _, err := StdDoubleMarshalTo(v, buf) - return buf, err -} - -func StdDoubleMarshalTo(v float64, data []byte) (int, error) { - pv := &DoubleValue{Value: v} - return pv.MarshalTo(data) -} - -func StdDoubleUnmarshal(v *float64, data []byte) error { - pv := &DoubleValue{} - if err := pv.Unmarshal(data); err != nil { - return err - } - *v = pv.Value - return nil -} -func NewPopulatedStdFloat(r randyWrappers, easy bool) *float32 { - v := NewPopulatedFloatValue(r, easy) - return &v.Value -} - -func SizeOfStdFloat(v float32) int { - pv := &FloatValue{Value: v} - return pv.Size() -} - -func StdFloatMarshal(v float32) ([]byte, error) { - size := SizeOfStdFloat(v) - buf := make([]byte, size) - _, err := StdFloatMarshalTo(v, buf) - return buf, err -} - -func StdFloatMarshalTo(v float32, data []byte) (int, error) { - pv := &FloatValue{Value: v} - return pv.MarshalTo(data) -} - -func StdFloatUnmarshal(v *float32, data []byte) error { - pv := &FloatValue{} - if err := pv.Unmarshal(data); err != nil { - return err - } - *v = pv.Value - return nil -} -func NewPopulatedStdInt64(r randyWrappers, easy bool) *int64 { - v := NewPopulatedInt64Value(r, easy) - return &v.Value -} - -func SizeOfStdInt64(v int64) int { - pv := &Int64Value{Value: v} - return pv.Size() -} - -func StdInt64Marshal(v int64) ([]byte, error) { - size := SizeOfStdInt64(v) - buf := make([]byte, size) - _, err := StdInt64MarshalTo(v, buf) - return buf, err -} - -func StdInt64MarshalTo(v int64, data []byte) (int, error) { - pv := &Int64Value{Value: v} - return pv.MarshalTo(data) -} - -func StdInt64Unmarshal(v *int64, data []byte) error { - pv := &Int64Value{} - if err := pv.Unmarshal(data); err != nil { - return err - } - *v = pv.Value - return nil -} -func NewPopulatedStdUInt64(r randyWrappers, easy bool) *uint64 { - v := NewPopulatedUInt64Value(r, easy) - return &v.Value -} - -func SizeOfStdUInt64(v uint64) int { - pv := &UInt64Value{Value: v} - return pv.Size() -} - -func StdUInt64Marshal(v uint64) ([]byte, error) { - size := SizeOfStdUInt64(v) - buf := make([]byte, size) - _, err := StdUInt64MarshalTo(v, buf) - return buf, err -} - -func StdUInt64MarshalTo(v uint64, data []byte) (int, error) { - pv := &UInt64Value{Value: v} - return pv.MarshalTo(data) -} - -func StdUInt64Unmarshal(v *uint64, data []byte) error { - pv := &UInt64Value{} - if err := pv.Unmarshal(data); err != nil { - return err - } - *v = pv.Value - return nil -} -func NewPopulatedStdInt32(r randyWrappers, easy bool) *int32 { - v := NewPopulatedInt32Value(r, easy) - return &v.Value -} - -func SizeOfStdInt32(v int32) int { - pv := &Int32Value{Value: v} - return pv.Size() -} - -func StdInt32Marshal(v int32) ([]byte, error) { - size := SizeOfStdInt32(v) - buf := make([]byte, size) - _, err := StdInt32MarshalTo(v, buf) - return buf, err -} - -func StdInt32MarshalTo(v int32, data []byte) (int, error) { - pv := &Int32Value{Value: v} - return pv.MarshalTo(data) -} - -func StdInt32Unmarshal(v *int32, data []byte) error { - pv := &Int32Value{} - if err := pv.Unmarshal(data); err != nil { - return err - } - *v = pv.Value - return nil -} -func NewPopulatedStdUInt32(r randyWrappers, easy bool) *uint32 { - v := NewPopulatedUInt32Value(r, easy) - return &v.Value -} - -func SizeOfStdUInt32(v uint32) int { - pv := &UInt32Value{Value: v} - return pv.Size() -} - -func StdUInt32Marshal(v uint32) ([]byte, error) { - size := SizeOfStdUInt32(v) - buf := make([]byte, size) - _, err := StdUInt32MarshalTo(v, buf) - return buf, err -} - -func StdUInt32MarshalTo(v uint32, data []byte) (int, error) { - pv := &UInt32Value{Value: v} - return pv.MarshalTo(data) -} - -func StdUInt32Unmarshal(v *uint32, data []byte) error { - pv := &UInt32Value{} - if err := pv.Unmarshal(data); err != nil { - return err - } - *v = pv.Value - return nil -} -func NewPopulatedStdBool(r randyWrappers, easy bool) *bool { - v := NewPopulatedBoolValue(r, easy) - return &v.Value -} - -func SizeOfStdBool(v bool) int { - pv := &BoolValue{Value: v} - return pv.Size() -} - -func StdBoolMarshal(v bool) ([]byte, error) { - size := SizeOfStdBool(v) - buf := make([]byte, size) - _, err := StdBoolMarshalTo(v, buf) - return buf, err -} - -func StdBoolMarshalTo(v bool, data []byte) (int, error) { - pv := &BoolValue{Value: v} - return pv.MarshalTo(data) -} - -func StdBoolUnmarshal(v *bool, data []byte) error { - pv := &BoolValue{} - if err := pv.Unmarshal(data); err != nil { - return err - } - *v = pv.Value - return nil -} -func NewPopulatedStdString(r randyWrappers, easy bool) *string { - v := NewPopulatedStringValue(r, easy) - return &v.Value -} - -func SizeOfStdString(v string) int { - pv := &StringValue{Value: v} - return pv.Size() -} - -func StdStringMarshal(v string) ([]byte, error) { - size := SizeOfStdString(v) - buf := make([]byte, size) - _, err := StdStringMarshalTo(v, buf) - return buf, err -} - -func StdStringMarshalTo(v string, data []byte) (int, error) { - pv := &StringValue{Value: v} - return pv.MarshalTo(data) -} - -func StdStringUnmarshal(v *string, data []byte) error { - pv := &StringValue{} - if err := pv.Unmarshal(data); err != nil { - return err - } - *v = pv.Value - return nil -} -func NewPopulatedStdBytes(r randyWrappers, easy bool) *[]byte { - v := NewPopulatedBytesValue(r, easy) - return &v.Value -} - -func SizeOfStdBytes(v []byte) int { - pv := &BytesValue{Value: v} - return pv.Size() -} - -func StdBytesMarshal(v []byte) ([]byte, error) { - size := SizeOfStdBytes(v) - buf := make([]byte, size) - _, err := StdBytesMarshalTo(v, buf) - return buf, err -} - -func StdBytesMarshalTo(v []byte, data []byte) (int, error) { - pv := &BytesValue{Value: v} - return pv.MarshalTo(data) -} - -func StdBytesUnmarshal(v *[]byte, data []byte) error { - pv := &BytesValue{} - if err := pv.Unmarshal(data); err != nil { - return err - } - *v = pv.Value - return nil -} diff --git a/vendor/github.com/golang/protobuf/AUTHORS b/vendor/github.com/golang/protobuf/AUTHORS deleted file mode 100644 index 15167cd746..0000000000 --- a/vendor/github.com/golang/protobuf/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/github.com/golang/protobuf/CONTRIBUTORS b/vendor/github.com/golang/protobuf/CONTRIBUTORS deleted file mode 100644 index 1c4577e968..0000000000 --- a/vendor/github.com/golang/protobuf/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/github.com/golang/protobuf/LICENSE b/vendor/github.com/golang/protobuf/LICENSE deleted file mode 100644 index 0f646931a4..0000000000 --- a/vendor/github.com/golang/protobuf/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright 2010 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/vendor/github.com/golang/protobuf/proto/buffer.go b/vendor/github.com/golang/protobuf/proto/buffer.go deleted file mode 100644 index e810e6fea1..0000000000 --- a/vendor/github.com/golang/protobuf/proto/buffer.go +++ /dev/null @@ -1,324 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package proto - -import ( - "errors" - "fmt" - - "google.golang.org/protobuf/encoding/prototext" - "google.golang.org/protobuf/encoding/protowire" - "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - WireVarint = 0 - WireFixed32 = 5 - WireFixed64 = 1 - WireBytes = 2 - WireStartGroup = 3 - WireEndGroup = 4 -) - -// EncodeVarint returns the varint encoded bytes of v. -func EncodeVarint(v uint64) []byte { - return protowire.AppendVarint(nil, v) -} - -// SizeVarint returns the length of the varint encoded bytes of v. -// This is equal to len(EncodeVarint(v)). -func SizeVarint(v uint64) int { - return protowire.SizeVarint(v) -} - -// DecodeVarint parses a varint encoded integer from b, -// returning the integer value and the length of the varint. -// It returns (0, 0) if there is a parse error. -func DecodeVarint(b []byte) (uint64, int) { - v, n := protowire.ConsumeVarint(b) - if n < 0 { - return 0, 0 - } - return v, n -} - -// Buffer is a buffer for encoding and decoding the protobuf wire format. -// It may be reused between invocations to reduce memory usage. -type Buffer struct { - buf []byte - idx int - deterministic bool -} - -// NewBuffer allocates a new Buffer initialized with buf, -// where the contents of buf are considered the unread portion of the buffer. -func NewBuffer(buf []byte) *Buffer { - return &Buffer{buf: buf} -} - -// SetDeterministic specifies whether to use deterministic serialization. -// -// Deterministic serialization guarantees that for a given binary, equal -// messages will always be serialized to the same bytes. This implies: -// -// - Repeated serialization of a message will return the same bytes. -// - Different processes of the same binary (which may be executing on -// different machines) will serialize equal messages to the same bytes. -// -// Note that the deterministic serialization is NOT canonical across -// languages. It is not guaranteed to remain stable over time. It is unstable -// across different builds with schema changes due to unknown fields. -// Users who need canonical serialization (e.g., persistent storage in a -// canonical form, fingerprinting, etc.) should define their own -// canonicalization specification and implement their own serializer rather -// than relying on this API. -// -// If deterministic serialization is requested, map entries will be sorted -// by keys in lexographical order. This is an implementation detail and -// subject to change. -func (b *Buffer) SetDeterministic(deterministic bool) { - b.deterministic = deterministic -} - -// SetBuf sets buf as the internal buffer, -// where the contents of buf are considered the unread portion of the buffer. -func (b *Buffer) SetBuf(buf []byte) { - b.buf = buf - b.idx = 0 -} - -// Reset clears the internal buffer of all written and unread data. -func (b *Buffer) Reset() { - b.buf = b.buf[:0] - b.idx = 0 -} - -// Bytes returns the internal buffer. -func (b *Buffer) Bytes() []byte { - return b.buf -} - -// Unread returns the unread portion of the buffer. -func (b *Buffer) Unread() []byte { - return b.buf[b.idx:] -} - -// Marshal appends the wire-format encoding of m to the buffer. -func (b *Buffer) Marshal(m Message) error { - var err error - b.buf, err = marshalAppend(b.buf, m, b.deterministic) - return err -} - -// Unmarshal parses the wire-format message in the buffer and -// places the decoded results in m. -// It does not reset m before unmarshaling. -func (b *Buffer) Unmarshal(m Message) error { - err := UnmarshalMerge(b.Unread(), m) - b.idx = len(b.buf) - return err -} - -type unknownFields struct{ XXX_unrecognized protoimpl.UnknownFields } - -func (m *unknownFields) String() string { panic("not implemented") } -func (m *unknownFields) Reset() { panic("not implemented") } -func (m *unknownFields) ProtoMessage() { panic("not implemented") } - -// DebugPrint dumps the encoded bytes of b with a header and footer including s -// to stdout. This is only intended for debugging. -func (*Buffer) DebugPrint(s string, b []byte) { - m := MessageReflect(new(unknownFields)) - m.SetUnknown(b) - b, _ = prototext.MarshalOptions{AllowPartial: true, Indent: "\t"}.Marshal(m.Interface()) - fmt.Printf("==== %s ====\n%s==== %s ====\n", s, b, s) -} - -// EncodeVarint appends an unsigned varint encoding to the buffer. -func (b *Buffer) EncodeVarint(v uint64) error { - b.buf = protowire.AppendVarint(b.buf, v) - return nil -} - -// EncodeZigzag32 appends a 32-bit zig-zag varint encoding to the buffer. -func (b *Buffer) EncodeZigzag32(v uint64) error { - return b.EncodeVarint(uint64((uint32(v) << 1) ^ uint32((int32(v) >> 31)))) -} - -// EncodeZigzag64 appends a 64-bit zig-zag varint encoding to the buffer. -func (b *Buffer) EncodeZigzag64(v uint64) error { - return b.EncodeVarint(uint64((uint64(v) << 1) ^ uint64((int64(v) >> 63)))) -} - -// EncodeFixed32 appends a 32-bit little-endian integer to the buffer. -func (b *Buffer) EncodeFixed32(v uint64) error { - b.buf = protowire.AppendFixed32(b.buf, uint32(v)) - return nil -} - -// EncodeFixed64 appends a 64-bit little-endian integer to the buffer. -func (b *Buffer) EncodeFixed64(v uint64) error { - b.buf = protowire.AppendFixed64(b.buf, uint64(v)) - return nil -} - -// EncodeRawBytes appends a length-prefixed raw bytes to the buffer. -func (b *Buffer) EncodeRawBytes(v []byte) error { - b.buf = protowire.AppendBytes(b.buf, v) - return nil -} - -// EncodeStringBytes appends a length-prefixed raw bytes to the buffer. -// It does not validate whether v contains valid UTF-8. -func (b *Buffer) EncodeStringBytes(v string) error { - b.buf = protowire.AppendString(b.buf, v) - return nil -} - -// EncodeMessage appends a length-prefixed encoded message to the buffer. -func (b *Buffer) EncodeMessage(m Message) error { - var err error - b.buf = protowire.AppendVarint(b.buf, uint64(Size(m))) - b.buf, err = marshalAppend(b.buf, m, b.deterministic) - return err -} - -// DecodeVarint consumes an encoded unsigned varint from the buffer. -func (b *Buffer) DecodeVarint() (uint64, error) { - v, n := protowire.ConsumeVarint(b.buf[b.idx:]) - if n < 0 { - return 0, protowire.ParseError(n) - } - b.idx += n - return uint64(v), nil -} - -// DecodeZigzag32 consumes an encoded 32-bit zig-zag varint from the buffer. -func (b *Buffer) DecodeZigzag32() (uint64, error) { - v, err := b.DecodeVarint() - if err != nil { - return 0, err - } - return uint64((uint32(v) >> 1) ^ uint32((int32(v&1)<<31)>>31)), nil -} - -// DecodeZigzag64 consumes an encoded 64-bit zig-zag varint from the buffer. -func (b *Buffer) DecodeZigzag64() (uint64, error) { - v, err := b.DecodeVarint() - if err != nil { - return 0, err - } - return uint64((uint64(v) >> 1) ^ uint64((int64(v&1)<<63)>>63)), nil -} - -// DecodeFixed32 consumes a 32-bit little-endian integer from the buffer. -func (b *Buffer) DecodeFixed32() (uint64, error) { - v, n := protowire.ConsumeFixed32(b.buf[b.idx:]) - if n < 0 { - return 0, protowire.ParseError(n) - } - b.idx += n - return uint64(v), nil -} - -// DecodeFixed64 consumes a 64-bit little-endian integer from the buffer. -func (b *Buffer) DecodeFixed64() (uint64, error) { - v, n := protowire.ConsumeFixed64(b.buf[b.idx:]) - if n < 0 { - return 0, protowire.ParseError(n) - } - b.idx += n - return uint64(v), nil -} - -// DecodeRawBytes consumes a length-prefixed raw bytes from the buffer. -// If alloc is specified, it returns a copy the raw bytes -// rather than a sub-slice of the buffer. -func (b *Buffer) DecodeRawBytes(alloc bool) ([]byte, error) { - v, n := protowire.ConsumeBytes(b.buf[b.idx:]) - if n < 0 { - return nil, protowire.ParseError(n) - } - b.idx += n - if alloc { - v = append([]byte(nil), v...) - } - return v, nil -} - -// DecodeStringBytes consumes a length-prefixed raw bytes from the buffer. -// It does not validate whether the raw bytes contain valid UTF-8. -func (b *Buffer) DecodeStringBytes() (string, error) { - v, n := protowire.ConsumeString(b.buf[b.idx:]) - if n < 0 { - return "", protowire.ParseError(n) - } - b.idx += n - return v, nil -} - -// DecodeMessage consumes a length-prefixed message from the buffer. -// It does not reset m before unmarshaling. -func (b *Buffer) DecodeMessage(m Message) error { - v, err := b.DecodeRawBytes(false) - if err != nil { - return err - } - return UnmarshalMerge(v, m) -} - -// DecodeGroup consumes a message group from the buffer. -// It assumes that the start group marker has already been consumed and -// consumes all bytes until (and including the end group marker). -// It does not reset m before unmarshaling. -func (b *Buffer) DecodeGroup(m Message) error { - v, n, err := consumeGroup(b.buf[b.idx:]) - if err != nil { - return err - } - b.idx += n - return UnmarshalMerge(v, m) -} - -// consumeGroup parses b until it finds an end group marker, returning -// the raw bytes of the message (excluding the end group marker) and the -// the total length of the message (including the end group marker). -func consumeGroup(b []byte) ([]byte, int, error) { - b0 := b - depth := 1 // assume this follows a start group marker - for { - _, wtyp, tagLen := protowire.ConsumeTag(b) - if tagLen < 0 { - return nil, 0, protowire.ParseError(tagLen) - } - b = b[tagLen:] - - var valLen int - switch wtyp { - case protowire.VarintType: - _, valLen = protowire.ConsumeVarint(b) - case protowire.Fixed32Type: - _, valLen = protowire.ConsumeFixed32(b) - case protowire.Fixed64Type: - _, valLen = protowire.ConsumeFixed64(b) - case protowire.BytesType: - _, valLen = protowire.ConsumeBytes(b) - case protowire.StartGroupType: - depth++ - case protowire.EndGroupType: - depth-- - default: - return nil, 0, errors.New("proto: cannot parse reserved wire type") - } - if valLen < 0 { - return nil, 0, protowire.ParseError(valLen) - } - b = b[valLen:] - - if depth == 0 { - return b0[:len(b0)-len(b)-tagLen], len(b0) - len(b), nil - } - } -} diff --git a/vendor/github.com/golang/protobuf/proto/defaults.go b/vendor/github.com/golang/protobuf/proto/defaults.go deleted file mode 100644 index d399bf069c..0000000000 --- a/vendor/github.com/golang/protobuf/proto/defaults.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package proto - -import ( - "google.golang.org/protobuf/reflect/protoreflect" -) - -// SetDefaults sets unpopulated scalar fields to their default values. -// Fields within a oneof are not set even if they have a default value. -// SetDefaults is recursively called upon any populated message fields. -func SetDefaults(m Message) { - if m != nil { - setDefaults(MessageReflect(m)) - } -} - -func setDefaults(m protoreflect.Message) { - fds := m.Descriptor().Fields() - for i := 0; i < fds.Len(); i++ { - fd := fds.Get(i) - if !m.Has(fd) { - if fd.HasDefault() && fd.ContainingOneof() == nil { - v := fd.Default() - if fd.Kind() == protoreflect.BytesKind { - v = protoreflect.ValueOf(append([]byte(nil), v.Bytes()...)) // copy the default bytes - } - m.Set(fd, v) - } - continue - } - } - - m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { - switch { - // Handle singular message. - case fd.Cardinality() != protoreflect.Repeated: - if fd.Message() != nil { - setDefaults(m.Get(fd).Message()) - } - // Handle list of messages. - case fd.IsList(): - if fd.Message() != nil { - ls := m.Get(fd).List() - for i := 0; i < ls.Len(); i++ { - setDefaults(ls.Get(i).Message()) - } - } - // Handle map of messages. - case fd.IsMap(): - if fd.MapValue().Message() != nil { - ms := m.Get(fd).Map() - ms.Range(func(_ protoreflect.MapKey, v protoreflect.Value) bool { - setDefaults(v.Message()) - return true - }) - } - } - return true - }) -} diff --git a/vendor/github.com/golang/protobuf/proto/deprecated.go b/vendor/github.com/golang/protobuf/proto/deprecated.go deleted file mode 100644 index e8db57e097..0000000000 --- a/vendor/github.com/golang/protobuf/proto/deprecated.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package proto - -import ( - "encoding/json" - "errors" - "fmt" - "strconv" - - protoV2 "google.golang.org/protobuf/proto" -) - -var ( - // Deprecated: No longer returned. - ErrNil = errors.New("proto: Marshal called with nil") - - // Deprecated: No longer returned. - ErrTooLarge = errors.New("proto: message encodes to over 2 GB") - - // Deprecated: No longer returned. - ErrInternalBadWireType = errors.New("proto: internal error: bad wiretype for oneof") -) - -// Deprecated: Do not use. -type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Size uint64 } - -// Deprecated: Do not use. -func GetStats() Stats { return Stats{} } - -// Deprecated: Do not use. -func MarshalMessageSet(interface{}) ([]byte, error) { - return nil, errors.New("proto: not implemented") -} - -// Deprecated: Do not use. -func UnmarshalMessageSet([]byte, interface{}) error { - return errors.New("proto: not implemented") -} - -// Deprecated: Do not use. -func MarshalMessageSetJSON(interface{}) ([]byte, error) { - return nil, errors.New("proto: not implemented") -} - -// Deprecated: Do not use. -func UnmarshalMessageSetJSON([]byte, interface{}) error { - return errors.New("proto: not implemented") -} - -// Deprecated: Do not use. -func RegisterMessageSetType(Message, int32, string) {} - -// Deprecated: Do not use. -func EnumName(m map[int32]string, v int32) string { - s, ok := m[v] - if ok { - return s - } - return strconv.Itoa(int(v)) -} - -// Deprecated: Do not use. -func UnmarshalJSONEnum(m map[string]int32, data []byte, enumName string) (int32, error) { - if data[0] == '"' { - // New style: enums are strings. - var repr string - if err := json.Unmarshal(data, &repr); err != nil { - return -1, err - } - val, ok := m[repr] - if !ok { - return 0, fmt.Errorf("unrecognized enum %s value %q", enumName, repr) - } - return val, nil - } - // Old style: enums are ints. - var val int32 - if err := json.Unmarshal(data, &val); err != nil { - return 0, fmt.Errorf("cannot unmarshal %#q into enum %s", data, enumName) - } - return val, nil -} - -// Deprecated: Do not use; this type existed for intenal-use only. -type InternalMessageInfo struct{} - -// Deprecated: Do not use; this method existed for intenal-use only. -func (*InternalMessageInfo) DiscardUnknown(m Message) { - DiscardUnknown(m) -} - -// Deprecated: Do not use; this method existed for intenal-use only. -func (*InternalMessageInfo) Marshal(b []byte, m Message, deterministic bool) ([]byte, error) { - return protoV2.MarshalOptions{Deterministic: deterministic}.MarshalAppend(b, MessageV2(m)) -} - -// Deprecated: Do not use; this method existed for intenal-use only. -func (*InternalMessageInfo) Merge(dst, src Message) { - protoV2.Merge(MessageV2(dst), MessageV2(src)) -} - -// Deprecated: Do not use; this method existed for intenal-use only. -func (*InternalMessageInfo) Size(m Message) int { - return protoV2.Size(MessageV2(m)) -} - -// Deprecated: Do not use; this method existed for intenal-use only. -func (*InternalMessageInfo) Unmarshal(m Message, b []byte) error { - return protoV2.UnmarshalOptions{Merge: true}.Unmarshal(b, MessageV2(m)) -} diff --git a/vendor/github.com/golang/protobuf/proto/discard.go b/vendor/github.com/golang/protobuf/proto/discard.go deleted file mode 100644 index 2187e877fa..0000000000 --- a/vendor/github.com/golang/protobuf/proto/discard.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package proto - -import ( - "google.golang.org/protobuf/reflect/protoreflect" -) - -// DiscardUnknown recursively discards all unknown fields from this message -// and all embedded messages. -// -// When unmarshaling a message with unrecognized fields, the tags and values -// of such fields are preserved in the Message. This allows a later call to -// marshal to be able to produce a message that continues to have those -// unrecognized fields. To avoid this, DiscardUnknown is used to -// explicitly clear the unknown fields after unmarshaling. -func DiscardUnknown(m Message) { - if m != nil { - discardUnknown(MessageReflect(m)) - } -} - -func discardUnknown(m protoreflect.Message) { - m.Range(func(fd protoreflect.FieldDescriptor, val protoreflect.Value) bool { - switch { - // Handle singular message. - case fd.Cardinality() != protoreflect.Repeated: - if fd.Message() != nil { - discardUnknown(m.Get(fd).Message()) - } - // Handle list of messages. - case fd.IsList(): - if fd.Message() != nil { - ls := m.Get(fd).List() - for i := 0; i < ls.Len(); i++ { - discardUnknown(ls.Get(i).Message()) - } - } - // Handle map of messages. - case fd.IsMap(): - if fd.MapValue().Message() != nil { - ms := m.Get(fd).Map() - ms.Range(func(_ protoreflect.MapKey, v protoreflect.Value) bool { - discardUnknown(v.Message()) - return true - }) - } - } - return true - }) - - // Discard unknown fields. - if len(m.GetUnknown()) > 0 { - m.SetUnknown(nil) - } -} diff --git a/vendor/github.com/golang/protobuf/proto/extensions.go b/vendor/github.com/golang/protobuf/proto/extensions.go deleted file mode 100644 index 42fc120c97..0000000000 --- a/vendor/github.com/golang/protobuf/proto/extensions.go +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package proto - -import ( - "errors" - "fmt" - "reflect" - - "google.golang.org/protobuf/encoding/protowire" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/runtime/protoiface" - "google.golang.org/protobuf/runtime/protoimpl" -) - -type ( - // ExtensionDesc represents an extension descriptor and - // is used to interact with an extension field in a message. - // - // Variables of this type are generated in code by protoc-gen-go. - ExtensionDesc = protoimpl.ExtensionInfo - - // ExtensionRange represents a range of message extensions. - // Used in code generated by protoc-gen-go. - ExtensionRange = protoiface.ExtensionRangeV1 - - // Deprecated: Do not use; this is an internal type. - Extension = protoimpl.ExtensionFieldV1 - - // Deprecated: Do not use; this is an internal type. - XXX_InternalExtensions = protoimpl.ExtensionFields -) - -// ErrMissingExtension reports whether the extension was not present. -var ErrMissingExtension = errors.New("proto: missing extension") - -var errNotExtendable = errors.New("proto: not an extendable proto.Message") - -// HasExtension reports whether the extension field is present in m -// either as an explicitly populated field or as an unknown field. -func HasExtension(m Message, xt *ExtensionDesc) (has bool) { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() { - return false - } - - // Check whether any populated known field matches the field number. - xtd := xt.TypeDescriptor() - if isValidExtension(mr.Descriptor(), xtd) { - has = mr.Has(xtd) - } else { - mr.Range(func(fd protoreflect.FieldDescriptor, _ protoreflect.Value) bool { - has = int32(fd.Number()) == xt.Field - return !has - }) - } - - // Check whether any unknown field matches the field number. - for b := mr.GetUnknown(); !has && len(b) > 0; { - num, _, n := protowire.ConsumeField(b) - has = int32(num) == xt.Field - b = b[n:] - } - return has -} - -// ClearExtension removes the extension field from m -// either as an explicitly populated field or as an unknown field. -func ClearExtension(m Message, xt *ExtensionDesc) { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() { - return - } - - xtd := xt.TypeDescriptor() - if isValidExtension(mr.Descriptor(), xtd) { - mr.Clear(xtd) - } else { - mr.Range(func(fd protoreflect.FieldDescriptor, _ protoreflect.Value) bool { - if int32(fd.Number()) == xt.Field { - mr.Clear(fd) - return false - } - return true - }) - } - clearUnknown(mr, fieldNum(xt.Field)) -} - -// ClearAllExtensions clears all extensions from m. -// This includes populated fields and unknown fields in the extension range. -func ClearAllExtensions(m Message) { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() { - return - } - - mr.Range(func(fd protoreflect.FieldDescriptor, _ protoreflect.Value) bool { - if fd.IsExtension() { - mr.Clear(fd) - } - return true - }) - clearUnknown(mr, mr.Descriptor().ExtensionRanges()) -} - -// GetExtension retrieves a proto2 extended field from m. -// -// If the descriptor is type complete (i.e., ExtensionDesc.ExtensionType is non-nil), -// then GetExtension parses the encoded field and returns a Go value of the specified type. -// If the field is not present, then the default value is returned (if one is specified), -// otherwise ErrMissingExtension is reported. -// -// If the descriptor is type incomplete (i.e., ExtensionDesc.ExtensionType is nil), -// then GetExtension returns the raw encoded bytes for the extension field. -func GetExtension(m Message, xt *ExtensionDesc) (interface{}, error) { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() || mr.Descriptor().ExtensionRanges().Len() == 0 { - return nil, errNotExtendable - } - - // Retrieve the unknown fields for this extension field. - var bo protoreflect.RawFields - for bi := mr.GetUnknown(); len(bi) > 0; { - num, _, n := protowire.ConsumeField(bi) - if int32(num) == xt.Field { - bo = append(bo, bi[:n]...) - } - bi = bi[n:] - } - - // For type incomplete descriptors, only retrieve the unknown fields. - if xt.ExtensionType == nil { - return []byte(bo), nil - } - - // If the extension field only exists as unknown fields, unmarshal it. - // This is rarely done since proto.Unmarshal eagerly unmarshals extensions. - xtd := xt.TypeDescriptor() - if !isValidExtension(mr.Descriptor(), xtd) { - return nil, fmt.Errorf("proto: bad extended type; %T does not extend %T", xt.ExtendedType, m) - } - if !mr.Has(xtd) && len(bo) > 0 { - m2 := mr.New() - if err := (proto.UnmarshalOptions{ - Resolver: extensionResolver{xt}, - }.Unmarshal(bo, m2.Interface())); err != nil { - return nil, err - } - if m2.Has(xtd) { - mr.Set(xtd, m2.Get(xtd)) - clearUnknown(mr, fieldNum(xt.Field)) - } - } - - // Check whether the message has the extension field set or a default. - var pv protoreflect.Value - switch { - case mr.Has(xtd): - pv = mr.Get(xtd) - case xtd.HasDefault(): - pv = xtd.Default() - default: - return nil, ErrMissingExtension - } - - v := xt.InterfaceOf(pv) - rv := reflect.ValueOf(v) - if isScalarKind(rv.Kind()) { - rv2 := reflect.New(rv.Type()) - rv2.Elem().Set(rv) - v = rv2.Interface() - } - return v, nil -} - -// extensionResolver is a custom extension resolver that stores a single -// extension type that takes precedence over the global registry. -type extensionResolver struct{ xt protoreflect.ExtensionType } - -func (r extensionResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) { - if xtd := r.xt.TypeDescriptor(); xtd.FullName() == field { - return r.xt, nil - } - return protoregistry.GlobalTypes.FindExtensionByName(field) -} - -func (r extensionResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { - if xtd := r.xt.TypeDescriptor(); xtd.ContainingMessage().FullName() == message && xtd.Number() == field { - return r.xt, nil - } - return protoregistry.GlobalTypes.FindExtensionByNumber(message, field) -} - -// GetExtensions returns a list of the extensions values present in m, -// corresponding with the provided list of extension descriptors, xts. -// If an extension is missing in m, the corresponding value is nil. -func GetExtensions(m Message, xts []*ExtensionDesc) ([]interface{}, error) { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() { - return nil, errNotExtendable - } - - vs := make([]interface{}, len(xts)) - for i, xt := range xts { - v, err := GetExtension(m, xt) - if err != nil { - if err == ErrMissingExtension { - continue - } - return vs, err - } - vs[i] = v - } - return vs, nil -} - -// SetExtension sets an extension field in m to the provided value. -func SetExtension(m Message, xt *ExtensionDesc, v interface{}) error { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() || mr.Descriptor().ExtensionRanges().Len() == 0 { - return errNotExtendable - } - - rv := reflect.ValueOf(v) - if reflect.TypeOf(v) != reflect.TypeOf(xt.ExtensionType) { - return fmt.Errorf("proto: bad extension value type. got: %T, want: %T", v, xt.ExtensionType) - } - if rv.Kind() == reflect.Ptr { - if rv.IsNil() { - return fmt.Errorf("proto: SetExtension called with nil value of type %T", v) - } - if isScalarKind(rv.Elem().Kind()) { - v = rv.Elem().Interface() - } - } - - xtd := xt.TypeDescriptor() - if !isValidExtension(mr.Descriptor(), xtd) { - return fmt.Errorf("proto: bad extended type; %T does not extend %T", xt.ExtendedType, m) - } - mr.Set(xtd, xt.ValueOf(v)) - clearUnknown(mr, fieldNum(xt.Field)) - return nil -} - -// SetRawExtension inserts b into the unknown fields of m. -// -// Deprecated: Use Message.ProtoReflect.SetUnknown instead. -func SetRawExtension(m Message, fnum int32, b []byte) { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() { - return - } - - // Verify that the raw field is valid. - for b0 := b; len(b0) > 0; { - num, _, n := protowire.ConsumeField(b0) - if int32(num) != fnum { - panic(fmt.Sprintf("mismatching field number: got %d, want %d", num, fnum)) - } - b0 = b0[n:] - } - - ClearExtension(m, &ExtensionDesc{Field: fnum}) - mr.SetUnknown(append(mr.GetUnknown(), b...)) -} - -// ExtensionDescs returns a list of extension descriptors found in m, -// containing descriptors for both populated extension fields in m and -// also unknown fields of m that are in the extension range. -// For the later case, an type incomplete descriptor is provided where only -// the ExtensionDesc.Field field is populated. -// The order of the extension descriptors is undefined. -func ExtensionDescs(m Message) ([]*ExtensionDesc, error) { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() || mr.Descriptor().ExtensionRanges().Len() == 0 { - return nil, errNotExtendable - } - - // Collect a set of known extension descriptors. - extDescs := make(map[protoreflect.FieldNumber]*ExtensionDesc) - mr.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { - if fd.IsExtension() { - xt := fd.(protoreflect.ExtensionTypeDescriptor) - if xd, ok := xt.Type().(*ExtensionDesc); ok { - extDescs[fd.Number()] = xd - } - } - return true - }) - - // Collect a set of unknown extension descriptors. - extRanges := mr.Descriptor().ExtensionRanges() - for b := mr.GetUnknown(); len(b) > 0; { - num, _, n := protowire.ConsumeField(b) - if extRanges.Has(num) && extDescs[num] == nil { - extDescs[num] = nil - } - b = b[n:] - } - - // Transpose the set of descriptors into a list. - var xts []*ExtensionDesc - for num, xt := range extDescs { - if xt == nil { - xt = &ExtensionDesc{Field: int32(num)} - } - xts = append(xts, xt) - } - return xts, nil -} - -// isValidExtension reports whether xtd is a valid extension descriptor for md. -func isValidExtension(md protoreflect.MessageDescriptor, xtd protoreflect.ExtensionTypeDescriptor) bool { - return xtd.ContainingMessage() == md && md.ExtensionRanges().Has(xtd.Number()) -} - -// isScalarKind reports whether k is a protobuf scalar kind (except bytes). -// This function exists for historical reasons since the representation of -// scalars differs between v1 and v2, where v1 uses *T and v2 uses T. -func isScalarKind(k reflect.Kind) bool { - switch k { - case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String: - return true - default: - return false - } -} - -// clearUnknown removes unknown fields from m where remover.Has reports true. -func clearUnknown(m protoreflect.Message, remover interface { - Has(protoreflect.FieldNumber) bool -}) { - var bo protoreflect.RawFields - for bi := m.GetUnknown(); len(bi) > 0; { - num, _, n := protowire.ConsumeField(bi) - if !remover.Has(num) { - bo = append(bo, bi[:n]...) - } - bi = bi[n:] - } - if bi := m.GetUnknown(); len(bi) != len(bo) { - m.SetUnknown(bo) - } -} - -type fieldNum protoreflect.FieldNumber - -func (n1 fieldNum) Has(n2 protoreflect.FieldNumber) bool { - return protoreflect.FieldNumber(n1) == n2 -} diff --git a/vendor/github.com/golang/protobuf/proto/properties.go b/vendor/github.com/golang/protobuf/proto/properties.go deleted file mode 100644 index dcdc2202fa..0000000000 --- a/vendor/github.com/golang/protobuf/proto/properties.go +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package proto - -import ( - "fmt" - "reflect" - "strconv" - "strings" - "sync" - - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/runtime/protoimpl" -) - -// StructProperties represents protocol buffer type information for a -// generated protobuf message in the open-struct API. -// -// Deprecated: Do not use. -type StructProperties struct { - // Prop are the properties for each field. - // - // Fields belonging to a oneof are stored in OneofTypes instead, with a - // single Properties representing the parent oneof held here. - // - // The order of Prop matches the order of fields in the Go struct. - // Struct fields that are not related to protobufs have a "XXX_" prefix - // in the Properties.Name and must be ignored by the user. - Prop []*Properties - - // OneofTypes contains information about the oneof fields in this message. - // It is keyed by the protobuf field name. - OneofTypes map[string]*OneofProperties -} - -// Properties represents the type information for a protobuf message field. -// -// Deprecated: Do not use. -type Properties struct { - // Name is a placeholder name with little meaningful semantic value. - // If the name has an "XXX_" prefix, the entire Properties must be ignored. - Name string - // OrigName is the protobuf field name or oneof name. - OrigName string - // JSONName is the JSON name for the protobuf field. - JSONName string - // Enum is a placeholder name for enums. - // For historical reasons, this is neither the Go name for the enum, - // nor the protobuf name for the enum. - Enum string // Deprecated: Do not use. - // Weak contains the full name of the weakly referenced message. - Weak string - // Wire is a string representation of the wire type. - Wire string - // WireType is the protobuf wire type for the field. - WireType int - // Tag is the protobuf field number. - Tag int - // Required reports whether this is a required field. - Required bool - // Optional reports whether this is a optional field. - Optional bool - // Repeated reports whether this is a repeated field. - Repeated bool - // Packed reports whether this is a packed repeated field of scalars. - Packed bool - // Proto3 reports whether this field operates under the proto3 syntax. - Proto3 bool - // Oneof reports whether this field belongs within a oneof. - Oneof bool - - // Default is the default value in string form. - Default string - // HasDefault reports whether the field has a default value. - HasDefault bool - - // MapKeyProp is the properties for the key field for a map field. - MapKeyProp *Properties - // MapValProp is the properties for the value field for a map field. - MapValProp *Properties -} - -// OneofProperties represents the type information for a protobuf oneof. -// -// Deprecated: Do not use. -type OneofProperties struct { - // Type is a pointer to the generated wrapper type for the field value. - // This is nil for messages that are not in the open-struct API. - Type reflect.Type - // Field is the index into StructProperties.Prop for the containing oneof. - Field int - // Prop is the properties for the field. - Prop *Properties -} - -// String formats the properties in the protobuf struct field tag style. -func (p *Properties) String() string { - s := p.Wire - s += "," + strconv.Itoa(p.Tag) - if p.Required { - s += ",req" - } - if p.Optional { - s += ",opt" - } - if p.Repeated { - s += ",rep" - } - if p.Packed { - s += ",packed" - } - s += ",name=" + p.OrigName - if p.JSONName != "" { - s += ",json=" + p.JSONName - } - if len(p.Enum) > 0 { - s += ",enum=" + p.Enum - } - if len(p.Weak) > 0 { - s += ",weak=" + p.Weak - } - if p.Proto3 { - s += ",proto3" - } - if p.Oneof { - s += ",oneof" - } - if p.HasDefault { - s += ",def=" + p.Default - } - return s -} - -// Parse populates p by parsing a string in the protobuf struct field tag style. -func (p *Properties) Parse(tag string) { - // For example: "bytes,49,opt,name=foo,def=hello!" - for len(tag) > 0 { - i := strings.IndexByte(tag, ',') - if i < 0 { - i = len(tag) - } - switch s := tag[:i]; { - case strings.HasPrefix(s, "name="): - p.OrigName = s[len("name="):] - case strings.HasPrefix(s, "json="): - p.JSONName = s[len("json="):] - case strings.HasPrefix(s, "enum="): - p.Enum = s[len("enum="):] - case strings.HasPrefix(s, "weak="): - p.Weak = s[len("weak="):] - case strings.Trim(s, "0123456789") == "": - n, _ := strconv.ParseUint(s, 10, 32) - p.Tag = int(n) - case s == "opt": - p.Optional = true - case s == "req": - p.Required = true - case s == "rep": - p.Repeated = true - case s == "varint" || s == "zigzag32" || s == "zigzag64": - p.Wire = s - p.WireType = WireVarint - case s == "fixed32": - p.Wire = s - p.WireType = WireFixed32 - case s == "fixed64": - p.Wire = s - p.WireType = WireFixed64 - case s == "bytes": - p.Wire = s - p.WireType = WireBytes - case s == "group": - p.Wire = s - p.WireType = WireStartGroup - case s == "packed": - p.Packed = true - case s == "proto3": - p.Proto3 = true - case s == "oneof": - p.Oneof = true - case strings.HasPrefix(s, "def="): - // The default tag is special in that everything afterwards is the - // default regardless of the presence of commas. - p.HasDefault = true - p.Default, i = tag[len("def="):], len(tag) - } - tag = strings.TrimPrefix(tag[i:], ",") - } -} - -// Init populates the properties from a protocol buffer struct tag. -// -// Deprecated: Do not use. -func (p *Properties) Init(typ reflect.Type, name, tag string, f *reflect.StructField) { - p.Name = name - p.OrigName = name - if tag == "" { - return - } - p.Parse(tag) - - if typ != nil && typ.Kind() == reflect.Map { - p.MapKeyProp = new(Properties) - p.MapKeyProp.Init(nil, "Key", f.Tag.Get("protobuf_key"), nil) - p.MapValProp = new(Properties) - p.MapValProp.Init(nil, "Value", f.Tag.Get("protobuf_val"), nil) - } -} - -var propertiesCache sync.Map // map[reflect.Type]*StructProperties - -// GetProperties returns the list of properties for the type represented by t, -// which must be a generated protocol buffer message in the open-struct API, -// where protobuf message fields are represented by exported Go struct fields. -// -// Deprecated: Use protobuf reflection instead. -func GetProperties(t reflect.Type) *StructProperties { - if p, ok := propertiesCache.Load(t); ok { - return p.(*StructProperties) - } - p, _ := propertiesCache.LoadOrStore(t, newProperties(t)) - return p.(*StructProperties) -} - -func newProperties(t reflect.Type) *StructProperties { - if t.Kind() != reflect.Struct { - panic(fmt.Sprintf("%v is not a generated message in the open-struct API", t)) - } - - var hasOneof bool - prop := new(StructProperties) - - // Construct a list of properties for each field in the struct. - for i := 0; i < t.NumField(); i++ { - p := new(Properties) - f := t.Field(i) - tagField := f.Tag.Get("protobuf") - p.Init(f.Type, f.Name, tagField, &f) - - tagOneof := f.Tag.Get("protobuf_oneof") - if tagOneof != "" { - hasOneof = true - p.OrigName = tagOneof - } - - // Rename unrelated struct fields with the "XXX_" prefix since so much - // user code simply checks for this to exclude special fields. - if tagField == "" && tagOneof == "" && !strings.HasPrefix(p.Name, "XXX_") { - p.Name = "XXX_" + p.Name - p.OrigName = "XXX_" + p.OrigName - } else if p.Weak != "" { - p.Name = p.OrigName // avoid possible "XXX_" prefix on weak field - } - - prop.Prop = append(prop.Prop, p) - } - - // Construct a mapping of oneof field names to properties. - if hasOneof { - var oneofWrappers []interface{} - if fn, ok := reflect.PtrTo(t).MethodByName("XXX_OneofFuncs"); ok { - oneofWrappers = fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))})[3].Interface().([]interface{}) - } - if fn, ok := reflect.PtrTo(t).MethodByName("XXX_OneofWrappers"); ok { - oneofWrappers = fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))})[0].Interface().([]interface{}) - } - if m, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(protoreflect.ProtoMessage); ok { - if m, ok := m.ProtoReflect().(interface{ ProtoMessageInfo() *protoimpl.MessageInfo }); ok { - oneofWrappers = m.ProtoMessageInfo().OneofWrappers - } - } - - prop.OneofTypes = make(map[string]*OneofProperties) - for _, wrapper := range oneofWrappers { - p := &OneofProperties{ - Type: reflect.ValueOf(wrapper).Type(), // *T - Prop: new(Properties), - } - f := p.Type.Elem().Field(0) - p.Prop.Name = f.Name - p.Prop.Parse(f.Tag.Get("protobuf")) - - // Determine the struct field that contains this oneof. - // Each wrapper is assignable to exactly one parent field. - var foundOneof bool - for i := 0; i < t.NumField() && !foundOneof; i++ { - if p.Type.AssignableTo(t.Field(i).Type) { - p.Field = i - foundOneof = true - } - } - if !foundOneof { - panic(fmt.Sprintf("%v is not a generated message in the open-struct API", t)) - } - prop.OneofTypes[p.Prop.OrigName] = p - } - } - - return prop -} - -func (sp *StructProperties) Len() int { return len(sp.Prop) } -func (sp *StructProperties) Less(i, j int) bool { return false } -func (sp *StructProperties) Swap(i, j int) { return } diff --git a/vendor/github.com/golang/protobuf/proto/proto.go b/vendor/github.com/golang/protobuf/proto/proto.go deleted file mode 100644 index 5aee89c323..0000000000 --- a/vendor/github.com/golang/protobuf/proto/proto.go +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package proto provides functionality for handling protocol buffer messages. -// In particular, it provides marshaling and unmarshaling between a protobuf -// message and the binary wire format. -// -// See https://developers.google.com/protocol-buffers/docs/gotutorial for -// more information. -// -// Deprecated: Use the "google.golang.org/protobuf/proto" package instead. -package proto - -import ( - protoV2 "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/runtime/protoiface" - "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - ProtoPackageIsVersion1 = true - ProtoPackageIsVersion2 = true - ProtoPackageIsVersion3 = true - ProtoPackageIsVersion4 = true -) - -// GeneratedEnum is any enum type generated by protoc-gen-go -// which is a named int32 kind. -// This type exists for documentation purposes. -type GeneratedEnum interface{} - -// GeneratedMessage is any message type generated by protoc-gen-go -// which is a pointer to a named struct kind. -// This type exists for documentation purposes. -type GeneratedMessage interface{} - -// Message is a protocol buffer message. -// -// This is the v1 version of the message interface and is marginally better -// than an empty interface as it lacks any method to programatically interact -// with the contents of the message. -// -// A v2 message is declared in "google.golang.org/protobuf/proto".Message and -// exposes protobuf reflection as a first-class feature of the interface. -// -// To convert a v1 message to a v2 message, use the MessageV2 function. -// To convert a v2 message to a v1 message, use the MessageV1 function. -type Message = protoiface.MessageV1 - -// MessageV1 converts either a v1 or v2 message to a v1 message. -// It returns nil if m is nil. -func MessageV1(m GeneratedMessage) protoiface.MessageV1 { - return protoimpl.X.ProtoMessageV1Of(m) -} - -// MessageV2 converts either a v1 or v2 message to a v2 message. -// It returns nil if m is nil. -func MessageV2(m GeneratedMessage) protoV2.Message { - return protoimpl.X.ProtoMessageV2Of(m) -} - -// MessageReflect returns a reflective view for a message. -// It returns nil if m is nil. -func MessageReflect(m Message) protoreflect.Message { - return protoimpl.X.MessageOf(m) -} - -// Marshaler is implemented by messages that can marshal themselves. -// This interface is used by the following functions: Size, Marshal, -// Buffer.Marshal, and Buffer.EncodeMessage. -// -// Deprecated: Do not implement. -type Marshaler interface { - // Marshal formats the encoded bytes of the message. - // It should be deterministic and emit valid protobuf wire data. - // The caller takes ownership of the returned buffer. - Marshal() ([]byte, error) -} - -// Unmarshaler is implemented by messages that can unmarshal themselves. -// This interface is used by the following functions: Unmarshal, UnmarshalMerge, -// Buffer.Unmarshal, Buffer.DecodeMessage, and Buffer.DecodeGroup. -// -// Deprecated: Do not implement. -type Unmarshaler interface { - // Unmarshal parses the encoded bytes of the protobuf wire input. - // The provided buffer is only valid for during method call. - // It should not reset the receiver message. - Unmarshal([]byte) error -} - -// Merger is implemented by messages that can merge themselves. -// This interface is used by the following functions: Clone and Merge. -// -// Deprecated: Do not implement. -type Merger interface { - // Merge merges the contents of src into the receiver message. - // It clones all data structures in src such that it aliases no mutable - // memory referenced by src. - Merge(src Message) -} - -// RequiredNotSetError is an error type returned when -// marshaling or unmarshaling a message with missing required fields. -type RequiredNotSetError struct { - err error -} - -func (e *RequiredNotSetError) Error() string { - if e.err != nil { - return e.err.Error() - } - return "proto: required field not set" -} -func (e *RequiredNotSetError) RequiredNotSet() bool { - return true -} - -func checkRequiredNotSet(m protoV2.Message) error { - if err := protoV2.CheckInitialized(m); err != nil { - return &RequiredNotSetError{err: err} - } - return nil -} - -// Clone returns a deep copy of src. -func Clone(src Message) Message { - return MessageV1(protoV2.Clone(MessageV2(src))) -} - -// Merge merges src into dst, which must be messages of the same type. -// -// Populated scalar fields in src are copied to dst, while populated -// singular messages in src are merged into dst by recursively calling Merge. -// The elements of every list field in src is appended to the corresponded -// list fields in dst. The entries of every map field in src is copied into -// the corresponding map field in dst, possibly replacing existing entries. -// The unknown fields of src are appended to the unknown fields of dst. -func Merge(dst, src Message) { - protoV2.Merge(MessageV2(dst), MessageV2(src)) -} - -// Equal reports whether two messages are equal. -// If two messages marshal to the same bytes under deterministic serialization, -// then Equal is guaranteed to report true. -// -// Two messages are equal if they are the same protobuf message type, -// have the same set of populated known and extension field values, -// and the same set of unknown fields values. -// -// Scalar values are compared with the equivalent of the == operator in Go, -// except bytes values which are compared using bytes.Equal and -// floating point values which specially treat NaNs as equal. -// Message values are compared by recursively calling Equal. -// Lists are equal if each element value is also equal. -// Maps are equal if they have the same set of keys, where the pair of values -// for each key is also equal. -func Equal(x, y Message) bool { - return protoV2.Equal(MessageV2(x), MessageV2(y)) -} - -func isMessageSet(md protoreflect.MessageDescriptor) bool { - ms, ok := md.(interface{ IsMessageSet() bool }) - return ok && ms.IsMessageSet() -} diff --git a/vendor/github.com/golang/protobuf/proto/registry.go b/vendor/github.com/golang/protobuf/proto/registry.go deleted file mode 100644 index 066b4323b4..0000000000 --- a/vendor/github.com/golang/protobuf/proto/registry.go +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package proto - -import ( - "bytes" - "compress/gzip" - "fmt" - "io/ioutil" - "reflect" - "strings" - "sync" - - "google.golang.org/protobuf/reflect/protodesc" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/runtime/protoimpl" -) - -// filePath is the path to the proto source file. -type filePath = string // e.g., "google/protobuf/descriptor.proto" - -// fileDescGZIP is the compressed contents of the encoded FileDescriptorProto. -type fileDescGZIP = []byte - -var fileCache sync.Map // map[filePath]fileDescGZIP - -// RegisterFile is called from generated code to register the compressed -// FileDescriptorProto with the file path for a proto source file. -// -// Deprecated: Use protoregistry.GlobalFiles.RegisterFile instead. -func RegisterFile(s filePath, d fileDescGZIP) { - // Decompress the descriptor. - zr, err := gzip.NewReader(bytes.NewReader(d)) - if err != nil { - panic(fmt.Sprintf("proto: invalid compressed file descriptor: %v", err)) - } - b, err := ioutil.ReadAll(zr) - if err != nil { - panic(fmt.Sprintf("proto: invalid compressed file descriptor: %v", err)) - } - - // Construct a protoreflect.FileDescriptor from the raw descriptor. - // Note that DescBuilder.Build automatically registers the constructed - // file descriptor with the v2 registry. - protoimpl.DescBuilder{RawDescriptor: b}.Build() - - // Locally cache the raw descriptor form for the file. - fileCache.Store(s, d) -} - -// FileDescriptor returns the compressed FileDescriptorProto given the file path -// for a proto source file. It returns nil if not found. -// -// Deprecated: Use protoregistry.GlobalFiles.FindFileByPath instead. -func FileDescriptor(s filePath) fileDescGZIP { - if v, ok := fileCache.Load(s); ok { - return v.(fileDescGZIP) - } - - // Find the descriptor in the v2 registry. - var b []byte - if fd, _ := protoregistry.GlobalFiles.FindFileByPath(s); fd != nil { - b, _ = Marshal(protodesc.ToFileDescriptorProto(fd)) - } - - // Locally cache the raw descriptor form for the file. - if len(b) > 0 { - v, _ := fileCache.LoadOrStore(s, protoimpl.X.CompressGZIP(b)) - return v.(fileDescGZIP) - } - return nil -} - -// enumName is the name of an enum. For historical reasons, the enum name is -// neither the full Go name nor the full protobuf name of the enum. -// The name is the dot-separated combination of just the proto package that the -// enum is declared within followed by the Go type name of the generated enum. -type enumName = string // e.g., "my.proto.package.GoMessage_GoEnum" - -// enumsByName maps enum values by name to their numeric counterpart. -type enumsByName = map[string]int32 - -// enumsByNumber maps enum values by number to their name counterpart. -type enumsByNumber = map[int32]string - -var enumCache sync.Map // map[enumName]enumsByName -var numFilesCache sync.Map // map[protoreflect.FullName]int - -// RegisterEnum is called from the generated code to register the mapping of -// enum value names to enum numbers for the enum identified by s. -// -// Deprecated: Use protoregistry.GlobalTypes.RegisterEnum instead. -func RegisterEnum(s enumName, _ enumsByNumber, m enumsByName) { - if _, ok := enumCache.Load(s); ok { - panic("proto: duplicate enum registered: " + s) - } - enumCache.Store(s, m) - - // This does not forward registration to the v2 registry since this API - // lacks sufficient information to construct a complete v2 enum descriptor. -} - -// EnumValueMap returns the mapping from enum value names to enum numbers for -// the enum of the given name. It returns nil if not found. -// -// Deprecated: Use protoregistry.GlobalTypes.FindEnumByName instead. -func EnumValueMap(s enumName) enumsByName { - if v, ok := enumCache.Load(s); ok { - return v.(enumsByName) - } - - // Check whether the cache is stale. If the number of files in the current - // package differs, then it means that some enums may have been recently - // registered upstream that we do not know about. - var protoPkg protoreflect.FullName - if i := strings.LastIndexByte(s, '.'); i >= 0 { - protoPkg = protoreflect.FullName(s[:i]) - } - v, _ := numFilesCache.Load(protoPkg) - numFiles, _ := v.(int) - if protoregistry.GlobalFiles.NumFilesByPackage(protoPkg) == numFiles { - return nil // cache is up-to-date; was not found earlier - } - - // Update the enum cache for all enums declared in the given proto package. - numFiles = 0 - protoregistry.GlobalFiles.RangeFilesByPackage(protoPkg, func(fd protoreflect.FileDescriptor) bool { - walkEnums(fd, func(ed protoreflect.EnumDescriptor) { - name := protoimpl.X.LegacyEnumName(ed) - if _, ok := enumCache.Load(name); !ok { - m := make(enumsByName) - evs := ed.Values() - for i := evs.Len() - 1; i >= 0; i-- { - ev := evs.Get(i) - m[string(ev.Name())] = int32(ev.Number()) - } - enumCache.LoadOrStore(name, m) - } - }) - numFiles++ - return true - }) - numFilesCache.Store(protoPkg, numFiles) - - // Check cache again for enum map. - if v, ok := enumCache.Load(s); ok { - return v.(enumsByName) - } - return nil -} - -// walkEnums recursively walks all enums declared in d. -func walkEnums(d interface { - Enums() protoreflect.EnumDescriptors - Messages() protoreflect.MessageDescriptors -}, f func(protoreflect.EnumDescriptor)) { - eds := d.Enums() - for i := eds.Len() - 1; i >= 0; i-- { - f(eds.Get(i)) - } - mds := d.Messages() - for i := mds.Len() - 1; i >= 0; i-- { - walkEnums(mds.Get(i), f) - } -} - -// messageName is the full name of protobuf message. -type messageName = string - -var messageTypeCache sync.Map // map[messageName]reflect.Type - -// RegisterType is called from generated code to register the message Go type -// for a message of the given name. -// -// Deprecated: Use protoregistry.GlobalTypes.RegisterMessage instead. -func RegisterType(m Message, s messageName) { - mt := protoimpl.X.LegacyMessageTypeOf(m, protoreflect.FullName(s)) - if err := protoregistry.GlobalTypes.RegisterMessage(mt); err != nil { - panic(err) - } - messageTypeCache.Store(s, reflect.TypeOf(m)) -} - -// RegisterMapType is called from generated code to register the Go map type -// for a protobuf message representing a map entry. -// -// Deprecated: Do not use. -func RegisterMapType(m interface{}, s messageName) { - t := reflect.TypeOf(m) - if t.Kind() != reflect.Map { - panic(fmt.Sprintf("invalid map kind: %v", t)) - } - if _, ok := messageTypeCache.Load(s); ok { - panic(fmt.Errorf("proto: duplicate proto message registered: %s", s)) - } - messageTypeCache.Store(s, t) -} - -// MessageType returns the message type for a named message. -// It returns nil if not found. -// -// Deprecated: Use protoregistry.GlobalTypes.FindMessageByName instead. -func MessageType(s messageName) reflect.Type { - if v, ok := messageTypeCache.Load(s); ok { - return v.(reflect.Type) - } - - // Derive the message type from the v2 registry. - var t reflect.Type - if mt, _ := protoregistry.GlobalTypes.FindMessageByName(protoreflect.FullName(s)); mt != nil { - t = messageGoType(mt) - } - - // If we could not get a concrete type, it is possible that it is a - // pseudo-message for a map entry. - if t == nil { - d, _ := protoregistry.GlobalFiles.FindDescriptorByName(protoreflect.FullName(s)) - if md, _ := d.(protoreflect.MessageDescriptor); md != nil && md.IsMapEntry() { - kt := goTypeForField(md.Fields().ByNumber(1)) - vt := goTypeForField(md.Fields().ByNumber(2)) - t = reflect.MapOf(kt, vt) - } - } - - // Locally cache the message type for the given name. - if t != nil { - v, _ := messageTypeCache.LoadOrStore(s, t) - return v.(reflect.Type) - } - return nil -} - -func goTypeForField(fd protoreflect.FieldDescriptor) reflect.Type { - switch k := fd.Kind(); k { - case protoreflect.EnumKind: - if et, _ := protoregistry.GlobalTypes.FindEnumByName(fd.Enum().FullName()); et != nil { - return enumGoType(et) - } - return reflect.TypeOf(protoreflect.EnumNumber(0)) - case protoreflect.MessageKind, protoreflect.GroupKind: - if mt, _ := protoregistry.GlobalTypes.FindMessageByName(fd.Message().FullName()); mt != nil { - return messageGoType(mt) - } - return reflect.TypeOf((*protoreflect.Message)(nil)).Elem() - default: - return reflect.TypeOf(fd.Default().Interface()) - } -} - -func enumGoType(et protoreflect.EnumType) reflect.Type { - return reflect.TypeOf(et.New(0)) -} - -func messageGoType(mt protoreflect.MessageType) reflect.Type { - return reflect.TypeOf(MessageV1(mt.Zero().Interface())) -} - -// MessageName returns the full protobuf name for the given message type. -// -// Deprecated: Use protoreflect.MessageDescriptor.FullName instead. -func MessageName(m Message) messageName { - if m == nil { - return "" - } - if m, ok := m.(interface{ XXX_MessageName() messageName }); ok { - return m.XXX_MessageName() - } - return messageName(protoimpl.X.MessageDescriptorOf(m).FullName()) -} - -// RegisterExtension is called from the generated code to register -// the extension descriptor. -// -// Deprecated: Use protoregistry.GlobalTypes.RegisterExtension instead. -func RegisterExtension(d *ExtensionDesc) { - if err := protoregistry.GlobalTypes.RegisterExtension(d); err != nil { - panic(err) - } -} - -type extensionsByNumber = map[int32]*ExtensionDesc - -var extensionCache sync.Map // map[messageName]extensionsByNumber - -// RegisteredExtensions returns a map of the registered extensions for the -// provided protobuf message, indexed by the extension field number. -// -// Deprecated: Use protoregistry.GlobalTypes.RangeExtensionsByMessage instead. -func RegisteredExtensions(m Message) extensionsByNumber { - // Check whether the cache is stale. If the number of extensions for - // the given message differs, then it means that some extensions were - // recently registered upstream that we do not know about. - s := MessageName(m) - v, _ := extensionCache.Load(s) - xs, _ := v.(extensionsByNumber) - if protoregistry.GlobalTypes.NumExtensionsByMessage(protoreflect.FullName(s)) == len(xs) { - return xs // cache is up-to-date - } - - // Cache is stale, re-compute the extensions map. - xs = make(extensionsByNumber) - protoregistry.GlobalTypes.RangeExtensionsByMessage(protoreflect.FullName(s), func(xt protoreflect.ExtensionType) bool { - if xd, ok := xt.(*ExtensionDesc); ok { - xs[int32(xt.TypeDescriptor().Number())] = xd - } else { - // TODO: This implies that the protoreflect.ExtensionType is a - // custom type not generated by protoc-gen-go. We could try and - // convert the type to an ExtensionDesc. - } - return true - }) - extensionCache.Store(s, xs) - return xs -} diff --git a/vendor/github.com/golang/protobuf/proto/text_decode.go b/vendor/github.com/golang/protobuf/proto/text_decode.go deleted file mode 100644 index 47eb3e4450..0000000000 --- a/vendor/github.com/golang/protobuf/proto/text_decode.go +++ /dev/null @@ -1,801 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package proto - -import ( - "encoding" - "errors" - "fmt" - "reflect" - "strconv" - "strings" - "unicode/utf8" - - "google.golang.org/protobuf/encoding/prototext" - protoV2 "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" -) - -const wrapTextUnmarshalV2 = false - -// ParseError is returned by UnmarshalText. -type ParseError struct { - Message string - - // Deprecated: Do not use. - Line, Offset int -} - -func (e *ParseError) Error() string { - if wrapTextUnmarshalV2 { - return e.Message - } - if e.Line == 1 { - return fmt.Sprintf("line 1.%d: %v", e.Offset, e.Message) - } - return fmt.Sprintf("line %d: %v", e.Line, e.Message) -} - -// UnmarshalText parses a proto text formatted string into m. -func UnmarshalText(s string, m Message) error { - if u, ok := m.(encoding.TextUnmarshaler); ok { - return u.UnmarshalText([]byte(s)) - } - - m.Reset() - mi := MessageV2(m) - - if wrapTextUnmarshalV2 { - err := prototext.UnmarshalOptions{ - AllowPartial: true, - }.Unmarshal([]byte(s), mi) - if err != nil { - return &ParseError{Message: err.Error()} - } - return checkRequiredNotSet(mi) - } else { - if err := newTextParser(s).unmarshalMessage(mi.ProtoReflect(), ""); err != nil { - return err - } - return checkRequiredNotSet(mi) - } -} - -type textParser struct { - s string // remaining input - done bool // whether the parsing is finished (success or error) - backed bool // whether back() was called - offset, line int - cur token -} - -type token struct { - value string - err *ParseError - line int // line number - offset int // byte number from start of input, not start of line - unquoted string // the unquoted version of value, if it was a quoted string -} - -func newTextParser(s string) *textParser { - p := new(textParser) - p.s = s - p.line = 1 - p.cur.line = 1 - return p -} - -func (p *textParser) unmarshalMessage(m protoreflect.Message, terminator string) (err error) { - md := m.Descriptor() - fds := md.Fields() - - // A struct is a sequence of "name: value", terminated by one of - // '>' or '}', or the end of the input. A name may also be - // "[extension]" or "[type/url]". - // - // The whole struct can also be an expanded Any message, like: - // [type/url] < ... struct contents ... > - seen := make(map[protoreflect.FieldNumber]bool) - for { - tok := p.next() - if tok.err != nil { - return tok.err - } - if tok.value == terminator { - break - } - if tok.value == "[" { - if err := p.unmarshalExtensionOrAny(m, seen); err != nil { - return err - } - continue - } - - // This is a normal, non-extension field. - name := protoreflect.Name(tok.value) - fd := fds.ByName(name) - switch { - case fd == nil: - gd := fds.ByName(protoreflect.Name(strings.ToLower(string(name)))) - if gd != nil && gd.Kind() == protoreflect.GroupKind && gd.Message().Name() == name { - fd = gd - } - case fd.Kind() == protoreflect.GroupKind && fd.Message().Name() != name: - fd = nil - case fd.IsWeak() && fd.Message().IsPlaceholder(): - fd = nil - } - if fd == nil { - typeName := string(md.FullName()) - if m, ok := m.Interface().(Message); ok { - t := reflect.TypeOf(m) - if t.Kind() == reflect.Ptr { - typeName = t.Elem().String() - } - } - return p.errorf("unknown field name %q in %v", name, typeName) - } - if od := fd.ContainingOneof(); od != nil && m.WhichOneof(od) != nil { - return p.errorf("field '%s' would overwrite already parsed oneof '%s'", name, od.Name()) - } - if fd.Cardinality() != protoreflect.Repeated && seen[fd.Number()] { - return p.errorf("non-repeated field %q was repeated", fd.Name()) - } - seen[fd.Number()] = true - - // Consume any colon. - if err := p.checkForColon(fd); err != nil { - return err - } - - // Parse into the field. - v := m.Get(fd) - if !m.Has(fd) && (fd.IsList() || fd.IsMap() || fd.Message() != nil) { - v = m.Mutable(fd) - } - if v, err = p.unmarshalValue(v, fd); err != nil { - return err - } - m.Set(fd, v) - - if err := p.consumeOptionalSeparator(); err != nil { - return err - } - } - return nil -} - -func (p *textParser) unmarshalExtensionOrAny(m protoreflect.Message, seen map[protoreflect.FieldNumber]bool) error { - name, err := p.consumeExtensionOrAnyName() - if err != nil { - return err - } - - // If it contains a slash, it's an Any type URL. - if slashIdx := strings.LastIndex(name, "/"); slashIdx >= 0 { - tok := p.next() - if tok.err != nil { - return tok.err - } - // consume an optional colon - if tok.value == ":" { - tok = p.next() - if tok.err != nil { - return tok.err - } - } - - var terminator string - switch tok.value { - case "<": - terminator = ">" - case "{": - terminator = "}" - default: - return p.errorf("expected '{' or '<', found %q", tok.value) - } - - mt, err := protoregistry.GlobalTypes.FindMessageByURL(name) - if err != nil { - return p.errorf("unrecognized message %q in google.protobuf.Any", name[slashIdx+len("/"):]) - } - m2 := mt.New() - if err := p.unmarshalMessage(m2, terminator); err != nil { - return err - } - b, err := protoV2.Marshal(m2.Interface()) - if err != nil { - return p.errorf("failed to marshal message of type %q: %v", name[slashIdx+len("/"):], err) - } - - urlFD := m.Descriptor().Fields().ByName("type_url") - valFD := m.Descriptor().Fields().ByName("value") - if seen[urlFD.Number()] { - return p.errorf("Any message unpacked multiple times, or %q already set", urlFD.Name()) - } - if seen[valFD.Number()] { - return p.errorf("Any message unpacked multiple times, or %q already set", valFD.Name()) - } - m.Set(urlFD, protoreflect.ValueOfString(name)) - m.Set(valFD, protoreflect.ValueOfBytes(b)) - seen[urlFD.Number()] = true - seen[valFD.Number()] = true - return nil - } - - xname := protoreflect.FullName(name) - xt, _ := protoregistry.GlobalTypes.FindExtensionByName(xname) - if xt == nil && isMessageSet(m.Descriptor()) { - xt, _ = protoregistry.GlobalTypes.FindExtensionByName(xname.Append("message_set_extension")) - } - if xt == nil { - return p.errorf("unrecognized extension %q", name) - } - fd := xt.TypeDescriptor() - if fd.ContainingMessage().FullName() != m.Descriptor().FullName() { - return p.errorf("extension field %q does not extend message %q", name, m.Descriptor().FullName()) - } - - if err := p.checkForColon(fd); err != nil { - return err - } - - v := m.Get(fd) - if !m.Has(fd) && (fd.IsList() || fd.IsMap() || fd.Message() != nil) { - v = m.Mutable(fd) - } - v, err = p.unmarshalValue(v, fd) - if err != nil { - return err - } - m.Set(fd, v) - return p.consumeOptionalSeparator() -} - -func (p *textParser) unmarshalValue(v protoreflect.Value, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) { - tok := p.next() - if tok.err != nil { - return v, tok.err - } - if tok.value == "" { - return v, p.errorf("unexpected EOF") - } - - switch { - case fd.IsList(): - lv := v.List() - var err error - if tok.value == "[" { - // Repeated field with list notation, like [1,2,3]. - for { - vv := lv.NewElement() - vv, err = p.unmarshalSingularValue(vv, fd) - if err != nil { - return v, err - } - lv.Append(vv) - - tok := p.next() - if tok.err != nil { - return v, tok.err - } - if tok.value == "]" { - break - } - if tok.value != "," { - return v, p.errorf("Expected ']' or ',' found %q", tok.value) - } - } - return v, nil - } - - // One value of the repeated field. - p.back() - vv := lv.NewElement() - vv, err = p.unmarshalSingularValue(vv, fd) - if err != nil { - return v, err - } - lv.Append(vv) - return v, nil - case fd.IsMap(): - // The map entry should be this sequence of tokens: - // < key : KEY value : VALUE > - // However, implementations may omit key or value, and technically - // we should support them in any order. - var terminator string - switch tok.value { - case "<": - terminator = ">" - case "{": - terminator = "}" - default: - return v, p.errorf("expected '{' or '<', found %q", tok.value) - } - - keyFD := fd.MapKey() - valFD := fd.MapValue() - - mv := v.Map() - kv := keyFD.Default() - vv := mv.NewValue() - for { - tok := p.next() - if tok.err != nil { - return v, tok.err - } - if tok.value == terminator { - break - } - var err error - switch tok.value { - case "key": - if err := p.consumeToken(":"); err != nil { - return v, err - } - if kv, err = p.unmarshalSingularValue(kv, keyFD); err != nil { - return v, err - } - if err := p.consumeOptionalSeparator(); err != nil { - return v, err - } - case "value": - if err := p.checkForColon(valFD); err != nil { - return v, err - } - if vv, err = p.unmarshalSingularValue(vv, valFD); err != nil { - return v, err - } - if err := p.consumeOptionalSeparator(); err != nil { - return v, err - } - default: - p.back() - return v, p.errorf(`expected "key", "value", or %q, found %q`, terminator, tok.value) - } - } - mv.Set(kv.MapKey(), vv) - return v, nil - default: - p.back() - return p.unmarshalSingularValue(v, fd) - } -} - -func (p *textParser) unmarshalSingularValue(v protoreflect.Value, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) { - tok := p.next() - if tok.err != nil { - return v, tok.err - } - if tok.value == "" { - return v, p.errorf("unexpected EOF") - } - - switch fd.Kind() { - case protoreflect.BoolKind: - switch tok.value { - case "true", "1", "t", "True": - return protoreflect.ValueOfBool(true), nil - case "false", "0", "f", "False": - return protoreflect.ValueOfBool(false), nil - } - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - if x, err := strconv.ParseInt(tok.value, 0, 32); err == nil { - return protoreflect.ValueOfInt32(int32(x)), nil - } - - // The C++ parser accepts large positive hex numbers that uses - // two's complement arithmetic to represent negative numbers. - // This feature is here for backwards compatibility with C++. - if strings.HasPrefix(tok.value, "0x") { - if x, err := strconv.ParseUint(tok.value, 0, 32); err == nil { - return protoreflect.ValueOfInt32(int32(-(int64(^x) + 1))), nil - } - } - case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - if x, err := strconv.ParseInt(tok.value, 0, 64); err == nil { - return protoreflect.ValueOfInt64(int64(x)), nil - } - - // The C++ parser accepts large positive hex numbers that uses - // two's complement arithmetic to represent negative numbers. - // This feature is here for backwards compatibility with C++. - if strings.HasPrefix(tok.value, "0x") { - if x, err := strconv.ParseUint(tok.value, 0, 64); err == nil { - return protoreflect.ValueOfInt64(int64(-(int64(^x) + 1))), nil - } - } - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: - if x, err := strconv.ParseUint(tok.value, 0, 32); err == nil { - return protoreflect.ValueOfUint32(uint32(x)), nil - } - case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - if x, err := strconv.ParseUint(tok.value, 0, 64); err == nil { - return protoreflect.ValueOfUint64(uint64(x)), nil - } - case protoreflect.FloatKind: - // Ignore 'f' for compatibility with output generated by C++, - // but don't remove 'f' when the value is "-inf" or "inf". - v := tok.value - if strings.HasSuffix(v, "f") && v != "-inf" && v != "inf" { - v = v[:len(v)-len("f")] - } - if x, err := strconv.ParseFloat(v, 32); err == nil { - return protoreflect.ValueOfFloat32(float32(x)), nil - } - case protoreflect.DoubleKind: - // Ignore 'f' for compatibility with output generated by C++, - // but don't remove 'f' when the value is "-inf" or "inf". - v := tok.value - if strings.HasSuffix(v, "f") && v != "-inf" && v != "inf" { - v = v[:len(v)-len("f")] - } - if x, err := strconv.ParseFloat(v, 64); err == nil { - return protoreflect.ValueOfFloat64(float64(x)), nil - } - case protoreflect.StringKind: - if isQuote(tok.value[0]) { - return protoreflect.ValueOfString(tok.unquoted), nil - } - case protoreflect.BytesKind: - if isQuote(tok.value[0]) { - return protoreflect.ValueOfBytes([]byte(tok.unquoted)), nil - } - case protoreflect.EnumKind: - if x, err := strconv.ParseInt(tok.value, 0, 32); err == nil { - return protoreflect.ValueOfEnum(protoreflect.EnumNumber(x)), nil - } - vd := fd.Enum().Values().ByName(protoreflect.Name(tok.value)) - if vd != nil { - return protoreflect.ValueOfEnum(vd.Number()), nil - } - case protoreflect.MessageKind, protoreflect.GroupKind: - var terminator string - switch tok.value { - case "{": - terminator = "}" - case "<": - terminator = ">" - default: - return v, p.errorf("expected '{' or '<', found %q", tok.value) - } - err := p.unmarshalMessage(v.Message(), terminator) - return v, err - default: - panic(fmt.Sprintf("invalid kind %v", fd.Kind())) - } - return v, p.errorf("invalid %v: %v", fd.Kind(), tok.value) -} - -// Consume a ':' from the input stream (if the next token is a colon), -// returning an error if a colon is needed but not present. -func (p *textParser) checkForColon(fd protoreflect.FieldDescriptor) *ParseError { - tok := p.next() - if tok.err != nil { - return tok.err - } - if tok.value != ":" { - if fd.Message() == nil { - return p.errorf("expected ':', found %q", tok.value) - } - p.back() - } - return nil -} - -// consumeExtensionOrAnyName consumes an extension name or an Any type URL and -// the following ']'. It returns the name or URL consumed. -func (p *textParser) consumeExtensionOrAnyName() (string, error) { - tok := p.next() - if tok.err != nil { - return "", tok.err - } - - // If extension name or type url is quoted, it's a single token. - if len(tok.value) > 2 && isQuote(tok.value[0]) && tok.value[len(tok.value)-1] == tok.value[0] { - name, err := unquoteC(tok.value[1:len(tok.value)-1], rune(tok.value[0])) - if err != nil { - return "", err - } - return name, p.consumeToken("]") - } - - // Consume everything up to "]" - var parts []string - for tok.value != "]" { - parts = append(parts, tok.value) - tok = p.next() - if tok.err != nil { - return "", p.errorf("unrecognized type_url or extension name: %s", tok.err) - } - if p.done && tok.value != "]" { - return "", p.errorf("unclosed type_url or extension name") - } - } - return strings.Join(parts, ""), nil -} - -// consumeOptionalSeparator consumes an optional semicolon or comma. -// It is used in unmarshalMessage to provide backward compatibility. -func (p *textParser) consumeOptionalSeparator() error { - tok := p.next() - if tok.err != nil { - return tok.err - } - if tok.value != ";" && tok.value != "," { - p.back() - } - return nil -} - -func (p *textParser) errorf(format string, a ...interface{}) *ParseError { - pe := &ParseError{fmt.Sprintf(format, a...), p.cur.line, p.cur.offset} - p.cur.err = pe - p.done = true - return pe -} - -func (p *textParser) skipWhitespace() { - i := 0 - for i < len(p.s) && (isWhitespace(p.s[i]) || p.s[i] == '#') { - if p.s[i] == '#' { - // comment; skip to end of line or input - for i < len(p.s) && p.s[i] != '\n' { - i++ - } - if i == len(p.s) { - break - } - } - if p.s[i] == '\n' { - p.line++ - } - i++ - } - p.offset += i - p.s = p.s[i:len(p.s)] - if len(p.s) == 0 { - p.done = true - } -} - -func (p *textParser) advance() { - // Skip whitespace - p.skipWhitespace() - if p.done { - return - } - - // Start of non-whitespace - p.cur.err = nil - p.cur.offset, p.cur.line = p.offset, p.line - p.cur.unquoted = "" - switch p.s[0] { - case '<', '>', '{', '}', ':', '[', ']', ';', ',', '/': - // Single symbol - p.cur.value, p.s = p.s[0:1], p.s[1:len(p.s)] - case '"', '\'': - // Quoted string - i := 1 - for i < len(p.s) && p.s[i] != p.s[0] && p.s[i] != '\n' { - if p.s[i] == '\\' && i+1 < len(p.s) { - // skip escaped char - i++ - } - i++ - } - if i >= len(p.s) || p.s[i] != p.s[0] { - p.errorf("unmatched quote") - return - } - unq, err := unquoteC(p.s[1:i], rune(p.s[0])) - if err != nil { - p.errorf("invalid quoted string %s: %v", p.s[0:i+1], err) - return - } - p.cur.value, p.s = p.s[0:i+1], p.s[i+1:len(p.s)] - p.cur.unquoted = unq - default: - i := 0 - for i < len(p.s) && isIdentOrNumberChar(p.s[i]) { - i++ - } - if i == 0 { - p.errorf("unexpected byte %#x", p.s[0]) - return - } - p.cur.value, p.s = p.s[0:i], p.s[i:len(p.s)] - } - p.offset += len(p.cur.value) -} - -// Back off the parser by one token. Can only be done between calls to next(). -// It makes the next advance() a no-op. -func (p *textParser) back() { p.backed = true } - -// Advances the parser and returns the new current token. -func (p *textParser) next() *token { - if p.backed || p.done { - p.backed = false - return &p.cur - } - p.advance() - if p.done { - p.cur.value = "" - } else if len(p.cur.value) > 0 && isQuote(p.cur.value[0]) { - // Look for multiple quoted strings separated by whitespace, - // and concatenate them. - cat := p.cur - for { - p.skipWhitespace() - if p.done || !isQuote(p.s[0]) { - break - } - p.advance() - if p.cur.err != nil { - return &p.cur - } - cat.value += " " + p.cur.value - cat.unquoted += p.cur.unquoted - } - p.done = false // parser may have seen EOF, but we want to return cat - p.cur = cat - } - return &p.cur -} - -func (p *textParser) consumeToken(s string) error { - tok := p.next() - if tok.err != nil { - return tok.err - } - if tok.value != s { - p.back() - return p.errorf("expected %q, found %q", s, tok.value) - } - return nil -} - -var errBadUTF8 = errors.New("proto: bad UTF-8") - -func unquoteC(s string, quote rune) (string, error) { - // This is based on C++'s tokenizer.cc. - // Despite its name, this is *not* parsing C syntax. - // For instance, "\0" is an invalid quoted string. - - // Avoid allocation in trivial cases. - simple := true - for _, r := range s { - if r == '\\' || r == quote { - simple = false - break - } - } - if simple { - return s, nil - } - - buf := make([]byte, 0, 3*len(s)/2) - for len(s) > 0 { - r, n := utf8.DecodeRuneInString(s) - if r == utf8.RuneError && n == 1 { - return "", errBadUTF8 - } - s = s[n:] - if r != '\\' { - if r < utf8.RuneSelf { - buf = append(buf, byte(r)) - } else { - buf = append(buf, string(r)...) - } - continue - } - - ch, tail, err := unescape(s) - if err != nil { - return "", err - } - buf = append(buf, ch...) - s = tail - } - return string(buf), nil -} - -func unescape(s string) (ch string, tail string, err error) { - r, n := utf8.DecodeRuneInString(s) - if r == utf8.RuneError && n == 1 { - return "", "", errBadUTF8 - } - s = s[n:] - switch r { - case 'a': - return "\a", s, nil - case 'b': - return "\b", s, nil - case 'f': - return "\f", s, nil - case 'n': - return "\n", s, nil - case 'r': - return "\r", s, nil - case 't': - return "\t", s, nil - case 'v': - return "\v", s, nil - case '?': - return "?", s, nil // trigraph workaround - case '\'', '"', '\\': - return string(r), s, nil - case '0', '1', '2', '3', '4', '5', '6', '7': - if len(s) < 2 { - return "", "", fmt.Errorf(`\%c requires 2 following digits`, r) - } - ss := string(r) + s[:2] - s = s[2:] - i, err := strconv.ParseUint(ss, 8, 8) - if err != nil { - return "", "", fmt.Errorf(`\%s contains non-octal digits`, ss) - } - return string([]byte{byte(i)}), s, nil - case 'x', 'X', 'u', 'U': - var n int - switch r { - case 'x', 'X': - n = 2 - case 'u': - n = 4 - case 'U': - n = 8 - } - if len(s) < n { - return "", "", fmt.Errorf(`\%c requires %d following digits`, r, n) - } - ss := s[:n] - s = s[n:] - i, err := strconv.ParseUint(ss, 16, 64) - if err != nil { - return "", "", fmt.Errorf(`\%c%s contains non-hexadecimal digits`, r, ss) - } - if r == 'x' || r == 'X' { - return string([]byte{byte(i)}), s, nil - } - if i > utf8.MaxRune { - return "", "", fmt.Errorf(`\%c%s is not a valid Unicode code point`, r, ss) - } - return string(rune(i)), s, nil - } - return "", "", fmt.Errorf(`unknown escape \%c`, r) -} - -func isIdentOrNumberChar(c byte) bool { - switch { - case 'A' <= c && c <= 'Z', 'a' <= c && c <= 'z': - return true - case '0' <= c && c <= '9': - return true - } - switch c { - case '-', '+', '.', '_': - return true - } - return false -} - -func isWhitespace(c byte) bool { - switch c { - case ' ', '\t', '\n', '\r': - return true - } - return false -} - -func isQuote(c byte) bool { - switch c { - case '"', '\'': - return true - } - return false -} diff --git a/vendor/github.com/golang/protobuf/proto/text_encode.go b/vendor/github.com/golang/protobuf/proto/text_encode.go deleted file mode 100644 index a31134eeb3..0000000000 --- a/vendor/github.com/golang/protobuf/proto/text_encode.go +++ /dev/null @@ -1,560 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package proto - -import ( - "bytes" - "encoding" - "fmt" - "io" - "math" - "sort" - "strings" - - "google.golang.org/protobuf/encoding/prototext" - "google.golang.org/protobuf/encoding/protowire" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" -) - -const wrapTextMarshalV2 = false - -// TextMarshaler is a configurable text format marshaler. -type TextMarshaler struct { - Compact bool // use compact text format (one line) - ExpandAny bool // expand google.protobuf.Any messages of known types -} - -// Marshal writes the proto text format of m to w. -func (tm *TextMarshaler) Marshal(w io.Writer, m Message) error { - b, err := tm.marshal(m) - if len(b) > 0 { - if _, err := w.Write(b); err != nil { - return err - } - } - return err -} - -// Text returns a proto text formatted string of m. -func (tm *TextMarshaler) Text(m Message) string { - b, _ := tm.marshal(m) - return string(b) -} - -func (tm *TextMarshaler) marshal(m Message) ([]byte, error) { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() { - return []byte(""), nil - } - - if wrapTextMarshalV2 { - if m, ok := m.(encoding.TextMarshaler); ok { - return m.MarshalText() - } - - opts := prototext.MarshalOptions{ - AllowPartial: true, - EmitUnknown: true, - } - if !tm.Compact { - opts.Indent = " " - } - if !tm.ExpandAny { - opts.Resolver = (*protoregistry.Types)(nil) - } - return opts.Marshal(mr.Interface()) - } else { - w := &textWriter{ - compact: tm.Compact, - expandAny: tm.ExpandAny, - complete: true, - } - - if m, ok := m.(encoding.TextMarshaler); ok { - b, err := m.MarshalText() - if err != nil { - return nil, err - } - w.Write(b) - return w.buf, nil - } - - err := w.writeMessage(mr) - return w.buf, err - } -} - -var ( - defaultTextMarshaler = TextMarshaler{} - compactTextMarshaler = TextMarshaler{Compact: true} -) - -// MarshalText writes the proto text format of m to w. -func MarshalText(w io.Writer, m Message) error { return defaultTextMarshaler.Marshal(w, m) } - -// MarshalTextString returns a proto text formatted string of m. -func MarshalTextString(m Message) string { return defaultTextMarshaler.Text(m) } - -// CompactText writes the compact proto text format of m to w. -func CompactText(w io.Writer, m Message) error { return compactTextMarshaler.Marshal(w, m) } - -// CompactTextString returns a compact proto text formatted string of m. -func CompactTextString(m Message) string { return compactTextMarshaler.Text(m) } - -var ( - newline = []byte("\n") - endBraceNewline = []byte("}\n") - posInf = []byte("inf") - negInf = []byte("-inf") - nan = []byte("nan") -) - -// textWriter is an io.Writer that tracks its indentation level. -type textWriter struct { - compact bool // same as TextMarshaler.Compact - expandAny bool // same as TextMarshaler.ExpandAny - complete bool // whether the current position is a complete line - indent int // indentation level; never negative - buf []byte -} - -func (w *textWriter) Write(p []byte) (n int, _ error) { - newlines := bytes.Count(p, newline) - if newlines == 0 { - if !w.compact && w.complete { - w.writeIndent() - } - w.buf = append(w.buf, p...) - w.complete = false - return len(p), nil - } - - frags := bytes.SplitN(p, newline, newlines+1) - if w.compact { - for i, frag := range frags { - if i > 0 { - w.buf = append(w.buf, ' ') - n++ - } - w.buf = append(w.buf, frag...) - n += len(frag) - } - return n, nil - } - - for i, frag := range frags { - if w.complete { - w.writeIndent() - } - w.buf = append(w.buf, frag...) - n += len(frag) - if i+1 < len(frags) { - w.buf = append(w.buf, '\n') - n++ - } - } - w.complete = len(frags[len(frags)-1]) == 0 - return n, nil -} - -func (w *textWriter) WriteByte(c byte) error { - if w.compact && c == '\n' { - c = ' ' - } - if !w.compact && w.complete { - w.writeIndent() - } - w.buf = append(w.buf, c) - w.complete = c == '\n' - return nil -} - -func (w *textWriter) writeName(fd protoreflect.FieldDescriptor) { - if !w.compact && w.complete { - w.writeIndent() - } - w.complete = false - - if fd.Kind() != protoreflect.GroupKind { - w.buf = append(w.buf, fd.Name()...) - w.WriteByte(':') - } else { - // Use message type name for group field name. - w.buf = append(w.buf, fd.Message().Name()...) - } - - if !w.compact { - w.WriteByte(' ') - } -} - -func requiresQuotes(u string) bool { - // When type URL contains any characters except [0-9A-Za-z./\-]*, it must be quoted. - for _, ch := range u { - switch { - case ch == '.' || ch == '/' || ch == '_': - continue - case '0' <= ch && ch <= '9': - continue - case 'A' <= ch && ch <= 'Z': - continue - case 'a' <= ch && ch <= 'z': - continue - default: - return true - } - } - return false -} - -// writeProto3Any writes an expanded google.protobuf.Any message. -// -// It returns (false, nil) if sv value can't be unmarshaled (e.g. because -// required messages are not linked in). -// -// It returns (true, error) when sv was written in expanded format or an error -// was encountered. -func (w *textWriter) writeProto3Any(m protoreflect.Message) (bool, error) { - md := m.Descriptor() - fdURL := md.Fields().ByName("type_url") - fdVal := md.Fields().ByName("value") - - url := m.Get(fdURL).String() - mt, err := protoregistry.GlobalTypes.FindMessageByURL(url) - if err != nil { - return false, nil - } - - b := m.Get(fdVal).Bytes() - m2 := mt.New() - if err := proto.Unmarshal(b, m2.Interface()); err != nil { - return false, nil - } - w.Write([]byte("[")) - if requiresQuotes(url) { - w.writeQuotedString(url) - } else { - w.Write([]byte(url)) - } - if w.compact { - w.Write([]byte("]:<")) - } else { - w.Write([]byte("]: <\n")) - w.indent++ - } - if err := w.writeMessage(m2); err != nil { - return true, err - } - if w.compact { - w.Write([]byte("> ")) - } else { - w.indent-- - w.Write([]byte(">\n")) - } - return true, nil -} - -func (w *textWriter) writeMessage(m protoreflect.Message) error { - md := m.Descriptor() - if w.expandAny && md.FullName() == "google.protobuf.Any" { - if canExpand, err := w.writeProto3Any(m); canExpand { - return err - } - } - - fds := md.Fields() - for i := 0; i < fds.Len(); { - fd := fds.Get(i) - if od := fd.ContainingOneof(); od != nil { - fd = m.WhichOneof(od) - i += od.Fields().Len() - } else { - i++ - } - if fd == nil || !m.Has(fd) { - continue - } - - switch { - case fd.IsList(): - lv := m.Get(fd).List() - for j := 0; j < lv.Len(); j++ { - w.writeName(fd) - v := lv.Get(j) - if err := w.writeSingularValue(v, fd); err != nil { - return err - } - w.WriteByte('\n') - } - case fd.IsMap(): - kfd := fd.MapKey() - vfd := fd.MapValue() - mv := m.Get(fd).Map() - - type entry struct{ key, val protoreflect.Value } - var entries []entry - mv.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool { - entries = append(entries, entry{k.Value(), v}) - return true - }) - sort.Slice(entries, func(i, j int) bool { - switch kfd.Kind() { - case protoreflect.BoolKind: - return !entries[i].key.Bool() && entries[j].key.Bool() - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind, protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - return entries[i].key.Int() < entries[j].key.Int() - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind, protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - return entries[i].key.Uint() < entries[j].key.Uint() - case protoreflect.StringKind: - return entries[i].key.String() < entries[j].key.String() - default: - panic("invalid kind") - } - }) - for _, entry := range entries { - w.writeName(fd) - w.WriteByte('<') - if !w.compact { - w.WriteByte('\n') - } - w.indent++ - w.writeName(kfd) - if err := w.writeSingularValue(entry.key, kfd); err != nil { - return err - } - w.WriteByte('\n') - w.writeName(vfd) - if err := w.writeSingularValue(entry.val, vfd); err != nil { - return err - } - w.WriteByte('\n') - w.indent-- - w.WriteByte('>') - w.WriteByte('\n') - } - default: - w.writeName(fd) - if err := w.writeSingularValue(m.Get(fd), fd); err != nil { - return err - } - w.WriteByte('\n') - } - } - - if b := m.GetUnknown(); len(b) > 0 { - w.writeUnknownFields(b) - } - return w.writeExtensions(m) -} - -func (w *textWriter) writeSingularValue(v protoreflect.Value, fd protoreflect.FieldDescriptor) error { - switch fd.Kind() { - case protoreflect.FloatKind, protoreflect.DoubleKind: - switch vf := v.Float(); { - case math.IsInf(vf, +1): - w.Write(posInf) - case math.IsInf(vf, -1): - w.Write(negInf) - case math.IsNaN(vf): - w.Write(nan) - default: - fmt.Fprint(w, v.Interface()) - } - case protoreflect.StringKind: - // NOTE: This does not validate UTF-8 for historical reasons. - w.writeQuotedString(string(v.String())) - case protoreflect.BytesKind: - w.writeQuotedString(string(v.Bytes())) - case protoreflect.MessageKind, protoreflect.GroupKind: - var bra, ket byte = '<', '>' - if fd.Kind() == protoreflect.GroupKind { - bra, ket = '{', '}' - } - w.WriteByte(bra) - if !w.compact { - w.WriteByte('\n') - } - w.indent++ - m := v.Message() - if m2, ok := m.Interface().(encoding.TextMarshaler); ok { - b, err := m2.MarshalText() - if err != nil { - return err - } - w.Write(b) - } else { - w.writeMessage(m) - } - w.indent-- - w.WriteByte(ket) - case protoreflect.EnumKind: - if ev := fd.Enum().Values().ByNumber(v.Enum()); ev != nil { - fmt.Fprint(w, ev.Name()) - } else { - fmt.Fprint(w, v.Enum()) - } - default: - fmt.Fprint(w, v.Interface()) - } - return nil -} - -// writeQuotedString writes a quoted string in the protocol buffer text format. -func (w *textWriter) writeQuotedString(s string) { - w.WriteByte('"') - for i := 0; i < len(s); i++ { - switch c := s[i]; c { - case '\n': - w.buf = append(w.buf, `\n`...) - case '\r': - w.buf = append(w.buf, `\r`...) - case '\t': - w.buf = append(w.buf, `\t`...) - case '"': - w.buf = append(w.buf, `\"`...) - case '\\': - w.buf = append(w.buf, `\\`...) - default: - if isPrint := c >= 0x20 && c < 0x7f; isPrint { - w.buf = append(w.buf, c) - } else { - w.buf = append(w.buf, fmt.Sprintf(`\%03o`, c)...) - } - } - } - w.WriteByte('"') -} - -func (w *textWriter) writeUnknownFields(b []byte) { - if !w.compact { - fmt.Fprintf(w, "/* %d unknown bytes */\n", len(b)) - } - - for len(b) > 0 { - num, wtyp, n := protowire.ConsumeTag(b) - if n < 0 { - return - } - b = b[n:] - - if wtyp == protowire.EndGroupType { - w.indent-- - w.Write(endBraceNewline) - continue - } - fmt.Fprint(w, num) - if wtyp != protowire.StartGroupType { - w.WriteByte(':') - } - if !w.compact || wtyp == protowire.StartGroupType { - w.WriteByte(' ') - } - switch wtyp { - case protowire.VarintType: - v, n := protowire.ConsumeVarint(b) - if n < 0 { - return - } - b = b[n:] - fmt.Fprint(w, v) - case protowire.Fixed32Type: - v, n := protowire.ConsumeFixed32(b) - if n < 0 { - return - } - b = b[n:] - fmt.Fprint(w, v) - case protowire.Fixed64Type: - v, n := protowire.ConsumeFixed64(b) - if n < 0 { - return - } - b = b[n:] - fmt.Fprint(w, v) - case protowire.BytesType: - v, n := protowire.ConsumeBytes(b) - if n < 0 { - return - } - b = b[n:] - fmt.Fprintf(w, "%q", v) - case protowire.StartGroupType: - w.WriteByte('{') - w.indent++ - default: - fmt.Fprintf(w, "/* unknown wire type %d */", wtyp) - } - w.WriteByte('\n') - } -} - -// writeExtensions writes all the extensions in m. -func (w *textWriter) writeExtensions(m protoreflect.Message) error { - md := m.Descriptor() - if md.ExtensionRanges().Len() == 0 { - return nil - } - - type ext struct { - desc protoreflect.FieldDescriptor - val protoreflect.Value - } - var exts []ext - m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { - if fd.IsExtension() { - exts = append(exts, ext{fd, v}) - } - return true - }) - sort.Slice(exts, func(i, j int) bool { - return exts[i].desc.Number() < exts[j].desc.Number() - }) - - for _, ext := range exts { - // For message set, use the name of the message as the extension name. - name := string(ext.desc.FullName()) - if isMessageSet(ext.desc.ContainingMessage()) { - name = strings.TrimSuffix(name, ".message_set_extension") - } - - if !ext.desc.IsList() { - if err := w.writeSingularExtension(name, ext.val, ext.desc); err != nil { - return err - } - } else { - lv := ext.val.List() - for i := 0; i < lv.Len(); i++ { - if err := w.writeSingularExtension(name, lv.Get(i), ext.desc); err != nil { - return err - } - } - } - } - return nil -} - -func (w *textWriter) writeSingularExtension(name string, v protoreflect.Value, fd protoreflect.FieldDescriptor) error { - fmt.Fprintf(w, "[%s]:", name) - if !w.compact { - w.WriteByte(' ') - } - if err := w.writeSingularValue(v, fd); err != nil { - return err - } - w.WriteByte('\n') - return nil -} - -func (w *textWriter) writeIndent() { - if !w.complete { - return - } - for i := 0; i < w.indent*2; i++ { - w.buf = append(w.buf, ' ') - } - w.complete = false -} diff --git a/vendor/github.com/golang/protobuf/proto/wire.go b/vendor/github.com/golang/protobuf/proto/wire.go deleted file mode 100644 index d7c28da5a7..0000000000 --- a/vendor/github.com/golang/protobuf/proto/wire.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package proto - -import ( - protoV2 "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/runtime/protoiface" -) - -// Size returns the size in bytes of the wire-format encoding of m. -func Size(m Message) int { - if m == nil { - return 0 - } - mi := MessageV2(m) - return protoV2.Size(mi) -} - -// Marshal returns the wire-format encoding of m. -func Marshal(m Message) ([]byte, error) { - b, err := marshalAppend(nil, m, false) - if b == nil { - b = zeroBytes - } - return b, err -} - -var zeroBytes = make([]byte, 0, 0) - -func marshalAppend(buf []byte, m Message, deterministic bool) ([]byte, error) { - if m == nil { - return nil, ErrNil - } - mi := MessageV2(m) - nbuf, err := protoV2.MarshalOptions{ - Deterministic: deterministic, - AllowPartial: true, - }.MarshalAppend(buf, mi) - if err != nil { - return buf, err - } - if len(buf) == len(nbuf) { - if !mi.ProtoReflect().IsValid() { - return buf, ErrNil - } - } - return nbuf, checkRequiredNotSet(mi) -} - -// Unmarshal parses a wire-format message in b and places the decoded results in m. -// -// Unmarshal resets m before starting to unmarshal, so any existing data in m is always -// removed. Use UnmarshalMerge to preserve and append to existing data. -func Unmarshal(b []byte, m Message) error { - m.Reset() - return UnmarshalMerge(b, m) -} - -// UnmarshalMerge parses a wire-format message in b and places the decoded results in m. -func UnmarshalMerge(b []byte, m Message) error { - mi := MessageV2(m) - out, err := protoV2.UnmarshalOptions{ - AllowPartial: true, - Merge: true, - }.UnmarshalState(protoiface.UnmarshalInput{ - Buf: b, - Message: mi.ProtoReflect(), - }) - if err != nil { - return err - } - if out.Flags&protoiface.UnmarshalInitialized > 0 { - return nil - } - return checkRequiredNotSet(mi) -} diff --git a/vendor/github.com/golang/protobuf/proto/wrappers.go b/vendor/github.com/golang/protobuf/proto/wrappers.go deleted file mode 100644 index 398e348599..0000000000 --- a/vendor/github.com/golang/protobuf/proto/wrappers.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package proto - -// Bool stores v in a new bool value and returns a pointer to it. -func Bool(v bool) *bool { return &v } - -// Int stores v in a new int32 value and returns a pointer to it. -// -// Deprecated: Use Int32 instead. -func Int(v int) *int32 { return Int32(int32(v)) } - -// Int32 stores v in a new int32 value and returns a pointer to it. -func Int32(v int32) *int32 { return &v } - -// Int64 stores v in a new int64 value and returns a pointer to it. -func Int64(v int64) *int64 { return &v } - -// Uint32 stores v in a new uint32 value and returns a pointer to it. -func Uint32(v uint32) *uint32 { return &v } - -// Uint64 stores v in a new uint64 value and returns a pointer to it. -func Uint64(v uint64) *uint64 { return &v } - -// Float32 stores v in a new float32 value and returns a pointer to it. -func Float32(v float32) *float32 { return &v } - -// Float64 stores v in a new float64 value and returns a pointer to it. -func Float64(v float64) *float64 { return &v } - -// String stores v in a new string value and returns a pointer to it. -func String(v string) *string { return &v } diff --git a/vendor/github.com/hashicorp/go-immutable-radix/.gitignore b/vendor/github.com/hashicorp/go-immutable-radix/.gitignore deleted file mode 100644 index daf913b1b3..0000000000 --- a/vendor/github.com/hashicorp/go-immutable-radix/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/vendor/github.com/hashicorp/go-immutable-radix/CHANGELOG.md b/vendor/github.com/hashicorp/go-immutable-radix/CHANGELOG.md deleted file mode 100644 index 86c6d03fba..0000000000 --- a/vendor/github.com/hashicorp/go-immutable-radix/CHANGELOG.md +++ /dev/null @@ -1,23 +0,0 @@ -# UNRELEASED - -# 1.3.0 (September 17th, 2020) - -FEATURES - -* Add reverse tree traversal [[GH-30](https://github.com/hashicorp/go-immutable-radix/pull/30)] - -# 1.2.0 (March 18th, 2020) - -FEATURES - -* Adds a `Clone` method to `Txn` allowing transactions to be split either into two independently mutable trees. [[GH-26](https://github.com/hashicorp/go-immutable-radix/pull/26)] - -# 1.1.0 (May 22nd, 2019) - -FEATURES - -* Add `SeekLowerBound` to allow for range scans. [[GH-24](https://github.com/hashicorp/go-immutable-radix/pull/24)] - -# 1.0.0 (August 30th, 2018) - -* go mod adopted diff --git a/vendor/github.com/hashicorp/go-immutable-radix/LICENSE b/vendor/github.com/hashicorp/go-immutable-radix/LICENSE deleted file mode 100644 index e87a115e46..0000000000 --- a/vendor/github.com/hashicorp/go-immutable-radix/LICENSE +++ /dev/null @@ -1,363 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. "Contributor" - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. "Contributor Version" - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the terms of - a Secondary License. - -1.6. "Executable Form" - - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - - means a work that combines Covered Software with other material, in a - separate file or files, that is not Covered Software. - -1.8. "License" - - means this document. - -1.9. "Licensable" - - means having the right to grant, to the maximum extent possible, whether - at the time of the initial grant or subsequently, any and all of the - rights conveyed by this License. - -1.10. "Modifications" - - means any of the following: - - a. any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. "Patent Claims" of a Contributor - - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the License, - by the making, using, selling, offering for sale, having made, import, - or transfer of either its Contributions or its Contributor Version. - -1.12. "Secondary License" - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. "Source Code Form" - - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, "control" means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights to - grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter the - recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, or - limitations of liability) contained within the Source Code Form of the - Covered Software, except that You may alter any license notices to the - extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, - judicial order, or regulation then You must: (a) comply with the terms of - this License to the maximum extent possible; and (b) describe the - limitations and the code they affect. Such description must be placed in a - text file included with all distributions of the Covered Software under - this License. Except to the extent prohibited by statute or regulation, - such description must be sufficiently detailed for a recipient of ordinary - skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing - basis, if such Contributor fails to notify You of the non-compliance by - some reasonable means prior to 60 days after You have come back into - compliance. Moreover, Your grants from a particular Contributor are - reinstated on an ongoing basis if such Contributor notifies You of the - non-compliance by some reasonable means, this is the first time You have - received notice of non-compliance with this License from such - Contributor, and You become compliant prior to 30 days after Your receipt - of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an "as is" basis, - without warranty of any kind, either expressed, implied, or statutory, - including, without limitation, warranties that the Covered Software is free - of defects, merchantable, fit for a particular purpose or non-infringing. - The entire risk as to the quality and performance of the Covered Software - is with You. Should any Covered Software prove defective in any respect, - You (not any Contributor) assume the cost of any necessary servicing, - repair, or correction. This disclaimer of warranty constitutes an essential - part of this License. No use of any Covered Software is authorized under - this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from - such party's negligence to the extent applicable law prohibits such - limitation. Some jurisdictions do not allow the exclusion or limitation of - incidental or consequential damages, so this exclusion and limitation may - not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts - of a jurisdiction where the defendant maintains its principal place of - business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. Nothing - in this Section shall prevent a party's ability to bring cross-claims or - counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides that - the language of a contract shall be construed against the drafter shall not - be used to construe this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses If You choose to distribute Source Code Form that is - Incompatible With Secondary Licenses under the terms of this version of - the License, the notice described in Exhibit B of this License must be - attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, -then You may include the notice in a location (such as a LICENSE file in a -relevant directory) where a recipient would be likely to look for such a -notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible - With Secondary Licenses", as defined by - the Mozilla Public License, v. 2.0. - diff --git a/vendor/github.com/hashicorp/go-immutable-radix/README.md b/vendor/github.com/hashicorp/go-immutable-radix/README.md deleted file mode 100644 index aca15a6421..0000000000 --- a/vendor/github.com/hashicorp/go-immutable-radix/README.md +++ /dev/null @@ -1,66 +0,0 @@ -go-immutable-radix [![CircleCI](https://circleci.com/gh/hashicorp/go-immutable-radix/tree/master.svg?style=svg)](https://circleci.com/gh/hashicorp/go-immutable-radix/tree/master) -========= - -Provides the `iradix` package that implements an immutable [radix tree](http://en.wikipedia.org/wiki/Radix_tree). -The package only provides a single `Tree` implementation, optimized for sparse nodes. - -As a radix tree, it provides the following: - * O(k) operations. In many cases, this can be faster than a hash table since - the hash function is an O(k) operation, and hash tables have very poor cache locality. - * Minimum / Maximum value lookups - * Ordered iteration - -A tree supports using a transaction to batch multiple updates (insert, delete) -in a more efficient manner than performing each operation one at a time. - -For a mutable variant, see [go-radix](https://github.com/armon/go-radix). - -Documentation -============= - -The full documentation is available on [Godoc](http://godoc.org/github.com/hashicorp/go-immutable-radix). - -Example -======= - -Below is a simple example of usage - -```go -// Create a tree -r := iradix.New() -r, _, _ = r.Insert([]byte("foo"), 1) -r, _, _ = r.Insert([]byte("bar"), 2) -r, _, _ = r.Insert([]byte("foobar"), 2) - -// Find the longest prefix match -m, _, _ := r.Root().LongestPrefix([]byte("foozip")) -if string(m) != "foo" { - panic("should be foo") -} -``` - -Here is an example of performing a range scan of the keys. - -```go -// Create a tree -r := iradix.New() -r, _, _ = r.Insert([]byte("001"), 1) -r, _, _ = r.Insert([]byte("002"), 2) -r, _, _ = r.Insert([]byte("005"), 5) -r, _, _ = r.Insert([]byte("010"), 10) -r, _, _ = r.Insert([]byte("100"), 10) - -// Range scan over the keys that sort lexicographically between [003, 050) -it := r.Root().Iterator() -it.SeekLowerBound([]byte("003")) -for key, _, ok := it.Next(); ok; key, _, ok = it.Next() { - if key >= "050" { - break - } - fmt.Println(key) -} -// Output: -// 005 -// 010 -``` - diff --git a/vendor/github.com/hashicorp/go-immutable-radix/edges.go b/vendor/github.com/hashicorp/go-immutable-radix/edges.go deleted file mode 100644 index a63674775f..0000000000 --- a/vendor/github.com/hashicorp/go-immutable-radix/edges.go +++ /dev/null @@ -1,21 +0,0 @@ -package iradix - -import "sort" - -type edges []edge - -func (e edges) Len() int { - return len(e) -} - -func (e edges) Less(i, j int) bool { - return e[i].label < e[j].label -} - -func (e edges) Swap(i, j int) { - e[i], e[j] = e[j], e[i] -} - -func (e edges) Sort() { - sort.Sort(e) -} diff --git a/vendor/github.com/hashicorp/go-immutable-radix/iradix.go b/vendor/github.com/hashicorp/go-immutable-radix/iradix.go deleted file mode 100644 index 168bda76df..0000000000 --- a/vendor/github.com/hashicorp/go-immutable-radix/iradix.go +++ /dev/null @@ -1,676 +0,0 @@ -package iradix - -import ( - "bytes" - "strings" - - "github.com/hashicorp/golang-lru/simplelru" -) - -const ( - // defaultModifiedCache is the default size of the modified node - // cache used per transaction. This is used to cache the updates - // to the nodes near the root, while the leaves do not need to be - // cached. This is important for very large transactions to prevent - // the modified cache from growing to be enormous. This is also used - // to set the max size of the mutation notify maps since those should - // also be bounded in a similar way. - defaultModifiedCache = 8192 -) - -// Tree implements an immutable radix tree. This can be treated as a -// Dictionary abstract data type. The main advantage over a standard -// hash map is prefix-based lookups and ordered iteration. The immutability -// means that it is safe to concurrently read from a Tree without any -// coordination. -type Tree struct { - root *Node - size int -} - -// New returns an empty Tree -func New() *Tree { - t := &Tree{ - root: &Node{ - mutateCh: make(chan struct{}), - }, - } - return t -} - -// Len is used to return the number of elements in the tree -func (t *Tree) Len() int { - return t.size -} - -// Txn is a transaction on the tree. This transaction is applied -// atomically and returns a new tree when committed. A transaction -// is not thread safe, and should only be used by a single goroutine. -type Txn struct { - // root is the modified root for the transaction. - root *Node - - // snap is a snapshot of the root node for use if we have to run the - // slow notify algorithm. - snap *Node - - // size tracks the size of the tree as it is modified during the - // transaction. - size int - - // writable is a cache of writable nodes that have been created during - // the course of the transaction. This allows us to re-use the same - // nodes for further writes and avoid unnecessary copies of nodes that - // have never been exposed outside the transaction. This will only hold - // up to defaultModifiedCache number of entries. - writable *simplelru.LRU - - // trackChannels is used to hold channels that need to be notified to - // signal mutation of the tree. This will only hold up to - // defaultModifiedCache number of entries, after which we will set the - // trackOverflow flag, which will cause us to use a more expensive - // algorithm to perform the notifications. Mutation tracking is only - // performed if trackMutate is true. - trackChannels map[chan struct{}]struct{} - trackOverflow bool - trackMutate bool -} - -// Txn starts a new transaction that can be used to mutate the tree -func (t *Tree) Txn() *Txn { - txn := &Txn{ - root: t.root, - snap: t.root, - size: t.size, - } - return txn -} - -// Clone makes an independent copy of the transaction. The new transaction -// does not track any nodes and has TrackMutate turned off. The cloned transaction will contain any uncommitted writes in the original transaction but further mutations to either will be independent and result in different radix trees on Commit. A cloned transaction may be passed to another goroutine and mutated there independently however each transaction may only be mutated in a single thread. -func (t *Txn) Clone() *Txn { - // reset the writable node cache to avoid leaking future writes into the clone - t.writable = nil - - txn := &Txn{ - root: t.root, - snap: t.snap, - size: t.size, - } - return txn -} - -// TrackMutate can be used to toggle if mutations are tracked. If this is enabled -// then notifications will be issued for affected internal nodes and leaves when -// the transaction is committed. -func (t *Txn) TrackMutate(track bool) { - t.trackMutate = track -} - -// trackChannel safely attempts to track the given mutation channel, setting the -// overflow flag if we can no longer track any more. This limits the amount of -// state that will accumulate during a transaction and we have a slower algorithm -// to switch to if we overflow. -func (t *Txn) trackChannel(ch chan struct{}) { - // In overflow, make sure we don't store any more objects. - if t.trackOverflow { - return - } - - // If this would overflow the state we reject it and set the flag (since - // we aren't tracking everything that's required any longer). - if len(t.trackChannels) >= defaultModifiedCache { - // Mark that we are in the overflow state - t.trackOverflow = true - - // Clear the map so that the channels can be garbage collected. It is - // safe to do this since we have already overflowed and will be using - // the slow notify algorithm. - t.trackChannels = nil - return - } - - // Create the map on the fly when we need it. - if t.trackChannels == nil { - t.trackChannels = make(map[chan struct{}]struct{}) - } - - // Otherwise we are good to track it. - t.trackChannels[ch] = struct{}{} -} - -// writeNode returns a node to be modified, if the current node has already been -// modified during the course of the transaction, it is used in-place. Set -// forLeafUpdate to true if you are getting a write node to update the leaf, -// which will set leaf mutation tracking appropriately as well. -func (t *Txn) writeNode(n *Node, forLeafUpdate bool) *Node { - // Ensure the writable set exists. - if t.writable == nil { - lru, err := simplelru.NewLRU(defaultModifiedCache, nil) - if err != nil { - panic(err) - } - t.writable = lru - } - - // If this node has already been modified, we can continue to use it - // during this transaction. We know that we don't need to track it for - // a node update since the node is writable, but if this is for a leaf - // update we track it, in case the initial write to this node didn't - // update the leaf. - if _, ok := t.writable.Get(n); ok { - if t.trackMutate && forLeafUpdate && n.leaf != nil { - t.trackChannel(n.leaf.mutateCh) - } - return n - } - - // Mark this node as being mutated. - if t.trackMutate { - t.trackChannel(n.mutateCh) - } - - // Mark its leaf as being mutated, if appropriate. - if t.trackMutate && forLeafUpdate && n.leaf != nil { - t.trackChannel(n.leaf.mutateCh) - } - - // Copy the existing node. If you have set forLeafUpdate it will be - // safe to replace this leaf with another after you get your node for - // writing. You MUST replace it, because the channel associated with - // this leaf will be closed when this transaction is committed. - nc := &Node{ - mutateCh: make(chan struct{}), - leaf: n.leaf, - } - if n.prefix != nil { - nc.prefix = make([]byte, len(n.prefix)) - copy(nc.prefix, n.prefix) - } - if len(n.edges) != 0 { - nc.edges = make([]edge, len(n.edges)) - copy(nc.edges, n.edges) - } - - // Mark this node as writable. - t.writable.Add(nc, nil) - return nc -} - -// Visit all the nodes in the tree under n, and add their mutateChannels to the transaction -// Returns the size of the subtree visited -func (t *Txn) trackChannelsAndCount(n *Node) int { - // Count only leaf nodes - leaves := 0 - if n.leaf != nil { - leaves = 1 - } - // Mark this node as being mutated. - if t.trackMutate { - t.trackChannel(n.mutateCh) - } - - // Mark its leaf as being mutated, if appropriate. - if t.trackMutate && n.leaf != nil { - t.trackChannel(n.leaf.mutateCh) - } - - // Recurse on the children - for _, e := range n.edges { - leaves += t.trackChannelsAndCount(e.node) - } - return leaves -} - -// mergeChild is called to collapse the given node with its child. This is only -// called when the given node is not a leaf and has a single edge. -func (t *Txn) mergeChild(n *Node) { - // Mark the child node as being mutated since we are about to abandon - // it. We don't need to mark the leaf since we are retaining it if it - // is there. - e := n.edges[0] - child := e.node - if t.trackMutate { - t.trackChannel(child.mutateCh) - } - - // Merge the nodes. - n.prefix = concat(n.prefix, child.prefix) - n.leaf = child.leaf - if len(child.edges) != 0 { - n.edges = make([]edge, len(child.edges)) - copy(n.edges, child.edges) - } else { - n.edges = nil - } -} - -// insert does a recursive insertion -func (t *Txn) insert(n *Node, k, search []byte, v interface{}) (*Node, interface{}, bool) { - // Handle key exhaustion - if len(search) == 0 { - var oldVal interface{} - didUpdate := false - if n.isLeaf() { - oldVal = n.leaf.val - didUpdate = true - } - - nc := t.writeNode(n, true) - nc.leaf = &leafNode{ - mutateCh: make(chan struct{}), - key: k, - val: v, - } - return nc, oldVal, didUpdate - } - - // Look for the edge - idx, child := n.getEdge(search[0]) - - // No edge, create one - if child == nil { - e := edge{ - label: search[0], - node: &Node{ - mutateCh: make(chan struct{}), - leaf: &leafNode{ - mutateCh: make(chan struct{}), - key: k, - val: v, - }, - prefix: search, - }, - } - nc := t.writeNode(n, false) - nc.addEdge(e) - return nc, nil, false - } - - // Determine longest prefix of the search key on match - commonPrefix := longestPrefix(search, child.prefix) - if commonPrefix == len(child.prefix) { - search = search[commonPrefix:] - newChild, oldVal, didUpdate := t.insert(child, k, search, v) - if newChild != nil { - nc := t.writeNode(n, false) - nc.edges[idx].node = newChild - return nc, oldVal, didUpdate - } - return nil, oldVal, didUpdate - } - - // Split the node - nc := t.writeNode(n, false) - splitNode := &Node{ - mutateCh: make(chan struct{}), - prefix: search[:commonPrefix], - } - nc.replaceEdge(edge{ - label: search[0], - node: splitNode, - }) - - // Restore the existing child node - modChild := t.writeNode(child, false) - splitNode.addEdge(edge{ - label: modChild.prefix[commonPrefix], - node: modChild, - }) - modChild.prefix = modChild.prefix[commonPrefix:] - - // Create a new leaf node - leaf := &leafNode{ - mutateCh: make(chan struct{}), - key: k, - val: v, - } - - // If the new key is a subset, add to to this node - search = search[commonPrefix:] - if len(search) == 0 { - splitNode.leaf = leaf - return nc, nil, false - } - - // Create a new edge for the node - splitNode.addEdge(edge{ - label: search[0], - node: &Node{ - mutateCh: make(chan struct{}), - leaf: leaf, - prefix: search, - }, - }) - return nc, nil, false -} - -// delete does a recursive deletion -func (t *Txn) delete(parent, n *Node, search []byte) (*Node, *leafNode) { - // Check for key exhaustion - if len(search) == 0 { - if !n.isLeaf() { - return nil, nil - } - // Copy the pointer in case we are in a transaction that already - // modified this node since the node will be reused. Any changes - // made to the node will not affect returning the original leaf - // value. - oldLeaf := n.leaf - - // Remove the leaf node - nc := t.writeNode(n, true) - nc.leaf = nil - - // Check if this node should be merged - if n != t.root && len(nc.edges) == 1 { - t.mergeChild(nc) - } - return nc, oldLeaf - } - - // Look for an edge - label := search[0] - idx, child := n.getEdge(label) - if child == nil || !bytes.HasPrefix(search, child.prefix) { - return nil, nil - } - - // Consume the search prefix - search = search[len(child.prefix):] - newChild, leaf := t.delete(n, child, search) - if newChild == nil { - return nil, nil - } - - // Copy this node. WATCH OUT - it's safe to pass "false" here because we - // will only ADD a leaf via nc.mergeChild() if there isn't one due to - // the !nc.isLeaf() check in the logic just below. This is pretty subtle, - // so be careful if you change any of the logic here. - nc := t.writeNode(n, false) - - // Delete the edge if the node has no edges - if newChild.leaf == nil && len(newChild.edges) == 0 { - nc.delEdge(label) - if n != t.root && len(nc.edges) == 1 && !nc.isLeaf() { - t.mergeChild(nc) - } - } else { - nc.edges[idx].node = newChild - } - return nc, leaf -} - -// delete does a recursive deletion -func (t *Txn) deletePrefix(parent, n *Node, search []byte) (*Node, int) { - // Check for key exhaustion - if len(search) == 0 { - nc := t.writeNode(n, true) - if n.isLeaf() { - nc.leaf = nil - } - nc.edges = nil - return nc, t.trackChannelsAndCount(n) - } - - // Look for an edge - label := search[0] - idx, child := n.getEdge(label) - // We make sure that either the child node's prefix starts with the search term, or the search term starts with the child node's prefix - // Need to do both so that we can delete prefixes that don't correspond to any node in the tree - if child == nil || (!bytes.HasPrefix(child.prefix, search) && !bytes.HasPrefix(search, child.prefix)) { - return nil, 0 - } - - // Consume the search prefix - if len(child.prefix) > len(search) { - search = []byte("") - } else { - search = search[len(child.prefix):] - } - newChild, numDeletions := t.deletePrefix(n, child, search) - if newChild == nil { - return nil, 0 - } - // Copy this node. WATCH OUT - it's safe to pass "false" here because we - // will only ADD a leaf via nc.mergeChild() if there isn't one due to - // the !nc.isLeaf() check in the logic just below. This is pretty subtle, - // so be careful if you change any of the logic here. - - nc := t.writeNode(n, false) - - // Delete the edge if the node has no edges - if newChild.leaf == nil && len(newChild.edges) == 0 { - nc.delEdge(label) - if n != t.root && len(nc.edges) == 1 && !nc.isLeaf() { - t.mergeChild(nc) - } - } else { - nc.edges[idx].node = newChild - } - return nc, numDeletions -} - -// Insert is used to add or update a given key. The return provides -// the previous value and a bool indicating if any was set. -func (t *Txn) Insert(k []byte, v interface{}) (interface{}, bool) { - newRoot, oldVal, didUpdate := t.insert(t.root, k, k, v) - if newRoot != nil { - t.root = newRoot - } - if !didUpdate { - t.size++ - } - return oldVal, didUpdate -} - -// Delete is used to delete a given key. Returns the old value if any, -// and a bool indicating if the key was set. -func (t *Txn) Delete(k []byte) (interface{}, bool) { - newRoot, leaf := t.delete(nil, t.root, k) - if newRoot != nil { - t.root = newRoot - } - if leaf != nil { - t.size-- - return leaf.val, true - } - return nil, false -} - -// DeletePrefix is used to delete an entire subtree that matches the prefix -// This will delete all nodes under that prefix -func (t *Txn) DeletePrefix(prefix []byte) bool { - newRoot, numDeletions := t.deletePrefix(nil, t.root, prefix) - if newRoot != nil { - t.root = newRoot - t.size = t.size - numDeletions - return true - } - return false - -} - -// Root returns the current root of the radix tree within this -// transaction. The root is not safe across insert and delete operations, -// but can be used to read the current state during a transaction. -func (t *Txn) Root() *Node { - return t.root -} - -// Get is used to lookup a specific key, returning -// the value and if it was found -func (t *Txn) Get(k []byte) (interface{}, bool) { - return t.root.Get(k) -} - -// GetWatch is used to lookup a specific key, returning -// the watch channel, value and if it was found -func (t *Txn) GetWatch(k []byte) (<-chan struct{}, interface{}, bool) { - return t.root.GetWatch(k) -} - -// Commit is used to finalize the transaction and return a new tree. If mutation -// tracking is turned on then notifications will also be issued. -func (t *Txn) Commit() *Tree { - nt := t.CommitOnly() - if t.trackMutate { - t.Notify() - } - return nt -} - -// CommitOnly is used to finalize the transaction and return a new tree, but -// does not issue any notifications until Notify is called. -func (t *Txn) CommitOnly() *Tree { - nt := &Tree{t.root, t.size} - t.writable = nil - return nt -} - -// slowNotify does a complete comparison of the before and after trees in order -// to trigger notifications. This doesn't require any additional state but it -// is very expensive to compute. -func (t *Txn) slowNotify() { - snapIter := t.snap.rawIterator() - rootIter := t.root.rawIterator() - for snapIter.Front() != nil || rootIter.Front() != nil { - // If we've exhausted the nodes in the old snapshot, we know - // there's nothing remaining to notify. - if snapIter.Front() == nil { - return - } - snapElem := snapIter.Front() - - // If we've exhausted the nodes in the new root, we know we need - // to invalidate everything that remains in the old snapshot. We - // know from the loop condition there's something in the old - // snapshot. - if rootIter.Front() == nil { - close(snapElem.mutateCh) - if snapElem.isLeaf() { - close(snapElem.leaf.mutateCh) - } - snapIter.Next() - continue - } - - // Do one string compare so we can check the various conditions - // below without repeating the compare. - cmp := strings.Compare(snapIter.Path(), rootIter.Path()) - - // If the snapshot is behind the root, then we must have deleted - // this node during the transaction. - if cmp < 0 { - close(snapElem.mutateCh) - if snapElem.isLeaf() { - close(snapElem.leaf.mutateCh) - } - snapIter.Next() - continue - } - - // If the snapshot is ahead of the root, then we must have added - // this node during the transaction. - if cmp > 0 { - rootIter.Next() - continue - } - - // If we have the same path, then we need to see if we mutated a - // node and possibly the leaf. - rootElem := rootIter.Front() - if snapElem != rootElem { - close(snapElem.mutateCh) - if snapElem.leaf != nil && (snapElem.leaf != rootElem.leaf) { - close(snapElem.leaf.mutateCh) - } - } - snapIter.Next() - rootIter.Next() - } -} - -// Notify is used along with TrackMutate to trigger notifications. This must -// only be done once a transaction is committed via CommitOnly, and it is called -// automatically by Commit. -func (t *Txn) Notify() { - if !t.trackMutate { - return - } - - // If we've overflowed the tracking state we can't use it in any way and - // need to do a full tree compare. - if t.trackOverflow { - t.slowNotify() - } else { - for ch := range t.trackChannels { - close(ch) - } - } - - // Clean up the tracking state so that a re-notify is safe (will trigger - // the else clause above which will be a no-op). - t.trackChannels = nil - t.trackOverflow = false -} - -// Insert is used to add or update a given key. The return provides -// the new tree, previous value and a bool indicating if any was set. -func (t *Tree) Insert(k []byte, v interface{}) (*Tree, interface{}, bool) { - txn := t.Txn() - old, ok := txn.Insert(k, v) - return txn.Commit(), old, ok -} - -// Delete is used to delete a given key. Returns the new tree, -// old value if any, and a bool indicating if the key was set. -func (t *Tree) Delete(k []byte) (*Tree, interface{}, bool) { - txn := t.Txn() - old, ok := txn.Delete(k) - return txn.Commit(), old, ok -} - -// DeletePrefix is used to delete all nodes starting with a given prefix. Returns the new tree, -// and a bool indicating if the prefix matched any nodes -func (t *Tree) DeletePrefix(k []byte) (*Tree, bool) { - txn := t.Txn() - ok := txn.DeletePrefix(k) - return txn.Commit(), ok -} - -// Root returns the root node of the tree which can be used for richer -// query operations. -func (t *Tree) Root() *Node { - return t.root -} - -// Get is used to lookup a specific key, returning -// the value and if it was found -func (t *Tree) Get(k []byte) (interface{}, bool) { - return t.root.Get(k) -} - -// longestPrefix finds the length of the shared prefix -// of two strings -func longestPrefix(k1, k2 []byte) int { - max := len(k1) - if l := len(k2); l < max { - max = l - } - var i int - for i = 0; i < max; i++ { - if k1[i] != k2[i] { - break - } - } - return i -} - -// concat two byte slices, returning a third new copy -func concat(a, b []byte) []byte { - c := make([]byte, len(a)+len(b)) - copy(c, a) - copy(c[len(a):], b) - return c -} diff --git a/vendor/github.com/hashicorp/go-immutable-radix/iter.go b/vendor/github.com/hashicorp/go-immutable-radix/iter.go deleted file mode 100644 index f17d0a644f..0000000000 --- a/vendor/github.com/hashicorp/go-immutable-radix/iter.go +++ /dev/null @@ -1,205 +0,0 @@ -package iradix - -import ( - "bytes" -) - -// Iterator is used to iterate over a set of nodes -// in pre-order -type Iterator struct { - node *Node - stack []edges -} - -// SeekPrefixWatch is used to seek the iterator to a given prefix -// and returns the watch channel of the finest granularity -func (i *Iterator) SeekPrefixWatch(prefix []byte) (watch <-chan struct{}) { - // Wipe the stack - i.stack = nil - n := i.node - watch = n.mutateCh - search := prefix - for { - // Check for key exhaustion - if len(search) == 0 { - i.node = n - return - } - - // Look for an edge - _, n = n.getEdge(search[0]) - if n == nil { - i.node = nil - return - } - - // Update to the finest granularity as the search makes progress - watch = n.mutateCh - - // Consume the search prefix - if bytes.HasPrefix(search, n.prefix) { - search = search[len(n.prefix):] - - } else if bytes.HasPrefix(n.prefix, search) { - i.node = n - return - } else { - i.node = nil - return - } - } -} - -// SeekPrefix is used to seek the iterator to a given prefix -func (i *Iterator) SeekPrefix(prefix []byte) { - i.SeekPrefixWatch(prefix) -} - -func (i *Iterator) recurseMin(n *Node) *Node { - // Traverse to the minimum child - if n.leaf != nil { - return n - } - nEdges := len(n.edges) - if nEdges > 1 { - // Add all the other edges to the stack (the min node will be added as - // we recurse) - i.stack = append(i.stack, n.edges[1:]) - } - if nEdges > 0 { - return i.recurseMin(n.edges[0].node) - } - // Shouldn't be possible - return nil -} - -// SeekLowerBound is used to seek the iterator to the smallest key that is -// greater or equal to the given key. There is no watch variant as it's hard to -// predict based on the radix structure which node(s) changes might affect the -// result. -func (i *Iterator) SeekLowerBound(key []byte) { - // Wipe the stack. Unlike Prefix iteration, we need to build the stack as we - // go because we need only a subset of edges of many nodes in the path to the - // leaf with the lower bound. Note that the iterator will still recurse into - // children that we don't traverse on the way to the reverse lower bound as it - // walks the stack. - i.stack = []edges{} - // i.node starts off in the common case as pointing to the root node of the - // tree. By the time we return we have either found a lower bound and setup - // the stack to traverse all larger keys, or we have not and the stack and - // node should both be nil to prevent the iterator from assuming it is just - // iterating the whole tree from the root node. Either way this needs to end - // up as nil so just set it here. - n := i.node - i.node = nil - search := key - - found := func(n *Node) { - i.stack = append(i.stack, edges{edge{node: n}}) - } - - findMin := func(n *Node) { - n = i.recurseMin(n) - if n != nil { - found(n) - return - } - } - - for { - // Compare current prefix with the search key's same-length prefix. - var prefixCmp int - if len(n.prefix) < len(search) { - prefixCmp = bytes.Compare(n.prefix, search[0:len(n.prefix)]) - } else { - prefixCmp = bytes.Compare(n.prefix, search) - } - - if prefixCmp > 0 { - // Prefix is larger, that means the lower bound is greater than the search - // and from now on we need to follow the minimum path to the smallest - // leaf under this subtree. - findMin(n) - return - } - - if prefixCmp < 0 { - // Prefix is smaller than search prefix, that means there is no lower - // bound - i.node = nil - return - } - - // Prefix is equal, we are still heading for an exact match. If this is a - // leaf and an exact match we're done. - if n.leaf != nil && bytes.Equal(n.leaf.key, key) { - found(n) - return - } - - // Consume the search prefix if the current node has one. Note that this is - // safe because if n.prefix is longer than the search slice prefixCmp would - // have been > 0 above and the method would have already returned. - search = search[len(n.prefix):] - - if len(search) == 0 { - // We've exhausted the search key, but the current node is not an exact - // match or not a leaf. That means that the leaf value if it exists, and - // all child nodes must be strictly greater, the smallest key in this - // subtree must be the lower bound. - findMin(n) - return - } - - // Otherwise, take the lower bound next edge. - idx, lbNode := n.getLowerBoundEdge(search[0]) - if lbNode == nil { - return - } - - // Create stack edges for the all strictly higher edges in this node. - if idx+1 < len(n.edges) { - i.stack = append(i.stack, n.edges[idx+1:]) - } - - // Recurse - n = lbNode - } -} - -// Next returns the next node in order -func (i *Iterator) Next() ([]byte, interface{}, bool) { - // Initialize our stack if needed - if i.stack == nil && i.node != nil { - i.stack = []edges{ - { - edge{node: i.node}, - }, - } - } - - for len(i.stack) > 0 { - // Inspect the last element of the stack - n := len(i.stack) - last := i.stack[n-1] - elem := last[0].node - - // Update the stack - if len(last) > 1 { - i.stack[n-1] = last[1:] - } else { - i.stack = i.stack[:n-1] - } - - // Push the edges onto the frontier - if len(elem.edges) > 0 { - i.stack = append(i.stack, elem.edges) - } - - // Return the leaf values if any - if elem.leaf != nil { - return elem.leaf.key, elem.leaf.val, true - } - } - return nil, nil, false -} diff --git a/vendor/github.com/hashicorp/go-immutable-radix/node.go b/vendor/github.com/hashicorp/go-immutable-radix/node.go deleted file mode 100644 index 3598548087..0000000000 --- a/vendor/github.com/hashicorp/go-immutable-radix/node.go +++ /dev/null @@ -1,334 +0,0 @@ -package iradix - -import ( - "bytes" - "sort" -) - -// WalkFn is used when walking the tree. Takes a -// key and value, returning if iteration should -// be terminated. -type WalkFn func(k []byte, v interface{}) bool - -// leafNode is used to represent a value -type leafNode struct { - mutateCh chan struct{} - key []byte - val interface{} -} - -// edge is used to represent an edge node -type edge struct { - label byte - node *Node -} - -// Node is an immutable node in the radix tree -type Node struct { - // mutateCh is closed if this node is modified - mutateCh chan struct{} - - // leaf is used to store possible leaf - leaf *leafNode - - // prefix is the common prefix we ignore - prefix []byte - - // Edges should be stored in-order for iteration. - // We avoid a fully materialized slice to save memory, - // since in most cases we expect to be sparse - edges edges -} - -func (n *Node) isLeaf() bool { - return n.leaf != nil -} - -func (n *Node) addEdge(e edge) { - num := len(n.edges) - idx := sort.Search(num, func(i int) bool { - return n.edges[i].label >= e.label - }) - n.edges = append(n.edges, e) - if idx != num { - copy(n.edges[idx+1:], n.edges[idx:num]) - n.edges[idx] = e - } -} - -func (n *Node) replaceEdge(e edge) { - num := len(n.edges) - idx := sort.Search(num, func(i int) bool { - return n.edges[i].label >= e.label - }) - if idx < num && n.edges[idx].label == e.label { - n.edges[idx].node = e.node - return - } - panic("replacing missing edge") -} - -func (n *Node) getEdge(label byte) (int, *Node) { - num := len(n.edges) - idx := sort.Search(num, func(i int) bool { - return n.edges[i].label >= label - }) - if idx < num && n.edges[idx].label == label { - return idx, n.edges[idx].node - } - return -1, nil -} - -func (n *Node) getLowerBoundEdge(label byte) (int, *Node) { - num := len(n.edges) - idx := sort.Search(num, func(i int) bool { - return n.edges[i].label >= label - }) - // we want lower bound behavior so return even if it's not an exact match - if idx < num { - return idx, n.edges[idx].node - } - return -1, nil -} - -func (n *Node) delEdge(label byte) { - num := len(n.edges) - idx := sort.Search(num, func(i int) bool { - return n.edges[i].label >= label - }) - if idx < num && n.edges[idx].label == label { - copy(n.edges[idx:], n.edges[idx+1:]) - n.edges[len(n.edges)-1] = edge{} - n.edges = n.edges[:len(n.edges)-1] - } -} - -func (n *Node) GetWatch(k []byte) (<-chan struct{}, interface{}, bool) { - search := k - watch := n.mutateCh - for { - // Check for key exhaustion - if len(search) == 0 { - if n.isLeaf() { - return n.leaf.mutateCh, n.leaf.val, true - } - break - } - - // Look for an edge - _, n = n.getEdge(search[0]) - if n == nil { - break - } - - // Update to the finest granularity as the search makes progress - watch = n.mutateCh - - // Consume the search prefix - if bytes.HasPrefix(search, n.prefix) { - search = search[len(n.prefix):] - } else { - break - } - } - return watch, nil, false -} - -func (n *Node) Get(k []byte) (interface{}, bool) { - _, val, ok := n.GetWatch(k) - return val, ok -} - -// LongestPrefix is like Get, but instead of an -// exact match, it will return the longest prefix match. -func (n *Node) LongestPrefix(k []byte) ([]byte, interface{}, bool) { - var last *leafNode - search := k - for { - // Look for a leaf node - if n.isLeaf() { - last = n.leaf - } - - // Check for key exhaution - if len(search) == 0 { - break - } - - // Look for an edge - _, n = n.getEdge(search[0]) - if n == nil { - break - } - - // Consume the search prefix - if bytes.HasPrefix(search, n.prefix) { - search = search[len(n.prefix):] - } else { - break - } - } - if last != nil { - return last.key, last.val, true - } - return nil, nil, false -} - -// Minimum is used to return the minimum value in the tree -func (n *Node) Minimum() ([]byte, interface{}, bool) { - for { - if n.isLeaf() { - return n.leaf.key, n.leaf.val, true - } - if len(n.edges) > 0 { - n = n.edges[0].node - } else { - break - } - } - return nil, nil, false -} - -// Maximum is used to return the maximum value in the tree -func (n *Node) Maximum() ([]byte, interface{}, bool) { - for { - if num := len(n.edges); num > 0 { - n = n.edges[num-1].node - continue - } - if n.isLeaf() { - return n.leaf.key, n.leaf.val, true - } else { - break - } - } - return nil, nil, false -} - -// Iterator is used to return an iterator at -// the given node to walk the tree -func (n *Node) Iterator() *Iterator { - return &Iterator{node: n} -} - -// ReverseIterator is used to return an iterator at -// the given node to walk the tree backwards -func (n *Node) ReverseIterator() *ReverseIterator { - return NewReverseIterator(n) -} - -// rawIterator is used to return a raw iterator at the given node to walk the -// tree. -func (n *Node) rawIterator() *rawIterator { - iter := &rawIterator{node: n} - iter.Next() - return iter -} - -// Walk is used to walk the tree -func (n *Node) Walk(fn WalkFn) { - recursiveWalk(n, fn) -} - -// WalkBackwards is used to walk the tree in reverse order -func (n *Node) WalkBackwards(fn WalkFn) { - reverseRecursiveWalk(n, fn) -} - -// WalkPrefix is used to walk the tree under a prefix -func (n *Node) WalkPrefix(prefix []byte, fn WalkFn) { - search := prefix - for { - // Check for key exhaution - if len(search) == 0 { - recursiveWalk(n, fn) - return - } - - // Look for an edge - _, n = n.getEdge(search[0]) - if n == nil { - break - } - - // Consume the search prefix - if bytes.HasPrefix(search, n.prefix) { - search = search[len(n.prefix):] - - } else if bytes.HasPrefix(n.prefix, search) { - // Child may be under our search prefix - recursiveWalk(n, fn) - return - } else { - break - } - } -} - -// WalkPath is used to walk the tree, but only visiting nodes -// from the root down to a given leaf. Where WalkPrefix walks -// all the entries *under* the given prefix, this walks the -// entries *above* the given prefix. -func (n *Node) WalkPath(path []byte, fn WalkFn) { - search := path - for { - // Visit the leaf values if any - if n.leaf != nil && fn(n.leaf.key, n.leaf.val) { - return - } - - // Check for key exhaution - if len(search) == 0 { - return - } - - // Look for an edge - _, n = n.getEdge(search[0]) - if n == nil { - return - } - - // Consume the search prefix - if bytes.HasPrefix(search, n.prefix) { - search = search[len(n.prefix):] - } else { - break - } - } -} - -// recursiveWalk is used to do a pre-order walk of a node -// recursively. Returns true if the walk should be aborted -func recursiveWalk(n *Node, fn WalkFn) bool { - // Visit the leaf values if any - if n.leaf != nil && fn(n.leaf.key, n.leaf.val) { - return true - } - - // Recurse on the children - for _, e := range n.edges { - if recursiveWalk(e.node, fn) { - return true - } - } - return false -} - -// reverseRecursiveWalk is used to do a reverse pre-order -// walk of a node recursively. Returns true if the walk -// should be aborted -func reverseRecursiveWalk(n *Node, fn WalkFn) bool { - // Visit the leaf values if any - if n.leaf != nil && fn(n.leaf.key, n.leaf.val) { - return true - } - - // Recurse on the children in reverse order - for i := len(n.edges) - 1; i >= 0; i-- { - e := n.edges[i] - if reverseRecursiveWalk(e.node, fn) { - return true - } - } - return false -} diff --git a/vendor/github.com/hashicorp/go-immutable-radix/raw_iter.go b/vendor/github.com/hashicorp/go-immutable-radix/raw_iter.go deleted file mode 100644 index 3c6a22525c..0000000000 --- a/vendor/github.com/hashicorp/go-immutable-radix/raw_iter.go +++ /dev/null @@ -1,78 +0,0 @@ -package iradix - -// rawIterator visits each of the nodes in the tree, even the ones that are not -// leaves. It keeps track of the effective path (what a leaf at a given node -// would be called), which is useful for comparing trees. -type rawIterator struct { - // node is the starting node in the tree for the iterator. - node *Node - - // stack keeps track of edges in the frontier. - stack []rawStackEntry - - // pos is the current position of the iterator. - pos *Node - - // path is the effective path of the current iterator position, - // regardless of whether the current node is a leaf. - path string -} - -// rawStackEntry is used to keep track of the cumulative common path as well as -// its associated edges in the frontier. -type rawStackEntry struct { - path string - edges edges -} - -// Front returns the current node that has been iterated to. -func (i *rawIterator) Front() *Node { - return i.pos -} - -// Path returns the effective path of the current node, even if it's not actually -// a leaf. -func (i *rawIterator) Path() string { - return i.path -} - -// Next advances the iterator to the next node. -func (i *rawIterator) Next() { - // Initialize our stack if needed. - if i.stack == nil && i.node != nil { - i.stack = []rawStackEntry{ - { - edges: edges{ - edge{node: i.node}, - }, - }, - } - } - - for len(i.stack) > 0 { - // Inspect the last element of the stack. - n := len(i.stack) - last := i.stack[n-1] - elem := last.edges[0].node - - // Update the stack. - if len(last.edges) > 1 { - i.stack[n-1].edges = last.edges[1:] - } else { - i.stack = i.stack[:n-1] - } - - // Push the edges onto the frontier. - if len(elem.edges) > 0 { - path := last.path + string(elem.prefix) - i.stack = append(i.stack, rawStackEntry{path, elem.edges}) - } - - i.pos = elem - i.path = last.path + string(elem.prefix) - return - } - - i.pos = nil - i.path = "" -} diff --git a/vendor/github.com/hashicorp/go-immutable-radix/reverse_iter.go b/vendor/github.com/hashicorp/go-immutable-radix/reverse_iter.go deleted file mode 100644 index 554fa7129c..0000000000 --- a/vendor/github.com/hashicorp/go-immutable-radix/reverse_iter.go +++ /dev/null @@ -1,239 +0,0 @@ -package iradix - -import ( - "bytes" -) - -// ReverseIterator is used to iterate over a set of nodes -// in reverse in-order -type ReverseIterator struct { - i *Iterator - - // expandedParents stores the set of parent nodes whose relevant children have - // already been pushed into the stack. This can happen during seek or during - // iteration. - // - // Unlike forward iteration we need to recurse into children before we can - // output the value stored in an internal leaf since all children are greater. - // We use this to track whether we have already ensured all the children are - // in the stack. - expandedParents map[*Node]struct{} -} - -// NewReverseIterator returns a new ReverseIterator at a node -func NewReverseIterator(n *Node) *ReverseIterator { - return &ReverseIterator{ - i: &Iterator{node: n}, - } -} - -// SeekPrefixWatch is used to seek the iterator to a given prefix -// and returns the watch channel of the finest granularity -func (ri *ReverseIterator) SeekPrefixWatch(prefix []byte) (watch <-chan struct{}) { - return ri.i.SeekPrefixWatch(prefix) -} - -// SeekPrefix is used to seek the iterator to a given prefix -func (ri *ReverseIterator) SeekPrefix(prefix []byte) { - ri.i.SeekPrefixWatch(prefix) -} - -// SeekReverseLowerBound is used to seek the iterator to the largest key that is -// lower or equal to the given key. There is no watch variant as it's hard to -// predict based on the radix structure which node(s) changes might affect the -// result. -func (ri *ReverseIterator) SeekReverseLowerBound(key []byte) { - // Wipe the stack. Unlike Prefix iteration, we need to build the stack as we - // go because we need only a subset of edges of many nodes in the path to the - // leaf with the lower bound. Note that the iterator will still recurse into - // children that we don't traverse on the way to the reverse lower bound as it - // walks the stack. - ri.i.stack = []edges{} - // ri.i.node starts off in the common case as pointing to the root node of the - // tree. By the time we return we have either found a lower bound and setup - // the stack to traverse all larger keys, or we have not and the stack and - // node should both be nil to prevent the iterator from assuming it is just - // iterating the whole tree from the root node. Either way this needs to end - // up as nil so just set it here. - n := ri.i.node - ri.i.node = nil - search := key - - if ri.expandedParents == nil { - ri.expandedParents = make(map[*Node]struct{}) - } - - found := func(n *Node) { - ri.i.stack = append(ri.i.stack, edges{edge{node: n}}) - // We need to mark this node as expanded in advance too otherwise the - // iterator will attempt to walk all of its children even though they are - // greater than the lower bound we have found. We've expanded it in the - // sense that all of its children that we want to walk are already in the - // stack (i.e. none of them). - ri.expandedParents[n] = struct{}{} - } - - for { - // Compare current prefix with the search key's same-length prefix. - var prefixCmp int - if len(n.prefix) < len(search) { - prefixCmp = bytes.Compare(n.prefix, search[0:len(n.prefix)]) - } else { - prefixCmp = bytes.Compare(n.prefix, search) - } - - if prefixCmp < 0 { - // Prefix is smaller than search prefix, that means there is no exact - // match for the search key. But we are looking in reverse, so the reverse - // lower bound will be the largest leaf under this subtree, since it is - // the value that would come right before the current search key if it - // were in the tree. So we need to follow the maximum path in this subtree - // to find it. Note that this is exactly what the iterator will already do - // if it finds a node in the stack that has _not_ been marked as expanded - // so in this one case we don't call `found` and instead let the iterator - // do the expansion and recursion through all the children. - ri.i.stack = append(ri.i.stack, edges{edge{node: n}}) - return - } - - if prefixCmp > 0 { - // Prefix is larger than search prefix, or there is no prefix but we've - // also exhausted the search key. Either way, that means there is no - // reverse lower bound since nothing comes before our current search - // prefix. - return - } - - // If this is a leaf, something needs to happen! Note that if it's a leaf - // and prefixCmp was zero (which it must be to get here) then the leaf value - // is either an exact match for the search, or it's lower. It can't be - // greater. - if n.isLeaf() { - - // Firstly, if it's an exact match, we're done! - if bytes.Equal(n.leaf.key, key) { - found(n) - return - } - - // It's not so this node's leaf value must be lower and could still be a - // valid contender for reverse lower bound. - - // If it has no children then we are also done. - if len(n.edges) == 0 { - // This leaf is the lower bound. - found(n) - return - } - - // Finally, this leaf is internal (has children) so we'll keep searching, - // but we need to add it to the iterator's stack since it has a leaf value - // that needs to be iterated over. It needs to be added to the stack - // before its children below as it comes first. - ri.i.stack = append(ri.i.stack, edges{edge{node: n}}) - // We also need to mark it as expanded since we'll be adding any of its - // relevant children below and so don't want the iterator to re-add them - // on its way back up the stack. - ri.expandedParents[n] = struct{}{} - } - - // Consume the search prefix. Note that this is safe because if n.prefix is - // longer than the search slice prefixCmp would have been > 0 above and the - // method would have already returned. - search = search[len(n.prefix):] - - if len(search) == 0 { - // We've exhausted the search key but we are not at a leaf. That means all - // children are greater than the search key so a reverse lower bound - // doesn't exist in this subtree. Note that there might still be one in - // the whole radix tree by following a different path somewhere further - // up. If that's the case then the iterator's stack will contain all the - // smaller nodes already and Previous will walk through them correctly. - return - } - - // Otherwise, take the lower bound next edge. - idx, lbNode := n.getLowerBoundEdge(search[0]) - - // From here, we need to update the stack with all values lower than - // the lower bound edge. Since getLowerBoundEdge() returns -1 when the - // search prefix is larger than all edges, we need to place idx at the - // last edge index so they can all be place in the stack, since they - // come before our search prefix. - if idx == -1 { - idx = len(n.edges) - } - - // Create stack edges for the all strictly lower edges in this node. - if len(n.edges[:idx]) > 0 { - ri.i.stack = append(ri.i.stack, n.edges[:idx]) - } - - // Exit if there's no lower bound edge. The stack will have the previous - // nodes already. - if lbNode == nil { - return - } - - // Recurse - n = lbNode - } -} - -// Previous returns the previous node in reverse order -func (ri *ReverseIterator) Previous() ([]byte, interface{}, bool) { - // Initialize our stack if needed - if ri.i.stack == nil && ri.i.node != nil { - ri.i.stack = []edges{ - { - edge{node: ri.i.node}, - }, - } - } - - if ri.expandedParents == nil { - ri.expandedParents = make(map[*Node]struct{}) - } - - for len(ri.i.stack) > 0 { - // Inspect the last element of the stack - n := len(ri.i.stack) - last := ri.i.stack[n-1] - m := len(last) - elem := last[m-1].node - - _, alreadyExpanded := ri.expandedParents[elem] - - // If this is an internal node and we've not seen it already, we need to - // leave it in the stack so we can return its possible leaf value _after_ - // we've recursed through all its children. - if len(elem.edges) > 0 && !alreadyExpanded { - // record that we've seen this node! - ri.expandedParents[elem] = struct{}{} - // push child edges onto stack and skip the rest of the loop to recurse - // into the largest one. - ri.i.stack = append(ri.i.stack, elem.edges) - continue - } - - // Remove the node from the stack - if m > 1 { - ri.i.stack[n-1] = last[:m-1] - } else { - ri.i.stack = ri.i.stack[:n-1] - } - // We don't need this state any more as it's no longer in the stack so we - // won't visit it again - if alreadyExpanded { - delete(ri.expandedParents, elem) - } - - // If this is a leaf, return it - if elem.leaf != nil { - return elem.leaf.key, elem.leaf.val, true - } - - // it's not a leaf so keep walking the stack to find the previous leaf - } - return nil, nil, false -} diff --git a/vendor/github.com/hashicorp/go-memdb/.gitignore b/vendor/github.com/hashicorp/go-memdb/.gitignore deleted file mode 100644 index 11b90db8d9..0000000000 --- a/vendor/github.com/hashicorp/go-memdb/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof - -.idea diff --git a/vendor/github.com/hashicorp/go-memdb/CODEOWNERS b/vendor/github.com/hashicorp/go-memdb/CODEOWNERS deleted file mode 100644 index 2cad39ac6f..0000000000 --- a/vendor/github.com/hashicorp/go-memdb/CODEOWNERS +++ /dev/null @@ -1,13 +0,0 @@ -# Each line is a file pattern followed by one or more owners. -# More on CODEOWNERS files: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners - -# Default owner -* @hashicorp/team-ip-compliance @hashicorp/raft-force - -# Add override rules below. Each line is a file/folder pattern followed by one or more owners. -# Being an owner means those groups or individuals will be added as reviewers to PRs affecting -# those areas of the code. -# Examples: -# /docs/ @docs-team -# *.js @js-team -# *.go @go-team diff --git a/vendor/github.com/hashicorp/go-memdb/LICENSE b/vendor/github.com/hashicorp/go-memdb/LICENSE deleted file mode 100644 index f4f97ee585..0000000000 --- a/vendor/github.com/hashicorp/go-memdb/LICENSE +++ /dev/null @@ -1,365 +0,0 @@ -Copyright (c) 2015 HashiCorp, Inc. - -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. "Contributor" - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. "Contributor Version" - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the terms of - a Secondary License. - -1.6. "Executable Form" - - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - - means a work that combines Covered Software with other material, in a - separate file or files, that is not Covered Software. - -1.8. "License" - - means this document. - -1.9. "Licensable" - - means having the right to grant, to the maximum extent possible, whether - at the time of the initial grant or subsequently, any and all of the - rights conveyed by this License. - -1.10. "Modifications" - - means any of the following: - - a. any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. "Patent Claims" of a Contributor - - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the License, - by the making, using, selling, offering for sale, having made, import, - or transfer of either its Contributions or its Contributor Version. - -1.12. "Secondary License" - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. "Source Code Form" - - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, "control" means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights to - grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter the - recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, or - limitations of liability) contained within the Source Code Form of the - Covered Software, except that You may alter any license notices to the - extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, - judicial order, or regulation then You must: (a) comply with the terms of - this License to the maximum extent possible; and (b) describe the - limitations and the code they affect. Such description must be placed in a - text file included with all distributions of the Covered Software under - this License. Except to the extent prohibited by statute or regulation, - such description must be sufficiently detailed for a recipient of ordinary - skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing - basis, if such Contributor fails to notify You of the non-compliance by - some reasonable means prior to 60 days after You have come back into - compliance. Moreover, Your grants from a particular Contributor are - reinstated on an ongoing basis if such Contributor notifies You of the - non-compliance by some reasonable means, this is the first time You have - received notice of non-compliance with this License from such - Contributor, and You become compliant prior to 30 days after Your receipt - of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an "as is" basis, - without warranty of any kind, either expressed, implied, or statutory, - including, without limitation, warranties that the Covered Software is free - of defects, merchantable, fit for a particular purpose or non-infringing. - The entire risk as to the quality and performance of the Covered Software - is with You. Should any Covered Software prove defective in any respect, - You (not any Contributor) assume the cost of any necessary servicing, - repair, or correction. This disclaimer of warranty constitutes an essential - part of this License. No use of any Covered Software is authorized under - this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from - such party's negligence to the extent applicable law prohibits such - limitation. Some jurisdictions do not allow the exclusion or limitation of - incidental or consequential damages, so this exclusion and limitation may - not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts - of a jurisdiction where the defendant maintains its principal place of - business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. Nothing - in this Section shall prevent a party's ability to bring cross-claims or - counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides that - the language of a contract shall be construed against the drafter shall not - be used to construe this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses If You choose to distribute Source Code Form that is - Incompatible With Secondary Licenses under the terms of this version of - the License, the notice described in Exhibit B of this License must be - attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, -then You may include the notice in a location (such as a LICENSE file in a -relevant directory) where a recipient would be likely to look for such a -notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible - With Secondary Licenses", as defined by - the Mozilla Public License, v. 2.0. - diff --git a/vendor/github.com/hashicorp/go-memdb/README.md b/vendor/github.com/hashicorp/go-memdb/README.md deleted file mode 100644 index 080b7447b2..0000000000 --- a/vendor/github.com/hashicorp/go-memdb/README.md +++ /dev/null @@ -1,146 +0,0 @@ -# go-memdb [![CircleCI](https://circleci.com/gh/hashicorp/go-memdb/tree/master.svg?style=svg)](https://circleci.com/gh/hashicorp/go-memdb/tree/master) - -Provides the `memdb` package that implements a simple in-memory database -built on immutable radix trees. The database provides Atomicity, Consistency -and Isolation from ACID. Being that it is in-memory, it does not provide durability. -The database is instantiated with a schema that specifies the tables and indices -that exist and allows transactions to be executed. - -The database provides the following: - -* Multi-Version Concurrency Control (MVCC) - By leveraging immutable radix trees - the database is able to support any number of concurrent readers without locking, - and allows a writer to make progress. - -* Transaction Support - The database allows for rich transactions, in which multiple - objects are inserted, updated or deleted. The transactions can span multiple tables, - and are applied atomically. The database provides atomicity and isolation in ACID - terminology, such that until commit the updates are not visible. - -* Rich Indexing - Tables can support any number of indexes, which can be simple like - a single field index, or more advanced compound field indexes. Certain types like - UUID can be efficiently compressed from strings into byte indexes for reduced - storage requirements. - -* Watches - Callers can populate a watch set as part of a query, which can be used to - detect when a modification has been made to the database which affects the query - results. This lets callers easily watch for changes in the database in a very general - way. - -For the underlying immutable radix trees, see [go-immutable-radix](https://github.com/hashicorp/go-immutable-radix). - -Documentation -============= - -The full documentation is available on [Godoc](https://pkg.go.dev/github.com/hashicorp/go-memdb). - -Example -======= - -Below is a [simple example](https://play.golang.org/p/gCGE9FA4og1) of usage - -```go -// Create a sample struct -type Person struct { - Email string - Name string - Age int -} - -// Create the DB schema -schema := &memdb.DBSchema{ - Tables: map[string]*memdb.TableSchema{ - "person": &memdb.TableSchema{ - Name: "person", - Indexes: map[string]*memdb.IndexSchema{ - "id": &memdb.IndexSchema{ - Name: "id", - Unique: true, - Indexer: &memdb.StringFieldIndex{Field: "Email"}, - }, - "age": &memdb.IndexSchema{ - Name: "age", - Unique: false, - Indexer: &memdb.IntFieldIndex{Field: "Age"}, - }, - }, - }, - }, -} - -// Create a new data base -db, err := memdb.NewMemDB(schema) -if err != nil { - panic(err) -} - -// Create a write transaction -txn := db.Txn(true) - -// Insert some people -people := []*Person{ - &Person{"joe@aol.com", "Joe", 30}, - &Person{"lucy@aol.com", "Lucy", 35}, - &Person{"tariq@aol.com", "Tariq", 21}, - &Person{"dorothy@aol.com", "Dorothy", 53}, -} -for _, p := range people { - if err := txn.Insert("person", p); err != nil { - panic(err) - } -} - -// Commit the transaction -txn.Commit() - -// Create read-only transaction -txn = db.Txn(false) -defer txn.Abort() - -// Lookup by email -raw, err := txn.First("person", "id", "joe@aol.com") -if err != nil { - panic(err) -} - -// Say hi! -fmt.Printf("Hello %s!\n", raw.(*Person).Name) - -// List all the people -it, err := txn.Get("person", "id") -if err != nil { - panic(err) -} - -fmt.Println("All the people:") -for obj := it.Next(); obj != nil; obj = it.Next() { - p := obj.(*Person) - fmt.Printf(" %s\n", p.Name) -} - -// Range scan over people with ages between 25 and 35 inclusive -it, err = txn.LowerBound("person", "age", 25) -if err != nil { - panic(err) -} - -fmt.Println("People aged 25 - 35:") -for obj := it.Next(); obj != nil; obj = it.Next() { - p := obj.(*Person) - if p.Age > 35 { - break - } - fmt.Printf(" %s is aged %d\n", p.Name, p.Age) -} -// Output: -// Hello Joe! -// All the people: -// Dorothy -// Joe -// Lucy -// Tariq -// People aged 25 - 35: -// Joe is aged 30 -// Lucy is aged 35 -``` - diff --git a/vendor/github.com/hashicorp/go-memdb/changes.go b/vendor/github.com/hashicorp/go-memdb/changes.go deleted file mode 100644 index 4761e925db..0000000000 --- a/vendor/github.com/hashicorp/go-memdb/changes.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package memdb - -// Changes describes a set of mutations to memDB tables performed during a -// transaction. -type Changes []Change - -// Change describes a mutation to an object in a table. -type Change struct { - Table string - Before interface{} - After interface{} - - // primaryKey stores the raw key value from the primary index so that we can - // de-duplicate multiple updates of the same object in the same transaction - // but we don't expose this implementation detail to the consumer. - primaryKey []byte -} - -// Created returns true if the mutation describes a new object being inserted. -func (m *Change) Created() bool { - return m.Before == nil && m.After != nil -} - -// Updated returns true if the mutation describes an existing object being -// updated. -func (m *Change) Updated() bool { - return m.Before != nil && m.After != nil -} - -// Deleted returns true if the mutation describes an existing object being -// deleted. -func (m *Change) Deleted() bool { - return m.Before != nil && m.After == nil -} diff --git a/vendor/github.com/hashicorp/go-memdb/filter.go b/vendor/github.com/hashicorp/go-memdb/filter.go deleted file mode 100644 index 2e1352162a..0000000000 --- a/vendor/github.com/hashicorp/go-memdb/filter.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package memdb - -// FilterFunc is a function that takes the results of an iterator and returns -// whether the result should be filtered out. -type FilterFunc func(interface{}) bool - -// FilterIterator is used to wrap a ResultIterator and apply a filter over it. -type FilterIterator struct { - // filter is the filter function applied over the base iterator. - filter FilterFunc - - // iter is the iterator that is being wrapped. - iter ResultIterator -} - -// NewFilterIterator wraps a ResultIterator. The filter function is applied -// to each value returned by a call to iter.Next. -// -// See the documentation for ResultIterator to understand the behaviour of the -// returned FilterIterator. -func NewFilterIterator(iter ResultIterator, filter FilterFunc) *FilterIterator { - return &FilterIterator{ - filter: filter, - iter: iter, - } -} - -// WatchCh returns the watch channel of the wrapped iterator. -func (f *FilterIterator) WatchCh() <-chan struct{} { return f.iter.WatchCh() } - -// Next returns the next non-filtered result from the wrapped iterator. -func (f *FilterIterator) Next() interface{} { - for { - if value := f.iter.Next(); value == nil || !f.filter(value) { - return value - } - } -} diff --git a/vendor/github.com/hashicorp/go-memdb/index.go b/vendor/github.com/hashicorp/go-memdb/index.go deleted file mode 100644 index 588e1c892a..0000000000 --- a/vendor/github.com/hashicorp/go-memdb/index.go +++ /dev/null @@ -1,934 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package memdb - -import ( - "encoding/binary" - "encoding/hex" - "errors" - "fmt" - "reflect" - "strconv" - "strings" -) - -// Indexer is an interface used for defining indexes. Indexes are used -// for efficient lookup of objects in a MemDB table. An Indexer must also -// implement one of SingleIndexer or MultiIndexer. -// -// Indexers are primarily responsible for returning the lookup key as -// a byte slice. The byte slice is the key data in the underlying data storage. -type Indexer interface { - // FromArgs is called to build the exact index key from a list of arguments. - FromArgs(args ...interface{}) ([]byte, error) -} - -// SingleIndexer is an interface used for defining indexes that generate a -// single value per object -type SingleIndexer interface { - // FromObject extracts the index value from an object. The return values - // are whether the index value was found, the index value, and any error - // while extracting the index value, respectively. - FromObject(raw interface{}) (bool, []byte, error) -} - -// MultiIndexer is an interface used for defining indexes that generate -// multiple values per object. Each value is stored as a seperate index -// pointing to the same object. -// -// For example, an index that extracts the first and last name of a person -// and allows lookup based on eitherd would be a MultiIndexer. The FromObject -// of this example would split the first and last name and return both as -// values. -type MultiIndexer interface { - // FromObject extracts index values from an object. The return values - // are the same as a SingleIndexer except there can be multiple index - // values. - FromObject(raw interface{}) (bool, [][]byte, error) -} - -// PrefixIndexer is an optional interface on top of an Indexer that allows -// indexes to support prefix-based iteration. -type PrefixIndexer interface { - // PrefixFromArgs is the same as FromArgs for an Indexer except that - // the index value returned should return all prefix-matched values. - PrefixFromArgs(args ...interface{}) ([]byte, error) -} - -// StringFieldIndex is used to extract a field from an object -// using reflection and builds an index on that field. -type StringFieldIndex struct { - Field string - Lowercase bool -} - -func (s *StringFieldIndex) FromObject(obj interface{}) (bool, []byte, error) { - v := reflect.ValueOf(obj) - v = reflect.Indirect(v) // Dereference the pointer if any - - fv := v.FieldByName(s.Field) - isPtr := fv.Kind() == reflect.Ptr - fv = reflect.Indirect(fv) - if !isPtr && !fv.IsValid() { - return false, nil, - fmt.Errorf("field '%s' for %#v is invalid %v ", s.Field, obj, isPtr) - } - - if isPtr && !fv.IsValid() { - val := "" - return false, []byte(val), nil - } - - val := fv.String() - if val == "" { - return false, nil, nil - } - - if s.Lowercase { - val = strings.ToLower(val) - } - - // Add the null character as a terminator - val += "\x00" - return true, []byte(val), nil -} - -func (s *StringFieldIndex) FromArgs(args ...interface{}) ([]byte, error) { - if len(args) != 1 { - return nil, fmt.Errorf("must provide only a single argument") - } - arg, ok := args[0].(string) - if !ok { - return nil, fmt.Errorf("argument must be a string: %#v", args[0]) - } - if s.Lowercase { - arg = strings.ToLower(arg) - } - // Add the null character as a terminator - arg += "\x00" - return []byte(arg), nil -} - -func (s *StringFieldIndex) PrefixFromArgs(args ...interface{}) ([]byte, error) { - val, err := s.FromArgs(args...) - if err != nil { - return nil, err - } - - // Strip the null terminator, the rest is a prefix - n := len(val) - if n > 0 { - return val[:n-1], nil - } - return val, nil -} - -// StringSliceFieldIndex builds an index from a field on an object that is a -// string slice ([]string). Each value within the string slice can be used for -// lookup. -type StringSliceFieldIndex struct { - Field string - Lowercase bool -} - -func (s *StringSliceFieldIndex) FromObject(obj interface{}) (bool, [][]byte, error) { - v := reflect.ValueOf(obj) - v = reflect.Indirect(v) // Dereference the pointer if any - - fv := v.FieldByName(s.Field) - if !fv.IsValid() { - return false, nil, - fmt.Errorf("field '%s' for %#v is invalid", s.Field, obj) - } - - if fv.Kind() != reflect.Slice || fv.Type().Elem().Kind() != reflect.String { - return false, nil, fmt.Errorf("field '%s' is not a string slice", s.Field) - } - - length := fv.Len() - vals := make([][]byte, 0, length) - for i := 0; i < fv.Len(); i++ { - val := fv.Index(i).String() - if val == "" { - continue - } - - if s.Lowercase { - val = strings.ToLower(val) - } - - // Add the null character as a terminator - val += "\x00" - vals = append(vals, []byte(val)) - } - if len(vals) == 0 { - return false, nil, nil - } - return true, vals, nil -} - -func (s *StringSliceFieldIndex) FromArgs(args ...interface{}) ([]byte, error) { - if len(args) != 1 { - return nil, fmt.Errorf("must provide only a single argument") - } - arg, ok := args[0].(string) - if !ok { - return nil, fmt.Errorf("argument must be a string: %#v", args[0]) - } - if s.Lowercase { - arg = strings.ToLower(arg) - } - // Add the null character as a terminator - arg += "\x00" - return []byte(arg), nil -} - -func (s *StringSliceFieldIndex) PrefixFromArgs(args ...interface{}) ([]byte, error) { - val, err := s.FromArgs(args...) - if err != nil { - return nil, err - } - - // Strip the null terminator, the rest is a prefix - n := len(val) - if n > 0 { - return val[:n-1], nil - } - return val, nil -} - -// StringMapFieldIndex is used to extract a field of type map[string]string -// from an object using reflection and builds an index on that field. -// -// Note that although FromArgs in theory supports using either one or -// two arguments, there is a bug: FromObject only creates an index -// using key/value, and does not also create an index using key. This -// means a lookup using one argument will never actually work. -// -// It is currently left as-is to prevent backwards compatibility -// issues. -// -// TODO: Fix this in the next major bump. -type StringMapFieldIndex struct { - Field string - Lowercase bool -} - -var MapType = reflect.MapOf(reflect.TypeOf(""), reflect.TypeOf("")).Kind() - -func (s *StringMapFieldIndex) FromObject(obj interface{}) (bool, [][]byte, error) { - v := reflect.ValueOf(obj) - v = reflect.Indirect(v) // Dereference the pointer if any - - fv := v.FieldByName(s.Field) - if !fv.IsValid() { - return false, nil, fmt.Errorf("field '%s' for %#v is invalid", s.Field, obj) - } - - if fv.Kind() != MapType { - return false, nil, fmt.Errorf("field '%s' is not a map[string]string", s.Field) - } - - length := fv.Len() - vals := make([][]byte, 0, length) - for _, key := range fv.MapKeys() { - k := key.String() - if k == "" { - continue - } - val := fv.MapIndex(key).String() - - if s.Lowercase { - k = strings.ToLower(k) - val = strings.ToLower(val) - } - - // Add the null character as a terminator - k += "\x00" + val + "\x00" - - vals = append(vals, []byte(k)) - } - if len(vals) == 0 { - return false, nil, nil - } - return true, vals, nil -} - -// WARNING: Because of a bug in FromObject, this function will never return -// a value when using the single-argument version. -func (s *StringMapFieldIndex) FromArgs(args ...interface{}) ([]byte, error) { - if len(args) > 2 || len(args) == 0 { - return nil, fmt.Errorf("must provide one or two arguments") - } - key, ok := args[0].(string) - if !ok { - return nil, fmt.Errorf("argument must be a string: %#v", args[0]) - } - if s.Lowercase { - key = strings.ToLower(key) - } - // Add the null character as a terminator - key += "\x00" - - if len(args) == 2 { - val, ok := args[1].(string) - if !ok { - return nil, fmt.Errorf("argument must be a string: %#v", args[1]) - } - if s.Lowercase { - val = strings.ToLower(val) - } - // Add the null character as a terminator - key += val + "\x00" - } - - return []byte(key), nil -} - -// IntFieldIndex is used to extract an int field from an object using -// reflection and builds an index on that field. -type IntFieldIndex struct { - Field string -} - -func (i *IntFieldIndex) FromObject(obj interface{}) (bool, []byte, error) { - v := reflect.ValueOf(obj) - v = reflect.Indirect(v) // Dereference the pointer if any - - fv := v.FieldByName(i.Field) - if !fv.IsValid() { - return false, nil, - fmt.Errorf("field '%s' for %#v is invalid", i.Field, obj) - } - - // Check the type - k := fv.Kind() - size, ok := IsIntType(k) - if !ok { - return false, nil, fmt.Errorf("field %q is of type %v; want an int", i.Field, k) - } - - // Get the value and encode it - val := fv.Int() - buf := encodeInt(val, size) - - return true, buf, nil -} - -func (i *IntFieldIndex) FromArgs(args ...interface{}) ([]byte, error) { - if len(args) != 1 { - return nil, fmt.Errorf("must provide only a single argument") - } - - v := reflect.ValueOf(args[0]) - if !v.IsValid() { - return nil, fmt.Errorf("%#v is invalid", args[0]) - } - - k := v.Kind() - size, ok := IsIntType(k) - if !ok { - return nil, fmt.Errorf("arg is of type %v; want a int", k) - } - - val := v.Int() - buf := encodeInt(val, size) - - return buf, nil -} - -func encodeInt(val int64, size int) []byte { - buf := make([]byte, size) - - // This bit flips the sign bit on any sized signed twos-complement integer, - // which when truncated to a uint of the same size will bias the value such - // that the maximum negative int becomes 0, and the maximum positive int - // becomes the maximum positive uint. - scaled := val ^ int64(-1<<(size*8-1)) - - switch size { - case 1: - buf[0] = uint8(scaled) - case 2: - binary.BigEndian.PutUint16(buf, uint16(scaled)) - case 4: - binary.BigEndian.PutUint32(buf, uint32(scaled)) - case 8: - binary.BigEndian.PutUint64(buf, uint64(scaled)) - default: - panic(fmt.Sprintf("unsupported int size parameter: %d", size)) - } - - return buf -} - -// IsIntType returns whether the passed type is a type of int and the number -// of bytes needed to encode the type. -func IsIntType(k reflect.Kind) (size int, okay bool) { - switch k { - case reflect.Int: - return strconv.IntSize / 8, true - case reflect.Int8: - return 1, true - case reflect.Int16: - return 2, true - case reflect.Int32: - return 4, true - case reflect.Int64: - return 8, true - default: - return 0, false - } -} - -// UintFieldIndex is used to extract a uint field from an object using -// reflection and builds an index on that field. -type UintFieldIndex struct { - Field string -} - -func (u *UintFieldIndex) FromObject(obj interface{}) (bool, []byte, error) { - v := reflect.ValueOf(obj) - v = reflect.Indirect(v) // Dereference the pointer if any - - fv := v.FieldByName(u.Field) - if !fv.IsValid() { - return false, nil, - fmt.Errorf("field '%s' for %#v is invalid", u.Field, obj) - } - - // Check the type - k := fv.Kind() - size, ok := IsUintType(k) - if !ok { - return false, nil, fmt.Errorf("field %q is of type %v; want a uint", u.Field, k) - } - - // Get the value and encode it - val := fv.Uint() - buf := encodeUInt(val, size) - - return true, buf, nil -} - -func (u *UintFieldIndex) FromArgs(args ...interface{}) ([]byte, error) { - if len(args) != 1 { - return nil, fmt.Errorf("must provide only a single argument") - } - - v := reflect.ValueOf(args[0]) - if !v.IsValid() { - return nil, fmt.Errorf("%#v is invalid", args[0]) - } - - k := v.Kind() - size, ok := IsUintType(k) - if !ok { - return nil, fmt.Errorf("arg is of type %v; want a uint", k) - } - - val := v.Uint() - buf := encodeUInt(val, size) - - return buf, nil -} - -func encodeUInt(val uint64, size int) []byte { - buf := make([]byte, size) - - switch size { - case 1: - buf[0] = uint8(val) - case 2: - binary.BigEndian.PutUint16(buf, uint16(val)) - case 4: - binary.BigEndian.PutUint32(buf, uint32(val)) - case 8: - binary.BigEndian.PutUint64(buf, val) - default: - panic(fmt.Sprintf("unsupported uint size parameter: %d", size)) - } - - return buf -} - -// IsUintType returns whether the passed type is a type of uint and the number -// of bytes needed to encode the type. -func IsUintType(k reflect.Kind) (size int, okay bool) { - switch k { - case reflect.Uint: - return strconv.IntSize / 8, true - case reflect.Uint8: - return 1, true - case reflect.Uint16: - return 2, true - case reflect.Uint32: - return 4, true - case reflect.Uint64: - return 8, true - default: - return 0, false - } -} - -// BoolFieldIndex is used to extract an boolean field from an object using -// reflection and builds an index on that field. -type BoolFieldIndex struct { - Field string -} - -func (i *BoolFieldIndex) FromObject(obj interface{}) (bool, []byte, error) { - v := reflect.ValueOf(obj) - v = reflect.Indirect(v) // Dereference the pointer if any - - fv := v.FieldByName(i.Field) - if !fv.IsValid() { - return false, nil, - fmt.Errorf("field '%s' for %#v is invalid", i.Field, obj) - } - - // Check the type - k := fv.Kind() - if k != reflect.Bool { - return false, nil, fmt.Errorf("field %q is of type %v; want a bool", i.Field, k) - } - - // Get the value and encode it - buf := make([]byte, 1) - if fv.Bool() { - buf[0] = 1 - } - - return true, buf, nil -} - -func (i *BoolFieldIndex) FromArgs(args ...interface{}) ([]byte, error) { - return fromBoolArgs(args) -} - -// UUIDFieldIndex is used to extract a field from an object -// using reflection and builds an index on that field by treating -// it as a UUID. This is an optimization to using a StringFieldIndex -// as the UUID can be more compactly represented in byte form. -type UUIDFieldIndex struct { - Field string -} - -func (u *UUIDFieldIndex) FromObject(obj interface{}) (bool, []byte, error) { - v := reflect.ValueOf(obj) - v = reflect.Indirect(v) // Dereference the pointer if any - - fv := v.FieldByName(u.Field) - if !fv.IsValid() { - return false, nil, - fmt.Errorf("field '%s' for %#v is invalid", u.Field, obj) - } - - val := fv.String() - if val == "" { - return false, nil, nil - } - - buf, err := u.parseString(val, true) - return true, buf, err -} - -func (u *UUIDFieldIndex) FromArgs(args ...interface{}) ([]byte, error) { - if len(args) != 1 { - return nil, fmt.Errorf("must provide only a single argument") - } - switch arg := args[0].(type) { - case string: - return u.parseString(arg, true) - case []byte: - if len(arg) != 16 { - return nil, fmt.Errorf("byte slice must be 16 characters") - } - return arg, nil - default: - return nil, - fmt.Errorf("argument must be a string or byte slice: %#v", args[0]) - } -} - -func (u *UUIDFieldIndex) PrefixFromArgs(args ...interface{}) ([]byte, error) { - if len(args) != 1 { - return nil, fmt.Errorf("must provide only a single argument") - } - switch arg := args[0].(type) { - case string: - return u.parseString(arg, false) - case []byte: - return arg, nil - default: - return nil, - fmt.Errorf("argument must be a string or byte slice: %#v", args[0]) - } -} - -// parseString parses a UUID from the string. If enforceLength is false, it will -// parse a partial UUID. An error is returned if the input, stripped of hyphens, -// is not even length. -func (u *UUIDFieldIndex) parseString(s string, enforceLength bool) ([]byte, error) { - // Verify the length - l := len(s) - if enforceLength && l != 36 { - return nil, fmt.Errorf("UUID must be 36 characters") - } else if l > 36 { - return nil, fmt.Errorf("Invalid UUID length. UUID have 36 characters; got %d", l) - } - - hyphens := strings.Count(s, "-") - if hyphens > 4 { - return nil, fmt.Errorf(`UUID should have maximum of 4 "-"; got %d`, hyphens) - } - - // The sanitized length is the length of the original string without the "-". - sanitized := strings.Replace(s, "-", "", -1) - sanitizedLength := len(sanitized) - if sanitizedLength%2 != 0 { - return nil, fmt.Errorf("Input (without hyphens) must be even length") - } - - dec, err := hex.DecodeString(sanitized) - if err != nil { - return nil, fmt.Errorf("Invalid UUID: %v", err) - } - - return dec, nil -} - -// FieldSetIndex is used to extract a field from an object using reflection and -// builds an index on whether the field is set by comparing it against its -// type's nil value. -type FieldSetIndex struct { - Field string -} - -func (f *FieldSetIndex) FromObject(obj interface{}) (bool, []byte, error) { - v := reflect.ValueOf(obj) - v = reflect.Indirect(v) // Dereference the pointer if any - - fv := v.FieldByName(f.Field) - if !fv.IsValid() { - return false, nil, - fmt.Errorf("field '%s' for %#v is invalid", f.Field, obj) - } - - if fv.Interface() == reflect.Zero(fv.Type()).Interface() { - return true, []byte{0}, nil - } - - return true, []byte{1}, nil -} - -func (f *FieldSetIndex) FromArgs(args ...interface{}) ([]byte, error) { - return fromBoolArgs(args) -} - -// ConditionalIndex builds an index based on a condition specified by a passed -// user function. This function may examine the passed object and return a -// boolean to encapsulate an arbitrarily complex conditional. -type ConditionalIndex struct { - Conditional ConditionalIndexFunc -} - -// ConditionalIndexFunc is the required function interface for a -// ConditionalIndex. -type ConditionalIndexFunc func(obj interface{}) (bool, error) - -func (c *ConditionalIndex) FromObject(obj interface{}) (bool, []byte, error) { - // Call the user's function - res, err := c.Conditional(obj) - if err != nil { - return false, nil, fmt.Errorf("ConditionalIndexFunc(%#v) failed: %v", obj, err) - } - - if res { - return true, []byte{1}, nil - } - - return true, []byte{0}, nil -} - -func (c *ConditionalIndex) FromArgs(args ...interface{}) ([]byte, error) { - return fromBoolArgs(args) -} - -// fromBoolArgs is a helper that expects only a single boolean argument and -// returns a single length byte array containing either a one or zero depending -// on whether the passed input is true or false respectively. -func fromBoolArgs(args []interface{}) ([]byte, error) { - if len(args) != 1 { - return nil, fmt.Errorf("must provide only a single argument") - } - - if val, ok := args[0].(bool); !ok { - return nil, fmt.Errorf("argument must be a boolean type: %#v", args[0]) - } else if val { - return []byte{1}, nil - } - - return []byte{0}, nil -} - -// CompoundIndex is used to build an index using multiple sub-indexes -// Prefix based iteration is supported as long as the appropriate prefix -// of indexers support it. All sub-indexers are only assumed to expect -// a single argument. -type CompoundIndex struct { - Indexes []Indexer - - // AllowMissing results in an index based on only the indexers - // that return data. If true, you may end up with 2/3 columns - // indexed which might be useful for an index scan. Otherwise, - // the CompoundIndex requires all indexers to be satisfied. - AllowMissing bool -} - -func (c *CompoundIndex) FromObject(raw interface{}) (bool, []byte, error) { - var out []byte - for i, idxRaw := range c.Indexes { - idx, ok := idxRaw.(SingleIndexer) - if !ok { - return false, nil, fmt.Errorf("sub-index %d error: %s", i, "sub-index must be a SingleIndexer") - } - ok, val, err := idx.FromObject(raw) - if err != nil { - return false, nil, fmt.Errorf("sub-index %d error: %v", i, err) - } - if !ok { - if c.AllowMissing { - break - } else { - return false, nil, nil - } - } - out = append(out, val...) - } - return true, out, nil -} - -func (c *CompoundIndex) FromArgs(args ...interface{}) ([]byte, error) { - if len(args) != len(c.Indexes) { - return nil, fmt.Errorf("non-equivalent argument count and index fields") - } - var out []byte - for i, arg := range args { - val, err := c.Indexes[i].FromArgs(arg) - if err != nil { - return nil, fmt.Errorf("sub-index %d error: %v", i, err) - } - out = append(out, val...) - } - return out, nil -} - -func (c *CompoundIndex) PrefixFromArgs(args ...interface{}) ([]byte, error) { - if len(args) > len(c.Indexes) { - return nil, fmt.Errorf("more arguments than index fields") - } - var out []byte - for i, arg := range args { - if i+1 < len(args) { - val, err := c.Indexes[i].FromArgs(arg) - if err != nil { - return nil, fmt.Errorf("sub-index %d error: %v", i, err) - } - out = append(out, val...) - } else { - prefixIndexer, ok := c.Indexes[i].(PrefixIndexer) - if !ok { - return nil, fmt.Errorf("sub-index %d does not support prefix scanning", i) - } - val, err := prefixIndexer.PrefixFromArgs(arg) - if err != nil { - return nil, fmt.Errorf("sub-index %d error: %v", i, err) - } - out = append(out, val...) - } - } - return out, nil -} - -// CompoundMultiIndex is used to build an index using multiple -// sub-indexes. -// -// Unlike CompoundIndex, CompoundMultiIndex can have both -// SingleIndexer and MultiIndexer sub-indexers. However, each -// MultiIndexer adds considerable overhead/complexity in terms of -// the number of indexes created under-the-hood. It is not suggested -// to use more than one or two, if possible. -// -// Another change from CompoundIndexer is that if AllowMissing is -// set, not only is it valid to have empty index fields, but it will -// still create index values up to the first empty index. This means -// that if you have a value with an empty field, rather than using a -// prefix for lookup, you can simply pass in less arguments. As an -// example, if {Foo, Bar} is indexed but Bar is missing for a value -// and AllowMissing is set, an index will still be created for {Foo} -// and it is valid to do a lookup passing in only Foo as an argument. -// Note that the ordering isn't guaranteed -- it's last-insert wins, -// but this is true if you have two objects that have the same -// indexes not using AllowMissing anyways. -// -// Because StringMapFieldIndexers can take a varying number of args, -// it is currently a requirement that whenever it is used, two -// arguments must _always_ be provided for it. In theory we only -// need one, except a bug in that indexer means the single-argument -// version will never work. You can leave the second argument nil, -// but it will never produce a value. We support this for whenever -// that bug is fixed, likely in a next major version bump. -// -// Prefix-based indexing is not currently supported. -type CompoundMultiIndex struct { - Indexes []Indexer - - // AllowMissing results in an index based on only the indexers - // that return data. If true, you may end up with 2/3 columns - // indexed which might be useful for an index scan. Otherwise, - // CompoundMultiIndex requires all indexers to be satisfied. - AllowMissing bool -} - -func (c *CompoundMultiIndex) FromObject(raw interface{}) (bool, [][]byte, error) { - // At each entry, builder is storing the results from the next index - builder := make([][][]byte, 0, len(c.Indexes)) - -forloop: - // This loop goes through each indexer and adds the value(s) provided to the next - // entry in the slice. We can then later walk it like a tree to construct the indices. - for i, idxRaw := range c.Indexes { - switch idx := idxRaw.(type) { - case SingleIndexer: - ok, val, err := idx.FromObject(raw) - if err != nil { - return false, nil, fmt.Errorf("single sub-index %d error: %v", i, err) - } - if !ok { - if c.AllowMissing { - break forloop - } else { - return false, nil, nil - } - } - builder = append(builder, [][]byte{val}) - - case MultiIndexer: - ok, vals, err := idx.FromObject(raw) - if err != nil { - return false, nil, fmt.Errorf("multi sub-index %d error: %v", i, err) - } - if !ok { - if c.AllowMissing { - break forloop - } else { - return false, nil, nil - } - } - - // Add each of the new values to each of the old values - builder = append(builder, vals) - - default: - return false, nil, fmt.Errorf("sub-index %d does not satisfy either SingleIndexer or MultiIndexer", i) - } - } - - // Start with something higher to avoid resizing if possible - out := make([][]byte, 0, len(c.Indexes)^3) - - // We are walking through the builder slice essentially in a depth-first fashion, - // building the prefix and leaves as we go. If AllowMissing is false, we only insert - // these full paths to leaves. Otherwise, we also insert each prefix along the way. - // This allows for lookup in FromArgs when AllowMissing is true that does not contain - // the full set of arguments. e.g. for {Foo, Bar} where an object has only the Foo - // field specified as "abc", it is valid to call FromArgs with just "abc". - var walkVals func([]byte, int) - walkVals = func(currPrefix []byte, depth int) { - if depth >= len(builder) { - return - } - - if depth == len(builder)-1 { - // These are the "leaves", so append directly - for _, v := range builder[depth] { - outcome := make([]byte, len(currPrefix)) - copy(outcome, currPrefix) - out = append(out, append(outcome, v...)) - } - return - } - for _, v := range builder[depth] { - nextPrefix := append(currPrefix, v...) - if c.AllowMissing { - out = append(out, nextPrefix) - } - walkVals(nextPrefix, depth+1) - } - } - - walkVals(nil, 0) - - return true, out, nil -} - -func (c *CompoundMultiIndex) FromArgs(args ...interface{}) ([]byte, error) { - var stringMapCount int - var argCount int - for _, index := range c.Indexes { - if argCount >= len(args) { - break - } - if _, ok := index.(*StringMapFieldIndex); ok { - // We require pairs for StringMapFieldIndex, but only got one - if argCount+1 >= len(args) { - return nil, errors.New("invalid number of arguments") - } - stringMapCount++ - argCount += 2 - } else { - argCount++ - } - } - argCount = 0 - - switch c.AllowMissing { - case true: - if len(args) > len(c.Indexes)+stringMapCount { - return nil, errors.New("too many arguments") - } - - default: - if len(args) != len(c.Indexes)+stringMapCount { - return nil, errors.New("number of arguments does not equal number of indexers") - } - } - - var out []byte - var val []byte - var err error - for i, idx := range c.Indexes { - if argCount >= len(args) { - // We're done; should only hit this if AllowMissing - break - } - if _, ok := idx.(*StringMapFieldIndex); ok { - if args[argCount+1] == nil { - val, err = idx.FromArgs(args[argCount]) - } else { - val, err = idx.FromArgs(args[argCount : argCount+2]...) - } - argCount += 2 - } else { - val, err = idx.FromArgs(args[argCount]) - argCount++ - } - if err != nil { - return nil, fmt.Errorf("sub-index %d error: %v", i, err) - } - out = append(out, val...) - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-memdb/memdb.go b/vendor/github.com/hashicorp/go-memdb/memdb.go deleted file mode 100644 index 13cc6a8ca0..0000000000 --- a/vendor/github.com/hashicorp/go-memdb/memdb.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -// Package memdb provides an in-memory database that supports transactions -// and MVCC. -package memdb - -import ( - "sync" - "sync/atomic" - "unsafe" - - "github.com/hashicorp/go-immutable-radix" -) - -// MemDB is an in-memory database providing Atomicity, Consistency, and -// Isolation from ACID. MemDB doesn't provide Durability since it is an -// in-memory database. -// -// MemDB provides a table abstraction to store objects (rows) with multiple -// indexes based on inserted values. The database makes use of immutable radix -// trees to provide transactions and MVCC. -// -// Objects inserted into MemDB are not copied. It is **extremely important** -// that objects are not modified in-place after they are inserted since they -// are stored directly in MemDB. It remains unsafe to modify inserted objects -// even after they've been deleted from MemDB since there may still be older -// snapshots of the DB being read from other goroutines. -type MemDB struct { - schema *DBSchema - root unsafe.Pointer // *iradix.Tree underneath - primary bool - - // There can only be a single writer at once - writer sync.Mutex -} - -// NewMemDB creates a new MemDB with the given schema. -func NewMemDB(schema *DBSchema) (*MemDB, error) { - // Validate the schema - if err := schema.Validate(); err != nil { - return nil, err - } - - // Create the MemDB - db := &MemDB{ - schema: schema, - root: unsafe.Pointer(iradix.New()), - primary: true, - } - if err := db.initialize(); err != nil { - return nil, err - } - - return db, nil -} - -// DBSchema returns schema in use for introspection. -// -// The method is intended for *read-only* debugging use cases, -// returned schema should *never be modified in-place*. -func (db *MemDB) DBSchema() *DBSchema { - return db.schema -} - -// getRoot is used to do an atomic load of the root pointer -func (db *MemDB) getRoot() *iradix.Tree { - root := (*iradix.Tree)(atomic.LoadPointer(&db.root)) - return root -} - -// Txn is used to start a new transaction in either read or write mode. -// There can only be a single concurrent writer, but any number of readers. -func (db *MemDB) Txn(write bool) *Txn { - if write { - db.writer.Lock() - } - txn := &Txn{ - db: db, - write: write, - rootTxn: db.getRoot().Txn(), - } - return txn -} - -// Snapshot is used to capture a point-in-time snapshot of the database that -// will not be affected by any write operations to the existing DB. -// -// If MemDB is storing reference-based values (pointers, maps, slices, etc.), -// the Snapshot will not deep copy those values. Therefore, it is still unsafe -// to modify any inserted values in either DB. -func (db *MemDB) Snapshot() *MemDB { - clone := &MemDB{ - schema: db.schema, - root: unsafe.Pointer(db.getRoot()), - primary: false, - } - return clone -} - -// initialize is used to setup the DB for use after creation. This should -// be called only once after allocating a MemDB. -func (db *MemDB) initialize() error { - root := db.getRoot() - for tName, tableSchema := range db.schema.Tables { - for iName := range tableSchema.Indexes { - index := iradix.New() - path := indexPath(tName, iName) - root, _, _ = root.Insert(path, index) - } - } - db.root = unsafe.Pointer(root) - return nil -} - -// indexPath returns the path from the root to the given table index -func indexPath(table, index string) []byte { - return []byte(table + "." + index) -} diff --git a/vendor/github.com/hashicorp/go-memdb/schema.go b/vendor/github.com/hashicorp/go-memdb/schema.go deleted file mode 100644 index 2d66f996d3..0000000000 --- a/vendor/github.com/hashicorp/go-memdb/schema.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package memdb - -import "fmt" - -// DBSchema is the schema to use for the full database with a MemDB instance. -// -// MemDB will require a valid schema. Schema validation can be tested using -// the Validate function. Calling this function is recommended in unit tests. -type DBSchema struct { - // Tables is the set of tables within this database. The key is the - // table name and must match the Name in TableSchema. - Tables map[string]*TableSchema -} - -// Validate validates the schema. -func (s *DBSchema) Validate() error { - if s == nil { - return fmt.Errorf("schema is nil") - } - - if len(s.Tables) == 0 { - return fmt.Errorf("schema has no tables defined") - } - - for name, table := range s.Tables { - if name != table.Name { - return fmt.Errorf("table name mis-match for '%s'", name) - } - - if err := table.Validate(); err != nil { - return fmt.Errorf("table %q: %s", name, err) - } - } - - return nil -} - -// TableSchema is the schema for a single table. -type TableSchema struct { - // Name of the table. This must match the key in the Tables map in DBSchema. - Name string - - // Indexes is the set of indexes for querying this table. The key - // is a unique name for the index and must match the Name in the - // IndexSchema. - Indexes map[string]*IndexSchema -} - -// Validate is used to validate the table schema -func (s *TableSchema) Validate() error { - if s.Name == "" { - return fmt.Errorf("missing table name") - } - - if len(s.Indexes) == 0 { - return fmt.Errorf("missing table indexes for '%s'", s.Name) - } - - if _, ok := s.Indexes["id"]; !ok { - return fmt.Errorf("must have id index") - } - - if !s.Indexes["id"].Unique { - return fmt.Errorf("id index must be unique") - } - - if _, ok := s.Indexes["id"].Indexer.(SingleIndexer); !ok { - return fmt.Errorf("id index must be a SingleIndexer") - } - - for name, index := range s.Indexes { - if name != index.Name { - return fmt.Errorf("index name mis-match for '%s'", name) - } - - if err := index.Validate(); err != nil { - return fmt.Errorf("index %q: %s", name, err) - } - } - - return nil -} - -// IndexSchema is the schema for an index. An index defines how a table is -// queried. -type IndexSchema struct { - // Name of the index. This must be unique among a tables set of indexes. - // This must match the key in the map of Indexes for a TableSchema. - Name string - - // AllowMissing if true ignores this index if it doesn't produce a - // value. For example, an index that extracts a field that doesn't - // exist from a structure. - AllowMissing bool - - Unique bool - Indexer Indexer -} - -func (s *IndexSchema) Validate() error { - if s.Name == "" { - return fmt.Errorf("missing index name") - } - if s.Indexer == nil { - return fmt.Errorf("missing index function for '%s'", s.Name) - } - switch s.Indexer.(type) { - case SingleIndexer: - case MultiIndexer: - default: - return fmt.Errorf("indexer for '%s' must be a SingleIndexer or MultiIndexer", s.Name) - } - return nil -} diff --git a/vendor/github.com/hashicorp/go-memdb/txn.go b/vendor/github.com/hashicorp/go-memdb/txn.go deleted file mode 100644 index f83f4fab25..0000000000 --- a/vendor/github.com/hashicorp/go-memdb/txn.go +++ /dev/null @@ -1,1024 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package memdb - -import ( - "bytes" - "fmt" - "strings" - "sync/atomic" - "unsafe" - - iradix "github.com/hashicorp/go-immutable-radix" -) - -const ( - id = "id" -) - -var ( - // ErrNotFound is returned when the requested item is not found - ErrNotFound = fmt.Errorf("not found") -) - -// tableIndex is a tuple of (Table, Index) used for lookups -type tableIndex struct { - Table string - Index string -} - -// Txn is a transaction against a MemDB. -// This can be a read or write transaction. -type Txn struct { - db *MemDB - write bool - rootTxn *iradix.Txn - after []func() - - // changes is used to track the changes performed during the transaction. If - // it is nil at transaction start then changes are not tracked. - changes Changes - - modified map[tableIndex]*iradix.Txn -} - -// TrackChanges enables change tracking for the transaction. If called at any -// point before commit, subsequent mutations will be recorded and can be -// retrieved using ChangeSet. Once this has been called on a transaction it -// can't be unset. As with other Txn methods it's not safe to call this from a -// different goroutine than the one making mutations or committing the -// transaction. -func (txn *Txn) TrackChanges() { - if txn.changes == nil { - txn.changes = make(Changes, 0, 1) - } -} - -// readableIndex returns a transaction usable for reading the given index in a -// table. If the transaction is a write transaction with modifications, a clone of the -// modified index will be returned. -func (txn *Txn) readableIndex(table, index string) *iradix.Txn { - // Look for existing transaction - if txn.write && txn.modified != nil { - key := tableIndex{table, index} - exist, ok := txn.modified[key] - if ok { - return exist.Clone() - } - } - - // Create a read transaction - path := indexPath(table, index) - raw, _ := txn.rootTxn.Get(path) - indexTxn := raw.(*iradix.Tree).Txn() - return indexTxn -} - -// writableIndex returns a transaction usable for modifying the -// given index in a table. -func (txn *Txn) writableIndex(table, index string) *iradix.Txn { - if txn.modified == nil { - txn.modified = make(map[tableIndex]*iradix.Txn) - } - - // Look for existing transaction - key := tableIndex{table, index} - exist, ok := txn.modified[key] - if ok { - return exist - } - - // Start a new transaction - path := indexPath(table, index) - raw, _ := txn.rootTxn.Get(path) - indexTxn := raw.(*iradix.Tree).Txn() - - // If we are the primary DB, enable mutation tracking. Snapshots should - // not notify, otherwise we will trigger watches on the primary DB when - // the writes will not be visible. - indexTxn.TrackMutate(txn.db.primary) - - // Keep this open for the duration of the txn - txn.modified[key] = indexTxn - return indexTxn -} - -// Abort is used to cancel this transaction. -// This is a noop for read transactions, -// already aborted or commited transactions. -func (txn *Txn) Abort() { - // Noop for a read transaction - if !txn.write { - return - } - - // Check if already aborted or committed - if txn.rootTxn == nil { - return - } - - // Clear the txn - txn.rootTxn = nil - txn.modified = nil - txn.changes = nil - - // Release the writer lock since this is invalid - txn.db.writer.Unlock() -} - -// Commit is used to finalize this transaction. -// This is a noop for read transactions, -// already aborted or committed transactions. -func (txn *Txn) Commit() { - // Noop for a read transaction - if !txn.write { - return - } - - // Check if already aborted or committed - if txn.rootTxn == nil { - return - } - - // Commit each sub-transaction scoped to (table, index) - for key, subTxn := range txn.modified { - path := indexPath(key.Table, key.Index) - final := subTxn.CommitOnly() - txn.rootTxn.Insert(path, final) - } - - // Update the root of the DB - newRoot := txn.rootTxn.CommitOnly() - atomic.StorePointer(&txn.db.root, unsafe.Pointer(newRoot)) - - // Now issue all of the mutation updates (this is safe to call - // even if mutation tracking isn't enabled); we do this after - // the root pointer is swapped so that waking responders will - // see the new state. - for _, subTxn := range txn.modified { - subTxn.Notify() - } - txn.rootTxn.Notify() - - // Clear the txn - txn.rootTxn = nil - txn.modified = nil - - // Release the writer lock since this is invalid - txn.db.writer.Unlock() - - // Run the deferred functions, if any - for i := len(txn.after); i > 0; i-- { - fn := txn.after[i-1] - fn() - } -} - -// Insert is used to add or update an object into the given table. -// -// When updating an object, the obj provided should be a copy rather -// than a value updated in-place. Modifying values in-place that are already -// inserted into MemDB is not supported behavior. -func (txn *Txn) Insert(table string, obj interface{}) error { - if !txn.write { - return fmt.Errorf("cannot insert in read-only transaction") - } - - // Get the table schema - tableSchema, ok := txn.db.schema.Tables[table] - if !ok { - return fmt.Errorf("invalid table '%s'", table) - } - - // Get the primary ID of the object - idSchema := tableSchema.Indexes[id] - idIndexer := idSchema.Indexer.(SingleIndexer) - ok, idVal, err := idIndexer.FromObject(obj) - if err != nil { - return fmt.Errorf("failed to build primary index: %v", err) - } - if !ok { - return fmt.Errorf("object missing primary index") - } - - // Lookup the object by ID first, to see if this is an update - idTxn := txn.writableIndex(table, id) - existing, update := idTxn.Get(idVal) - - // On an update, there is an existing object with the given - // primary ID. We do the update by deleting the current object - // and inserting the new object. - for name, indexSchema := range tableSchema.Indexes { - indexTxn := txn.writableIndex(table, name) - - // Determine the new index value - var ( - ok bool - vals [][]byte - err error - ) - switch indexer := indexSchema.Indexer.(type) { - case SingleIndexer: - var val []byte - ok, val, err = indexer.FromObject(obj) - vals = [][]byte{val} - case MultiIndexer: - ok, vals, err = indexer.FromObject(obj) - } - if err != nil { - return fmt.Errorf("failed to build index '%s': %v", name, err) - } - - // Handle non-unique index by computing a unique index. - // This is done by appending the primary key which must - // be unique anyways. - if ok && !indexSchema.Unique { - for i := range vals { - vals[i] = append(vals[i], idVal...) - } - } - - // Handle the update by deleting from the index first - if update { - var ( - okExist bool - valsExist [][]byte - err error - ) - switch indexer := indexSchema.Indexer.(type) { - case SingleIndexer: - var valExist []byte - okExist, valExist, err = indexer.FromObject(existing) - valsExist = [][]byte{valExist} - case MultiIndexer: - okExist, valsExist, err = indexer.FromObject(existing) - } - if err != nil { - return fmt.Errorf("failed to build index '%s': %v", name, err) - } - if okExist { - for i, valExist := range valsExist { - // Handle non-unique index by computing a unique index. - // This is done by appending the primary key which must - // be unique anyways. - if !indexSchema.Unique { - valExist = append(valExist, idVal...) - } - - // If we are writing to the same index with the same value, - // we can avoid the delete as the insert will overwrite the - // value anyways. - if i >= len(vals) || !bytes.Equal(valExist, vals[i]) { - indexTxn.Delete(valExist) - } - } - } - } - - // If there is no index value, either this is an error or an expected - // case and we can skip updating - if !ok { - if indexSchema.AllowMissing { - continue - } else { - return fmt.Errorf("missing value for index '%s'", name) - } - } - - // Update the value of the index - for _, val := range vals { - indexTxn.Insert(val, obj) - } - } - if txn.changes != nil { - txn.changes = append(txn.changes, Change{ - Table: table, - Before: existing, // might be nil on a create - After: obj, - primaryKey: idVal, - }) - } - return nil -} - -// Delete is used to delete a single object from the given table. -// This object must already exist in the table. -func (txn *Txn) Delete(table string, obj interface{}) error { - if !txn.write { - return fmt.Errorf("cannot delete in read-only transaction") - } - - // Get the table schema - tableSchema, ok := txn.db.schema.Tables[table] - if !ok { - return fmt.Errorf("invalid table '%s'", table) - } - - // Get the primary ID of the object - idSchema := tableSchema.Indexes[id] - idIndexer := idSchema.Indexer.(SingleIndexer) - ok, idVal, err := idIndexer.FromObject(obj) - if err != nil { - return fmt.Errorf("failed to build primary index: %v", err) - } - if !ok { - return fmt.Errorf("object missing primary index") - } - - // Lookup the object by ID first, check if we should continue - idTxn := txn.writableIndex(table, id) - existing, ok := idTxn.Get(idVal) - if !ok { - return ErrNotFound - } - - // Remove the object from all the indexes - for name, indexSchema := range tableSchema.Indexes { - indexTxn := txn.writableIndex(table, name) - - // Handle the update by deleting from the index first - var ( - ok bool - vals [][]byte - err error - ) - switch indexer := indexSchema.Indexer.(type) { - case SingleIndexer: - var val []byte - ok, val, err = indexer.FromObject(existing) - vals = [][]byte{val} - case MultiIndexer: - ok, vals, err = indexer.FromObject(existing) - } - if err != nil { - return fmt.Errorf("failed to build index '%s': %v", name, err) - } - if ok { - // Handle non-unique index by computing a unique index. - // This is done by appending the primary key which must - // be unique anyways. - for _, val := range vals { - if !indexSchema.Unique { - val = append(val, idVal...) - } - indexTxn.Delete(val) - } - } - } - if txn.changes != nil { - txn.changes = append(txn.changes, Change{ - Table: table, - Before: existing, - After: nil, // Now nil indicates deletion - primaryKey: idVal, - }) - } - return nil -} - -// DeletePrefix is used to delete an entire subtree based on a prefix. -// The given index must be a prefix index, and will be used to perform a scan and enumerate the set of objects to delete. -// These will be removed from all other indexes, and then a special prefix operation will delete the objects from the given index in an efficient subtree delete operation. -// This is useful when you have a very large number of objects indexed by the given index, along with a much smaller number of entries in the other indexes for those objects. -func (txn *Txn) DeletePrefix(table string, prefix_index string, prefix string) (bool, error) { - if !txn.write { - return false, fmt.Errorf("cannot delete in read-only transaction") - } - - if !strings.HasSuffix(prefix_index, "_prefix") { - return false, fmt.Errorf("Index name for DeletePrefix must be a prefix index, Got %v ", prefix_index) - } - - deletePrefixIndex := strings.TrimSuffix(prefix_index, "_prefix") - - // Get an iterator over all of the keys with the given prefix. - entries, err := txn.Get(table, prefix_index, prefix) - if err != nil { - return false, fmt.Errorf("failed kvs lookup: %s", err) - } - // Get the table schema - tableSchema, ok := txn.db.schema.Tables[table] - if !ok { - return false, fmt.Errorf("invalid table '%s'", table) - } - - foundAny := false - for entry := entries.Next(); entry != nil; entry = entries.Next() { - if !foundAny { - foundAny = true - } - // Get the primary ID of the object - idSchema := tableSchema.Indexes[id] - idIndexer := idSchema.Indexer.(SingleIndexer) - ok, idVal, err := idIndexer.FromObject(entry) - if err != nil { - return false, fmt.Errorf("failed to build primary index: %v", err) - } - if !ok { - return false, fmt.Errorf("object missing primary index") - } - if txn.changes != nil { - // Record the deletion - idTxn := txn.writableIndex(table, id) - existing, ok := idTxn.Get(idVal) - if ok { - txn.changes = append(txn.changes, Change{ - Table: table, - Before: existing, - After: nil, // Now nil indicates deletion - primaryKey: idVal, - }) - } - } - // Remove the object from all the indexes except the given prefix index - for name, indexSchema := range tableSchema.Indexes { - if name == deletePrefixIndex { - continue - } - indexTxn := txn.writableIndex(table, name) - - // Handle the update by deleting from the index first - var ( - ok bool - vals [][]byte - err error - ) - switch indexer := indexSchema.Indexer.(type) { - case SingleIndexer: - var val []byte - ok, val, err = indexer.FromObject(entry) - vals = [][]byte{val} - case MultiIndexer: - ok, vals, err = indexer.FromObject(entry) - } - if err != nil { - return false, fmt.Errorf("failed to build index '%s': %v", name, err) - } - - if ok { - // Handle non-unique index by computing a unique index. - // This is done by appending the primary key which must - // be unique anyways. - for _, val := range vals { - if !indexSchema.Unique { - val = append(val, idVal...) - } - indexTxn.Delete(val) - } - } - } - - } - if foundAny { - indexTxn := txn.writableIndex(table, deletePrefixIndex) - ok = indexTxn.DeletePrefix([]byte(prefix)) - if !ok { - panic(fmt.Errorf("prefix %v matched some entries but DeletePrefix did not delete any ", prefix)) - } - return true, nil - } - return false, nil -} - -// DeleteAll is used to delete all the objects in a given table -// matching the constraints on the index -func (txn *Txn) DeleteAll(table, index string, args ...interface{}) (int, error) { - if !txn.write { - return 0, fmt.Errorf("cannot delete in read-only transaction") - } - - // Get all the objects - iter, err := txn.Get(table, index, args...) - if err != nil { - return 0, err - } - - // Put them into a slice so there are no safety concerns while actually - // performing the deletes - var objs []interface{} - for { - obj := iter.Next() - if obj == nil { - break - } - - objs = append(objs, obj) - } - - // Do the deletes - num := 0 - for _, obj := range objs { - if err := txn.Delete(table, obj); err != nil { - return num, err - } - num++ - } - return num, nil -} - -// FirstWatch is used to return the first matching object for -// the given constraints on the index along with the watch channel. -// -// Note that all values read in the transaction form a consistent snapshot -// from the time when the transaction was created. -// -// The watch channel is closed when a subsequent write transaction -// has updated the result of the query. Since each read transaction -// operates on an isolated snapshot, a new read transaction must be -// started to observe the changes that have been made. -// -// If the value of index ends with "_prefix", FirstWatch will perform a prefix -// match instead of full match on the index. The registered indexer must implement -// PrefixIndexer, otherwise an error is returned. -func (txn *Txn) FirstWatch(table, index string, args ...interface{}) (<-chan struct{}, interface{}, error) { - // Get the index value - indexSchema, val, err := txn.getIndexValue(table, index, args...) - if err != nil { - return nil, nil, err - } - - // Get the index itself - indexTxn := txn.readableIndex(table, indexSchema.Name) - - // Do an exact lookup - if indexSchema.Unique && val != nil && indexSchema.Name == index { - watch, obj, ok := indexTxn.GetWatch(val) - if !ok { - return watch, nil, nil - } - return watch, obj, nil - } - - // Handle non-unique index by using an iterator and getting the first value - iter := indexTxn.Root().Iterator() - watch := iter.SeekPrefixWatch(val) - _, value, _ := iter.Next() - return watch, value, nil -} - -// LastWatch is used to return the last matching object for -// the given constraints on the index along with the watch channel. -// -// Note that all values read in the transaction form a consistent snapshot -// from the time when the transaction was created. -// -// The watch channel is closed when a subsequent write transaction -// has updated the result of the query. Since each read transaction -// operates on an isolated snapshot, a new read transaction must be -// started to observe the changes that have been made. -// -// If the value of index ends with "_prefix", LastWatch will perform a prefix -// match instead of full match on the index. The registered indexer must implement -// PrefixIndexer, otherwise an error is returned. -func (txn *Txn) LastWatch(table, index string, args ...interface{}) (<-chan struct{}, interface{}, error) { - // Get the index value - indexSchema, val, err := txn.getIndexValue(table, index, args...) - if err != nil { - return nil, nil, err - } - - // Get the index itself - indexTxn := txn.readableIndex(table, indexSchema.Name) - - // Do an exact lookup - if indexSchema.Unique && val != nil && indexSchema.Name == index { - watch, obj, ok := indexTxn.GetWatch(val) - if !ok { - return watch, nil, nil - } - return watch, obj, nil - } - - // Handle non-unique index by using an iterator and getting the last value - iter := indexTxn.Root().ReverseIterator() - watch := iter.SeekPrefixWatch(val) - _, value, _ := iter.Previous() - return watch, value, nil -} - -// First is used to return the first matching object for -// the given constraints on the index. -// -// Note that all values read in the transaction form a consistent snapshot -// from the time when the transaction was created. -func (txn *Txn) First(table, index string, args ...interface{}) (interface{}, error) { - _, val, err := txn.FirstWatch(table, index, args...) - return val, err -} - -// Last is used to return the last matching object for -// the given constraints on the index. -// -// Note that all values read in the transaction form a consistent snapshot -// from the time when the transaction was created. -func (txn *Txn) Last(table, index string, args ...interface{}) (interface{}, error) { - _, val, err := txn.LastWatch(table, index, args...) - return val, err -} - -// LongestPrefix is used to fetch the longest prefix match for the given -// constraints on the index. Note that this will not work with the memdb -// StringFieldIndex because it adds null terminators which prevent the -// algorithm from correctly finding a match (it will get to right before the -// null and fail to find a leaf node). This should only be used where the prefix -// given is capable of matching indexed entries directly, which typically only -// applies to a custom indexer. See the unit test for an example. -// -// Note that all values read in the transaction form a consistent snapshot -// from the time when the transaction was created. -func (txn *Txn) LongestPrefix(table, index string, args ...interface{}) (interface{}, error) { - // Enforce that this only works on prefix indexes. - if !strings.HasSuffix(index, "_prefix") { - return nil, fmt.Errorf("must use '%s_prefix' on index", index) - } - - // Get the index value. - indexSchema, val, err := txn.getIndexValue(table, index, args...) - if err != nil { - return nil, err - } - - // This algorithm only makes sense against a unique index, otherwise the - // index keys will have the IDs appended to them. - if !indexSchema.Unique { - return nil, fmt.Errorf("index '%s' is not unique", index) - } - - // Find the longest prefix match with the given index. - indexTxn := txn.readableIndex(table, indexSchema.Name) - if _, value, ok := indexTxn.Root().LongestPrefix(val); ok { - return value, nil - } - return nil, nil -} - -// getIndexValue is used to get the IndexSchema and the value -// used to scan the index given the parameters. This handles prefix based -// scans when the index has the "_prefix" suffix. The index must support -// prefix iteration. -func (txn *Txn) getIndexValue(table, index string, args ...interface{}) (*IndexSchema, []byte, error) { - // Get the table schema - tableSchema, ok := txn.db.schema.Tables[table] - if !ok { - return nil, nil, fmt.Errorf("invalid table '%s'", table) - } - - // Check for a prefix scan - prefixScan := false - if strings.HasSuffix(index, "_prefix") { - index = strings.TrimSuffix(index, "_prefix") - prefixScan = true - } - - // Get the index schema - indexSchema, ok := tableSchema.Indexes[index] - if !ok { - return nil, nil, fmt.Errorf("invalid index '%s'", index) - } - - // Hot-path for when there are no arguments - if len(args) == 0 { - return indexSchema, nil, nil - } - - // Special case the prefix scanning - if prefixScan { - prefixIndexer, ok := indexSchema.Indexer.(PrefixIndexer) - if !ok { - return indexSchema, nil, - fmt.Errorf("index '%s' does not support prefix scanning", index) - } - - val, err := prefixIndexer.PrefixFromArgs(args...) - if err != nil { - return indexSchema, nil, fmt.Errorf("index error: %v", err) - } - return indexSchema, val, err - } - - // Get the exact match index - val, err := indexSchema.Indexer.FromArgs(args...) - if err != nil { - return indexSchema, nil, fmt.Errorf("index error: %v", err) - } - return indexSchema, val, err -} - -// ResultIterator is used to iterate over a list of results from a query on a table. -// -// When a ResultIterator is created from a write transaction, the results from -// Next will reflect a snapshot of the table at the time the ResultIterator is -// created. -// This means that calling Insert or Delete on a transaction while iterating is -// allowed, but the changes made by Insert or Delete will not be observed in the -// results returned from subsequent calls to Next. For example if an item is deleted -// from the index used by the iterator it will still be returned by Next. If an -// item is inserted into the index used by the iterator, it will not be returned -// by Next. However, an iterator created after a call to Insert or Delete will -// reflect the modifications. -// -// When a ResultIterator is created from a write transaction, and there are already -// modifications to the index used by the iterator, the modification cache of the -// index will be invalidated. This may result in some additional allocations if -// the same node in the index is modified again. -type ResultIterator interface { - WatchCh() <-chan struct{} - // Next returns the next result from the iterator. If there are no more results - // nil is returned. - Next() interface{} -} - -// Get is used to construct a ResultIterator over all the rows that match the -// given constraints of an index. The index values must match exactly (this -// is not a range-based or prefix-based lookup) by default. -// -// Prefix lookups: if the named index implements PrefixIndexer, you may perform -// prefix-based lookups by appending "_prefix" to the index name. In this -// scenario, the index values given in args are treated as prefix lookups. For -// example, a StringFieldIndex will match any string with the given value -// as a prefix: "mem" matches "memdb". -// -// See the documentation for ResultIterator to understand the behaviour of the -// returned ResultIterator. -func (txn *Txn) Get(table, index string, args ...interface{}) (ResultIterator, error) { - indexIter, val, err := txn.getIndexIterator(table, index, args...) - if err != nil { - return nil, err - } - - // Seek the iterator to the appropriate sub-set - watchCh := indexIter.SeekPrefixWatch(val) - - // Create an iterator - iter := &radixIterator{ - iter: indexIter, - watchCh: watchCh, - } - return iter, nil -} - -// GetReverse is used to construct a Reverse ResultIterator over all the -// rows that match the given constraints of an index. -// The returned ResultIterator's Next() will return the next Previous value. -// -// See the documentation on Get for details on arguments. -// -// See the documentation for ResultIterator to understand the behaviour of the -// returned ResultIterator. -func (txn *Txn) GetReverse(table, index string, args ...interface{}) (ResultIterator, error) { - indexIter, val, err := txn.getIndexIteratorReverse(table, index, args...) - if err != nil { - return nil, err - } - - // Seek the iterator to the appropriate sub-set - watchCh := indexIter.SeekPrefixWatch(val) - - // Create an iterator - iter := &radixReverseIterator{ - iter: indexIter, - watchCh: watchCh, - } - return iter, nil -} - -// LowerBound is used to construct a ResultIterator over all the the range of -// rows that have an index value greater than or equal to the provide args. -// Calling this then iterating until the rows are larger than required allows -// range scans within an index. It is not possible to watch the resulting -// iterator since the radix tree doesn't efficiently allow watching on lower -// bound changes. The WatchCh returned will be nill and so will block forever. -// -// If the value of index ends with "_prefix", LowerBound will perform a prefix match instead of -// a full match on the index. The registered index must implement PrefixIndexer, -// otherwise an error is returned. -// -// See the documentation for ResultIterator to understand the behaviour of the -// returned ResultIterator. -func (txn *Txn) LowerBound(table, index string, args ...interface{}) (ResultIterator, error) { - indexIter, val, err := txn.getIndexIterator(table, index, args...) - if err != nil { - return nil, err - } - - // Seek the iterator to the appropriate sub-set - indexIter.SeekLowerBound(val) - - // Create an iterator - iter := &radixIterator{ - iter: indexIter, - } - return iter, nil -} - -// ReverseLowerBound is used to construct a Reverse ResultIterator over all the -// the range of rows that have an index value less than or equal to the -// provide args. Calling this then iterating until the rows are lower than -// required allows range scans within an index. It is not possible to watch the -// resulting iterator since the radix tree doesn't efficiently allow watching -// on lower bound changes. The WatchCh returned will be nill and so will block -// forever. -// -// See the documentation for ResultIterator to understand the behaviour of the -// returned ResultIterator. -func (txn *Txn) ReverseLowerBound(table, index string, args ...interface{}) (ResultIterator, error) { - indexIter, val, err := txn.getIndexIteratorReverse(table, index, args...) - if err != nil { - return nil, err - } - - // Seek the iterator to the appropriate sub-set - indexIter.SeekReverseLowerBound(val) - - // Create an iterator - iter := &radixReverseIterator{ - iter: indexIter, - } - return iter, nil -} - -// objectID is a tuple of table name and the raw internal id byte slice -// converted to a string. It's only converted to a string to make it comparable -// so this struct can be used as a map index. -type objectID struct { - Table string - IndexVal string -} - -// mutInfo stores metadata about mutations to allow collapsing multiple -// mutations to the same object into one. -type mutInfo struct { - firstBefore interface{} - lastIdx int -} - -// Changes returns the set of object changes that have been made in the -// transaction so far. If change tracking is not enabled it wil always return -// nil. It can be called before or after Commit. If it is before Commit it will -// return all changes made so far which may not be the same as the final -// Changes. After abort it will always return nil. As with other Txn methods -// it's not safe to call this from a different goroutine than the one making -// mutations or committing the transaction. Mutations will appear in the order -// they were performed in the transaction but multiple operations to the same -// object will be collapsed so only the effective overall change to that object -// is present. If transaction operations are dependent (e.g. copy object X to Y -// then delete X) this might mean the set of mutations is incomplete to verify -// history, but it is complete in that the net effect is preserved (Y got a new -// value, X got removed). -func (txn *Txn) Changes() Changes { - if txn.changes == nil { - return nil - } - - // De-duplicate mutations by key so all take effect at the point of the last - // write but we keep the mutations in order. - dups := make(map[objectID]mutInfo) - for i, m := range txn.changes { - oid := objectID{ - Table: m.Table, - IndexVal: string(m.primaryKey), - } - // Store the latest mutation index for each key value - mi, ok := dups[oid] - if !ok { - // First entry for key, store the before value - mi.firstBefore = m.Before - } - mi.lastIdx = i - dups[oid] = mi - } - if len(dups) == len(txn.changes) { - // No duplicates found, fast path return it as is - return txn.changes - } - - // Need to remove the duplicates - cs := make(Changes, 0, len(dups)) - for i, m := range txn.changes { - oid := objectID{ - Table: m.Table, - IndexVal: string(m.primaryKey), - } - mi := dups[oid] - if mi.lastIdx == i { - // This was the latest value for this key copy it with the before value in - // case it's different. Note that m is not a pointer so we are not - // modifying the txn.changeSet here - it's already a copy. - m.Before = mi.firstBefore - - // Edge case - if the object was inserted and then eventually deleted in - // the same transaction, then the net affect on that key is a no-op. Don't - // emit a mutation with nil for before and after as it's meaningless and - // might violate expectations and cause a panic in code that assumes at - // least one must be set. - if m.Before == nil && m.After == nil { - continue - } - cs = append(cs, m) - } - } - // Store the de-duped version in case this is called again - txn.changes = cs - return cs -} - -func (txn *Txn) getIndexIterator(table, index string, args ...interface{}) (*iradix.Iterator, []byte, error) { - // Get the index value to scan - indexSchema, val, err := txn.getIndexValue(table, index, args...) - if err != nil { - return nil, nil, err - } - - // Get the index itself - indexTxn := txn.readableIndex(table, indexSchema.Name) - indexRoot := indexTxn.Root() - - // Get an iterator over the index - indexIter := indexRoot.Iterator() - return indexIter, val, nil -} - -func (txn *Txn) getIndexIteratorReverse(table, index string, args ...interface{}) (*iradix.ReverseIterator, []byte, error) { - // Get the index value to scan - indexSchema, val, err := txn.getIndexValue(table, index, args...) - if err != nil { - return nil, nil, err - } - - // Get the index itself - indexTxn := txn.readableIndex(table, indexSchema.Name) - indexRoot := indexTxn.Root() - - // Get an interator over the index - indexIter := indexRoot.ReverseIterator() - return indexIter, val, nil -} - -// Defer is used to push a new arbitrary function onto a stack which -// gets called when a transaction is committed and finished. Deferred -// functions are called in LIFO order, and only invoked at the end of -// write transactions. -func (txn *Txn) Defer(fn func()) { - txn.after = append(txn.after, fn) -} - -// radixIterator is used to wrap an underlying iradix iterator. -// This is much more efficient than a sliceIterator as we are not -// materializing the entire view. -type radixIterator struct { - iter *iradix.Iterator - watchCh <-chan struct{} -} - -func (r *radixIterator) WatchCh() <-chan struct{} { - return r.watchCh -} - -func (r *radixIterator) Next() interface{} { - _, value, ok := r.iter.Next() - if !ok { - return nil - } - return value -} - -type radixReverseIterator struct { - iter *iradix.ReverseIterator - watchCh <-chan struct{} -} - -func (r *radixReverseIterator) Next() interface{} { - _, value, ok := r.iter.Previous() - if !ok { - return nil - } - return value -} - -func (r *radixReverseIterator) WatchCh() <-chan struct{} { - return r.watchCh -} - -// Snapshot creates a snapshot of the current state of the transaction. -// Returns a new read-only transaction or nil if the transaction is already -// aborted or committed. -func (txn *Txn) Snapshot() *Txn { - if txn.rootTxn == nil { - return nil - } - - snapshot := &Txn{ - db: txn.db, - rootTxn: txn.rootTxn.Clone(), - } - - // Commit sub-transactions into the snapshot - for key, subTxn := range txn.modified { - path := indexPath(key.Table, key.Index) - final := subTxn.CommitOnly() - snapshot.rootTxn.Insert(path, final) - } - - return snapshot -} diff --git a/vendor/github.com/hashicorp/go-memdb/watch.go b/vendor/github.com/hashicorp/go-memdb/watch.go deleted file mode 100644 index 4d9cc7ee97..0000000000 --- a/vendor/github.com/hashicorp/go-memdb/watch.go +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package memdb - -import ( - "context" - "time" -) - -// WatchSet is a collection of watch channels. The zero value is not usable. -// Use NewWatchSet to create a WatchSet. -type WatchSet map[<-chan struct{}]struct{} - -// NewWatchSet constructs a new watch set. -func NewWatchSet() WatchSet { - return make(map[<-chan struct{}]struct{}) -} - -// Add appends a watchCh to the WatchSet if non-nil. -func (w WatchSet) Add(watchCh <-chan struct{}) { - if w == nil { - return - } - - if _, ok := w[watchCh]; !ok { - w[watchCh] = struct{}{} - } -} - -// AddWithLimit appends a watchCh to the WatchSet if non-nil, and if the given -// softLimit hasn't been exceeded. Otherwise, it will watch the given alternate -// channel. It's expected that the altCh will be the same on many calls to this -// function, so you will exceed the soft limit a little bit if you hit this, but -// not by much. -// -// This is useful if you want to track individual items up to some limit, after -// which you watch a higher-level channel (usually a channel from start of -// an iterator higher up in the radix tree) that will watch a superset of items. -func (w WatchSet) AddWithLimit(softLimit int, watchCh <-chan struct{}, altCh <-chan struct{}) { - // This is safe for a nil WatchSet so we don't need to check that here. - if len(w) < softLimit { - w.Add(watchCh) - } else { - w.Add(altCh) - } -} - -// Watch blocks until one of the channels in the watch set is closed, or -// timeoutCh sends a value. -// Returns true if timeoutCh is what caused Watch to unblock. -func (w WatchSet) Watch(timeoutCh <-chan time.Time) bool { - if w == nil { - return false - } - - // Create a context that gets cancelled when the timeout is triggered - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - go func() { - select { - case <-timeoutCh: - cancel() - case <-ctx.Done(): - } - }() - - return w.WatchCtx(ctx) == context.Canceled -} - -// WatchCtx blocks until one of the channels in the watch set is closed, or -// ctx is done (cancelled or exceeds the deadline). WatchCtx returns an error -// if the ctx causes it to unblock, otherwise returns nil. -// -// WatchCtx should be preferred over Watch. -func (w WatchSet) WatchCtx(ctx context.Context) error { - if w == nil { - return nil - } - - if n := len(w); n <= aFew { - idx := 0 - chunk := make([]<-chan struct{}, aFew) - for watchCh := range w { - chunk[idx] = watchCh - idx++ - } - return watchFew(ctx, chunk) - } - - return w.watchMany(ctx) -} - -// watchMany is used if there are many watchers. -func (w WatchSet) watchMany(ctx context.Context) error { - // Cancel all watcher goroutines when return. - watcherCtx, cancel := context.WithCancel(ctx) - defer cancel() - - // Set up a goroutine for each watcher. - triggerCh := make(chan struct{}, 1) - watcher := func(chunk []<-chan struct{}) { - if err := watchFew(watcherCtx, chunk); err == nil { - select { - case triggerCh <- struct{}{}: - default: - } - } - } - - // Apportion the watch channels into chunks we can feed into the - // watchFew helper. - idx := 0 - chunk := make([]<-chan struct{}, aFew) - for watchCh := range w { - subIdx := idx % aFew - chunk[subIdx] = watchCh - idx++ - - // Fire off this chunk and start a fresh one. - if idx%aFew == 0 { - go watcher(chunk) - chunk = make([]<-chan struct{}, aFew) - } - } - - // Make sure to watch any residual channels in the last chunk. - if idx%aFew != 0 { - go watcher(chunk) - } - - // Wait for a channel to trigger or timeout. - select { - case <-triggerCh: - return nil - case <-ctx.Done(): - return ctx.Err() - } -} - -// WatchCh returns a channel that is used to wait for any channel of the watch set to trigger -// or for the context to be cancelled. WatchCh creates a new goroutine each call, so -// callers may need to cache the returned channel to avoid creating extra goroutines. -func (w WatchSet) WatchCh(ctx context.Context) <-chan error { - // Create the outgoing channel - triggerCh := make(chan error, 1) - - // Create a goroutine to collect the error from WatchCtx - go func() { - triggerCh <- w.WatchCtx(ctx) - }() - - return triggerCh -} diff --git a/vendor/github.com/hashicorp/go-memdb/watch_few.go b/vendor/github.com/hashicorp/go-memdb/watch_few.go deleted file mode 100644 index ccdbff0f19..0000000000 --- a/vendor/github.com/hashicorp/go-memdb/watch_few.go +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package memdb - -//go:generate sh -c "go run watch-gen/main.go >watch_few.go" - -import ( - "context" -) - -// aFew gives how many watchers this function is wired to support. You must -// always pass a full slice of this length, but unused channels can be nil. -const aFew = 32 - -// watchFew is used if there are only a few watchers as a performance -// optimization. -func watchFew(ctx context.Context, ch []<-chan struct{}) error { - select { - - case <-ch[0]: - return nil - - case <-ch[1]: - return nil - - case <-ch[2]: - return nil - - case <-ch[3]: - return nil - - case <-ch[4]: - return nil - - case <-ch[5]: - return nil - - case <-ch[6]: - return nil - - case <-ch[7]: - return nil - - case <-ch[8]: - return nil - - case <-ch[9]: - return nil - - case <-ch[10]: - return nil - - case <-ch[11]: - return nil - - case <-ch[12]: - return nil - - case <-ch[13]: - return nil - - case <-ch[14]: - return nil - - case <-ch[15]: - return nil - - case <-ch[16]: - return nil - - case <-ch[17]: - return nil - - case <-ch[18]: - return nil - - case <-ch[19]: - return nil - - case <-ch[20]: - return nil - - case <-ch[21]: - return nil - - case <-ch[22]: - return nil - - case <-ch[23]: - return nil - - case <-ch[24]: - return nil - - case <-ch[25]: - return nil - - case <-ch[26]: - return nil - - case <-ch[27]: - return nil - - case <-ch[28]: - return nil - - case <-ch[29]: - return nil - - case <-ch[30]: - return nil - - case <-ch[31]: - return nil - - case <-ctx.Done(): - return ctx.Err() - } -} diff --git a/vendor/github.com/hashicorp/golang-lru/LICENSE b/vendor/github.com/hashicorp/golang-lru/LICENSE deleted file mode 100644 index 0e5d580e0e..0000000000 --- a/vendor/github.com/hashicorp/golang-lru/LICENSE +++ /dev/null @@ -1,364 +0,0 @@ -Copyright (c) 2014 HashiCorp, Inc. - -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. "Contributor" - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. "Contributor Version" - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the terms of - a Secondary License. - -1.6. "Executable Form" - - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - - means a work that combines Covered Software with other material, in a - separate file or files, that is not Covered Software. - -1.8. "License" - - means this document. - -1.9. "Licensable" - - means having the right to grant, to the maximum extent possible, whether - at the time of the initial grant or subsequently, any and all of the - rights conveyed by this License. - -1.10. "Modifications" - - means any of the following: - - a. any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. "Patent Claims" of a Contributor - - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the License, - by the making, using, selling, offering for sale, having made, import, - or transfer of either its Contributions or its Contributor Version. - -1.12. "Secondary License" - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. "Source Code Form" - - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, "control" means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights to - grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter the - recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, or - limitations of liability) contained within the Source Code Form of the - Covered Software, except that You may alter any license notices to the - extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, - judicial order, or regulation then You must: (a) comply with the terms of - this License to the maximum extent possible; and (b) describe the - limitations and the code they affect. Such description must be placed in a - text file included with all distributions of the Covered Software under - this License. Except to the extent prohibited by statute or regulation, - such description must be sufficiently detailed for a recipient of ordinary - skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing - basis, if such Contributor fails to notify You of the non-compliance by - some reasonable means prior to 60 days after You have come back into - compliance. Moreover, Your grants from a particular Contributor are - reinstated on an ongoing basis if such Contributor notifies You of the - non-compliance by some reasonable means, this is the first time You have - received notice of non-compliance with this License from such - Contributor, and You become compliant prior to 30 days after Your receipt - of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an "as is" basis, - without warranty of any kind, either expressed, implied, or statutory, - including, without limitation, warranties that the Covered Software is free - of defects, merchantable, fit for a particular purpose or non-infringing. - The entire risk as to the quality and performance of the Covered Software - is with You. Should any Covered Software prove defective in any respect, - You (not any Contributor) assume the cost of any necessary servicing, - repair, or correction. This disclaimer of warranty constitutes an essential - part of this License. No use of any Covered Software is authorized under - this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from - such party's negligence to the extent applicable law prohibits such - limitation. Some jurisdictions do not allow the exclusion or limitation of - incidental or consequential damages, so this exclusion and limitation may - not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts - of a jurisdiction where the defendant maintains its principal place of - business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. Nothing - in this Section shall prevent a party's ability to bring cross-claims or - counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides that - the language of a contract shall be construed against the drafter shall not - be used to construe this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses If You choose to distribute Source Code Form that is - Incompatible With Secondary Licenses under the terms of this version of - the License, the notice described in Exhibit B of this License must be - attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, -then You may include the notice in a location (such as a LICENSE file in a -relevant directory) where a recipient would be likely to look for such a -notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible - With Secondary Licenses", as defined by - the Mozilla Public License, v. 2.0. diff --git a/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go b/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go deleted file mode 100644 index 9233583c91..0000000000 --- a/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go +++ /dev/null @@ -1,177 +0,0 @@ -package simplelru - -import ( - "container/list" - "errors" -) - -// EvictCallback is used to get a callback when a cache entry is evicted -type EvictCallback func(key interface{}, value interface{}) - -// LRU implements a non-thread safe fixed size LRU cache -type LRU struct { - size int - evictList *list.List - items map[interface{}]*list.Element - onEvict EvictCallback -} - -// entry is used to hold a value in the evictList -type entry struct { - key interface{} - value interface{} -} - -// NewLRU constructs an LRU of the given size -func NewLRU(size int, onEvict EvictCallback) (*LRU, error) { - if size <= 0 { - return nil, errors.New("must provide a positive size") - } - c := &LRU{ - size: size, - evictList: list.New(), - items: make(map[interface{}]*list.Element), - onEvict: onEvict, - } - return c, nil -} - -// Purge is used to completely clear the cache. -func (c *LRU) Purge() { - for k, v := range c.items { - if c.onEvict != nil { - c.onEvict(k, v.Value.(*entry).value) - } - delete(c.items, k) - } - c.evictList.Init() -} - -// Add adds a value to the cache. Returns true if an eviction occurred. -func (c *LRU) Add(key, value interface{}) (evicted bool) { - // Check for existing item - if ent, ok := c.items[key]; ok { - c.evictList.MoveToFront(ent) - ent.Value.(*entry).value = value - return false - } - - // Add new item - ent := &entry{key, value} - entry := c.evictList.PushFront(ent) - c.items[key] = entry - - evict := c.evictList.Len() > c.size - // Verify size not exceeded - if evict { - c.removeOldest() - } - return evict -} - -// Get looks up a key's value from the cache. -func (c *LRU) Get(key interface{}) (value interface{}, ok bool) { - if ent, ok := c.items[key]; ok { - c.evictList.MoveToFront(ent) - if ent.Value.(*entry) == nil { - return nil, false - } - return ent.Value.(*entry).value, true - } - return -} - -// Contains checks if a key is in the cache, without updating the recent-ness -// or deleting it for being stale. -func (c *LRU) Contains(key interface{}) (ok bool) { - _, ok = c.items[key] - return ok -} - -// Peek returns the key value (or undefined if not found) without updating -// the "recently used"-ness of the key. -func (c *LRU) Peek(key interface{}) (value interface{}, ok bool) { - var ent *list.Element - if ent, ok = c.items[key]; ok { - return ent.Value.(*entry).value, true - } - return nil, ok -} - -// Remove removes the provided key from the cache, returning if the -// key was contained. -func (c *LRU) Remove(key interface{}) (present bool) { - if ent, ok := c.items[key]; ok { - c.removeElement(ent) - return true - } - return false -} - -// RemoveOldest removes the oldest item from the cache. -func (c *LRU) RemoveOldest() (key, value interface{}, ok bool) { - ent := c.evictList.Back() - if ent != nil { - c.removeElement(ent) - kv := ent.Value.(*entry) - return kv.key, kv.value, true - } - return nil, nil, false -} - -// GetOldest returns the oldest entry -func (c *LRU) GetOldest() (key, value interface{}, ok bool) { - ent := c.evictList.Back() - if ent != nil { - kv := ent.Value.(*entry) - return kv.key, kv.value, true - } - return nil, nil, false -} - -// Keys returns a slice of the keys in the cache, from oldest to newest. -func (c *LRU) Keys() []interface{} { - keys := make([]interface{}, len(c.items)) - i := 0 - for ent := c.evictList.Back(); ent != nil; ent = ent.Prev() { - keys[i] = ent.Value.(*entry).key - i++ - } - return keys -} - -// Len returns the number of items in the cache. -func (c *LRU) Len() int { - return c.evictList.Len() -} - -// Resize changes the cache size. -func (c *LRU) Resize(size int) (evicted int) { - diff := c.Len() - size - if diff < 0 { - diff = 0 - } - for i := 0; i < diff; i++ { - c.removeOldest() - } - c.size = size - return diff -} - -// removeOldest removes the oldest item from the cache. -func (c *LRU) removeOldest() { - ent := c.evictList.Back() - if ent != nil { - c.removeElement(ent) - } -} - -// removeElement is used to remove a given list element from the cache -func (c *LRU) removeElement(e *list.Element) { - c.evictList.Remove(e) - kv := e.Value.(*entry) - delete(c.items, kv.key) - if c.onEvict != nil { - c.onEvict(kv.key, kv.value) - } -} diff --git a/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go b/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go deleted file mode 100644 index cb7f8caf03..0000000000 --- a/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go +++ /dev/null @@ -1,40 +0,0 @@ -// Package simplelru provides simple LRU implementation based on build-in container/list. -package simplelru - -// LRUCache is the interface for simple LRU cache. -type LRUCache interface { - // Adds a value to the cache, returns true if an eviction occurred and - // updates the "recently used"-ness of the key. - Add(key, value interface{}) bool - - // Returns key's value from the cache and - // updates the "recently used"-ness of the key. #value, isFound - Get(key interface{}) (value interface{}, ok bool) - - // Checks if a key exists in cache without updating the recent-ness. - Contains(key interface{}) (ok bool) - - // Returns key's value without updating the "recently used"-ness of the key. - Peek(key interface{}) (value interface{}, ok bool) - - // Removes a key from the cache. - Remove(key interface{}) bool - - // Removes the oldest entry from cache. - RemoveOldest() (interface{}, interface{}, bool) - - // Returns the oldest entry from the cache. #key, value, isFound - GetOldest() (interface{}, interface{}, bool) - - // Returns a slice of the keys in the cache, from oldest to newest. - Keys() []interface{} - - // Returns the number of items in the cache. - Len() int - - // Clears all cache entries. - Purge() - - // Resizes cache, returning number evicted - Resize(int) int -} diff --git a/vendor/github.com/moby/swarmkit/v2/LICENSE b/vendor/github.com/moby/swarmkit/v2/LICENSE deleted file mode 100644 index e2db6ed114..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2016-2018 Docker Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/moby/swarmkit/v2/agent/exec/controller.go b/vendor/github.com/moby/swarmkit/v2/agent/exec/controller.go deleted file mode 100644 index 2837377245..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/agent/exec/controller.go +++ /dev/null @@ -1,360 +0,0 @@ -package exec - -import ( - "context" - "fmt" - "time" - - "github.com/moby/swarmkit/v2/api" - "github.com/moby/swarmkit/v2/api/equality" - "github.com/moby/swarmkit/v2/log" - "github.com/moby/swarmkit/v2/protobuf/ptypes" - "github.com/pkg/errors" -) - -// Controller controls execution of a task. -type Controller interface { - // Update the task definition seen by the controller. Will return - // ErrTaskUpdateFailed if the provided task definition changes fields that - // cannot be changed. - // - // Will be ignored if the task has exited. - Update(ctx context.Context, t *api.Task) error - - // Prepare the task for execution. This should ensure that all resources - // are created such that a call to start should execute immediately. - Prepare(ctx context.Context) error - - // Start the target and return when it has started successfully. - Start(ctx context.Context) error - - // Wait blocks until the target has exited. - Wait(ctx context.Context) error - - // Shutdown requests to exit the target gracefully. - Shutdown(ctx context.Context) error - - // Terminate the target. - Terminate(ctx context.Context) error - - // Remove all resources allocated by the controller. - Remove(ctx context.Context) error - - // Close closes any ephemeral resources associated with controller instance. - Close() error -} - -// ControllerLogs defines a component that makes logs accessible. -// -// Can usually be accessed on a controller instance via type assertion. -type ControllerLogs interface { - // Logs will write publisher until the context is cancelled or an error - // occurs. - Logs(ctx context.Context, publisher LogPublisher, options api.LogSubscriptionOptions) error -} - -// LogPublisher defines the protocol for receiving a log message. -type LogPublisher interface { - Publish(ctx context.Context, message api.LogMessage) error -} - -// LogPublisherFunc implements publisher with just a function. -type LogPublisherFunc func(ctx context.Context, message api.LogMessage) error - -// Publish calls the wrapped function. -func (fn LogPublisherFunc) Publish(ctx context.Context, message api.LogMessage) error { - return fn(ctx, message) -} - -// LogPublisherProvider defines the protocol for receiving a log publisher -type LogPublisherProvider interface { - Publisher(ctx context.Context, subscriptionID string) (LogPublisher, func(), error) -} - -// ContainerStatuser reports status of a container. -// -// This can be implemented by controllers or error types. -type ContainerStatuser interface { - // ContainerStatus returns the status of the target container, if - // available. When the container is not available, the status will be nil. - ContainerStatus(ctx context.Context) (*api.ContainerStatus, error) -} - -// PortStatuser reports status of ports which are allocated by the executor -type PortStatuser interface { - // PortStatus returns the status on a list of PortConfigs - // which are managed at the host level by the controller. - PortStatus(ctx context.Context) (*api.PortStatus, error) -} - -// Resolve attempts to get a controller from the executor and reports the -// correct status depending on the tasks current state according to the result. -// -// Unlike Do, if an error is returned, the status should still be reported. The -// error merely reports the failure at getting the controller. -func Resolve(ctx context.Context, task *api.Task, executor Executor) (Controller, *api.TaskStatus, error) { - status := task.Status.Copy() - - defer func() { - logStateChange(ctx, task.DesiredState, task.Status.State, status.State) - }() - - ctlr, err := executor.Controller(task) - - // depending on the tasks state, a failed controller resolution has varying - // impact. The following expresses that impact. - if err != nil { - status.Message = "resolving controller failed" - status.Err = err.Error() - // before the task has been started, we consider it a rejection. - // if task is running, consider the task has failed - // otherwise keep the existing state - if task.Status.State < api.TaskStateStarting { - status.State = api.TaskStateRejected - } else if task.Status.State <= api.TaskStateRunning { - status.State = api.TaskStateFailed - } - } else if task.Status.State < api.TaskStateAccepted { - // we always want to proceed to accepted when we resolve the controller - status.Message = "accepted" - status.State = api.TaskStateAccepted - status.Err = "" - } - - return ctlr, status, err -} - -// Do progresses the task state using the controller performing a single -// operation on the controller. The return TaskStatus should be marked as the -// new state of the task. -// -// The returned status should be reported and placed back on to task -// before the next call. The operation can be cancelled by creating a -// cancelling context. -// -// Errors from the task controller will reported on the returned status. Any -// errors coming from this function should not be reported as related to the -// individual task. -// -// If ErrTaskNoop is returned, it means a second call to Do will result in no -// change. If ErrTaskDead is returned, calls to Do will no longer result in any -// action. -func Do(ctx context.Context, task *api.Task, ctlr Controller) (*api.TaskStatus, error) { - status := task.Status.Copy() - - // stay in the current state. - noop := func(errs ...error) (*api.TaskStatus, error) { - return status, ErrTaskNoop - } - - retry := func() (*api.TaskStatus, error) { - // while we retry on all errors, this allows us to explicitly declare - // retry cases. - return status, ErrTaskRetry - } - - // transition moves the task to the next state. - transition := func(state api.TaskState, msg string) (*api.TaskStatus, error) { - current := status.State - status.State = state - status.Message = msg - status.Err = "" - - if current > state { - panic("invalid state transition") - } - return status, nil - } - - // containerStatus exitCode keeps track of whether or not we've set it in - // this particular method. Eventually, we assemble this as part of a defer. - var ( - containerStatus *api.ContainerStatus - portStatus *api.PortStatus - exitCode int - ) - - // returned when a fatal execution of the task is fatal. In this case, we - // proceed to a terminal error state and set the appropriate fields. - // - // Common checks for the nature of an error should be included here. If the - // error is determined not to be fatal for the task, - fatal := func(err error) (*api.TaskStatus, error) { - if err == nil { - panic("err must not be nil when fatal") - } - - if cs, ok := err.(ContainerStatuser); ok { - var err error - containerStatus, err = cs.ContainerStatus(ctx) - if err != nil && !contextDoneError(err) { - log.G(ctx).WithError(err).Error("error resolving container status on fatal") - } - } - - // make sure we've set the *correct* exit code - if ec, ok := err.(ExitCoder); ok { - exitCode = ec.ExitCode() - } - - if cause := errors.Cause(err); cause == context.DeadlineExceeded || cause == context.Canceled { - return retry() - } - - status.Err = err.Error() // still reported on temporary - if IsTemporary(err) { - return retry() - } - - // only at this point do we consider the error fatal to the task. - log.G(ctx).WithError(err).Error("fatal task error") - - // NOTE(stevvooe): The following switch dictates the terminal failure - // state based on the state in which the failure was encountered. - switch { - case status.State < api.TaskStateStarting: - status.State = api.TaskStateRejected - case status.State >= api.TaskStateStarting: - status.State = api.TaskStateFailed - } - - return status, nil - } - - // below, we have several callbacks that are run after the state transition - // is completed. - defer func() { - logStateChange(ctx, task.DesiredState, task.Status.State, status.State) - - if !equality.TaskStatusesEqualStable(status, &task.Status) { - status.Timestamp = ptypes.MustTimestampProto(time.Now()) - } - }() - - // extract the container status from the container, if supported. - defer func() { - // only do this if in an active state - if status.State < api.TaskStateStarting { - return - } - - if containerStatus == nil { - // collect this, if we haven't - cctlr, ok := ctlr.(ContainerStatuser) - if !ok { - return - } - - var err error - containerStatus, err = cctlr.ContainerStatus(ctx) - if err != nil && !contextDoneError(err) { - log.G(ctx).WithError(err).Error("container status unavailable") - } - - // at this point, things have gone fairly wrong. Remain positive - // and let's get something out the door. - if containerStatus == nil { - containerStatus = new(api.ContainerStatus) - containerStatusTask := task.Status.GetContainer() - if containerStatusTask != nil { - *containerStatus = *containerStatusTask // copy it over. - } - } - } - - // at this point, we *must* have a containerStatus. - if exitCode != 0 { - containerStatus.ExitCode = int32(exitCode) - } - - status.RuntimeStatus = &api.TaskStatus_Container{ - Container: containerStatus, - } - - if portStatus == nil { - pctlr, ok := ctlr.(PortStatuser) - if !ok { - return - } - - var err error - portStatus, err = pctlr.PortStatus(ctx) - if err != nil && !contextDoneError(err) { - log.G(ctx).WithError(err).Error("container port status unavailable") - } - } - - status.PortStatus = portStatus - }() - - // this branch bounds the largest state achievable in the agent as SHUTDOWN, which - // is exactly the correct behavior for the agent. - if task.DesiredState >= api.TaskStateShutdown { - if status.State >= api.TaskStateCompleted { - return noop() - } - - if err := ctlr.Shutdown(ctx); err != nil { - return fatal(err) - } - - return transition(api.TaskStateShutdown, "shutdown") - } - - if status.State > task.DesiredState { - return noop() // way beyond desired state, pause - } - - // the following states may proceed past desired state. - switch status.State { - case api.TaskStatePreparing: - if err := ctlr.Prepare(ctx); err != nil && err != ErrTaskPrepared { - return fatal(err) - } - - return transition(api.TaskStateReady, "prepared") - case api.TaskStateStarting: - if err := ctlr.Start(ctx); err != nil && err != ErrTaskStarted { - return fatal(err) - } - - return transition(api.TaskStateRunning, "started") - case api.TaskStateRunning: - if err := ctlr.Wait(ctx); err != nil { - return fatal(err) - } - - return transition(api.TaskStateCompleted, "finished") - } - - // The following represent "pause" states. We can only proceed when the - // desired state is beyond our current state. - if status.State >= task.DesiredState { - return noop() - } - - switch status.State { - case api.TaskStateNew, api.TaskStatePending, api.TaskStateAssigned: - return transition(api.TaskStateAccepted, "accepted") - case api.TaskStateAccepted: - return transition(api.TaskStatePreparing, "preparing") - case api.TaskStateReady: - return transition(api.TaskStateStarting, "starting") - default: // terminal states - return noop() - } -} - -func logStateChange(ctx context.Context, desired, previous, next api.TaskState) { - if previous != next { - log.G(ctx).WithFields(log.Fields{ - "state.transition": fmt.Sprintf("%v->%v", previous, next), - "state.desired": desired, - }).Debug("state changed") - } -} - -func contextDoneError(err error) bool { - cause := errors.Cause(err) - return cause == context.Canceled || cause == context.DeadlineExceeded -} diff --git a/vendor/github.com/moby/swarmkit/v2/agent/exec/controller_stub.go b/vendor/github.com/moby/swarmkit/v2/agent/exec/controller_stub.go deleted file mode 100644 index a116f15611..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/agent/exec/controller_stub.go +++ /dev/null @@ -1,75 +0,0 @@ -package exec - -import ( - "context" - "runtime" - "strings" - - "github.com/moby/swarmkit/v2/api" -) - -// StubController implements the Controller interface, -// but allows you to specify behaviors for each of its methods. -type StubController struct { - Controller - UpdateFn func(ctx context.Context, t *api.Task) error - PrepareFn func(ctx context.Context) error - StartFn func(ctx context.Context) error - WaitFn func(ctx context.Context) error - ShutdownFn func(ctx context.Context) error - TerminateFn func(ctx context.Context) error - RemoveFn func(ctx context.Context) error - CloseFn func() error - calls map[string]int -} - -// NewStubController returns an initialized StubController -func NewStubController() *StubController { - return &StubController{ - calls: make(map[string]int), - } -} - -// If function A calls updateCountsForSelf, -// The callCount[A] value will be incremented -func (sc *StubController) called() { - pc, _, _, ok := runtime.Caller(1) - if !ok { - panic("Failed to find caller of function") - } - // longName looks like 'github.com/moby/swarmkit/agent/exec.(*StubController).Prepare:1' - longName := runtime.FuncForPC(pc).Name() - parts := strings.Split(longName, ".") - tail := strings.Split(parts[len(parts)-1], ":") - sc.calls[tail[0]]++ -} - -// Update is part of the Controller interface -func (sc *StubController) Update(ctx context.Context, t *api.Task) error { - sc.called() - return sc.UpdateFn(ctx, t) -} - -// Prepare is part of the Controller interface -func (sc *StubController) Prepare(ctx context.Context) error { sc.called(); return sc.PrepareFn(ctx) } - -// Start is part of the Controller interface -func (sc *StubController) Start(ctx context.Context) error { sc.called(); return sc.StartFn(ctx) } - -// Wait is part of the Controller interface -func (sc *StubController) Wait(ctx context.Context) error { sc.called(); return sc.WaitFn(ctx) } - -// Shutdown is part of the Controller interface -func (sc *StubController) Shutdown(ctx context.Context) error { sc.called(); return sc.ShutdownFn(ctx) } - -// Terminate is part of the Controller interface -func (sc *StubController) Terminate(ctx context.Context) error { - sc.called() - return sc.TerminateFn(ctx) -} - -// Remove is part of the Controller interface -func (sc *StubController) Remove(ctx context.Context) error { sc.called(); return sc.RemoveFn(ctx) } - -// Close is part of the Controller interface -func (sc *StubController) Close() error { sc.called(); return sc.CloseFn() } diff --git a/vendor/github.com/moby/swarmkit/v2/agent/exec/errors.go b/vendor/github.com/moby/swarmkit/v2/agent/exec/errors.go deleted file mode 100644 index f57629161f..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/agent/exec/errors.go +++ /dev/null @@ -1,79 +0,0 @@ -package exec - -import "github.com/pkg/errors" - -var ( - // ErrRuntimeUnsupported encountered when a task requires a runtime - // unsupported by the executor. - ErrRuntimeUnsupported = errors.New("exec: unsupported runtime") - - // ErrTaskPrepared is called if the task is already prepared. - ErrTaskPrepared = errors.New("exec: task already prepared") - - // ErrTaskStarted can be returned from any operation that cannot be - // performed because the task has already been started. This does not imply - // that the task is running but rather that it is no longer valid to call - // Start. - ErrTaskStarted = errors.New("exec: task already started") - - // ErrTaskUpdateRejected is returned if a task update is rejected by a controller. - ErrTaskUpdateRejected = errors.New("exec: task update rejected") - - // ErrControllerClosed returned when a task controller has been closed. - ErrControllerClosed = errors.New("exec: controller closed") - - // ErrTaskRetry is returned by Do when an operation failed by should be - // retried. The status should still be reported in this case. - ErrTaskRetry = errors.New("exec: task retry") - - // ErrTaskNoop returns when the a subsequent call to Do will not result in - // advancing the task. Callers should avoid calling Do until the task has been updated. - ErrTaskNoop = errors.New("exec: task noop") - - // ErrDependencyNotReady is returned if a given dependency can be accessed - // through the Getter, but is not yet ready to be used. This is most - // relevant for Volumes, which must be staged and published on the node. - ErrDependencyNotReady error = errors.New("dependency not ready") -) - -// ExitCoder is implemented by errors that have an exit code. -type ExitCoder interface { - // ExitCode returns the exit code. - ExitCode() int -} - -// Temporary indicates whether or not the error condition is temporary. -// -// If this is encountered in the controller, the failing operation will be -// retried when this returns true. Otherwise, the operation is considered -// fatal. -type Temporary interface { - Temporary() bool -} - -// MakeTemporary makes the error temporary. -func MakeTemporary(err error) error { - if IsTemporary(err) { - return err - } - - return temporary{err} -} - -type temporary struct { - error -} - -func (t temporary) Unwrap() error { return t.error } -func (t temporary) Cause() error { return t.error } -func (t temporary) Temporary() bool { return true } - -// IsTemporary returns true if the error or a recursive cause returns true for -// temporary. -func IsTemporary(err error) bool { - var tmp Temporary - if errors.As(err, &tmp) { - return tmp.Temporary() - } - return false -} diff --git a/vendor/github.com/moby/swarmkit/v2/agent/exec/executor.go b/vendor/github.com/moby/swarmkit/v2/agent/exec/executor.go deleted file mode 100644 index 6469fddbf3..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/agent/exec/executor.go +++ /dev/null @@ -1,126 +0,0 @@ -package exec - -import ( - "context" - - "github.com/moby/swarmkit/v2/api" -) - -// Executor provides controllers for tasks. -type Executor interface { - // Describe returns the underlying node description. - Describe(ctx context.Context) (*api.NodeDescription, error) - - // Configure uses the node object state to propagate node - // state to the underlying executor. - Configure(ctx context.Context, node *api.Node) error - - // Controller provides a controller for the given task. - Controller(t *api.Task) (Controller, error) - - // SetNetworkBootstrapKeys passes the symmetric keys from the - // manager to the executor. - SetNetworkBootstrapKeys([]*api.EncryptionKey) error -} - -// SecretsProvider is implemented by objects that can store secrets, typically -// an executor. -type SecretsProvider interface { - Secrets() SecretsManager -} - -// ConfigsProvider is implemented by objects that can store configs, -// typically an executor. -type ConfigsProvider interface { - Configs() ConfigsManager -} - -// VolumesProvider is implemented by objects that can store volumes, -// typically an executor. -type VolumesProvider interface { - Volumes() VolumesManager -} - -// DependencyManager is a meta-object that can keep track of typed objects -// such as secrets and configs. -type DependencyManager interface { - SecretsProvider - ConfigsProvider - VolumesProvider -} - -// DependencyGetter is a meta-object that can provide access to typed objects -// such as secrets and configs. -type DependencyGetter interface { - Secrets() SecretGetter - Configs() ConfigGetter - Volumes() VolumeGetter -} - -// SecretGetter contains secret data necessary for the Controller. -type SecretGetter interface { - // Get returns the the secret with a specific secret ID, if available. - // When the secret is not available, the return will be nil. - Get(secretID string) (*api.Secret, error) -} - -// SecretsManager is the interface for secret storage and updates. -type SecretsManager interface { - SecretGetter - - Add(secrets ...api.Secret) // add one or more secrets - Remove(secrets []string) // remove the secrets by ID - Reset() // remove all secrets -} - -// ConfigGetter contains config data necessary for the Controller. -type ConfigGetter interface { - // Get returns the the config with a specific config ID, if available. - // When the config is not available, the return will be nil. - Get(configID string) (*api.Config, error) -} - -// ConfigsManager is the interface for config storage and updates. -type ConfigsManager interface { - ConfigGetter - - Add(configs ...api.Config) // add one or more configs - Remove(configs []string) // remove the configs by ID - Reset() // remove all configs -} - -// VolumeGetter contains volume data necessary for the Controller. -type VolumeGetter interface { - // Get returns the the volume with a specific volume ID, if available. - // When the volume is not available, the return will be nil. - Get(volumeID string) (string, error) -} - -// VolumesManager is the interface for volume storage and updates. -type VolumesManager interface { - VolumeGetter - - // Add adds one or more volumes - Add(volumes ...api.VolumeAssignment) - // Remove removes one or more volumes. The callback is called each time a - // volume is successfully removed with the ID of the volume removed. - // - // Remove takes a full VolumeAssignment because we may be instructed by the - // swarm manager to attempt removal of a Volume we don't know we have. - Remove(volumes []api.VolumeAssignment, callback func(string)) - // Plugins returns the VolumePluginManager for this VolumesManager - Plugins() VolumePluginManager -} - -// VolumePluginManager is the interface for accessing the volume plugin manager from -// the executor. This is identical to -// github.com/moby/swarmkit/agent/csi/plugin.PluginManager, except the former -// also includes a Get method for the VolumesManager to use. This does not -// contain that Get method, to avoid having to import the Plugin type, and -// because in this context, it is not needed. -type VolumePluginManager interface { - // NodeInfo returns the NodeCSIInfo for each active plugin. Plugins which - // are added through Set but to which no connection has yet been - // successfully established will not be included. - NodeInfo(ctx context.Context) ([]*api.NodeCSIInfo, error) -} diff --git a/vendor/github.com/moby/swarmkit/v2/api/README.md b/vendor/github.com/moby/swarmkit/v2/api/README.md deleted file mode 100644 index a7ec3fc541..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/README.md +++ /dev/null @@ -1,24 +0,0 @@ -### Notice - -Do not change .pb.go files directly. You need to change the corresponding .proto files and run the following command to regenerate the .pb.go files. -``` -$ make generate -``` - -Click [here](https://github.com/google/protobuf) for more information about protobuf. - -The `api.pb.txt` file contains merged descriptors of all defined services and messages. -Definitions present here are considered frozen after the release. - -At release time, the current `api.pb.txt` file will be moved into place to -freeze the API changes for the minor version. For example, when 1.0.0 is -released, `api.pb.txt` should be moved to `1.0.txt`. Notice that we leave off -the patch number, since the API will be completely locked down for a given -patch series. - -We may find that by default, protobuf descriptors are too noisy to lock down -API changes. In that case, we may filter out certain fields in the descriptors, -possibly regenerating for old versions. - -This process is similar to the [process used to ensure backwards compatibility -in Go](https://github.com/golang/go/tree/master/api). diff --git a/vendor/github.com/moby/swarmkit/v2/api/api.pb.txt b/vendor/github.com/moby/swarmkit/v2/api/api.pb.txt deleted file mode 100644 index a77d1a8965..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/api.pb.txt +++ /dev/null @@ -1,12158 +0,0 @@ -file { - name: "google/protobuf/timestamp.proto" - package: "google.protobuf" - message_type { - name: "Timestamp" - field { - name: "seconds" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "seconds" - } - field { - name: "nanos" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_INT32 - json_name: "nanos" - } - } - options { - java_package: "com.google.protobuf" - java_outer_classname: "TimestampProto" - java_multiple_files: true - go_package: "github.com/golang/protobuf/ptypes/timestamp" - cc_enable_arenas: true - objc_class_prefix: "GPB" - csharp_namespace: "Google.Protobuf.WellKnownTypes" - } - syntax: "proto3" -} -file { - name: "google/protobuf/duration.proto" - package: "google.protobuf" - message_type { - name: "Duration" - field { - name: "seconds" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "seconds" - } - field { - name: "nanos" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_INT32 - json_name: "nanos" - } - } - options { - java_package: "com.google.protobuf" - java_outer_classname: "DurationProto" - java_multiple_files: true - go_package: "github.com/golang/protobuf/ptypes/duration" - cc_enable_arenas: true - objc_class_prefix: "GPB" - csharp_namespace: "Google.Protobuf.WellKnownTypes" - } - syntax: "proto3" -} -file { - name: "google/protobuf/wrappers.proto" - package: "google.protobuf" - message_type { - name: "DoubleValue" - field { - name: "value" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_DOUBLE - json_name: "value" - } - } - message_type { - name: "FloatValue" - field { - name: "value" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_FLOAT - json_name: "value" - } - } - message_type { - name: "Int64Value" - field { - name: "value" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "value" - } - } - message_type { - name: "UInt64Value" - field { - name: "value" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "value" - } - } - message_type { - name: "Int32Value" - field { - name: "value" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_INT32 - json_name: "value" - } - } - message_type { - name: "UInt32Value" - field { - name: "value" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_UINT32 - json_name: "value" - } - } - message_type { - name: "BoolValue" - field { - name: "value" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "value" - } - } - message_type { - name: "StringValue" - field { - name: "value" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - } - message_type { - name: "BytesValue" - field { - name: "value" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "value" - } - } - options { - java_package: "com.google.protobuf" - java_outer_classname: "WrappersProto" - java_multiple_files: true - go_package: "github.com/golang/protobuf/ptypes/wrappers" - cc_enable_arenas: true - objc_class_prefix: "GPB" - csharp_namespace: "Google.Protobuf.WellKnownTypes" - } - syntax: "proto3" -} -file { - name: "google/protobuf/descriptor.proto" - package: "google.protobuf" - message_type { - name: "FileDescriptorSet" - field { - name: "file" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.FileDescriptorProto" - json_name: "file" - } - } - message_type { - name: "FileDescriptorProto" - field { - name: "name" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "name" - } - field { - name: "package" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "package" - } - field { - name: "dependency" - number: 3 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "dependency" - } - field { - name: "public_dependency" - number: 10 - label: LABEL_REPEATED - type: TYPE_INT32 - json_name: "publicDependency" - } - field { - name: "weak_dependency" - number: 11 - label: LABEL_REPEATED - type: TYPE_INT32 - json_name: "weakDependency" - } - field { - name: "message_type" - number: 4 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.DescriptorProto" - json_name: "messageType" - } - field { - name: "enum_type" - number: 5 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.EnumDescriptorProto" - json_name: "enumType" - } - field { - name: "service" - number: 6 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.ServiceDescriptorProto" - json_name: "service" - } - field { - name: "extension" - number: 7 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.FieldDescriptorProto" - json_name: "extension" - } - field { - name: "options" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.FileOptions" - json_name: "options" - } - field { - name: "source_code_info" - number: 9 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.SourceCodeInfo" - json_name: "sourceCodeInfo" - } - field { - name: "syntax" - number: 12 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "syntax" - } - } - message_type { - name: "DescriptorProto" - field { - name: "name" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "name" - } - field { - name: "field" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.FieldDescriptorProto" - json_name: "field" - } - field { - name: "extension" - number: 6 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.FieldDescriptorProto" - json_name: "extension" - } - field { - name: "nested_type" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.DescriptorProto" - json_name: "nestedType" - } - field { - name: "enum_type" - number: 4 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.EnumDescriptorProto" - json_name: "enumType" - } - field { - name: "extension_range" - number: 5 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.DescriptorProto.ExtensionRange" - json_name: "extensionRange" - } - field { - name: "oneof_decl" - number: 8 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.OneofDescriptorProto" - json_name: "oneofDecl" - } - field { - name: "options" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.MessageOptions" - json_name: "options" - } - field { - name: "reserved_range" - number: 9 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.DescriptorProto.ReservedRange" - json_name: "reservedRange" - } - field { - name: "reserved_name" - number: 10 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "reservedName" - } - nested_type { - name: "ExtensionRange" - field { - name: "start" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_INT32 - json_name: "start" - } - field { - name: "end" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_INT32 - json_name: "end" - } - field { - name: "options" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.ExtensionRangeOptions" - json_name: "options" - } - } - nested_type { - name: "ReservedRange" - field { - name: "start" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_INT32 - json_name: "start" - } - field { - name: "end" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_INT32 - json_name: "end" - } - } - } - message_type { - name: "ExtensionRangeOptions" - field { - name: "uninterpreted_option" - number: 999 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.UninterpretedOption" - json_name: "uninterpretedOption" - } - extension_range { - start: 1000 - end: 536870912 - } - } - message_type { - name: "FieldDescriptorProto" - field { - name: "name" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "name" - } - field { - name: "number" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_INT32 - json_name: "number" - } - field { - name: "label" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".google.protobuf.FieldDescriptorProto.Label" - json_name: "label" - } - field { - name: "type" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".google.protobuf.FieldDescriptorProto.Type" - json_name: "type" - } - field { - name: "type_name" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "typeName" - } - field { - name: "extendee" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "extendee" - } - field { - name: "default_value" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "defaultValue" - } - field { - name: "oneof_index" - number: 9 - label: LABEL_OPTIONAL - type: TYPE_INT32 - json_name: "oneofIndex" - } - field { - name: "json_name" - number: 10 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "jsonName" - } - field { - name: "options" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.FieldOptions" - json_name: "options" - } - enum_type { - name: "Type" - value { - name: "TYPE_DOUBLE" - number: 1 - } - value { - name: "TYPE_FLOAT" - number: 2 - } - value { - name: "TYPE_INT64" - number: 3 - } - value { - name: "TYPE_UINT64" - number: 4 - } - value { - name: "TYPE_INT32" - number: 5 - } - value { - name: "TYPE_FIXED64" - number: 6 - } - value { - name: "TYPE_FIXED32" - number: 7 - } - value { - name: "TYPE_BOOL" - number: 8 - } - value { - name: "TYPE_STRING" - number: 9 - } - value { - name: "TYPE_GROUP" - number: 10 - } - value { - name: "TYPE_MESSAGE" - number: 11 - } - value { - name: "TYPE_BYTES" - number: 12 - } - value { - name: "TYPE_UINT32" - number: 13 - } - value { - name: "TYPE_ENUM" - number: 14 - } - value { - name: "TYPE_SFIXED32" - number: 15 - } - value { - name: "TYPE_SFIXED64" - number: 16 - } - value { - name: "TYPE_SINT32" - number: 17 - } - value { - name: "TYPE_SINT64" - number: 18 - } - } - enum_type { - name: "Label" - value { - name: "LABEL_OPTIONAL" - number: 1 - } - value { - name: "LABEL_REQUIRED" - number: 2 - } - value { - name: "LABEL_REPEATED" - number: 3 - } - } - } - message_type { - name: "OneofDescriptorProto" - field { - name: "name" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "name" - } - field { - name: "options" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.OneofOptions" - json_name: "options" - } - } - message_type { - name: "EnumDescriptorProto" - field { - name: "name" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "name" - } - field { - name: "value" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.EnumValueDescriptorProto" - json_name: "value" - } - field { - name: "options" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.EnumOptions" - json_name: "options" - } - field { - name: "reserved_range" - number: 4 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.EnumDescriptorProto.EnumReservedRange" - json_name: "reservedRange" - } - field { - name: "reserved_name" - number: 5 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "reservedName" - } - nested_type { - name: "EnumReservedRange" - field { - name: "start" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_INT32 - json_name: "start" - } - field { - name: "end" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_INT32 - json_name: "end" - } - } - } - message_type { - name: "EnumValueDescriptorProto" - field { - name: "name" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "name" - } - field { - name: "number" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_INT32 - json_name: "number" - } - field { - name: "options" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.EnumValueOptions" - json_name: "options" - } - } - message_type { - name: "ServiceDescriptorProto" - field { - name: "name" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "name" - } - field { - name: "method" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.MethodDescriptorProto" - json_name: "method" - } - field { - name: "options" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.ServiceOptions" - json_name: "options" - } - } - message_type { - name: "MethodDescriptorProto" - field { - name: "name" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "name" - } - field { - name: "input_type" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "inputType" - } - field { - name: "output_type" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "outputType" - } - field { - name: "options" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.MethodOptions" - json_name: "options" - } - field { - name: "client_streaming" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "clientStreaming" - } - field { - name: "server_streaming" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "serverStreaming" - } - } - message_type { - name: "FileOptions" - field { - name: "java_package" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "javaPackage" - } - field { - name: "java_outer_classname" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "javaOuterClassname" - } - field { - name: "java_multiple_files" - number: 10 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "javaMultipleFiles" - } - field { - name: "java_generate_equals_and_hash" - number: 20 - label: LABEL_OPTIONAL - type: TYPE_BOOL - options { - deprecated: true - } - json_name: "javaGenerateEqualsAndHash" - } - field { - name: "java_string_check_utf8" - number: 27 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "javaStringCheckUtf8" - } - field { - name: "optimize_for" - number: 9 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".google.protobuf.FileOptions.OptimizeMode" - default_value: "SPEED" - json_name: "optimizeFor" - } - field { - name: "go_package" - number: 11 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "goPackage" - } - field { - name: "cc_generic_services" - number: 16 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "ccGenericServices" - } - field { - name: "java_generic_services" - number: 17 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "javaGenericServices" - } - field { - name: "py_generic_services" - number: 18 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "pyGenericServices" - } - field { - name: "php_generic_services" - number: 42 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "phpGenericServices" - } - field { - name: "deprecated" - number: 23 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "deprecated" - } - field { - name: "cc_enable_arenas" - number: 31 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "ccEnableArenas" - } - field { - name: "objc_class_prefix" - number: 36 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "objcClassPrefix" - } - field { - name: "csharp_namespace" - number: 37 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "csharpNamespace" - } - field { - name: "swift_prefix" - number: 39 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "swiftPrefix" - } - field { - name: "php_class_prefix" - number: 40 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "phpClassPrefix" - } - field { - name: "php_namespace" - number: 41 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "phpNamespace" - } - field { - name: "php_metadata_namespace" - number: 44 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "phpMetadataNamespace" - } - field { - name: "ruby_package" - number: 45 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "rubyPackage" - } - field { - name: "uninterpreted_option" - number: 999 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.UninterpretedOption" - json_name: "uninterpretedOption" - } - enum_type { - name: "OptimizeMode" - value { - name: "SPEED" - number: 1 - } - value { - name: "CODE_SIZE" - number: 2 - } - value { - name: "LITE_RUNTIME" - number: 3 - } - } - extension_range { - start: 1000 - end: 536870912 - } - reserved_range { - start: 38 - end: 39 - } - } - message_type { - name: "MessageOptions" - field { - name: "message_set_wire_format" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "messageSetWireFormat" - } - field { - name: "no_standard_descriptor_accessor" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "noStandardDescriptorAccessor" - } - field { - name: "deprecated" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "deprecated" - } - field { - name: "map_entry" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "mapEntry" - } - field { - name: "uninterpreted_option" - number: 999 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.UninterpretedOption" - json_name: "uninterpretedOption" - } - extension_range { - start: 1000 - end: 536870912 - } - reserved_range { - start: 8 - end: 9 - } - reserved_range { - start: 9 - end: 10 - } - } - message_type { - name: "FieldOptions" - field { - name: "ctype" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".google.protobuf.FieldOptions.CType" - default_value: "STRING" - json_name: "ctype" - } - field { - name: "packed" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "packed" - } - field { - name: "jstype" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".google.protobuf.FieldOptions.JSType" - default_value: "JS_NORMAL" - json_name: "jstype" - } - field { - name: "lazy" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "lazy" - } - field { - name: "deprecated" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "deprecated" - } - field { - name: "weak" - number: 10 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "weak" - } - field { - name: "uninterpreted_option" - number: 999 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.UninterpretedOption" - json_name: "uninterpretedOption" - } - enum_type { - name: "CType" - value { - name: "STRING" - number: 0 - } - value { - name: "CORD" - number: 1 - } - value { - name: "STRING_PIECE" - number: 2 - } - } - enum_type { - name: "JSType" - value { - name: "JS_NORMAL" - number: 0 - } - value { - name: "JS_STRING" - number: 1 - } - value { - name: "JS_NUMBER" - number: 2 - } - } - extension_range { - start: 1000 - end: 536870912 - } - reserved_range { - start: 4 - end: 5 - } - } - message_type { - name: "OneofOptions" - field { - name: "uninterpreted_option" - number: 999 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.UninterpretedOption" - json_name: "uninterpretedOption" - } - extension_range { - start: 1000 - end: 536870912 - } - } - message_type { - name: "EnumOptions" - field { - name: "allow_alias" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "allowAlias" - } - field { - name: "deprecated" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "deprecated" - } - field { - name: "uninterpreted_option" - number: 999 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.UninterpretedOption" - json_name: "uninterpretedOption" - } - extension_range { - start: 1000 - end: 536870912 - } - reserved_range { - start: 5 - end: 6 - } - } - message_type { - name: "EnumValueOptions" - field { - name: "deprecated" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "deprecated" - } - field { - name: "uninterpreted_option" - number: 999 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.UninterpretedOption" - json_name: "uninterpretedOption" - } - extension_range { - start: 1000 - end: 536870912 - } - } - message_type { - name: "ServiceOptions" - field { - name: "deprecated" - number: 33 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "deprecated" - } - field { - name: "uninterpreted_option" - number: 999 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.UninterpretedOption" - json_name: "uninterpretedOption" - } - extension_range { - start: 1000 - end: 536870912 - } - } - message_type { - name: "MethodOptions" - field { - name: "deprecated" - number: 33 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "false" - json_name: "deprecated" - } - field { - name: "idempotency_level" - number: 34 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".google.protobuf.MethodOptions.IdempotencyLevel" - default_value: "IDEMPOTENCY_UNKNOWN" - json_name: "idempotencyLevel" - } - field { - name: "uninterpreted_option" - number: 999 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.UninterpretedOption" - json_name: "uninterpretedOption" - } - enum_type { - name: "IdempotencyLevel" - value { - name: "IDEMPOTENCY_UNKNOWN" - number: 0 - } - value { - name: "NO_SIDE_EFFECTS" - number: 1 - } - value { - name: "IDEMPOTENT" - number: 2 - } - } - extension_range { - start: 1000 - end: 536870912 - } - } - message_type { - name: "UninterpretedOption" - field { - name: "name" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.UninterpretedOption.NamePart" - json_name: "name" - } - field { - name: "identifier_value" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "identifierValue" - } - field { - name: "positive_int_value" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "positiveIntValue" - } - field { - name: "negative_int_value" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "negativeIntValue" - } - field { - name: "double_value" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_DOUBLE - json_name: "doubleValue" - } - field { - name: "string_value" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "stringValue" - } - field { - name: "aggregate_value" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "aggregateValue" - } - nested_type { - name: "NamePart" - field { - name: "name_part" - number: 1 - label: LABEL_REQUIRED - type: TYPE_STRING - json_name: "namePart" - } - field { - name: "is_extension" - number: 2 - label: LABEL_REQUIRED - type: TYPE_BOOL - json_name: "isExtension" - } - } - } - message_type { - name: "SourceCodeInfo" - field { - name: "location" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.SourceCodeInfo.Location" - json_name: "location" - } - nested_type { - name: "Location" - field { - name: "path" - number: 1 - label: LABEL_REPEATED - type: TYPE_INT32 - options { - packed: true - } - json_name: "path" - } - field { - name: "span" - number: 2 - label: LABEL_REPEATED - type: TYPE_INT32 - options { - packed: true - } - json_name: "span" - } - field { - name: "leading_comments" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "leadingComments" - } - field { - name: "trailing_comments" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "trailingComments" - } - field { - name: "leading_detached_comments" - number: 6 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "leadingDetachedComments" - } - } - } - message_type { - name: "GeneratedCodeInfo" - field { - name: "annotation" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".google.protobuf.GeneratedCodeInfo.Annotation" - json_name: "annotation" - } - nested_type { - name: "Annotation" - field { - name: "path" - number: 1 - label: LABEL_REPEATED - type: TYPE_INT32 - options { - packed: true - } - json_name: "path" - } - field { - name: "source_file" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "sourceFile" - } - field { - name: "begin" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_INT32 - json_name: "begin" - } - field { - name: "end" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_INT32 - json_name: "end" - } - } - } - options { - java_package: "com.google.protobuf" - java_outer_classname: "DescriptorProtos" - optimize_for: SPEED - go_package: "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor" - cc_enable_arenas: true - objc_class_prefix: "GPB" - csharp_namespace: "Google.Protobuf.Reflection" - } -} -file { - name: "gogoproto/gogo.proto" - package: "gogoproto" - dependency: "google/protobuf/descriptor.proto" - extension { - name: "goproto_enum_prefix" - extendee: ".google.protobuf.EnumOptions" - number: 62001 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoEnumPrefix" - } - extension { - name: "goproto_enum_stringer" - extendee: ".google.protobuf.EnumOptions" - number: 62021 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoEnumStringer" - } - extension { - name: "enum_stringer" - extendee: ".google.protobuf.EnumOptions" - number: 62022 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "enumStringer" - } - extension { - name: "enum_customname" - extendee: ".google.protobuf.EnumOptions" - number: 62023 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "enumCustomname" - } - extension { - name: "enumdecl" - extendee: ".google.protobuf.EnumOptions" - number: 62024 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "enumdecl" - } - extension { - name: "enumvalue_customname" - extendee: ".google.protobuf.EnumValueOptions" - number: 66001 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "enumvalueCustomname" - } - extension { - name: "goproto_getters_all" - extendee: ".google.protobuf.FileOptions" - number: 63001 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoGettersAll" - } - extension { - name: "goproto_enum_prefix_all" - extendee: ".google.protobuf.FileOptions" - number: 63002 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoEnumPrefixAll" - } - extension { - name: "goproto_stringer_all" - extendee: ".google.protobuf.FileOptions" - number: 63003 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoStringerAll" - } - extension { - name: "verbose_equal_all" - extendee: ".google.protobuf.FileOptions" - number: 63004 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "verboseEqualAll" - } - extension { - name: "face_all" - extendee: ".google.protobuf.FileOptions" - number: 63005 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "faceAll" - } - extension { - name: "gostring_all" - extendee: ".google.protobuf.FileOptions" - number: 63006 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "gostringAll" - } - extension { - name: "populate_all" - extendee: ".google.protobuf.FileOptions" - number: 63007 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "populateAll" - } - extension { - name: "stringer_all" - extendee: ".google.protobuf.FileOptions" - number: 63008 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "stringerAll" - } - extension { - name: "onlyone_all" - extendee: ".google.protobuf.FileOptions" - number: 63009 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "onlyoneAll" - } - extension { - name: "equal_all" - extendee: ".google.protobuf.FileOptions" - number: 63013 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "equalAll" - } - extension { - name: "description_all" - extendee: ".google.protobuf.FileOptions" - number: 63014 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "descriptionAll" - } - extension { - name: "testgen_all" - extendee: ".google.protobuf.FileOptions" - number: 63015 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "testgenAll" - } - extension { - name: "benchgen_all" - extendee: ".google.protobuf.FileOptions" - number: 63016 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "benchgenAll" - } - extension { - name: "marshaler_all" - extendee: ".google.protobuf.FileOptions" - number: 63017 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "marshalerAll" - } - extension { - name: "unmarshaler_all" - extendee: ".google.protobuf.FileOptions" - number: 63018 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "unmarshalerAll" - } - extension { - name: "stable_marshaler_all" - extendee: ".google.protobuf.FileOptions" - number: 63019 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "stableMarshalerAll" - } - extension { - name: "sizer_all" - extendee: ".google.protobuf.FileOptions" - number: 63020 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "sizerAll" - } - extension { - name: "goproto_enum_stringer_all" - extendee: ".google.protobuf.FileOptions" - number: 63021 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoEnumStringerAll" - } - extension { - name: "enum_stringer_all" - extendee: ".google.protobuf.FileOptions" - number: 63022 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "enumStringerAll" - } - extension { - name: "unsafe_marshaler_all" - extendee: ".google.protobuf.FileOptions" - number: 63023 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "unsafeMarshalerAll" - } - extension { - name: "unsafe_unmarshaler_all" - extendee: ".google.protobuf.FileOptions" - number: 63024 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "unsafeUnmarshalerAll" - } - extension { - name: "goproto_extensions_map_all" - extendee: ".google.protobuf.FileOptions" - number: 63025 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoExtensionsMapAll" - } - extension { - name: "goproto_unrecognized_all" - extendee: ".google.protobuf.FileOptions" - number: 63026 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoUnrecognizedAll" - } - extension { - name: "gogoproto_import" - extendee: ".google.protobuf.FileOptions" - number: 63027 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "gogoprotoImport" - } - extension { - name: "protosizer_all" - extendee: ".google.protobuf.FileOptions" - number: 63028 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "protosizerAll" - } - extension { - name: "compare_all" - extendee: ".google.protobuf.FileOptions" - number: 63029 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "compareAll" - } - extension { - name: "typedecl_all" - extendee: ".google.protobuf.FileOptions" - number: 63030 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "typedeclAll" - } - extension { - name: "enumdecl_all" - extendee: ".google.protobuf.FileOptions" - number: 63031 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "enumdeclAll" - } - extension { - name: "goproto_registration" - extendee: ".google.protobuf.FileOptions" - number: 63032 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoRegistration" - } - extension { - name: "messagename_all" - extendee: ".google.protobuf.FileOptions" - number: 63033 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "messagenameAll" - } - extension { - name: "goproto_sizecache_all" - extendee: ".google.protobuf.FileOptions" - number: 63034 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoSizecacheAll" - } - extension { - name: "goproto_unkeyed_all" - extendee: ".google.protobuf.FileOptions" - number: 63035 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoUnkeyedAll" - } - extension { - name: "goproto_getters" - extendee: ".google.protobuf.MessageOptions" - number: 64001 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoGetters" - } - extension { - name: "goproto_stringer" - extendee: ".google.protobuf.MessageOptions" - number: 64003 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoStringer" - } - extension { - name: "verbose_equal" - extendee: ".google.protobuf.MessageOptions" - number: 64004 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "verboseEqual" - } - extension { - name: "face" - extendee: ".google.protobuf.MessageOptions" - number: 64005 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "face" - } - extension { - name: "gostring" - extendee: ".google.protobuf.MessageOptions" - number: 64006 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "gostring" - } - extension { - name: "populate" - extendee: ".google.protobuf.MessageOptions" - number: 64007 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "populate" - } - extension { - name: "stringer" - extendee: ".google.protobuf.MessageOptions" - number: 67008 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "stringer" - } - extension { - name: "onlyone" - extendee: ".google.protobuf.MessageOptions" - number: 64009 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "onlyone" - } - extension { - name: "equal" - extendee: ".google.protobuf.MessageOptions" - number: 64013 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "equal" - } - extension { - name: "description" - extendee: ".google.protobuf.MessageOptions" - number: 64014 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "description" - } - extension { - name: "testgen" - extendee: ".google.protobuf.MessageOptions" - number: 64015 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "testgen" - } - extension { - name: "benchgen" - extendee: ".google.protobuf.MessageOptions" - number: 64016 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "benchgen" - } - extension { - name: "marshaler" - extendee: ".google.protobuf.MessageOptions" - number: 64017 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "marshaler" - } - extension { - name: "unmarshaler" - extendee: ".google.protobuf.MessageOptions" - number: 64018 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "unmarshaler" - } - extension { - name: "stable_marshaler" - extendee: ".google.protobuf.MessageOptions" - number: 64019 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "stableMarshaler" - } - extension { - name: "sizer" - extendee: ".google.protobuf.MessageOptions" - number: 64020 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "sizer" - } - extension { - name: "unsafe_marshaler" - extendee: ".google.protobuf.MessageOptions" - number: 64023 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "unsafeMarshaler" - } - extension { - name: "unsafe_unmarshaler" - extendee: ".google.protobuf.MessageOptions" - number: 64024 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "unsafeUnmarshaler" - } - extension { - name: "goproto_extensions_map" - extendee: ".google.protobuf.MessageOptions" - number: 64025 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoExtensionsMap" - } - extension { - name: "goproto_unrecognized" - extendee: ".google.protobuf.MessageOptions" - number: 64026 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoUnrecognized" - } - extension { - name: "protosizer" - extendee: ".google.protobuf.MessageOptions" - number: 64028 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "protosizer" - } - extension { - name: "compare" - extendee: ".google.protobuf.MessageOptions" - number: 64029 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "compare" - } - extension { - name: "typedecl" - extendee: ".google.protobuf.MessageOptions" - number: 64030 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "typedecl" - } - extension { - name: "messagename" - extendee: ".google.protobuf.MessageOptions" - number: 64033 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "messagename" - } - extension { - name: "goproto_sizecache" - extendee: ".google.protobuf.MessageOptions" - number: 64034 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoSizecache" - } - extension { - name: "goproto_unkeyed" - extendee: ".google.protobuf.MessageOptions" - number: 64035 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "goprotoUnkeyed" - } - extension { - name: "nullable" - extendee: ".google.protobuf.FieldOptions" - number: 65001 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "nullable" - } - extension { - name: "embed" - extendee: ".google.protobuf.FieldOptions" - number: 65002 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "embed" - } - extension { - name: "customtype" - extendee: ".google.protobuf.FieldOptions" - number: 65003 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "customtype" - } - extension { - name: "customname" - extendee: ".google.protobuf.FieldOptions" - number: 65004 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "customname" - } - extension { - name: "jsontag" - extendee: ".google.protobuf.FieldOptions" - number: 65005 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "jsontag" - } - extension { - name: "moretags" - extendee: ".google.protobuf.FieldOptions" - number: 65006 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "moretags" - } - extension { - name: "casttype" - extendee: ".google.protobuf.FieldOptions" - number: 65007 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "casttype" - } - extension { - name: "castkey" - extendee: ".google.protobuf.FieldOptions" - number: 65008 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "castkey" - } - extension { - name: "castvalue" - extendee: ".google.protobuf.FieldOptions" - number: 65009 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "castvalue" - } - extension { - name: "stdtime" - extendee: ".google.protobuf.FieldOptions" - number: 65010 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "stdtime" - } - extension { - name: "stdduration" - extendee: ".google.protobuf.FieldOptions" - number: 65011 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "stdduration" - } - extension { - name: "wktpointer" - extendee: ".google.protobuf.FieldOptions" - number: 65012 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "wktpointer" - } - options { - java_package: "com.google.protobuf" - java_outer_classname: "GoGoProtos" - go_package: "github.com/gogo/protobuf/gogoproto" - } -} -file { - name: "github.com/docker/swarmkit/api/types.proto" - package: "docker.swarmkit.v1" - dependency: "google/protobuf/timestamp.proto" - dependency: "google/protobuf/duration.proto" - dependency: "google/protobuf/wrappers.proto" - dependency: "gogoproto/gogo.proto" - message_type { - name: "Version" - field { - name: "index" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "index" - } - } - message_type { - name: "IndexEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "val" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "val" - } - } - message_type { - name: "Annotations" - field { - name: "name" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "name" - } - field { - name: "labels" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Annotations.LabelsEntry" - json_name: "labels" - } - field { - name: "indices" - number: 4 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.IndexEntry" - options { - 65001: 0 - } - json_name: "indices" - } - nested_type { - name: "LabelsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - message_type { - name: "NamedGenericResource" - field { - name: "kind" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "kind" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - } - message_type { - name: "DiscreteGenericResource" - field { - name: "kind" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "kind" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "value" - } - } - message_type { - name: "GenericResource" - field { - name: "named_resource_spec" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NamedGenericResource" - oneof_index: 0 - json_name: "namedResourceSpec" - } - field { - name: "discrete_resource_spec" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.DiscreteGenericResource" - oneof_index: 0 - json_name: "discreteResourceSpec" - } - oneof_decl { - name: "resource" - } - } - message_type { - name: "Resources" - field { - name: "nano_cpus" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_INT64 - options { - 65004: "NanoCPUs" - } - json_name: "nanoCpus" - } - field { - name: "memory_bytes" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "memoryBytes" - } - field { - name: "generic" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.GenericResource" - json_name: "generic" - } - } - message_type { - name: "ResourceRequirements" - field { - name: "limits" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Resources" - json_name: "limits" - } - field { - name: "reservations" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Resources" - json_name: "reservations" - } - field { - name: "swap_bytes" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Int64Value" - json_name: "swapBytes" - } - field { - name: "memory_swappiness" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Int64Value" - json_name: "memorySwappiness" - } - } - message_type { - name: "Platform" - field { - name: "architecture" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "architecture" - } - field { - name: "os" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "OS" - } - json_name: "os" - } - } - message_type { - name: "PluginDescription" - field { - name: "type" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "type" - } - field { - name: "name" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "name" - } - } - message_type { - name: "EngineDescription" - field { - name: "engine_version" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "engineVersion" - } - field { - name: "labels" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.EngineDescription.LabelsEntry" - json_name: "labels" - } - field { - name: "plugins" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.PluginDescription" - options { - 65001: 0 - } - json_name: "plugins" - } - nested_type { - name: "LabelsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - message_type { - name: "NodeDescription" - field { - name: "hostname" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "hostname" - } - field { - name: "platform" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Platform" - json_name: "platform" - } - field { - name: "resources" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Resources" - json_name: "resources" - } - field { - name: "engine" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.EngineDescription" - json_name: "engine" - } - field { - name: "tls_info" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NodeTLSInfo" - options { - 65004: "TLSInfo" - } - json_name: "tlsInfo" - } - field { - name: "fips" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_BOOL - options { - 65004: "FIPS" - } - json_name: "fips" - } - field { - name: "csi_info" - number: 7 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NodeCSIInfo" - options { - 65004: "CSIInfo" - } - json_name: "csiInfo" - } - } - message_type { - name: "NodeTLSInfo" - field { - name: "trust_root" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "trustRoot" - } - field { - name: "cert_issuer_subject" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "certIssuerSubject" - } - field { - name: "cert_issuer_public_key" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "certIssuerPublicKey" - } - } - message_type { - name: "NodeCSIInfo" - field { - name: "plugin_name" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "pluginName" - } - field { - name: "node_id" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "nodeId" - } - field { - name: "max_volumes_per_node" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "maxVolumesPerNode" - } - field { - name: "accessible_topology" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Topology" - json_name: "accessibleTopology" - } - } - message_type { - name: "RaftMemberStatus" - field { - name: "leader" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "leader" - } - field { - name: "reachability" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.RaftMemberStatus.Reachability" - json_name: "reachability" - } - field { - name: "message" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "message" - } - enum_type { - name: "Reachability" - value { - name: "UNKNOWN" - number: 0 - } - value { - name: "UNREACHABLE" - number: 1 - } - value { - name: "REACHABLE" - number: 2 - } - } - } - message_type { - name: "NodeStatus" - field { - name: "state" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.NodeStatus.State" - json_name: "state" - } - field { - name: "message" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "message" - } - field { - name: "addr" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "addr" - } - enum_type { - name: "State" - value { - name: "UNKNOWN" - number: 0 - } - value { - name: "DOWN" - number: 1 - } - value { - name: "READY" - number: 2 - } - value { - name: "DISCONNECTED" - number: 3 - } - } - } - message_type { - name: "Image" - field { - name: "reference" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "reference" - } - } - message_type { - name: "Mount" - field { - name: "type" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.Mount.Type" - json_name: "type" - } - field { - name: "source" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "source" - } - field { - name: "target" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "target" - } - field { - name: "readonly" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_BOOL - options { - 65004: "ReadOnly" - } - json_name: "readonly" - } - field { - name: "consistency" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.Mount.Consistency" - json_name: "consistency" - } - field { - name: "bind_options" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Mount.BindOptions" - json_name: "bindOptions" - } - field { - name: "volume_options" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Mount.VolumeOptions" - json_name: "volumeOptions" - } - field { - name: "tmpfs_options" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Mount.TmpfsOptions" - json_name: "tmpfsOptions" - } - nested_type { - name: "BindOptions" - field { - name: "propagation" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.Mount.BindOptions.Propagation" - json_name: "propagation" - } - field { - name: "nonrecursive" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BOOL - options { - 65004: "NonRecursive" - } - json_name: "nonrecursive" - } - field { - name: "createmountpoint" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BOOL - options { - 65004: "CreateMountpoint" - } - json_name: "createmountpoint" - } - field { - name: "readonlynonrecursive" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_BOOL - options { - 65004: "ReadOnlyNonRecursive" - } - json_name: "readonlynonrecursive" - } - field { - name: "readonlyforcerecursive" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_BOOL - options { - 65004: "ReadOnlyForceRecursive" - } - json_name: "readonlyforcerecursive" - } - enum_type { - name: "Propagation" - value { - name: "RPRIVATE" - number: 0 - options { - 66001: "MountPropagationRPrivate" - } - } - value { - name: "PRIVATE" - number: 1 - options { - 66001: "MountPropagationPrivate" - } - } - value { - name: "RSHARED" - number: 2 - options { - 66001: "MountPropagationRShared" - } - } - value { - name: "SHARED" - number: 3 - options { - 66001: "MountPropagationShared" - } - } - value { - name: "RSLAVE" - number: 4 - options { - 66001: "MountPropagationRSlave" - } - } - value { - name: "SLAVE" - number: 5 - options { - 66001: "MountPropagationSlave" - } - } - options { - 62001: 0 - 62023: "MountPropagation" - } - } - } - nested_type { - name: "VolumeOptions" - field { - name: "nocopy" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BOOL - options { - 65004: "NoCopy" - } - json_name: "nocopy" - } - field { - name: "labels" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Mount.VolumeOptions.LabelsEntry" - json_name: "labels" - } - field { - name: "driver_config" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Driver" - json_name: "driverConfig" - } - field { - name: "subpath" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "Subpath" - } - json_name: "subpath" - } - nested_type { - name: "LabelsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - nested_type { - name: "TmpfsOptions" - field { - name: "size_bytes" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "sizeBytes" - } - field { - name: "mode" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_UINT32 - options { - 65003: "os.FileMode" - 65001: 0 - } - json_name: "mode" - } - field { - name: "options" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "options" - } - } - enum_type { - name: "Type" - value { - name: "BIND" - number: 0 - options { - 66001: "MountTypeBind" - } - } - value { - name: "VOLUME" - number: 1 - options { - 66001: "MountTypeVolume" - } - } - value { - name: "TMPFS" - number: 2 - options { - 66001: "MountTypeTmpfs" - } - } - value { - name: "NPIPE" - number: 3 - options { - 66001: "MountTypeNamedPipe" - } - } - value { - name: "CLUSTER" - number: 4 - options { - 66001: "MountTypeCluster" - } - } - options { - 62001: 0 - 62023: "MountType" - } - } - enum_type { - name: "Consistency" - value { - name: "DEFAULT" - number: 0 - options { - 66001: "MountConsistencyDefault" - } - } - value { - name: "CONSISTENT" - number: 1 - options { - 66001: "MountConsistencyFull" - } - } - value { - name: "CACHED" - number: 2 - options { - 66001: "MountConsistencyCached" - } - } - value { - name: "DELEGATED" - number: 3 - options { - 66001: "MountConsistencyDelegated" - } - } - options { - 62001: 0 - 62023: "MountConsistency" - } - } - } - message_type { - name: "RestartPolicy" - field { - name: "condition" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.RestartPolicy.RestartCondition" - json_name: "condition" - } - field { - name: "delay" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Duration" - json_name: "delay" - } - field { - name: "max_attempts" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "maxAttempts" - } - field { - name: "window" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Duration" - json_name: "window" - } - enum_type { - name: "RestartCondition" - value { - name: "NONE" - number: 0 - options { - 66001: "RestartOnNone" - } - } - value { - name: "ON_FAILURE" - number: 1 - options { - 66001: "RestartOnFailure" - } - } - value { - name: "ANY" - number: 2 - options { - 66001: "RestartOnAny" - } - } - options { - 62001: 0 - 62023: "RestartCondition" - } - } - } - message_type { - name: "UpdateConfig" - field { - name: "parallelism" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "parallelism" - } - field { - name: "delay" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Duration" - options { - 65011: 1 - 65001: 0 - } - json_name: "delay" - } - field { - name: "failure_action" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.UpdateConfig.FailureAction" - json_name: "failureAction" - } - field { - name: "monitor" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Duration" - json_name: "monitor" - } - field { - name: "max_failure_ratio" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_FLOAT - json_name: "maxFailureRatio" - } - field { - name: "order" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.UpdateConfig.UpdateOrder" - json_name: "order" - } - enum_type { - name: "FailureAction" - value { - name: "PAUSE" - number: 0 - } - value { - name: "CONTINUE" - number: 1 - } - value { - name: "ROLLBACK" - number: 2 - } - } - enum_type { - name: "UpdateOrder" - value { - name: "STOP_FIRST" - number: 0 - } - value { - name: "START_FIRST" - number: 1 - } - } - } - message_type { - name: "UpdateStatus" - field { - name: "state" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.UpdateStatus.UpdateState" - json_name: "state" - } - field { - name: "started_at" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Timestamp" - json_name: "startedAt" - } - field { - name: "completed_at" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Timestamp" - json_name: "completedAt" - } - field { - name: "message" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "message" - } - enum_type { - name: "UpdateState" - value { - name: "UNKNOWN" - number: 0 - } - value { - name: "UPDATING" - number: 1 - } - value { - name: "PAUSED" - number: 2 - } - value { - name: "COMPLETED" - number: 3 - } - value { - name: "ROLLBACK_STARTED" - number: 4 - } - value { - name: "ROLLBACK_PAUSED" - number: 5 - } - value { - name: "ROLLBACK_COMPLETED" - number: 6 - } - } - } - message_type { - name: "ContainerStatus" - field { - name: "container_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "containerId" - } - field { - name: "pid" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_INT32 - options { - 65004: "PID" - } - json_name: "pid" - } - field { - name: "exit_code" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_INT32 - json_name: "exitCode" - } - } - message_type { - name: "PortStatus" - field { - name: "ports" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.PortConfig" - json_name: "ports" - } - } - message_type { - name: "TaskStatus" - field { - name: "timestamp" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Timestamp" - json_name: "timestamp" - } - field { - name: "state" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.TaskState" - json_name: "state" - } - field { - name: "message" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "message" - } - field { - name: "err" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "err" - } - field { - name: "container" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ContainerStatus" - oneof_index: 0 - json_name: "container" - } - field { - name: "port_status" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.PortStatus" - json_name: "portStatus" - } - field { - name: "applied_by" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "appliedBy" - } - field { - name: "applied_at" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Timestamp" - json_name: "appliedAt" - } - oneof_decl { - name: "runtime_status" - } - } - message_type { - name: "NetworkAttachmentConfig" - field { - name: "target" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "target" - } - field { - name: "aliases" - number: 2 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "aliases" - } - field { - name: "addresses" - number: 3 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "addresses" - } - field { - name: "driver_attachment_opts" - number: 4 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NetworkAttachmentConfig.DriverAttachmentOptsEntry" - json_name: "driverAttachmentOpts" - } - nested_type { - name: "DriverAttachmentOptsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - message_type { - name: "IPAMConfig" - field { - name: "family" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.IPAMConfig.AddressFamily" - json_name: "family" - } - field { - name: "subnet" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "subnet" - } - field { - name: "range" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "range" - } - field { - name: "gateway" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "gateway" - } - field { - name: "reserved" - number: 5 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.IPAMConfig.ReservedEntry" - json_name: "reserved" - } - nested_type { - name: "ReservedEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - enum_type { - name: "AddressFamily" - value { - name: "UNKNOWN" - number: 0 - } - value { - name: "IPV4" - number: 4 - } - value { - name: "IPV6" - number: 6 - } - } - } - message_type { - name: "PortConfig" - field { - name: "name" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "name" - } - field { - name: "protocol" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.PortConfig.Protocol" - json_name: "protocol" - } - field { - name: "target_port" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_UINT32 - json_name: "targetPort" - } - field { - name: "published_port" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_UINT32 - json_name: "publishedPort" - } - field { - name: "publish_mode" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.PortConfig.PublishMode" - json_name: "publishMode" - } - enum_type { - name: "Protocol" - value { - name: "TCP" - number: 0 - options { - 66001: "ProtocolTCP" - } - } - value { - name: "UDP" - number: 1 - options { - 66001: "ProtocolUDP" - } - } - value { - name: "SCTP" - number: 2 - options { - 66001: "ProtocolSCTP" - } - } - options { - 62001: 0 - } - } - enum_type { - name: "PublishMode" - value { - name: "INGRESS" - number: 0 - options { - 66001: "PublishModeIngress" - } - } - value { - name: "HOST" - number: 1 - options { - 66001: "PublishModeHost" - } - } - options { - 62023: "PublishMode" - 62001: 0 - } - } - } - message_type { - name: "Driver" - field { - name: "name" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "name" - } - field { - name: "options" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Driver.OptionsEntry" - json_name: "options" - } - nested_type { - name: "OptionsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - message_type { - name: "IPAMOptions" - field { - name: "driver" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Driver" - json_name: "driver" - } - field { - name: "configs" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.IPAMConfig" - json_name: "configs" - } - } - message_type { - name: "Peer" - field { - name: "node_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "nodeId" - } - field { - name: "addr" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "addr" - } - } - message_type { - name: "WeightedPeer" - field { - name: "peer" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Peer" - json_name: "peer" - } - field { - name: "weight" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "weight" - } - } - message_type { - name: "IssuanceStatus" - field { - name: "state" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.IssuanceStatus.State" - json_name: "state" - } - field { - name: "err" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "err" - } - enum_type { - name: "State" - value { - name: "UNKNOWN" - number: 0 - options { - 66001: "IssuanceStateUnknown" - } - } - value { - name: "RENEW" - number: 1 - options { - 66001: "IssuanceStateRenew" - } - } - value { - name: "PENDING" - number: 2 - options { - 66001: "IssuanceStatePending" - } - } - value { - name: "ISSUED" - number: 3 - options { - 66001: "IssuanceStateIssued" - } - } - value { - name: "FAILED" - number: 4 - options { - 66001: "IssuanceStateFailed" - } - } - value { - name: "ROTATE" - number: 5 - options { - 66001: "IssuanceStateRotate" - } - } - options { - 62001: 0 - } - } - } - message_type { - name: "AcceptancePolicy" - field { - name: "policies" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.AcceptancePolicy.RoleAdmissionPolicy" - json_name: "policies" - } - nested_type { - name: "RoleAdmissionPolicy" - field { - name: "role" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.NodeRole" - json_name: "role" - } - field { - name: "autoaccept" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "autoaccept" - } - field { - name: "secret" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.AcceptancePolicy.RoleAdmissionPolicy.Secret" - json_name: "secret" - } - nested_type { - name: "Secret" - field { - name: "data" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "data" - } - field { - name: "alg" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "alg" - } - } - } - } - message_type { - name: "ExternalCA" - field { - name: "protocol" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.ExternalCA.CAProtocol" - json_name: "protocol" - } - field { - name: "url" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "URL" - } - json_name: "url" - } - field { - name: "options" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ExternalCA.OptionsEntry" - json_name: "options" - } - field { - name: "ca_cert" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_BYTES - options { - 65004: "CACert" - } - json_name: "caCert" - } - nested_type { - name: "OptionsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - enum_type { - name: "CAProtocol" - value { - name: "CFSSL" - number: 0 - options { - 66001: "CAProtocolCFSSL" - } - } - } - } - message_type { - name: "CAConfig" - field { - name: "node_cert_expiry" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Duration" - json_name: "nodeCertExpiry" - } - field { - name: "external_cas" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ExternalCA" - options { - 65004: "ExternalCAs" - } - json_name: "externalCas" - } - field { - name: "signing_ca_cert" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BYTES - options { - 65004: "SigningCACert" - } - json_name: "signingCaCert" - } - field { - name: "signing_ca_key" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_BYTES - options { - 65004: "SigningCAKey" - } - json_name: "signingCaKey" - } - field { - name: "force_rotate" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "forceRotate" - } - } - message_type { - name: "OrchestrationConfig" - field { - name: "task_history_retention_limit" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "taskHistoryRetentionLimit" - } - } - message_type { - name: "TaskDefaults" - field { - name: "log_driver" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Driver" - json_name: "logDriver" - } - } - message_type { - name: "DispatcherConfig" - field { - name: "heartbeat_period" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Duration" - json_name: "heartbeatPeriod" - } - } - message_type { - name: "RaftConfig" - field { - name: "snapshot_interval" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "snapshotInterval" - } - field { - name: "keep_old_snapshots" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "keepOldSnapshots" - } - field { - name: "log_entries_for_slow_followers" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "logEntriesForSlowFollowers" - } - field { - name: "heartbeat_tick" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_UINT32 - json_name: "heartbeatTick" - } - field { - name: "election_tick" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_UINT32 - json_name: "electionTick" - } - } - message_type { - name: "EncryptionConfig" - field { - name: "auto_lock_managers" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "autoLockManagers" - } - } - message_type { - name: "SpreadOver" - field { - name: "spread_descriptor" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "spreadDescriptor" - } - } - message_type { - name: "PlacementPreference" - field { - name: "spread" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.SpreadOver" - oneof_index: 0 - json_name: "spread" - } - oneof_decl { - name: "Preference" - } - } - message_type { - name: "Placement" - field { - name: "constraints" - number: 1 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "constraints" - } - field { - name: "preferences" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.PlacementPreference" - json_name: "preferences" - } - field { - name: "platforms" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Platform" - json_name: "platforms" - } - field { - name: "max_replicas" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "maxReplicas" - } - } - message_type { - name: "JoinTokens" - field { - name: "worker" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "worker" - } - field { - name: "manager" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "manager" - } - } - message_type { - name: "RootCA" - field { - name: "ca_key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BYTES - options { - 65004: "CAKey" - } - json_name: "caKey" - } - field { - name: "ca_cert" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BYTES - options { - 65004: "CACert" - } - json_name: "caCert" - } - field { - name: "ca_cert_hash" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "CACertHash" - } - json_name: "caCertHash" - } - field { - name: "join_tokens" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.JoinTokens" - options { - 65001: 0 - } - json_name: "joinTokens" - } - field { - name: "root_rotation" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.RootRotation" - json_name: "rootRotation" - } - field { - name: "last_forced_rotation" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "lastForcedRotation" - } - } - message_type { - name: "Certificate" - field { - name: "role" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.NodeRole" - json_name: "role" - } - field { - name: "csr" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BYTES - options { - 65004: "CSR" - } - json_name: "csr" - } - field { - name: "status" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.IssuanceStatus" - options { - 65001: 0 - } - json_name: "status" - } - field { - name: "certificate" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "certificate" - } - field { - name: "cn" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "CN" - } - json_name: "cn" - } - } - message_type { - name: "EncryptionKey" - field { - name: "subsystem" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "subsystem" - } - field { - name: "algorithm" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.EncryptionKey.Algorithm" - json_name: "algorithm" - } - field { - name: "key" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "key" - } - field { - name: "lamport_time" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "lamportTime" - } - enum_type { - name: "Algorithm" - value { - name: "AES_128_GCM" - number: 0 - } - options { - 62001: 0 - } - } - } - message_type { - name: "ManagerStatus" - field { - name: "raft_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "raftId" - } - field { - name: "addr" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "addr" - } - field { - name: "leader" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "leader" - } - field { - name: "reachability" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.RaftMemberStatus.Reachability" - json_name: "reachability" - } - } - message_type { - name: "FileTarget" - field { - name: "name" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "name" - } - field { - name: "uid" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "UID" - } - json_name: "uid" - } - field { - name: "gid" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "GID" - } - json_name: "gid" - } - field { - name: "mode" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_UINT32 - options { - 65003: "os.FileMode" - 65001: 0 - } - json_name: "mode" - } - } - message_type { - name: "RuntimeTarget" - } - message_type { - name: "SecretReference" - field { - name: "secret_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "secretId" - } - field { - name: "secret_name" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "secretName" - } - field { - name: "file" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.FileTarget" - oneof_index: 0 - json_name: "file" - } - oneof_decl { - name: "target" - } - } - message_type { - name: "ConfigReference" - field { - name: "config_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "configId" - } - field { - name: "config_name" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "configName" - } - field { - name: "file" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.FileTarget" - oneof_index: 0 - json_name: "file" - } - field { - name: "runtime" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.RuntimeTarget" - oneof_index: 0 - json_name: "runtime" - } - oneof_decl { - name: "target" - } - } - message_type { - name: "BlacklistedCertificate" - field { - name: "expiry" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Timestamp" - json_name: "expiry" - } - } - message_type { - name: "HealthConfig" - field { - name: "test" - number: 1 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "test" - } - field { - name: "interval" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Duration" - json_name: "interval" - } - field { - name: "timeout" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Duration" - json_name: "timeout" - } - field { - name: "retries" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_INT32 - json_name: "retries" - } - field { - name: "start_period" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Duration" - json_name: "startPeriod" - } - field { - name: "start_interval" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Duration" - json_name: "startInterval" - } - } - message_type { - name: "MaybeEncryptedRecord" - field { - name: "algorithm" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.MaybeEncryptedRecord.Algorithm" - json_name: "algorithm" - } - field { - name: "data" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "data" - } - field { - name: "nonce" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "nonce" - } - enum_type { - name: "Algorithm" - value { - name: "NONE" - number: 0 - options { - 66001: "NotEncrypted" - } - } - value { - name: "SECRETBOX_SALSA20_POLY1305" - number: 1 - options { - 66001: "NACLSecretboxSalsa20Poly1305" - } - } - value { - name: "FERNET_AES_128_CBC" - number: 2 - options { - 66001: "FernetAES128CBC" - } - } - } - } - message_type { - name: "RootRotation" - field { - name: "ca_cert" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BYTES - options { - 65004: "CACert" - } - json_name: "caCert" - } - field { - name: "ca_key" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BYTES - options { - 65004: "CAKey" - } - json_name: "caKey" - } - field { - name: "cross_signed_ca_cert" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BYTES - options { - 65004: "CrossSignedCACert" - } - json_name: "crossSignedCaCert" - } - } - message_type { - name: "Privileges" - field { - name: "credential_spec" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Privileges.CredentialSpec" - json_name: "credentialSpec" - } - field { - name: "selinux_context" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Privileges.SELinuxContext" - options { - 65004: "SELinuxContext" - } - json_name: "selinuxContext" - } - field { - name: "seccomp" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Privileges.SeccompOpts" - json_name: "seccomp" - } - field { - name: "apparmor" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Privileges.AppArmorOpts" - json_name: "apparmor" - } - field { - name: "no_new_privileges" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "noNewPrivileges" - } - nested_type { - name: "CredentialSpec" - field { - name: "file" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - oneof_index: 0 - json_name: "file" - } - field { - name: "registry" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - oneof_index: 0 - json_name: "registry" - } - field { - name: "config" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - oneof_index: 0 - json_name: "config" - } - oneof_decl { - name: "source" - } - } - nested_type { - name: "SELinuxContext" - field { - name: "disable" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "disable" - } - field { - name: "user" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "user" - } - field { - name: "role" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "role" - } - field { - name: "type" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "type" - } - field { - name: "level" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "level" - } - } - nested_type { - name: "SeccompOpts" - field { - name: "mode" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.Privileges.SeccompOpts.SeccompMode" - json_name: "mode" - } - field { - name: "profile" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "profile" - } - enum_type { - name: "SeccompMode" - value { - name: "DEFAULT" - number: 0 - } - value { - name: "UNCONFINED" - number: 1 - } - value { - name: "CUSTOM" - number: 2 - } - } - } - nested_type { - name: "AppArmorOpts" - field { - name: "mode" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.Privileges.AppArmorOpts.AppArmorMode" - json_name: "mode" - } - enum_type { - name: "AppArmorMode" - value { - name: "DEFAULT" - number: 0 - } - value { - name: "DISABLED" - number: 1 - } - } - } - } - message_type { - name: "JobStatus" - field { - name: "job_iteration" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Version" - options { - 65001: 0 - } - json_name: "jobIteration" - } - field { - name: "last_execution" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Timestamp" - json_name: "lastExecution" - } - } - message_type { - name: "VolumeAccessMode" - field { - name: "scope" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.VolumeAccessMode.Scope" - json_name: "scope" - } - field { - name: "sharing" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.VolumeAccessMode.Sharing" - json_name: "sharing" - } - field { - name: "block" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeAccessMode.BlockVolume" - oneof_index: 0 - json_name: "block" - } - field { - name: "mount" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeAccessMode.MountVolume" - oneof_index: 0 - json_name: "mount" - } - nested_type { - name: "BlockVolume" - } - nested_type { - name: "MountVolume" - field { - name: "fs_type" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "fsType" - } - field { - name: "mount_flags" - number: 2 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "mountFlags" - } - } - enum_type { - name: "Scope" - value { - name: "SINGLE_NODE" - number: 0 - options { - 66001: "VolumeScopeSingleNode" - } - } - value { - name: "MULTI_NODE" - number: 1 - options { - 66001: "VolumeScopeMultiNode" - } - } - options { - 62001: 0 - } - } - enum_type { - name: "Sharing" - value { - name: "NONE" - number: 0 - options { - 66001: "VolumeSharingNone" - } - } - value { - name: "READ_ONLY" - number: 1 - options { - 66001: "VolumeSharingReadOnly" - } - } - value { - name: "ONE_WRITER" - number: 2 - options { - 66001: "VolumeSharingOneWriter" - } - } - value { - name: "ALL" - number: 3 - options { - 66001: "VolumeSharingAll" - } - } - options { - 62001: 0 - } - } - oneof_decl { - name: "access_type" - } - } - message_type { - name: "VolumeSecret" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "secret" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "secret" - } - } - message_type { - name: "VolumePublishStatus" - field { - name: "node_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "nodeId" - } - field { - name: "state" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.VolumePublishStatus.State" - json_name: "state" - } - field { - name: "publish_context" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumePublishStatus.PublishContextEntry" - json_name: "publishContext" - } - field { - name: "message" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "message" - } - nested_type { - name: "PublishContextEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - enum_type { - name: "State" - value { - name: "PENDING_PUBLISH" - number: 0 - } - value { - name: "PUBLISHED" - number: 1 - } - value { - name: "PENDING_NODE_UNPUBLISH" - number: 2 - } - value { - name: "PENDING_UNPUBLISH" - number: 3 - } - } - } - message_type { - name: "VolumeInfo" - field { - name: "capacity_bytes" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "capacityBytes" - } - field { - name: "volume_context" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeInfo.VolumeContextEntry" - json_name: "volumeContext" - } - field { - name: "volume_id" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "volumeId" - } - field { - name: "accessible_topology" - number: 4 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Topology" - json_name: "accessibleTopology" - } - nested_type { - name: "VolumeContextEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - message_type { - name: "CapacityRange" - field { - name: "required_bytes" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "requiredBytes" - } - field { - name: "limit_bytes" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "limitBytes" - } - } - message_type { - name: "VolumeAssignment" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "id" - } - field { - name: "volume_id" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "volumeId" - } - field { - name: "driver" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Driver" - json_name: "driver" - } - field { - name: "volume_context" - number: 4 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeAssignment.VolumeContextEntry" - json_name: "volumeContext" - } - field { - name: "publish_context" - number: 5 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeAssignment.PublishContextEntry" - json_name: "publishContext" - } - field { - name: "access_mode" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeAccessMode" - json_name: "accessMode" - } - field { - name: "secrets" - number: 7 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeSecret" - json_name: "secrets" - } - nested_type { - name: "VolumeContextEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - nested_type { - name: "PublishContextEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - message_type { - name: "VolumeAttachment" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "id" - } - field { - name: "source" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "source" - } - field { - name: "target" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "target" - } - } - message_type { - name: "TopologyRequirement" - field { - name: "requisite" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Topology" - json_name: "requisite" - } - field { - name: "preferred" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Topology" - json_name: "preferred" - } - } - message_type { - name: "Topology" - field { - name: "segments" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Topology.SegmentsEntry" - json_name: "segments" - } - nested_type { - name: "SegmentsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - message_type { - name: "VolumeCapability" - field { - name: "block" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeCapability.BlockVolume" - oneof_index: 0 - json_name: "block" - } - field { - name: "mount" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeCapability.MountVolume" - oneof_index: 0 - json_name: "mount" - } - field { - name: "access_mode" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeCapability.AccessMode" - json_name: "accessMode" - } - nested_type { - name: "BlockVolume" - } - nested_type { - name: "MountVolume" - field { - name: "fs_type" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "fsType" - } - field { - name: "mount_flags" - number: 2 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "mountFlags" - } - } - nested_type { - name: "AccessMode" - field { - name: "mode" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.VolumeCapability.AccessMode.Mode" - json_name: "mode" - } - enum_type { - name: "Mode" - value { - name: "UNKNOWN" - number: 0 - } - value { - name: "SINGLE_NODE_WRITER" - number: 1 - } - value { - name: "SINGLE_NODE_READER_ONLY" - number: 2 - } - value { - name: "MULTI_NODE_READER_ONLY" - number: 3 - } - value { - name: "MULTI_NODE_SINGLE_WRITER" - number: 4 - } - value { - name: "MULTI_NODE_MULTI_WRITER" - number: 5 - } - } - } - oneof_decl { - name: "access_type" - } - } - enum_type { - name: "ResourceType" - value { - name: "TASK" - number: 0 - } - value { - name: "SECRET" - number: 1 - } - value { - name: "CONFIG" - number: 2 - } - value { - name: "VOLUME" - number: 3 - } - } - enum_type { - name: "TaskState" - value { - name: "NEW" - number: 0 - options { - 66001: "TaskStateNew" - } - } - value { - name: "PENDING" - number: 64 - options { - 66001: "TaskStatePending" - } - } - value { - name: "ASSIGNED" - number: 192 - options { - 66001: "TaskStateAssigned" - } - } - value { - name: "ACCEPTED" - number: 256 - options { - 66001: "TaskStateAccepted" - } - } - value { - name: "PREPARING" - number: 320 - options { - 66001: "TaskStatePreparing" - } - } - value { - name: "READY" - number: 384 - options { - 66001: "TaskStateReady" - } - } - value { - name: "STARTING" - number: 448 - options { - 66001: "TaskStateStarting" - } - } - value { - name: "RUNNING" - number: 512 - options { - 66001: "TaskStateRunning" - } - } - value { - name: "COMPLETE" - number: 576 - options { - 66001: "TaskStateCompleted" - } - } - value { - name: "SHUTDOWN" - number: 640 - options { - 66001: "TaskStateShutdown" - } - } - value { - name: "FAILED" - number: 704 - options { - 66001: "TaskStateFailed" - } - } - value { - name: "REJECTED" - number: 768 - options { - 66001: "TaskStateRejected" - } - } - value { - name: "REMOVE" - number: 800 - options { - 66001: "TaskStateRemove" - } - } - value { - name: "ORPHANED" - number: 832 - options { - 66001: "TaskStateOrphaned" - } - } - options { - 62001: 0 - 62023: "TaskState" - } - } - enum_type { - name: "NodeRole" - value { - name: "WORKER" - number: 0 - options { - 66001: "NodeRoleWorker" - } - } - value { - name: "MANAGER" - number: 1 - options { - 66001: "NodeRoleManager" - } - } - options { - 62023: "NodeRole" - 62001: 0 - } - } - syntax: "proto3" -} -file { - name: "google/protobuf/any.proto" - package: "google.protobuf" - message_type { - name: "Any" - field { - name: "type_url" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "typeUrl" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "value" - } - } - options { - java_package: "com.google.protobuf" - java_outer_classname: "AnyProto" - java_multiple_files: true - go_package: "github.com/golang/protobuf/ptypes/any" - objc_class_prefix: "GPB" - csharp_namespace: "Google.Protobuf.WellKnownTypes" - } - syntax: "proto3" -} -file { - name: "github.com/docker/swarmkit/api/specs.proto" - package: "docker.swarmkit.v1" - dependency: "github.com/docker/swarmkit/api/types.proto" - dependency: "gogoproto/gogo.proto" - dependency: "google/protobuf/duration.proto" - dependency: "google/protobuf/any.proto" - dependency: "google/protobuf/wrappers.proto" - message_type { - name: "NodeSpec" - field { - name: "annotations" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Annotations" - options { - 65001: 0 - } - json_name: "annotations" - } - field { - name: "desired_role" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.NodeRole" - json_name: "desiredRole" - } - field { - name: "membership" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.NodeSpec.Membership" - json_name: "membership" - } - field { - name: "availability" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.NodeSpec.Availability" - json_name: "availability" - } - enum_type { - name: "Membership" - value { - name: "PENDING" - number: 0 - options { - 66001: "NodeMembershipPending" - } - } - value { - name: "ACCEPTED" - number: 1 - options { - 66001: "NodeMembershipAccepted" - } - } - options { - 62001: 0 - } - } - enum_type { - name: "Availability" - value { - name: "ACTIVE" - number: 0 - options { - 66001: "NodeAvailabilityActive" - } - } - value { - name: "PAUSE" - number: 1 - options { - 66001: "NodeAvailabilityPause" - } - } - value { - name: "DRAIN" - number: 2 - options { - 66001: "NodeAvailabilityDrain" - } - } - options { - 62001: 0 - } - } - } - message_type { - name: "ServiceSpec" - field { - name: "annotations" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Annotations" - options { - 65001: 0 - } - json_name: "annotations" - } - field { - name: "task" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.TaskSpec" - options { - 65001: 0 - } - json_name: "task" - } - field { - name: "replicated" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ReplicatedService" - oneof_index: 0 - json_name: "replicated" - } - field { - name: "global" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.GlobalService" - oneof_index: 0 - json_name: "global" - } - field { - name: "replicated_job" - number: 10 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ReplicatedJob" - oneof_index: 0 - json_name: "replicatedJob" - } - field { - name: "global_job" - number: 11 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.GlobalJob" - oneof_index: 0 - json_name: "globalJob" - } - field { - name: "update" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.UpdateConfig" - json_name: "update" - } - field { - name: "rollback" - number: 9 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.UpdateConfig" - json_name: "rollback" - } - field { - name: "networks" - number: 7 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NetworkAttachmentConfig" - options { - deprecated: true - } - json_name: "networks" - } - field { - name: "endpoint" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.EndpointSpec" - json_name: "endpoint" - } - oneof_decl { - name: "mode" - } - } - message_type { - name: "ReplicatedService" - field { - name: "replicas" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "replicas" - } - } - message_type { - name: "GlobalService" - } - message_type { - name: "ReplicatedJob" - field { - name: "max_concurrent" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "maxConcurrent" - } - field { - name: "total_completions" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "totalCompletions" - } - } - message_type { - name: "GlobalJob" - } - message_type { - name: "TaskSpec" - field { - name: "attachment" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NetworkAttachmentSpec" - oneof_index: 0 - json_name: "attachment" - } - field { - name: "container" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ContainerSpec" - oneof_index: 0 - json_name: "container" - } - field { - name: "generic" - number: 10 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.GenericRuntimeSpec" - oneof_index: 0 - json_name: "generic" - } - field { - name: "resources" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ResourceRequirements" - json_name: "resources" - } - field { - name: "restart" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.RestartPolicy" - json_name: "restart" - } - field { - name: "placement" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Placement" - json_name: "placement" - } - field { - name: "log_driver" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Driver" - json_name: "logDriver" - } - field { - name: "networks" - number: 7 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NetworkAttachmentConfig" - json_name: "networks" - } - field { - name: "force_update" - number: 9 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "forceUpdate" - } - field { - name: "resource_references" - number: 11 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ResourceReference" - options { - 65001: 0 - } - json_name: "resourceReferences" - } - oneof_decl { - name: "runtime" - } - } - message_type { - name: "ResourceReference" - field { - name: "resource_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "resourceId" - } - field { - name: "resource_type" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.ResourceType" - json_name: "resourceType" - } - } - message_type { - name: "GenericRuntimeSpec" - field { - name: "kind" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "kind" - } - field { - name: "payload" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Any" - json_name: "payload" - } - } - message_type { - name: "NetworkAttachmentSpec" - field { - name: "container_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "containerId" - } - } - message_type { - name: "ContainerSpec" - field { - name: "image" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "image" - } - field { - name: "labels" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ContainerSpec.LabelsEntry" - json_name: "labels" - } - field { - name: "command" - number: 3 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "command" - } - field { - name: "args" - number: 4 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "args" - } - field { - name: "hostname" - number: 14 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "hostname" - } - field { - name: "env" - number: 5 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "env" - } - field { - name: "dir" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "dir" - } - field { - name: "user" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "user" - } - field { - name: "groups" - number: 11 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "groups" - } - field { - name: "privileges" - number: 22 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Privileges" - json_name: "privileges" - } - field { - name: "init" - number: 23 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.BoolValue" - json_name: "init" - } - field { - name: "tty" - number: 13 - label: LABEL_OPTIONAL - type: TYPE_BOOL - options { - 65004: "TTY" - } - json_name: "tty" - } - field { - name: "open_stdin" - number: 18 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "openStdin" - } - field { - name: "read_only" - number: 19 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "readOnly" - } - field { - name: "stop_signal" - number: 20 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "stopSignal" - } - field { - name: "mounts" - number: 8 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Mount" - options { - 65001: 0 - } - json_name: "mounts" - } - field { - name: "stop_grace_period" - number: 9 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Duration" - json_name: "stopGracePeriod" - } - field { - name: "pull_options" - number: 10 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ContainerSpec.PullOptions" - json_name: "pullOptions" - } - field { - name: "secrets" - number: 12 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.SecretReference" - json_name: "secrets" - } - field { - name: "configs" - number: 21 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ConfigReference" - json_name: "configs" - } - field { - name: "hosts" - number: 17 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "hosts" - } - field { - name: "dns_config" - number: 15 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ContainerSpec.DNSConfig" - options { - 65004: "DNSConfig" - } - json_name: "dnsConfig" - } - field { - name: "healthcheck" - number: 16 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.HealthConfig" - json_name: "healthcheck" - } - field { - name: "isolation" - number: 24 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.ContainerSpec.Isolation" - json_name: "isolation" - } - field { - name: "pidsLimit" - number: 25 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "pidsLimit" - } - field { - name: "sysctls" - number: 26 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ContainerSpec.SysctlsEntry" - json_name: "sysctls" - } - field { - name: "capability_add" - number: 27 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "capabilityAdd" - } - field { - name: "capability_drop" - number: 28 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "capabilityDrop" - } - field { - name: "ulimits" - number: 29 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ContainerSpec.Ulimit" - json_name: "ulimits" - } - field { - name: "oom_score_adj" - number: 30 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "oomScoreAdj" - } - nested_type { - name: "LabelsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - nested_type { - name: "PullOptions" - field { - name: "registry_auth" - number: 64 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "registryAuth" - } - } - nested_type { - name: "DNSConfig" - field { - name: "nameservers" - number: 1 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "nameservers" - } - field { - name: "search" - number: 2 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "search" - } - field { - name: "options" - number: 3 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "options" - } - } - nested_type { - name: "SysctlsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - nested_type { - name: "Ulimit" - field { - name: "name" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "name" - } - field { - name: "soft" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "soft" - } - field { - name: "hard" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "hard" - } - } - enum_type { - name: "Isolation" - value { - name: "ISOLATION_DEFAULT" - number: 0 - options { - 66001: "ContainerIsolationDefault" - } - } - value { - name: "ISOLATION_PROCESS" - number: 1 - options { - 66001: "ContainerIsolationProcess" - } - } - value { - name: "ISOLATION_HYPERV" - number: 2 - options { - 66001: "ContainerIsolationHyperV" - } - } - options { - 62001: 0 - } - } - } - message_type { - name: "EndpointSpec" - field { - name: "mode" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.EndpointSpec.ResolutionMode" - json_name: "mode" - } - field { - name: "ports" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.PortConfig" - json_name: "ports" - } - enum_type { - name: "ResolutionMode" - value { - name: "VIP" - number: 0 - options { - 66001: "ResolutionModeVirtualIP" - } - } - value { - name: "DNSRR" - number: 1 - options { - 66001: "ResolutionModeDNSRoundRobin" - } - } - options { - 62001: 0 - } - } - } - message_type { - name: "NetworkSpec" - field { - name: "annotations" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Annotations" - options { - 65001: 0 - } - json_name: "annotations" - } - field { - name: "driver_config" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Driver" - json_name: "driverConfig" - } - field { - name: "ipv6_enabled" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "ipv6Enabled" - } - field { - name: "internal" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "internal" - } - field { - name: "ipam" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.IPAMOptions" - options { - 65004: "IPAM" - } - json_name: "ipam" - } - field { - name: "attachable" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "attachable" - } - field { - name: "ingress" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "ingress" - } - field { - name: "network" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_STRING - oneof_index: 0 - json_name: "network" - } - oneof_decl { - name: "config_from" - } - } - message_type { - name: "ClusterSpec" - field { - name: "annotations" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Annotations" - options { - 65001: 0 - } - json_name: "annotations" - } - field { - name: "acceptance_policy" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.AcceptancePolicy" - options { - deprecated: true - 65001: 0 - } - json_name: "acceptancePolicy" - } - field { - name: "orchestration" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.OrchestrationConfig" - options { - 65001: 0 - } - json_name: "orchestration" - } - field { - name: "raft" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.RaftConfig" - options { - 65001: 0 - } - json_name: "raft" - } - field { - name: "dispatcher" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.DispatcherConfig" - options { - 65001: 0 - } - json_name: "dispatcher" - } - field { - name: "ca_config" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.CAConfig" - options { - 65001: 0 - 65004: "CAConfig" - } - json_name: "caConfig" - } - field { - name: "task_defaults" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.TaskDefaults" - options { - 65001: 0 - } - json_name: "taskDefaults" - } - field { - name: "encryption_config" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.EncryptionConfig" - options { - 65001: 0 - } - json_name: "encryptionConfig" - } - } - message_type { - name: "SecretSpec" - field { - name: "annotations" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Annotations" - options { - 65001: 0 - } - json_name: "annotations" - } - field { - name: "data" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "data" - } - field { - name: "templating" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Driver" - json_name: "templating" - } - field { - name: "driver" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Driver" - json_name: "driver" - } - } - message_type { - name: "ConfigSpec" - field { - name: "annotations" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Annotations" - options { - 65001: 0 - } - json_name: "annotations" - } - field { - name: "data" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "data" - } - field { - name: "templating" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Driver" - json_name: "templating" - } - } - message_type { - name: "VolumeSpec" - field { - name: "annotations" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Annotations" - options { - 65001: 0 - } - json_name: "annotations" - } - field { - name: "group" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "group" - } - field { - name: "driver" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Driver" - json_name: "driver" - } - field { - name: "access_mode" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeAccessMode" - json_name: "accessMode" - } - field { - name: "secrets" - number: 5 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeSecret" - json_name: "secrets" - } - field { - name: "AccessibilityRequirements" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.TopologyRequirement" - json_name: "AccessibilityRequirements" - } - field { - name: "capacity_range" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.CapacityRange" - json_name: "capacityRange" - } - field { - name: "availability" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.VolumeSpec.VolumeAvailability" - json_name: "availability" - } - enum_type { - name: "VolumeAvailability" - value { - name: "ACTIVE" - number: 0 - options { - 66001: "VolumeAvailabilityActive" - } - } - value { - name: "PAUSE" - number: 1 - options { - 66001: "VolumeAvailabilityPause" - } - } - value { - name: "DRAIN" - number: 2 - options { - 66001: "VolumeAvailabilityDrain" - } - } - options { - 62001: 0 - } - } - } - syntax: "proto3" -} -file { - name: "github.com/docker/swarmkit/protobuf/plugin/plugin.proto" - package: "docker.protobuf.plugin" - dependency: "google/protobuf/descriptor.proto" - message_type { - name: "WatchSelectors" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "id" - } - field { - name: "id_prefix" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "idPrefix" - } - field { - name: "name" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "name" - } - field { - name: "name_prefix" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "namePrefix" - } - field { - name: "custom" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "custom" - } - field { - name: "custom_prefix" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "customPrefix" - } - field { - name: "service_id" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "serviceId" - } - field { - name: "node_id" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "nodeId" - } - field { - name: "slot" - number: 9 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "slot" - } - field { - name: "desired_state" - number: 10 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "desiredState" - } - field { - name: "role" - number: 11 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "role" - } - field { - name: "membership" - number: 12 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "membership" - } - field { - name: "kind" - number: 13 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "kind" - } - } - message_type { - name: "StoreObject" - field { - name: "watch_selectors" - number: 1 - label: LABEL_REQUIRED - type: TYPE_MESSAGE - type_name: ".docker.protobuf.plugin.WatchSelectors" - json_name: "watchSelectors" - } - } - message_type { - name: "TLSAuthorization" - field { - name: "roles" - number: 1 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "roles" - } - field { - name: "insecure" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "insecure" - } - } - extension { - name: "deepcopy" - extendee: ".google.protobuf.MessageOptions" - number: 70000 - label: LABEL_OPTIONAL - type: TYPE_BOOL - default_value: "true" - json_name: "deepcopy" - } - extension { - name: "store_object" - extendee: ".google.protobuf.MessageOptions" - number: 70001 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.protobuf.plugin.StoreObject" - json_name: "storeObject" - } - extension { - name: "tls_authorization" - extendee: ".google.protobuf.MethodOptions" - number: 73626345 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.protobuf.plugin.TLSAuthorization" - json_name: "tlsAuthorization" - } -} -file { - name: "github.com/docker/swarmkit/api/ca.proto" - package: "docker.swarmkit.v1" - dependency: "github.com/docker/swarmkit/api/types.proto" - dependency: "github.com/docker/swarmkit/api/specs.proto" - dependency: "gogoproto/gogo.proto" - dependency: "github.com/docker/swarmkit/protobuf/plugin/plugin.proto" - message_type { - name: "NodeCertificateStatusRequest" - field { - name: "node_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "nodeId" - } - } - message_type { - name: "NodeCertificateStatusResponse" - field { - name: "status" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.IssuanceStatus" - json_name: "status" - } - field { - name: "certificate" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Certificate" - json_name: "certificate" - } - } - message_type { - name: "IssueNodeCertificateRequest" - field { - name: "role" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.NodeRole" - options { - deprecated: true - } - json_name: "role" - } - field { - name: "csr" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BYTES - options { - 65004: "CSR" - } - json_name: "csr" - } - field { - name: "token" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "token" - } - field { - name: "availability" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.NodeSpec.Availability" - json_name: "availability" - } - } - message_type { - name: "IssueNodeCertificateResponse" - field { - name: "node_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "nodeId" - } - field { - name: "node_membership" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.NodeSpec.Membership" - json_name: "nodeMembership" - } - } - message_type { - name: "GetRootCACertificateRequest" - } - message_type { - name: "GetRootCACertificateResponse" - field { - name: "certificate" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "certificate" - } - } - message_type { - name: "GetUnlockKeyRequest" - } - message_type { - name: "GetUnlockKeyResponse" - field { - name: "unlock_key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "unlockKey" - } - field { - name: "version" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Version" - options { - 65001: 0 - } - json_name: "version" - } - } - service { - name: "CA" - method { - name: "GetRootCACertificate" - input_type: ".docker.swarmkit.v1.GetRootCACertificateRequest" - output_type: ".docker.swarmkit.v1.GetRootCACertificateResponse" - options { - 73626345 { - 2: 1 - } - } - } - method { - name: "GetUnlockKey" - input_type: ".docker.swarmkit.v1.GetUnlockKeyRequest" - output_type: ".docker.swarmkit.v1.GetUnlockKeyResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - } - service { - name: "NodeCA" - method { - name: "IssueNodeCertificate" - input_type: ".docker.swarmkit.v1.IssueNodeCertificateRequest" - output_type: ".docker.swarmkit.v1.IssueNodeCertificateResponse" - options { - 73626345 { - 2: 1 - } - } - } - method { - name: "NodeCertificateStatus" - input_type: ".docker.swarmkit.v1.NodeCertificateStatusRequest" - output_type: ".docker.swarmkit.v1.NodeCertificateStatusResponse" - options { - 73626345 { - 2: 1 - } - } - } - } - syntax: "proto3" -} -file { - name: "github.com/docker/swarmkit/api/objects.proto" - package: "docker.swarmkit.v1" - dependency: "github.com/docker/swarmkit/api/types.proto" - dependency: "github.com/docker/swarmkit/api/specs.proto" - dependency: "google/protobuf/timestamp.proto" - dependency: "gogoproto/gogo.proto" - dependency: "google/protobuf/any.proto" - dependency: "github.com/docker/swarmkit/protobuf/plugin/plugin.proto" - message_type { - name: "Meta" - field { - name: "version" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Version" - options { - 65001: 0 - } - json_name: "version" - } - field { - name: "created_at" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Timestamp" - json_name: "createdAt" - } - field { - name: "updated_at" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Timestamp" - json_name: "updatedAt" - } - } - message_type { - name: "Node" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "id" - } - field { - name: "meta" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Meta" - options { - 65001: 0 - } - json_name: "meta" - } - field { - name: "spec" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NodeSpec" - options { - 65001: 0 - } - json_name: "spec" - } - field { - name: "description" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NodeDescription" - json_name: "description" - } - field { - name: "status" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NodeStatus" - options { - 65001: 0 - } - json_name: "status" - } - field { - name: "manager_status" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ManagerStatus" - json_name: "managerStatus" - } - field { - name: "attachment" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NetworkAttachment" - options { - deprecated: true - } - json_name: "attachment" - } - field { - name: "certificate" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Certificate" - options { - 65001: 0 - } - json_name: "certificate" - } - field { - name: "role" - number: 9 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.NodeRole" - json_name: "role" - } - field { - name: "attachments" - number: 10 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NetworkAttachment" - json_name: "attachments" - } - field { - name: "VXLANUDPPort" - number: 11 - label: LABEL_OPTIONAL - type: TYPE_UINT32 - json_name: "VXLANUDPPort" - } - options { - 70001 { - 1 { - 1: 1 - 2: 1 - 3: 1 - 4: 1 - 5: 1 - 6: 1 - 11: 1 - 12: 1 - } - } - } - } - message_type { - name: "Service" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "id" - } - field { - name: "meta" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Meta" - options { - 65001: 0 - } - json_name: "meta" - } - field { - name: "spec" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ServiceSpec" - options { - 65001: 0 - } - json_name: "spec" - } - field { - name: "spec_version" - number: 10 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Version" - json_name: "specVersion" - } - field { - name: "previous_spec" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ServiceSpec" - json_name: "previousSpec" - } - field { - name: "previous_spec_version" - number: 11 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Version" - json_name: "previousSpecVersion" - } - field { - name: "endpoint" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Endpoint" - json_name: "endpoint" - } - field { - name: "update_status" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.UpdateStatus" - json_name: "updateStatus" - } - field { - name: "job_status" - number: 12 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.JobStatus" - json_name: "jobStatus" - } - field { - name: "pending_delete" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "pendingDelete" - } - options { - 70001 { - 1 { - 1: 1 - 2: 1 - 3: 1 - 4: 1 - 5: 1 - 6: 1 - } - } - } - } - message_type { - name: "Endpoint" - field { - name: "spec" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.EndpointSpec" - json_name: "spec" - } - field { - name: "ports" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.PortConfig" - json_name: "ports" - } - field { - name: "virtual_ips" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Endpoint.VirtualIP" - options { - 65004: "VirtualIPs" - } - json_name: "virtualIps" - } - nested_type { - name: "VirtualIP" - field { - name: "network_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "networkId" - } - field { - name: "addr" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "addr" - } - } - } - message_type { - name: "Task" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "id" - } - field { - name: "meta" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Meta" - options { - 65001: 0 - } - json_name: "meta" - } - field { - name: "spec" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.TaskSpec" - options { - 65001: 0 - } - json_name: "spec" - } - field { - name: "spec_version" - number: 14 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Version" - json_name: "specVersion" - } - field { - name: "service_id" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "serviceId" - } - field { - name: "slot" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "slot" - } - field { - name: "node_id" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "nodeId" - } - field { - name: "annotations" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Annotations" - options { - 65001: 0 - } - json_name: "annotations" - } - field { - name: "service_annotations" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Annotations" - options { - 65001: 0 - } - json_name: "serviceAnnotations" - } - field { - name: "status" - number: 9 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.TaskStatus" - options { - 65001: 0 - } - json_name: "status" - } - field { - name: "desired_state" - number: 10 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.TaskState" - json_name: "desiredState" - } - field { - name: "networks" - number: 11 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NetworkAttachment" - json_name: "networks" - } - field { - name: "endpoint" - number: 12 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Endpoint" - json_name: "endpoint" - } - field { - name: "log_driver" - number: 13 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Driver" - json_name: "logDriver" - } - field { - name: "assigned_generic_resources" - number: 15 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.GenericResource" - json_name: "assignedGenericResources" - } - field { - name: "job_iteration" - number: 16 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Version" - json_name: "jobIteration" - } - field { - name: "volumes" - number: 17 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeAttachment" - json_name: "volumes" - } - options { - 70001 { - 1 { - 1: 1 - 2: 1 - 3: 1 - 4: 1 - 5: 1 - 6: 1 - 7: 1 - 8: 1 - 9: 1 - 10: 1 - } - } - } - } - message_type { - name: "NetworkAttachment" - field { - name: "network" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Network" - json_name: "network" - } - field { - name: "addresses" - number: 2 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "addresses" - } - field { - name: "aliases" - number: 3 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "aliases" - } - field { - name: "driver_attachment_opts" - number: 4 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NetworkAttachment.DriverAttachmentOptsEntry" - json_name: "driverAttachmentOpts" - } - nested_type { - name: "DriverAttachmentOptsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - message_type { - name: "Network" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "id" - } - field { - name: "meta" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Meta" - options { - 65001: 0 - } - json_name: "meta" - } - field { - name: "spec" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NetworkSpec" - options { - 65001: 0 - } - json_name: "spec" - } - field { - name: "driver_state" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Driver" - json_name: "driverState" - } - field { - name: "ipam" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.IPAMOptions" - options { - 65004: "IPAM" - } - json_name: "ipam" - } - field { - name: "pending_delete" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "pendingDelete" - } - options { - 70001 { - 1 { - 1: 1 - 2: 1 - 3: 1 - 4: 1 - 5: 1 - 6: 1 - } - } - } - } - message_type { - name: "Cluster" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "id" - } - field { - name: "meta" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Meta" - options { - 65001: 0 - } - json_name: "meta" - } - field { - name: "spec" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ClusterSpec" - options { - 65001: 0 - } - json_name: "spec" - } - field { - name: "root_ca" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.RootCA" - options { - 65001: 0 - 65004: "RootCA" - } - json_name: "rootCa" - } - field { - name: "network_bootstrap_keys" - number: 5 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.EncryptionKey" - json_name: "networkBootstrapKeys" - } - field { - name: "encryption_key_lamport_clock" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "encryptionKeyLamportClock" - } - field { - name: "blacklisted_certificates" - number: 8 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Cluster.BlacklistedCertificatesEntry" - json_name: "blacklistedCertificates" - } - field { - name: "unlock_keys" - number: 9 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.EncryptionKey" - json_name: "unlockKeys" - } - field { - name: "fips" - number: 10 - label: LABEL_OPTIONAL - type: TYPE_BOOL - options { - 65004: "FIPS" - } - json_name: "fips" - } - field { - name: "defaultAddressPool" - number: 11 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "defaultAddressPool" - } - field { - name: "subnetSize" - number: 12 - label: LABEL_OPTIONAL - type: TYPE_UINT32 - json_name: "subnetSize" - } - field { - name: "VXLANUDPPort" - number: 13 - label: LABEL_OPTIONAL - type: TYPE_UINT32 - json_name: "VXLANUDPPort" - } - nested_type { - name: "BlacklistedCertificatesEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.BlacklistedCertificate" - json_name: "value" - } - options { - map_entry: true - } - } - options { - 70001 { - 1 { - 1: 1 - 2: 1 - 3: 1 - 4: 1 - 5: 1 - 6: 1 - } - } - } - } - message_type { - name: "Secret" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "id" - } - field { - name: "meta" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Meta" - options { - 65001: 0 - } - json_name: "meta" - } - field { - name: "spec" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.SecretSpec" - options { - 65001: 0 - } - json_name: "spec" - } - field { - name: "internal" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "internal" - } - options { - 70001 { - 1 { - 1: 1 - 2: 1 - 3: 1 - 4: 1 - 5: 1 - 6: 1 - } - } - } - } - message_type { - name: "Config" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "id" - } - field { - name: "meta" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Meta" - options { - 65001: 0 - } - json_name: "meta" - } - field { - name: "spec" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ConfigSpec" - options { - 65001: 0 - } - json_name: "spec" - } - options { - 70001 { - 1 { - 1: 1 - 2: 1 - 3: 1 - 4: 1 - 5: 1 - 6: 1 - } - } - } - } - message_type { - name: "Resource" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "ID" - } - json_name: "id" - } - field { - name: "meta" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Meta" - options { - 65001: 0 - } - json_name: "meta" - } - field { - name: "annotations" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Annotations" - options { - 65001: 0 - } - json_name: "annotations" - } - field { - name: "kind" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "kind" - } - field { - name: "payload" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Any" - json_name: "payload" - } - options { - 70001 { - 1 { - 1: 1 - 2: 1 - 3: 1 - 4: 1 - 5: 1 - 6: 1 - 13: 1 - } - } - } - } - message_type { - name: "Extension" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "ID" - } - json_name: "id" - } - field { - name: "meta" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Meta" - options { - 65001: 0 - } - json_name: "meta" - } - field { - name: "annotations" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Annotations" - options { - 65001: 0 - } - json_name: "annotations" - } - field { - name: "description" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "description" - } - options { - 70001 { - 1 { - 1: 1 - 2: 1 - 3: 1 - 4: 1 - 5: 1 - 6: 1 - } - } - } - } - message_type { - name: "Volume" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "id" - } - field { - name: "meta" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Meta" - options { - 65001: 0 - } - json_name: "meta" - } - field { - name: "spec" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeSpec" - options { - 65001: 0 - } - json_name: "spec" - } - field { - name: "publish_status" - number: 4 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumePublishStatus" - json_name: "publishStatus" - } - field { - name: "volume_info" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeInfo" - json_name: "volumeInfo" - } - field { - name: "pending_delete" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "pendingDelete" - } - options { - 70001 { - 1 { - 1: 1 - 2: 1 - 3: 1 - 4: 1 - 5: 1 - 6: 1 - } - } - } - } - syntax: "proto3" -} -file { - name: "github.com/docker/swarmkit/api/control.proto" - package: "docker.swarmkit.v1" - dependency: "github.com/docker/swarmkit/api/specs.proto" - dependency: "github.com/docker/swarmkit/api/objects.proto" - dependency: "github.com/docker/swarmkit/api/types.proto" - dependency: "gogoproto/gogo.proto" - dependency: "google/protobuf/any.proto" - dependency: "github.com/docker/swarmkit/protobuf/plugin/plugin.proto" - message_type { - name: "GetNodeRequest" - field { - name: "node_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "nodeId" - } - } - message_type { - name: "GetNodeResponse" - field { - name: "node" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Node" - json_name: "node" - } - } - message_type { - name: "ListNodesRequest" - field { - name: "filters" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListNodesRequest.Filters" - json_name: "filters" - } - nested_type { - name: "Filters" - field { - name: "names" - number: 1 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "names" - } - field { - name: "id_prefixes" - number: 2 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "idPrefixes" - } - field { - name: "labels" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListNodesRequest.Filters.LabelsEntry" - json_name: "labels" - } - field { - name: "node_labels" - number: 7 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListNodesRequest.Filters.NodeLabelsEntry" - json_name: "nodeLabels" - } - field { - name: "memberships" - number: 4 - label: LABEL_REPEATED - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.NodeSpec.Membership" - options { - packed: false - } - json_name: "memberships" - } - field { - name: "roles" - number: 5 - label: LABEL_REPEATED - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.NodeRole" - options { - packed: false - } - json_name: "roles" - } - field { - name: "name_prefixes" - number: 6 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "namePrefixes" - } - nested_type { - name: "LabelsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - nested_type { - name: "NodeLabelsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - } - message_type { - name: "ListNodesResponse" - field { - name: "nodes" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Node" - json_name: "nodes" - } - } - message_type { - name: "UpdateNodeRequest" - field { - name: "node_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "nodeId" - } - field { - name: "node_version" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Version" - json_name: "nodeVersion" - } - field { - name: "spec" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NodeSpec" - json_name: "spec" - } - } - message_type { - name: "UpdateNodeResponse" - field { - name: "node" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Node" - json_name: "node" - } - } - message_type { - name: "RemoveNodeRequest" - field { - name: "node_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "nodeId" - } - field { - name: "force" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "force" - } - } - message_type { - name: "RemoveNodeResponse" - } - message_type { - name: "GetTaskRequest" - field { - name: "task_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "taskId" - } - } - message_type { - name: "GetTaskResponse" - field { - name: "task" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Task" - json_name: "task" - } - } - message_type { - name: "RemoveTaskRequest" - field { - name: "task_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "taskId" - } - } - message_type { - name: "RemoveTaskResponse" - } - message_type { - name: "ListTasksRequest" - field { - name: "filters" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListTasksRequest.Filters" - json_name: "filters" - } - nested_type { - name: "Filters" - field { - name: "names" - number: 1 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "names" - } - field { - name: "id_prefixes" - number: 2 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "idPrefixes" - } - field { - name: "labels" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListTasksRequest.Filters.LabelsEntry" - json_name: "labels" - } - field { - name: "service_ids" - number: 4 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "serviceIds" - } - field { - name: "node_ids" - number: 5 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "nodeIds" - } - field { - name: "desired_states" - number: 6 - label: LABEL_REPEATED - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.TaskState" - options { - packed: false - } - json_name: "desiredStates" - } - field { - name: "name_prefixes" - number: 7 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "namePrefixes" - } - field { - name: "runtimes" - number: 9 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "runtimes" - } - field { - name: "up_to_date" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "upToDate" - } - nested_type { - name: "LabelsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - } - message_type { - name: "ListTasksResponse" - field { - name: "tasks" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Task" - json_name: "tasks" - } - } - message_type { - name: "CreateServiceRequest" - field { - name: "spec" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ServiceSpec" - json_name: "spec" - } - } - message_type { - name: "CreateServiceResponse" - field { - name: "service" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Service" - json_name: "service" - } - } - message_type { - name: "GetServiceRequest" - field { - name: "service_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "serviceId" - } - field { - name: "insert_defaults" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "insertDefaults" - } - } - message_type { - name: "GetServiceResponse" - field { - name: "service" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Service" - json_name: "service" - } - } - message_type { - name: "UpdateServiceRequest" - field { - name: "service_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "serviceId" - } - field { - name: "service_version" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Version" - json_name: "serviceVersion" - } - field { - name: "spec" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ServiceSpec" - json_name: "spec" - } - field { - name: "rollback" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.UpdateServiceRequest.Rollback" - json_name: "rollback" - } - enum_type { - name: "Rollback" - value { - name: "NONE" - number: 0 - } - value { - name: "PREVIOUS" - number: 1 - } - } - } - message_type { - name: "UpdateServiceResponse" - field { - name: "service" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Service" - json_name: "service" - } - } - message_type { - name: "RemoveServiceRequest" - field { - name: "service_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "serviceId" - } - } - message_type { - name: "RemoveServiceResponse" - } - message_type { - name: "ListServicesRequest" - field { - name: "filters" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListServicesRequest.Filters" - json_name: "filters" - } - nested_type { - name: "Filters" - field { - name: "names" - number: 1 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "names" - } - field { - name: "id_prefixes" - number: 2 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "idPrefixes" - } - field { - name: "labels" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListServicesRequest.Filters.LabelsEntry" - json_name: "labels" - } - field { - name: "name_prefixes" - number: 4 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "namePrefixes" - } - field { - name: "runtimes" - number: 5 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "runtimes" - } - nested_type { - name: "LabelsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - } - message_type { - name: "ListServicesResponse" - field { - name: "services" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Service" - json_name: "services" - } - } - message_type { - name: "ListServiceStatusesRequest" - field { - name: "services" - number: 1 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "services" - } - } - message_type { - name: "ListServiceStatusesResponse" - field { - name: "statuses" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListServiceStatusesResponse.ServiceStatus" - json_name: "statuses" - } - nested_type { - name: "ServiceStatus" - field { - name: "service_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "serviceId" - } - field { - name: "desired_tasks" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "desiredTasks" - } - field { - name: "running_tasks" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "runningTasks" - } - field { - name: "completed_tasks" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "completedTasks" - } - } - } - message_type { - name: "CreateNetworkRequest" - field { - name: "spec" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NetworkSpec" - json_name: "spec" - } - } - message_type { - name: "CreateNetworkResponse" - field { - name: "network" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Network" - json_name: "network" - } - } - message_type { - name: "GetNetworkRequest" - field { - name: "name" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "name" - } - field { - name: "network_id" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "networkId" - } - } - message_type { - name: "GetNetworkResponse" - field { - name: "network" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Network" - json_name: "network" - } - } - message_type { - name: "RemoveNetworkRequest" - field { - name: "name" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "name" - } - field { - name: "network_id" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "networkId" - } - } - message_type { - name: "RemoveNetworkResponse" - } - message_type { - name: "ListNetworksRequest" - field { - name: "filters" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListNetworksRequest.Filters" - json_name: "filters" - } - nested_type { - name: "Filters" - field { - name: "names" - number: 1 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "names" - } - field { - name: "id_prefixes" - number: 2 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "idPrefixes" - } - field { - name: "labels" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListNetworksRequest.Filters.LabelsEntry" - json_name: "labels" - } - field { - name: "name_prefixes" - number: 4 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "namePrefixes" - } - nested_type { - name: "LabelsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - } - message_type { - name: "ListNetworksResponse" - field { - name: "networks" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Network" - json_name: "networks" - } - } - message_type { - name: "GetClusterRequest" - field { - name: "cluster_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "clusterId" - } - } - message_type { - name: "GetClusterResponse" - field { - name: "cluster" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Cluster" - json_name: "cluster" - } - } - message_type { - name: "ListClustersRequest" - field { - name: "filters" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListClustersRequest.Filters" - json_name: "filters" - } - nested_type { - name: "Filters" - field { - name: "names" - number: 1 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "names" - } - field { - name: "id_prefixes" - number: 2 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "idPrefixes" - } - field { - name: "labels" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListClustersRequest.Filters.LabelsEntry" - json_name: "labels" - } - field { - name: "name_prefixes" - number: 4 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "namePrefixes" - } - nested_type { - name: "LabelsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - } - message_type { - name: "ListClustersResponse" - field { - name: "clusters" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Cluster" - json_name: "clusters" - } - } - message_type { - name: "KeyRotation" - field { - name: "worker_join_token" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "workerJoinToken" - } - field { - name: "manager_join_token" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "managerJoinToken" - } - field { - name: "manager_unlock_key" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "managerUnlockKey" - } - } - message_type { - name: "UpdateClusterRequest" - field { - name: "cluster_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "clusterId" - } - field { - name: "cluster_version" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Version" - json_name: "clusterVersion" - } - field { - name: "spec" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ClusterSpec" - json_name: "spec" - } - field { - name: "rotation" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.KeyRotation" - options { - 65001: 0 - } - json_name: "rotation" - } - } - message_type { - name: "UpdateClusterResponse" - field { - name: "cluster" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Cluster" - json_name: "cluster" - } - } - message_type { - name: "GetSecretRequest" - field { - name: "secret_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "secretId" - } - } - message_type { - name: "GetSecretResponse" - field { - name: "secret" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Secret" - json_name: "secret" - } - } - message_type { - name: "UpdateSecretRequest" - field { - name: "secret_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "secretId" - } - field { - name: "secret_version" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Version" - json_name: "secretVersion" - } - field { - name: "spec" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.SecretSpec" - json_name: "spec" - } - } - message_type { - name: "UpdateSecretResponse" - field { - name: "secret" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Secret" - json_name: "secret" - } - } - message_type { - name: "ListSecretsRequest" - field { - name: "filters" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListSecretsRequest.Filters" - json_name: "filters" - } - nested_type { - name: "Filters" - field { - name: "names" - number: 1 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "names" - } - field { - name: "id_prefixes" - number: 2 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "idPrefixes" - } - field { - name: "labels" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListSecretsRequest.Filters.LabelsEntry" - json_name: "labels" - } - field { - name: "name_prefixes" - number: 4 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "namePrefixes" - } - nested_type { - name: "LabelsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - } - message_type { - name: "ListSecretsResponse" - field { - name: "secrets" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Secret" - json_name: "secrets" - } - } - message_type { - name: "CreateSecretRequest" - field { - name: "spec" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.SecretSpec" - json_name: "spec" - } - } - message_type { - name: "CreateSecretResponse" - field { - name: "secret" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Secret" - json_name: "secret" - } - } - message_type { - name: "RemoveSecretRequest" - field { - name: "secret_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "secretId" - } - } - message_type { - name: "RemoveSecretResponse" - } - message_type { - name: "GetConfigRequest" - field { - name: "config_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "configId" - } - } - message_type { - name: "GetConfigResponse" - field { - name: "config" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Config" - json_name: "config" - } - } - message_type { - name: "UpdateConfigRequest" - field { - name: "config_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "configId" - } - field { - name: "config_version" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Version" - json_name: "configVersion" - } - field { - name: "spec" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ConfigSpec" - json_name: "spec" - } - } - message_type { - name: "UpdateConfigResponse" - field { - name: "config" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Config" - json_name: "config" - } - } - message_type { - name: "ListConfigsRequest" - field { - name: "filters" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListConfigsRequest.Filters" - json_name: "filters" - } - nested_type { - name: "Filters" - field { - name: "names" - number: 1 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "names" - } - field { - name: "id_prefixes" - number: 2 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "idPrefixes" - } - field { - name: "labels" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListConfigsRequest.Filters.LabelsEntry" - json_name: "labels" - } - field { - name: "name_prefixes" - number: 4 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "namePrefixes" - } - nested_type { - name: "LabelsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - } - message_type { - name: "ListConfigsResponse" - field { - name: "configs" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Config" - json_name: "configs" - } - } - message_type { - name: "CreateConfigRequest" - field { - name: "spec" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ConfigSpec" - json_name: "spec" - } - } - message_type { - name: "CreateConfigResponse" - field { - name: "config" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Config" - json_name: "config" - } - } - message_type { - name: "RemoveConfigRequest" - field { - name: "config_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "configId" - } - } - message_type { - name: "RemoveConfigResponse" - } - message_type { - name: "CreateExtensionRequest" - field { - name: "annotations" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Annotations" - json_name: "annotations" - } - field { - name: "description" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "description" - } - } - message_type { - name: "CreateExtensionResponse" - field { - name: "extension" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Extension" - json_name: "extension" - } - } - message_type { - name: "RemoveExtensionRequest" - field { - name: "extension_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "extensionId" - } - } - message_type { - name: "RemoveExtensionResponse" - } - message_type { - name: "GetExtensionRequest" - field { - name: "extension_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "extensionId" - } - } - message_type { - name: "GetExtensionResponse" - field { - name: "extension" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Extension" - json_name: "extension" - } - } - message_type { - name: "CreateResourceRequest" - field { - name: "annotations" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Annotations" - json_name: "annotations" - } - field { - name: "kind" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "kind" - } - field { - name: "payload" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Any" - json_name: "payload" - } - } - message_type { - name: "CreateResourceResponse" - field { - name: "resource" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Resource" - json_name: "resource" - } - } - message_type { - name: "RemoveResourceRequest" - field { - name: "resource_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "resourceId" - } - } - message_type { - name: "RemoveResourceResponse" - } - message_type { - name: "UpdateResourceRequest" - field { - name: "resource_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "resourceId" - } - field { - name: "resource_version" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Version" - json_name: "resourceVersion" - } - field { - name: "annotations" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Annotations" - json_name: "annotations" - } - field { - name: "payload" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Any" - json_name: "payload" - } - } - message_type { - name: "UpdateResourceResponse" - field { - name: "resource" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Resource" - json_name: "resource" - } - } - message_type { - name: "GetResourceRequest" - field { - name: "resource_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "resourceId" - } - } - message_type { - name: "GetResourceResponse" - field { - name: "resource" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Resource" - json_name: "resource" - } - } - message_type { - name: "ListResourcesRequest" - field { - name: "filters" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListResourcesRequest.Filters" - json_name: "filters" - } - nested_type { - name: "Filters" - field { - name: "names" - number: 1 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "names" - } - field { - name: "id_prefixes" - number: 2 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "idPrefixes" - } - field { - name: "labels" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListResourcesRequest.Filters.LabelsEntry" - json_name: "labels" - } - field { - name: "name_prefixes" - number: 4 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "namePrefixes" - } - field { - name: "kind" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "kind" - } - nested_type { - name: "LabelsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - } - message_type { - name: "ListResourcesResponse" - field { - name: "resources" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Resource" - json_name: "resources" - } - } - message_type { - name: "CreateVolumeRequest" - field { - name: "spec" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeSpec" - json_name: "spec" - } - } - message_type { - name: "CreateVolumeResponse" - field { - name: "volume" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Volume" - json_name: "volume" - } - } - message_type { - name: "GetVolumeRequest" - field { - name: "volume_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "volumeId" - } - } - message_type { - name: "GetVolumeResponse" - field { - name: "volume" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Volume" - json_name: "volume" - } - } - message_type { - name: "UpdateVolumeRequest" - field { - name: "volume_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "volumeId" - } - field { - name: "volume_version" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Version" - json_name: "volumeVersion" - } - field { - name: "spec" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeSpec" - json_name: "spec" - } - } - message_type { - name: "UpdateVolumeResponse" - field { - name: "volume" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Volume" - json_name: "volume" - } - } - message_type { - name: "ListVolumesRequest" - field { - name: "filters" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListVolumesRequest.Filters" - json_name: "filters" - } - nested_type { - name: "Filters" - field { - name: "names" - number: 1 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "names" - } - field { - name: "id_prefixes" - number: 2 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "idPrefixes" - } - field { - name: "labels" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ListVolumesRequest.Filters.LabelsEntry" - json_name: "labels" - } - field { - name: "name_prefixes" - number: 4 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "namePrefixes" - } - field { - name: "groups" - number: 5 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "groups" - } - field { - name: "drivers" - number: 6 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "drivers" - } - nested_type { - name: "LabelsEntry" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - options { - map_entry: true - } - } - } - } - message_type { - name: "ListVolumesResponse" - field { - name: "volumes" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Volume" - json_name: "volumes" - } - } - message_type { - name: "RemoveVolumeRequest" - field { - name: "volume_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "volumeId" - } - field { - name: "force" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "force" - } - } - message_type { - name: "RemoveVolumeResponse" - } - service { - name: "Control" - method { - name: "GetNode" - input_type: ".docker.swarmkit.v1.GetNodeRequest" - output_type: ".docker.swarmkit.v1.GetNodeResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "ListNodes" - input_type: ".docker.swarmkit.v1.ListNodesRequest" - output_type: ".docker.swarmkit.v1.ListNodesResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "UpdateNode" - input_type: ".docker.swarmkit.v1.UpdateNodeRequest" - output_type: ".docker.swarmkit.v1.UpdateNodeResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "RemoveNode" - input_type: ".docker.swarmkit.v1.RemoveNodeRequest" - output_type: ".docker.swarmkit.v1.RemoveNodeResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "GetTask" - input_type: ".docker.swarmkit.v1.GetTaskRequest" - output_type: ".docker.swarmkit.v1.GetTaskResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "ListTasks" - input_type: ".docker.swarmkit.v1.ListTasksRequest" - output_type: ".docker.swarmkit.v1.ListTasksResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "RemoveTask" - input_type: ".docker.swarmkit.v1.RemoveTaskRequest" - output_type: ".docker.swarmkit.v1.RemoveTaskResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "GetService" - input_type: ".docker.swarmkit.v1.GetServiceRequest" - output_type: ".docker.swarmkit.v1.GetServiceResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "ListServices" - input_type: ".docker.swarmkit.v1.ListServicesRequest" - output_type: ".docker.swarmkit.v1.ListServicesResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "CreateService" - input_type: ".docker.swarmkit.v1.CreateServiceRequest" - output_type: ".docker.swarmkit.v1.CreateServiceResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "UpdateService" - input_type: ".docker.swarmkit.v1.UpdateServiceRequest" - output_type: ".docker.swarmkit.v1.UpdateServiceResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "RemoveService" - input_type: ".docker.swarmkit.v1.RemoveServiceRequest" - output_type: ".docker.swarmkit.v1.RemoveServiceResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "ListServiceStatuses" - input_type: ".docker.swarmkit.v1.ListServiceStatusesRequest" - output_type: ".docker.swarmkit.v1.ListServiceStatusesResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "GetNetwork" - input_type: ".docker.swarmkit.v1.GetNetworkRequest" - output_type: ".docker.swarmkit.v1.GetNetworkResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "ListNetworks" - input_type: ".docker.swarmkit.v1.ListNetworksRequest" - output_type: ".docker.swarmkit.v1.ListNetworksResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "CreateNetwork" - input_type: ".docker.swarmkit.v1.CreateNetworkRequest" - output_type: ".docker.swarmkit.v1.CreateNetworkResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "RemoveNetwork" - input_type: ".docker.swarmkit.v1.RemoveNetworkRequest" - output_type: ".docker.swarmkit.v1.RemoveNetworkResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "GetCluster" - input_type: ".docker.swarmkit.v1.GetClusterRequest" - output_type: ".docker.swarmkit.v1.GetClusterResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "ListClusters" - input_type: ".docker.swarmkit.v1.ListClustersRequest" - output_type: ".docker.swarmkit.v1.ListClustersResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "UpdateCluster" - input_type: ".docker.swarmkit.v1.UpdateClusterRequest" - output_type: ".docker.swarmkit.v1.UpdateClusterResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "GetSecret" - input_type: ".docker.swarmkit.v1.GetSecretRequest" - output_type: ".docker.swarmkit.v1.GetSecretResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "UpdateSecret" - input_type: ".docker.swarmkit.v1.UpdateSecretRequest" - output_type: ".docker.swarmkit.v1.UpdateSecretResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "ListSecrets" - input_type: ".docker.swarmkit.v1.ListSecretsRequest" - output_type: ".docker.swarmkit.v1.ListSecretsResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "CreateSecret" - input_type: ".docker.swarmkit.v1.CreateSecretRequest" - output_type: ".docker.swarmkit.v1.CreateSecretResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "RemoveSecret" - input_type: ".docker.swarmkit.v1.RemoveSecretRequest" - output_type: ".docker.swarmkit.v1.RemoveSecretResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "GetConfig" - input_type: ".docker.swarmkit.v1.GetConfigRequest" - output_type: ".docker.swarmkit.v1.GetConfigResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "UpdateConfig" - input_type: ".docker.swarmkit.v1.UpdateConfigRequest" - output_type: ".docker.swarmkit.v1.UpdateConfigResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "ListConfigs" - input_type: ".docker.swarmkit.v1.ListConfigsRequest" - output_type: ".docker.swarmkit.v1.ListConfigsResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "CreateConfig" - input_type: ".docker.swarmkit.v1.CreateConfigRequest" - output_type: ".docker.swarmkit.v1.CreateConfigResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "RemoveConfig" - input_type: ".docker.swarmkit.v1.RemoveConfigRequest" - output_type: ".docker.swarmkit.v1.RemoveConfigResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "GetExtension" - input_type: ".docker.swarmkit.v1.GetExtensionRequest" - output_type: ".docker.swarmkit.v1.GetExtensionResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "CreateExtension" - input_type: ".docker.swarmkit.v1.CreateExtensionRequest" - output_type: ".docker.swarmkit.v1.CreateExtensionResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "RemoveExtension" - input_type: ".docker.swarmkit.v1.RemoveExtensionRequest" - output_type: ".docker.swarmkit.v1.RemoveExtensionResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "GetResource" - input_type: ".docker.swarmkit.v1.GetResourceRequest" - output_type: ".docker.swarmkit.v1.GetResourceResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "UpdateResource" - input_type: ".docker.swarmkit.v1.UpdateResourceRequest" - output_type: ".docker.swarmkit.v1.UpdateResourceResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "ListResources" - input_type: ".docker.swarmkit.v1.ListResourcesRequest" - output_type: ".docker.swarmkit.v1.ListResourcesResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "CreateResource" - input_type: ".docker.swarmkit.v1.CreateResourceRequest" - output_type: ".docker.swarmkit.v1.CreateResourceResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "RemoveResource" - input_type: ".docker.swarmkit.v1.RemoveResourceRequest" - output_type: ".docker.swarmkit.v1.RemoveResourceResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "CreateVolume" - input_type: ".docker.swarmkit.v1.CreateVolumeRequest" - output_type: ".docker.swarmkit.v1.CreateVolumeResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "GetVolume" - input_type: ".docker.swarmkit.v1.GetVolumeRequest" - output_type: ".docker.swarmkit.v1.GetVolumeResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "UpdateVolume" - input_type: ".docker.swarmkit.v1.UpdateVolumeRequest" - output_type: ".docker.swarmkit.v1.UpdateVolumeResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "ListVolumes" - input_type: ".docker.swarmkit.v1.ListVolumesRequest" - output_type: ".docker.swarmkit.v1.ListVolumesResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "RemoveVolume" - input_type: ".docker.swarmkit.v1.RemoveVolumeRequest" - output_type: ".docker.swarmkit.v1.RemoveVolumeResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - } - syntax: "proto3" -} -file { - name: "github.com/docker/swarmkit/api/dispatcher.proto" - package: "docker.swarmkit.v1" - dependency: "github.com/docker/swarmkit/api/types.proto" - dependency: "github.com/docker/swarmkit/api/objects.proto" - dependency: "gogoproto/gogo.proto" - dependency: "github.com/docker/swarmkit/protobuf/plugin/plugin.proto" - dependency: "google/protobuf/duration.proto" - message_type { - name: "SessionRequest" - field { - name: "description" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NodeDescription" - json_name: "description" - } - field { - name: "session_id" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "sessionId" - } - } - message_type { - name: "SessionMessage" - field { - name: "session_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "sessionId" - } - field { - name: "node" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Node" - json_name: "node" - } - field { - name: "managers" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.WeightedPeer" - json_name: "managers" - } - field { - name: "network_bootstrap_keys" - number: 4 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.EncryptionKey" - json_name: "networkBootstrapKeys" - } - field { - name: "RootCA" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "RootCA" - } - } - message_type { - name: "HeartbeatRequest" - field { - name: "session_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "sessionId" - } - } - message_type { - name: "HeartbeatResponse" - field { - name: "period" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Duration" - options { - 65011: 1 - 65001: 0 - } - json_name: "period" - } - } - message_type { - name: "UpdateTaskStatusRequest" - field { - name: "session_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "sessionId" - } - field { - name: "updates" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.UpdateTaskStatusRequest.TaskStatusUpdate" - json_name: "updates" - } - nested_type { - name: "TaskStatusUpdate" - field { - name: "task_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "taskId" - } - field { - name: "status" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.TaskStatus" - json_name: "status" - } - } - } - message_type { - name: "UpdateTaskStatusResponse" - } - message_type { - name: "UpdateVolumeStatusRequest" - field { - name: "session_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "sessionId" - } - field { - name: "updates" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.UpdateVolumeStatusRequest.VolumeStatusUpdate" - json_name: "updates" - } - nested_type { - name: "VolumeStatusUpdate" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "id" - } - field { - name: "unpublished" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "unpublished" - } - } - } - message_type { - name: "UpdateVolumeStatusResponse" - } - message_type { - name: "TasksRequest" - field { - name: "session_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "sessionId" - } - } - message_type { - name: "TasksMessage" - field { - name: "tasks" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Task" - json_name: "tasks" - } - } - message_type { - name: "AssignmentsRequest" - field { - name: "session_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "sessionId" - } - } - message_type { - name: "Assignment" - field { - name: "task" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Task" - oneof_index: 0 - json_name: "task" - } - field { - name: "secret" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Secret" - oneof_index: 0 - json_name: "secret" - } - field { - name: "config" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Config" - oneof_index: 0 - json_name: "config" - } - field { - name: "volume" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.VolumeAssignment" - oneof_index: 0 - json_name: "volume" - } - oneof_decl { - name: "item" - } - } - message_type { - name: "AssignmentChange" - field { - name: "assignment" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Assignment" - json_name: "assignment" - } - field { - name: "action" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.AssignmentChange.AssignmentAction" - json_name: "action" - } - enum_type { - name: "AssignmentAction" - value { - name: "UPDATE" - number: 0 - options { - 66001: "AssignmentActionUpdate" - } - } - value { - name: "REMOVE" - number: 1 - options { - 66001: "AssignmentActionRemove" - } - } - } - } - message_type { - name: "AssignmentsMessage" - field { - name: "type" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.AssignmentsMessage.Type" - json_name: "type" - } - field { - name: "applies_to" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "appliesTo" - } - field { - name: "results_in" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "resultsIn" - } - field { - name: "changes" - number: 4 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.AssignmentChange" - json_name: "changes" - } - enum_type { - name: "Type" - value { - name: "COMPLETE" - number: 0 - } - value { - name: "INCREMENTAL" - number: 1 - } - } - } - service { - name: "Dispatcher" - method { - name: "Session" - input_type: ".docker.swarmkit.v1.SessionRequest" - output_type: ".docker.swarmkit.v1.SessionMessage" - options { - 73626345 { - 1: "swarm-worker" - 1: "swarm-manager" - } - } - server_streaming: true - } - method { - name: "Heartbeat" - input_type: ".docker.swarmkit.v1.HeartbeatRequest" - output_type: ".docker.swarmkit.v1.HeartbeatResponse" - options { - 73626345 { - 1: "swarm-worker" - 1: "swarm-manager" - } - } - } - method { - name: "UpdateTaskStatus" - input_type: ".docker.swarmkit.v1.UpdateTaskStatusRequest" - output_type: ".docker.swarmkit.v1.UpdateTaskStatusResponse" - options { - 73626345 { - 1: "swarm-worker" - 1: "swarm-manager" - } - } - } - method { - name: "UpdateVolumeStatus" - input_type: ".docker.swarmkit.v1.UpdateVolumeStatusRequest" - output_type: ".docker.swarmkit.v1.UpdateVolumeStatusResponse" - options { - 73626345 { - 1: "swarm-worker" - 1: "swarm-manager" - } - } - } - method { - name: "Tasks" - input_type: ".docker.swarmkit.v1.TasksRequest" - output_type: ".docker.swarmkit.v1.TasksMessage" - options { - deprecated: true - 73626345 { - 1: "swarm-worker" - 1: "swarm-manager" - } - } - server_streaming: true - } - method { - name: "Assignments" - input_type: ".docker.swarmkit.v1.AssignmentsRequest" - output_type: ".docker.swarmkit.v1.AssignmentsMessage" - options { - 73626345 { - 1: "swarm-worker" - 1: "swarm-manager" - } - } - server_streaming: true - } - } - syntax: "proto3" -} -file { - name: "github.com/docker/swarmkit/api/health.proto" - package: "docker.swarmkit.v1" - dependency: "gogoproto/gogo.proto" - dependency: "github.com/docker/swarmkit/protobuf/plugin/plugin.proto" - message_type { - name: "HealthCheckRequest" - field { - name: "service" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "service" - } - } - message_type { - name: "HealthCheckResponse" - field { - name: "status" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.HealthCheckResponse.ServingStatus" - json_name: "status" - } - enum_type { - name: "ServingStatus" - value { - name: "UNKNOWN" - number: 0 - } - value { - name: "SERVING" - number: 1 - } - value { - name: "NOT_SERVING" - number: 2 - } - } - } - service { - name: "Health" - method { - name: "Check" - input_type: ".docker.swarmkit.v1.HealthCheckRequest" - output_type: ".docker.swarmkit.v1.HealthCheckResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - } - syntax: "proto3" -} -file { - name: "github.com/docker/swarmkit/api/logbroker.proto" - package: "docker.swarmkit.v1" - dependency: "gogoproto/gogo.proto" - dependency: "google/protobuf/timestamp.proto" - dependency: "github.com/docker/swarmkit/protobuf/plugin/plugin.proto" - message_type { - name: "LogSubscriptionOptions" - field { - name: "streams" - number: 1 - label: LABEL_REPEATED - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.LogStream" - options { - packed: false - } - json_name: "streams" - } - field { - name: "follow" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "follow" - } - field { - name: "tail" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_INT64 - json_name: "tail" - } - field { - name: "since" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Timestamp" - json_name: "since" - } - } - message_type { - name: "LogSelector" - field { - name: "service_ids" - number: 1 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "serviceIds" - } - field { - name: "node_ids" - number: 2 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "nodeIds" - } - field { - name: "task_ids" - number: 3 - label: LABEL_REPEATED - type: TYPE_STRING - json_name: "taskIds" - } - } - message_type { - name: "LogContext" - field { - name: "service_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "serviceId" - } - field { - name: "node_id" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "nodeId" - } - field { - name: "task_id" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "taskId" - } - } - message_type { - name: "LogAttr" - field { - name: "key" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "key" - } - field { - name: "value" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - } - message_type { - name: "LogMessage" - field { - name: "context" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.LogContext" - options { - 65001: 0 - } - json_name: "context" - } - field { - name: "timestamp" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".google.protobuf.Timestamp" - json_name: "timestamp" - } - field { - name: "stream" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.LogStream" - json_name: "stream" - } - field { - name: "data" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "data" - } - field { - name: "attrs" - number: 5 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.LogAttr" - options { - 65001: 0 - } - json_name: "attrs" - } - } - message_type { - name: "SubscribeLogsRequest" - field { - name: "selector" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.LogSelector" - json_name: "selector" - } - field { - name: "options" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.LogSubscriptionOptions" - json_name: "options" - } - } - message_type { - name: "SubscribeLogsMessage" - field { - name: "messages" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.LogMessage" - options { - 65001: 0 - } - json_name: "messages" - } - } - message_type { - name: "ListenSubscriptionsRequest" - } - message_type { - name: "SubscriptionMessage" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "id" - } - field { - name: "selector" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.LogSelector" - json_name: "selector" - } - field { - name: "options" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.LogSubscriptionOptions" - json_name: "options" - } - field { - name: "close" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "close" - } - } - message_type { - name: "PublishLogsMessage" - field { - name: "subscription_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "subscriptionId" - } - field { - name: "messages" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.LogMessage" - options { - 65001: 0 - } - json_name: "messages" - } - field { - name: "close" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "close" - } - } - message_type { - name: "PublishLogsResponse" - } - enum_type { - name: "LogStream" - value { - name: "LOG_STREAM_UNKNOWN" - number: 0 - options { - 66001: "LogStreamUnknown" - } - } - value { - name: "LOG_STREAM_STDOUT" - number: 1 - options { - 66001: "LogStreamStdout" - } - } - value { - name: "LOG_STREAM_STDERR" - number: 2 - options { - 66001: "LogStreamStderr" - } - } - options { - 62001: 0 - 62023: "LogStream" - } - } - service { - name: "Logs" - method { - name: "SubscribeLogs" - input_type: ".docker.swarmkit.v1.SubscribeLogsRequest" - output_type: ".docker.swarmkit.v1.SubscribeLogsMessage" - options { - 73626345 { - 1: "swarm-manager" - } - } - server_streaming: true - } - } - service { - name: "LogBroker" - method { - name: "ListenSubscriptions" - input_type: ".docker.swarmkit.v1.ListenSubscriptionsRequest" - output_type: ".docker.swarmkit.v1.SubscriptionMessage" - options { - 73626345 { - 1: "swarm-worker" - 1: "swarm-manager" - } - } - server_streaming: true - } - method { - name: "PublishLogs" - input_type: ".docker.swarmkit.v1.PublishLogsMessage" - output_type: ".docker.swarmkit.v1.PublishLogsResponse" - options { - 73626345 { - 1: "swarm-worker" - 1: "swarm-manager" - } - } - client_streaming: true - } - } - syntax: "proto3" -} -file { - name: "go.etcd.io/etcd/raft/v3/raftpb/raft.proto" - package: "raftpb" - dependency: "gogoproto/gogo.proto" - message_type { - name: "Entry" - field { - name: "Term" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - } - json_name: "Term" - } - field { - name: "Index" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - } - json_name: "Index" - } - field { - name: "Type" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".raftpb.EntryType" - options { - 65001: 0 - } - json_name: "Type" - } - field { - name: "Data" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "Data" - } - } - message_type { - name: "SnapshotMetadata" - field { - name: "conf_state" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".raftpb.ConfState" - options { - 65001: 0 - } - json_name: "confState" - } - field { - name: "index" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - } - json_name: "index" - } - field { - name: "term" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - } - json_name: "term" - } - } - message_type { - name: "Snapshot" - field { - name: "data" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "data" - } - field { - name: "metadata" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".raftpb.SnapshotMetadata" - options { - 65001: 0 - } - json_name: "metadata" - } - } - message_type { - name: "Message" - field { - name: "type" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".raftpb.MessageType" - options { - 65001: 0 - } - json_name: "type" - } - field { - name: "to" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - } - json_name: "to" - } - field { - name: "from" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - } - json_name: "from" - } - field { - name: "term" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - } - json_name: "term" - } - field { - name: "logTerm" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - } - json_name: "logTerm" - } - field { - name: "index" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - } - json_name: "index" - } - field { - name: "entries" - number: 7 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".raftpb.Entry" - options { - 65001: 0 - } - json_name: "entries" - } - field { - name: "commit" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - } - json_name: "commit" - } - field { - name: "snapshot" - number: 9 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".raftpb.Snapshot" - options { - 65001: 0 - } - json_name: "snapshot" - } - field { - name: "reject" - number: 10 - label: LABEL_OPTIONAL - type: TYPE_BOOL - options { - 65001: 0 - } - json_name: "reject" - } - field { - name: "rejectHint" - number: 11 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - } - json_name: "rejectHint" - } - field { - name: "context" - number: 12 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "context" - } - } - message_type { - name: "HardState" - field { - name: "term" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - } - json_name: "term" - } - field { - name: "vote" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - } - json_name: "vote" - } - field { - name: "commit" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - } - json_name: "commit" - } - } - message_type { - name: "ConfState" - field { - name: "voters" - number: 1 - label: LABEL_REPEATED - type: TYPE_UINT64 - json_name: "voters" - } - field { - name: "learners" - number: 2 - label: LABEL_REPEATED - type: TYPE_UINT64 - json_name: "learners" - } - field { - name: "voters_outgoing" - number: 3 - label: LABEL_REPEATED - type: TYPE_UINT64 - json_name: "votersOutgoing" - } - field { - name: "learners_next" - number: 4 - label: LABEL_REPEATED - type: TYPE_UINT64 - json_name: "learnersNext" - } - field { - name: "auto_leave" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_BOOL - options { - 65001: 0 - } - json_name: "autoLeave" - } - } - message_type { - name: "ConfChange" - field { - name: "type" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".raftpb.ConfChangeType" - options { - 65001: 0 - } - json_name: "type" - } - field { - name: "node_id" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - 65004: "NodeID" - } - json_name: "nodeId" - } - field { - name: "context" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "context" - } - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - 65004: "ID" - } - json_name: "id" - } - } - message_type { - name: "ConfChangeSingle" - field { - name: "type" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".raftpb.ConfChangeType" - options { - 65001: 0 - } - json_name: "type" - } - field { - name: "node_id" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - options { - 65001: 0 - 65004: "NodeID" - } - json_name: "nodeId" - } - } - message_type { - name: "ConfChangeV2" - field { - name: "transition" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".raftpb.ConfChangeTransition" - options { - 65001: 0 - } - json_name: "transition" - } - field { - name: "changes" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".raftpb.ConfChangeSingle" - options { - 65001: 0 - } - json_name: "changes" - } - field { - name: "context" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BYTES - json_name: "context" - } - } - enum_type { - name: "EntryType" - value { - name: "EntryNormal" - number: 0 - } - value { - name: "EntryConfChange" - number: 1 - } - value { - name: "EntryConfChangeV2" - number: 2 - } - } - enum_type { - name: "MessageType" - value { - name: "MsgHup" - number: 0 - } - value { - name: "MsgBeat" - number: 1 - } - value { - name: "MsgProp" - number: 2 - } - value { - name: "MsgApp" - number: 3 - } - value { - name: "MsgAppResp" - number: 4 - } - value { - name: "MsgVote" - number: 5 - } - value { - name: "MsgVoteResp" - number: 6 - } - value { - name: "MsgSnap" - number: 7 - } - value { - name: "MsgHeartbeat" - number: 8 - } - value { - name: "MsgHeartbeatResp" - number: 9 - } - value { - name: "MsgUnreachable" - number: 10 - } - value { - name: "MsgSnapStatus" - number: 11 - } - value { - name: "MsgCheckQuorum" - number: 12 - } - value { - name: "MsgTransferLeader" - number: 13 - } - value { - name: "MsgTimeoutNow" - number: 14 - } - value { - name: "MsgReadIndex" - number: 15 - } - value { - name: "MsgReadIndexResp" - number: 16 - } - value { - name: "MsgPreVote" - number: 17 - } - value { - name: "MsgPreVoteResp" - number: 18 - } - } - enum_type { - name: "ConfChangeTransition" - value { - name: "ConfChangeTransitionAuto" - number: 0 - } - value { - name: "ConfChangeTransitionJointImplicit" - number: 1 - } - value { - name: "ConfChangeTransitionJointExplicit" - number: 2 - } - } - enum_type { - name: "ConfChangeType" - value { - name: "ConfChangeAddNode" - number: 0 - } - value { - name: "ConfChangeRemoveNode" - number: 1 - } - value { - name: "ConfChangeUpdateNode" - number: 2 - } - value { - name: "ConfChangeAddLearnerNode" - number: 3 - } - } - options { - 63017: 1 - 63020: 1 - 63018: 1 - 63001: 0 - 63002: 0 - 63035: 0 - 63026: 0 - 63034: 0 - } -} -file { - name: "github.com/docker/swarmkit/api/raft.proto" - package: "docker.swarmkit.v1" - dependency: "github.com/docker/swarmkit/api/objects.proto" - dependency: "github.com/docker/swarmkit/api/types.proto" - dependency: "go.etcd.io/etcd/raft/v3/raftpb/raft.proto" - dependency: "gogoproto/gogo.proto" - dependency: "github.com/docker/swarmkit/protobuf/plugin/plugin.proto" - message_type { - name: "RaftMember" - field { - name: "raft_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "raftId" - } - field { - name: "node_id" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "nodeId" - } - field { - name: "addr" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "addr" - } - field { - name: "status" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.RaftMemberStatus" - options { - 65001: 0 - } - json_name: "status" - } - } - message_type { - name: "JoinRequest" - field { - name: "addr" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "addr" - } - } - message_type { - name: "JoinResponse" - field { - name: "raft_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "raftId" - } - field { - name: "members" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.RaftMember" - json_name: "members" - } - field { - name: "removed_members" - number: 3 - label: LABEL_REPEATED - type: TYPE_UINT64 - options { - packed: false - } - json_name: "removedMembers" - } - } - message_type { - name: "LeaveRequest" - field { - name: "node" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.RaftMember" - json_name: "node" - } - } - message_type { - name: "LeaveResponse" - } - message_type { - name: "ProcessRaftMessageRequest" - field { - name: "message" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".raftpb.Message" - json_name: "message" - } - options { - 70000: 0 - } - } - message_type { - name: "ProcessRaftMessageResponse" - } - message_type { - name: "StreamRaftMessageRequest" - field { - name: "message" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".raftpb.Message" - json_name: "message" - } - options { - 70000: 0 - } - } - message_type { - name: "StreamRaftMessageResponse" - } - message_type { - name: "ResolveAddressRequest" - field { - name: "raft_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "raftId" - } - } - message_type { - name: "ResolveAddressResponse" - field { - name: "addr" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "addr" - } - } - message_type { - name: "InternalRaftRequest" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "id" - } - field { - name: "action" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.StoreAction" - options { - 65001: 0 - } - json_name: "action" - } - } - message_type { - name: "StoreAction" - field { - name: "action" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.StoreActionKind" - json_name: "action" - } - field { - name: "node" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Node" - oneof_index: 0 - json_name: "node" - } - field { - name: "service" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Service" - oneof_index: 0 - json_name: "service" - } - field { - name: "task" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Task" - oneof_index: 0 - json_name: "task" - } - field { - name: "network" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Network" - oneof_index: 0 - json_name: "network" - } - field { - name: "cluster" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Cluster" - oneof_index: 0 - json_name: "cluster" - } - field { - name: "secret" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Secret" - oneof_index: 0 - json_name: "secret" - } - field { - name: "resource" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Resource" - oneof_index: 0 - json_name: "resource" - } - field { - name: "extension" - number: 9 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Extension" - oneof_index: 0 - json_name: "extension" - } - field { - name: "config" - number: 10 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Config" - oneof_index: 0 - json_name: "config" - } - field { - name: "volume" - number: 11 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Volume" - oneof_index: 0 - json_name: "volume" - } - oneof_decl { - name: "target" - } - } - enum_type { - name: "StoreActionKind" - value { - name: "UNKNOWN" - number: 0 - options { - 66001: "StoreActionKindUnknown" - } - } - value { - name: "STORE_ACTION_CREATE" - number: 1 - options { - 66001: "StoreActionKindCreate" - } - } - value { - name: "STORE_ACTION_UPDATE" - number: 2 - options { - 66001: "StoreActionKindUpdate" - } - } - value { - name: "STORE_ACTION_REMOVE" - number: 3 - options { - 66001: "StoreActionKindRemove" - } - } - options { - 62001: 0 - 62023: "StoreActionKind" - } - } - service { - name: "Raft" - method { - name: "ProcessRaftMessage" - input_type: ".docker.swarmkit.v1.ProcessRaftMessageRequest" - output_type: ".docker.swarmkit.v1.ProcessRaftMessageResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "StreamRaftMessage" - input_type: ".docker.swarmkit.v1.StreamRaftMessageRequest" - output_type: ".docker.swarmkit.v1.StreamRaftMessageResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - client_streaming: true - } - method { - name: "ResolveAddress" - input_type: ".docker.swarmkit.v1.ResolveAddressRequest" - output_type: ".docker.swarmkit.v1.ResolveAddressResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - } - service { - name: "RaftMembership" - method { - name: "Join" - input_type: ".docker.swarmkit.v1.JoinRequest" - output_type: ".docker.swarmkit.v1.JoinResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - method { - name: "Leave" - input_type: ".docker.swarmkit.v1.LeaveRequest" - output_type: ".docker.swarmkit.v1.LeaveResponse" - options { - 73626345 { - 1: "swarm-manager" - } - } - } - } - weak_dependency: 3 - weak_dependency: 4 - syntax: "proto3" -} -file { - name: "github.com/docker/swarmkit/api/resource.proto" - package: "docker.swarmkit.v1" - dependency: "github.com/docker/swarmkit/api/types.proto" - dependency: "gogoproto/gogo.proto" - dependency: "github.com/docker/swarmkit/protobuf/plugin/plugin.proto" - message_type { - name: "AttachNetworkRequest" - field { - name: "config" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.NetworkAttachmentConfig" - json_name: "config" - } - field { - name: "container_id" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "containerId" - } - } - message_type { - name: "AttachNetworkResponse" - field { - name: "attachment_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "attachmentId" - } - } - message_type { - name: "DetachNetworkRequest" - field { - name: "attachment_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "attachmentId" - } - } - message_type { - name: "DetachNetworkResponse" - } - service { - name: "ResourceAllocator" - method { - name: "AttachNetwork" - input_type: ".docker.swarmkit.v1.AttachNetworkRequest" - output_type: ".docker.swarmkit.v1.AttachNetworkResponse" - options { - 73626345 { - 1: "swarm-worker" - 1: "swarm-manager" - } - } - } - method { - name: "DetachNetwork" - input_type: ".docker.swarmkit.v1.DetachNetworkRequest" - output_type: ".docker.swarmkit.v1.DetachNetworkResponse" - options { - 73626345 { - 1: "swarm-worker" - 1: "swarm-manager" - } - } - } - } - syntax: "proto3" -} -file { - name: "github.com/docker/swarmkit/api/snapshot.proto" - package: "docker.swarmkit.v1" - dependency: "github.com/docker/swarmkit/api/objects.proto" - dependency: "github.com/docker/swarmkit/api/raft.proto" - dependency: "gogoproto/gogo.proto" - message_type { - name: "StoreSnapshot" - field { - name: "nodes" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Node" - json_name: "nodes" - } - field { - name: "services" - number: 2 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Service" - json_name: "services" - } - field { - name: "networks" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Network" - json_name: "networks" - } - field { - name: "tasks" - number: 4 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Task" - json_name: "tasks" - } - field { - name: "clusters" - number: 5 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Cluster" - json_name: "clusters" - } - field { - name: "secrets" - number: 6 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Secret" - json_name: "secrets" - } - field { - name: "resources" - number: 7 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Resource" - json_name: "resources" - } - field { - name: "extensions" - number: 8 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Extension" - json_name: "extensions" - } - field { - name: "configs" - number: 9 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Config" - json_name: "configs" - } - field { - name: "volumes" - number: 10 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Volume" - json_name: "volumes" - } - } - message_type { - name: "ClusterSnapshot" - field { - name: "members" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.RaftMember" - json_name: "members" - } - field { - name: "removed" - number: 2 - label: LABEL_REPEATED - type: TYPE_UINT64 - options { - packed: false - } - json_name: "removed" - } - } - message_type { - name: "Snapshot" - field { - name: "version" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.Snapshot.Version" - json_name: "version" - } - field { - name: "membership" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.ClusterSnapshot" - options { - 65001: 0 - } - json_name: "membership" - } - field { - name: "store" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.StoreSnapshot" - options { - 65001: 0 - } - json_name: "store" - } - enum_type { - name: "Version" - value { - name: "V0" - number: 0 - } - } - } - weak_dependency: 2 - syntax: "proto3" -} -file { - name: "github.com/docker/swarmkit/api/watch.proto" - package: "docker.swarmkit.v1" - dependency: "github.com/docker/swarmkit/api/specs.proto" - dependency: "github.com/docker/swarmkit/api/objects.proto" - dependency: "github.com/docker/swarmkit/api/types.proto" - dependency: "gogoproto/gogo.proto" - dependency: "github.com/docker/swarmkit/protobuf/plugin/plugin.proto" - message_type { - name: "Object" - field { - name: "node" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Node" - oneof_index: 0 - json_name: "node" - } - field { - name: "service" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Service" - oneof_index: 0 - json_name: "service" - } - field { - name: "network" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Network" - oneof_index: 0 - json_name: "network" - } - field { - name: "task" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Task" - oneof_index: 0 - json_name: "task" - } - field { - name: "cluster" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Cluster" - oneof_index: 0 - json_name: "cluster" - } - field { - name: "secret" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Secret" - oneof_index: 0 - json_name: "secret" - } - field { - name: "resource" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Resource" - oneof_index: 0 - json_name: "resource" - } - field { - name: "extension" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Extension" - oneof_index: 0 - json_name: "extension" - } - field { - name: "config" - number: 9 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Config" - oneof_index: 0 - json_name: "config" - } - field { - name: "volume" - number: 10 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Volume" - oneof_index: 0 - json_name: "volume" - } - oneof_decl { - name: "Object" - } - } - message_type { - name: "SelectBySlot" - field { - name: "service_id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "ServiceID" - } - json_name: "serviceId" - } - field { - name: "slot" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_UINT64 - json_name: "slot" - } - } - message_type { - name: "SelectByCustom" - field { - name: "kind" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "kind" - } - field { - name: "index" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "index" - } - field { - name: "value" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "value" - } - } - message_type { - name: "SelectBy" - field { - name: "id" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "ID" - } - oneof_index: 0 - json_name: "id" - } - field { - name: "id_prefix" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "IDPrefix" - } - oneof_index: 0 - json_name: "idPrefix" - } - field { - name: "name" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_STRING - oneof_index: 0 - json_name: "name" - } - field { - name: "name_prefix" - number: 4 - label: LABEL_OPTIONAL - type: TYPE_STRING - oneof_index: 0 - json_name: "namePrefix" - } - field { - name: "custom" - number: 5 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.SelectByCustom" - oneof_index: 0 - json_name: "custom" - } - field { - name: "custom_prefix" - number: 6 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.SelectByCustom" - oneof_index: 0 - json_name: "customPrefix" - } - field { - name: "service_id" - number: 7 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "ServiceID" - } - oneof_index: 0 - json_name: "serviceId" - } - field { - name: "node_id" - number: 8 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "NodeID" - } - oneof_index: 0 - json_name: "nodeId" - } - field { - name: "slot" - number: 9 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.SelectBySlot" - oneof_index: 0 - json_name: "slot" - } - field { - name: "desired_state" - number: 10 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.TaskState" - oneof_index: 0 - json_name: "desiredState" - } - field { - name: "role" - number: 11 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.NodeRole" - oneof_index: 0 - json_name: "role" - } - field { - name: "membership" - number: 12 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.NodeSpec.Membership" - oneof_index: 0 - json_name: "membership" - } - field { - name: "referenced_network_id" - number: 13 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "ReferencedNetworkID" - } - oneof_index: 0 - json_name: "referencedNetworkId" - } - field { - name: "referenced_secret_id" - number: 14 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "ReferencedSecretID" - } - oneof_index: 0 - json_name: "referencedSecretId" - } - field { - name: "referenced_config_id" - number: 16 - label: LABEL_OPTIONAL - type: TYPE_STRING - options { - 65004: "ReferencedConfigID" - } - oneof_index: 0 - json_name: "referencedConfigId" - } - field { - name: "kind" - number: 15 - label: LABEL_OPTIONAL - type: TYPE_STRING - oneof_index: 0 - json_name: "kind" - } - oneof_decl { - name: "By" - } - } - message_type { - name: "WatchRequest" - field { - name: "entries" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.WatchRequest.WatchEntry" - json_name: "entries" - } - field { - name: "resume_from" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Version" - json_name: "resumeFrom" - } - field { - name: "include_old_object" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_BOOL - json_name: "includeOldObject" - } - nested_type { - name: "WatchEntry" - field { - name: "kind" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - json_name: "kind" - } - field { - name: "action" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.WatchActionKind" - json_name: "action" - } - field { - name: "filters" - number: 3 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.SelectBy" - json_name: "filters" - } - } - } - message_type { - name: "WatchMessage" - field { - name: "events" - number: 1 - label: LABEL_REPEATED - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.WatchMessage.Event" - json_name: "events" - } - field { - name: "version" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Version" - json_name: "version" - } - nested_type { - name: "Event" - field { - name: "action" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_ENUM - type_name: ".docker.swarmkit.v1.WatchActionKind" - json_name: "action" - } - field { - name: "object" - number: 2 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Object" - json_name: "object" - } - field { - name: "old_object" - number: 3 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: ".docker.swarmkit.v1.Object" - json_name: "oldObject" - } - } - } - enum_type { - name: "WatchActionKind" - value { - name: "WATCH_ACTION_UNKNOWN" - number: 0 - options { - 66001: "WatchActionKindUnknown" - } - } - value { - name: "WATCH_ACTION_CREATE" - number: 1 - options { - 66001: "WatchActionKindCreate" - } - } - value { - name: "WATCH_ACTION_UPDATE" - number: 2 - options { - 66001: "WatchActionKindUpdate" - } - } - value { - name: "WATCH_ACTION_REMOVE" - number: 4 - options { - 66001: "WatchActionKindRemove" - } - } - options { - 62001: 0 - 62023: "WatchActionKind" - } - } - service { - name: "Watch" - method { - name: "Watch" - input_type: ".docker.swarmkit.v1.WatchRequest" - output_type: ".docker.swarmkit.v1.WatchMessage" - options { - 73626345 { - 1: "swarm-manager" - } - } - server_streaming: true - } - } - syntax: "proto3" -} diff --git a/vendor/github.com/moby/swarmkit/v2/api/ca.pb.go b/vendor/github.com/moby/swarmkit/v2/api/ca.pb.go deleted file mode 100644 index 42e77d893d..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/ca.pb.go +++ /dev/null @@ -1,2428 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/docker/swarmkit/api/ca.proto - -package api - -import ( - context "context" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_moby_swarmkit_v2_api_deepcopy "github.com/moby/swarmkit/v2/api/deepcopy" - raftselector "github.com/moby/swarmkit/v2/manager/raftselector" - _ "github.com/moby/swarmkit/v2/protobuf/plugin" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - metadata "google.golang.org/grpc/metadata" - peer "google.golang.org/grpc/peer" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" - rafttime "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type NodeCertificateStatusRequest struct { - NodeID string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` -} - -func (m *NodeCertificateStatusRequest) Reset() { *m = NodeCertificateStatusRequest{} } -func (*NodeCertificateStatusRequest) ProtoMessage() {} -func (*NodeCertificateStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_64a8db18191af608, []int{0} -} -func (m *NodeCertificateStatusRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodeCertificateStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NodeCertificateStatusRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NodeCertificateStatusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeCertificateStatusRequest.Merge(m, src) -} -func (m *NodeCertificateStatusRequest) XXX_Size() int { - return m.Size() -} -func (m *NodeCertificateStatusRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NodeCertificateStatusRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeCertificateStatusRequest proto.InternalMessageInfo - -type NodeCertificateStatusResponse struct { - Status *IssuanceStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - Certificate *Certificate `protobuf:"bytes,2,opt,name=certificate,proto3" json:"certificate,omitempty"` -} - -func (m *NodeCertificateStatusResponse) Reset() { *m = NodeCertificateStatusResponse{} } -func (*NodeCertificateStatusResponse) ProtoMessage() {} -func (*NodeCertificateStatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_64a8db18191af608, []int{1} -} -func (m *NodeCertificateStatusResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodeCertificateStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NodeCertificateStatusResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NodeCertificateStatusResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeCertificateStatusResponse.Merge(m, src) -} -func (m *NodeCertificateStatusResponse) XXX_Size() int { - return m.Size() -} -func (m *NodeCertificateStatusResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NodeCertificateStatusResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeCertificateStatusResponse proto.InternalMessageInfo - -type IssueNodeCertificateRequest struct { - // DEPRECATED: Role is now selected based on which secret is matched. - Role NodeRole `protobuf:"varint,1,opt,name=role,proto3,enum=docker.swarmkit.v1.NodeRole" json:"role,omitempty"` // Deprecated: Do not use. - // CSR is the certificate signing request. - CSR []byte `protobuf:"bytes,2,opt,name=csr,proto3" json:"csr,omitempty"` - // Token represents a user-provided string that is necessary for new - // nodes to join the cluster - Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` - // Availability allows a user to control the current scheduling status of a node - Availability NodeSpec_Availability `protobuf:"varint,4,opt,name=availability,proto3,enum=docker.swarmkit.v1.NodeSpec_Availability" json:"availability,omitempty"` -} - -func (m *IssueNodeCertificateRequest) Reset() { *m = IssueNodeCertificateRequest{} } -func (*IssueNodeCertificateRequest) ProtoMessage() {} -func (*IssueNodeCertificateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_64a8db18191af608, []int{2} -} -func (m *IssueNodeCertificateRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IssueNodeCertificateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IssueNodeCertificateRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *IssueNodeCertificateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_IssueNodeCertificateRequest.Merge(m, src) -} -func (m *IssueNodeCertificateRequest) XXX_Size() int { - return m.Size() -} -func (m *IssueNodeCertificateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_IssueNodeCertificateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_IssueNodeCertificateRequest proto.InternalMessageInfo - -type IssueNodeCertificateResponse struct { - NodeID string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - NodeMembership NodeSpec_Membership `protobuf:"varint,2,opt,name=node_membership,json=nodeMembership,proto3,enum=docker.swarmkit.v1.NodeSpec_Membership" json:"node_membership,omitempty"` -} - -func (m *IssueNodeCertificateResponse) Reset() { *m = IssueNodeCertificateResponse{} } -func (*IssueNodeCertificateResponse) ProtoMessage() {} -func (*IssueNodeCertificateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_64a8db18191af608, []int{3} -} -func (m *IssueNodeCertificateResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IssueNodeCertificateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IssueNodeCertificateResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *IssueNodeCertificateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_IssueNodeCertificateResponse.Merge(m, src) -} -func (m *IssueNodeCertificateResponse) XXX_Size() int { - return m.Size() -} -func (m *IssueNodeCertificateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_IssueNodeCertificateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_IssueNodeCertificateResponse proto.InternalMessageInfo - -type GetRootCACertificateRequest struct { -} - -func (m *GetRootCACertificateRequest) Reset() { *m = GetRootCACertificateRequest{} } -func (*GetRootCACertificateRequest) ProtoMessage() {} -func (*GetRootCACertificateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_64a8db18191af608, []int{4} -} -func (m *GetRootCACertificateRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetRootCACertificateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetRootCACertificateRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetRootCACertificateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetRootCACertificateRequest.Merge(m, src) -} -func (m *GetRootCACertificateRequest) XXX_Size() int { - return m.Size() -} -func (m *GetRootCACertificateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetRootCACertificateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetRootCACertificateRequest proto.InternalMessageInfo - -type GetRootCACertificateResponse struct { - Certificate []byte `protobuf:"bytes,1,opt,name=certificate,proto3" json:"certificate,omitempty"` -} - -func (m *GetRootCACertificateResponse) Reset() { *m = GetRootCACertificateResponse{} } -func (*GetRootCACertificateResponse) ProtoMessage() {} -func (*GetRootCACertificateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_64a8db18191af608, []int{5} -} -func (m *GetRootCACertificateResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetRootCACertificateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetRootCACertificateResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetRootCACertificateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetRootCACertificateResponse.Merge(m, src) -} -func (m *GetRootCACertificateResponse) XXX_Size() int { - return m.Size() -} -func (m *GetRootCACertificateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetRootCACertificateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetRootCACertificateResponse proto.InternalMessageInfo - -type GetUnlockKeyRequest struct { -} - -func (m *GetUnlockKeyRequest) Reset() { *m = GetUnlockKeyRequest{} } -func (*GetUnlockKeyRequest) ProtoMessage() {} -func (*GetUnlockKeyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_64a8db18191af608, []int{6} -} -func (m *GetUnlockKeyRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetUnlockKeyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetUnlockKeyRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetUnlockKeyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUnlockKeyRequest.Merge(m, src) -} -func (m *GetUnlockKeyRequest) XXX_Size() int { - return m.Size() -} -func (m *GetUnlockKeyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetUnlockKeyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetUnlockKeyRequest proto.InternalMessageInfo - -type GetUnlockKeyResponse struct { - UnlockKey []byte `protobuf:"bytes,1,opt,name=unlock_key,json=unlockKey,proto3" json:"unlock_key,omitempty"` - Version Version `protobuf:"bytes,2,opt,name=version,proto3" json:"version"` -} - -func (m *GetUnlockKeyResponse) Reset() { *m = GetUnlockKeyResponse{} } -func (*GetUnlockKeyResponse) ProtoMessage() {} -func (*GetUnlockKeyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_64a8db18191af608, []int{7} -} -func (m *GetUnlockKeyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetUnlockKeyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetUnlockKeyResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetUnlockKeyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUnlockKeyResponse.Merge(m, src) -} -func (m *GetUnlockKeyResponse) XXX_Size() int { - return m.Size() -} -func (m *GetUnlockKeyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetUnlockKeyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetUnlockKeyResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*NodeCertificateStatusRequest)(nil), "docker.swarmkit.v1.NodeCertificateStatusRequest") - proto.RegisterType((*NodeCertificateStatusResponse)(nil), "docker.swarmkit.v1.NodeCertificateStatusResponse") - proto.RegisterType((*IssueNodeCertificateRequest)(nil), "docker.swarmkit.v1.IssueNodeCertificateRequest") - proto.RegisterType((*IssueNodeCertificateResponse)(nil), "docker.swarmkit.v1.IssueNodeCertificateResponse") - proto.RegisterType((*GetRootCACertificateRequest)(nil), "docker.swarmkit.v1.GetRootCACertificateRequest") - proto.RegisterType((*GetRootCACertificateResponse)(nil), "docker.swarmkit.v1.GetRootCACertificateResponse") - proto.RegisterType((*GetUnlockKeyRequest)(nil), "docker.swarmkit.v1.GetUnlockKeyRequest") - proto.RegisterType((*GetUnlockKeyResponse)(nil), "docker.swarmkit.v1.GetUnlockKeyResponse") -} - -func init() { - proto.RegisterFile("github.com/docker/swarmkit/api/ca.proto", fileDescriptor_64a8db18191af608) -} - -var fileDescriptor_64a8db18191af608 = []byte{ - // 651 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xc1, 0x4f, 0x13, 0x4f, - 0x14, 0xee, 0x2c, 0xfc, 0xca, 0x8f, 0x47, 0x05, 0x33, 0x42, 0x52, 0x4b, 0xd9, 0x92, 0xd5, 0x04, - 0x34, 0x71, 0x17, 0xaa, 0x89, 0x89, 0x5e, 0x6c, 0x6b, 0x42, 0x88, 0xc1, 0x98, 0x21, 0x7a, 0x25, - 0xdb, 0xed, 0x50, 0x26, 0x6d, 0x77, 0xd6, 0x9d, 0x59, 0xb4, 0x37, 0x13, 0x8d, 0x67, 0x2f, 0x46, - 0x4f, 0xfe, 0x09, 0xfe, 0x1d, 0xc4, 0x13, 0x89, 0x17, 0x4e, 0x44, 0x96, 0xbb, 0x7f, 0x83, 0xd9, - 0xd9, 0x5d, 0x69, 0x61, 0x5b, 0xf0, 0xd4, 0x9d, 0xf7, 0xbe, 0xef, 0x7b, 0xef, 0x7d, 0xf3, 0x3a, - 0xb0, 0xd2, 0x66, 0x72, 0x2f, 0x68, 0x9a, 0x0e, 0xef, 0x59, 0x2d, 0xee, 0x74, 0xa8, 0x6f, 0x89, - 0x37, 0xb6, 0xdf, 0xeb, 0x30, 0x69, 0xd9, 0x1e, 0xb3, 0x1c, 0xdb, 0xf4, 0x7c, 0x2e, 0x39, 0xc6, - 0x71, 0xd6, 0x4c, 0xb3, 0xe6, 0xfe, 0x7a, 0xe9, 0xee, 0x25, 0x64, 0xd9, 0xf7, 0xa8, 0x88, 0xf9, - 0x97, 0x62, 0x85, 0x47, 0x9d, 0x14, 0x3b, 0xdf, 0xe6, 0x6d, 0xae, 0x3e, 0xad, 0xe8, 0x2b, 0x89, - 0x3e, 0x1c, 0xa3, 0xa0, 0x10, 0xcd, 0x60, 0xd7, 0xf2, 0xba, 0x41, 0x9b, 0xb9, 0xc9, 0x4f, 0x4c, - 0x34, 0x1a, 0x50, 0x7e, 0xce, 0x5b, 0xb4, 0x41, 0x7d, 0xc9, 0x76, 0x99, 0x63, 0x4b, 0xba, 0x2d, - 0x6d, 0x19, 0x08, 0x42, 0x5f, 0x07, 0x54, 0x48, 0x7c, 0x0b, 0xa6, 0x5c, 0xde, 0xa2, 0x3b, 0xac, - 0x55, 0x44, 0xcb, 0x68, 0x75, 0xba, 0x0e, 0xe1, 0x71, 0x25, 0x1f, 0x51, 0x36, 0x9f, 0x92, 0x7c, - 0x94, 0xda, 0x6c, 0x19, 0xdf, 0x10, 0x2c, 0x8d, 0x50, 0x11, 0x1e, 0x77, 0x05, 0xc5, 0x8f, 0x20, - 0x2f, 0x54, 0x44, 0xa9, 0xcc, 0x54, 0x0d, 0xf3, 0xa2, 0x65, 0xe6, 0xa6, 0x10, 0x81, 0xed, 0x3a, - 0x29, 0x37, 0x61, 0xe0, 0x1a, 0xcc, 0x38, 0x67, 0xc2, 0x45, 0x4d, 0x09, 0x54, 0xb2, 0x04, 0x06, - 0xea, 0x93, 0x41, 0x8e, 0xf1, 0x13, 0xc1, 0x62, 0xa4, 0x4e, 0xcf, 0x75, 0x99, 0x4e, 0xf9, 0x00, - 0x26, 0x7d, 0xde, 0xa5, 0xaa, 0xb9, 0xd9, 0x6a, 0x39, 0x4b, 0x3b, 0x62, 0x12, 0xde, 0xa5, 0x75, - 0xad, 0x88, 0x88, 0x42, 0xe3, 0x9b, 0x30, 0xe1, 0x08, 0x5f, 0x35, 0x54, 0xa8, 0x4f, 0x85, 0xc7, - 0x95, 0x89, 0xc6, 0x36, 0x21, 0x51, 0x0c, 0xcf, 0xc3, 0x7f, 0x92, 0x77, 0xa8, 0x5b, 0x9c, 0x88, - 0x4c, 0x23, 0xf1, 0x01, 0x6f, 0x41, 0xc1, 0xde, 0xb7, 0x59, 0xd7, 0x6e, 0xb2, 0x2e, 0x93, 0xfd, - 0xe2, 0xa4, 0x2a, 0x77, 0x67, 0x54, 0xb9, 0x6d, 0x8f, 0x3a, 0x66, 0x6d, 0x80, 0x40, 0x86, 0xe8, - 0xc6, 0x67, 0x04, 0xe5, 0xec, 0xa9, 0x12, 0xd7, 0xaf, 0x72, 0x79, 0xf8, 0x05, 0xcc, 0x29, 0x50, - 0x8f, 0xf6, 0x9a, 0xd4, 0x17, 0x7b, 0xcc, 0x53, 0x13, 0xcd, 0x56, 0x57, 0xc6, 0xf6, 0xb5, 0xf5, - 0x17, 0x4e, 0x66, 0x23, 0xfe, 0xd9, 0xd9, 0x58, 0x82, 0xc5, 0x0d, 0x2a, 0x09, 0xe7, 0xb2, 0x51, - 0xbb, 0x68, 0xb6, 0xf1, 0x04, 0xca, 0xd9, 0xe9, 0xa4, 0xeb, 0xe5, 0xe1, 0xfb, 0x8e, 0x3a, 0x2f, - 0x0c, 0x5f, 0xe7, 0x02, 0xdc, 0xd8, 0xa0, 0xf2, 0xa5, 0xdb, 0xe5, 0x4e, 0xe7, 0x19, 0xed, 0xa7, - 0xc2, 0x3e, 0xcc, 0x0f, 0x87, 0x13, 0xc1, 0x25, 0x80, 0x40, 0x05, 0x77, 0x3a, 0xb4, 0x9f, 0xe8, - 0x4d, 0x07, 0x29, 0x0c, 0x3f, 0x86, 0xa9, 0x7d, 0xea, 0x0b, 0xc6, 0xdd, 0x64, 0xb7, 0x16, 0xb3, - 0x06, 0x7f, 0x15, 0x43, 0xea, 0x93, 0x07, 0xc7, 0x95, 0x1c, 0x49, 0x19, 0xd5, 0x0f, 0x1a, 0x68, - 0x8d, 0x1a, 0x7e, 0x8f, 0x54, 0xed, 0x0b, 0x43, 0x61, 0x2b, 0x4b, 0x6b, 0x8c, 0x3b, 0xa5, 0xb5, - 0xab, 0x13, 0xe2, 0xf1, 0x8c, 0xff, 0x7f, 0x7c, 0xff, 0xfd, 0x55, 0xd3, 0xae, 0x23, 0xfc, 0x16, - 0x0a, 0x83, 0x06, 0xe0, 0x95, 0x11, 0x5a, 0xe7, 0x9d, 0x2b, 0xad, 0x5e, 0x0e, 0x4c, 0x8a, 0x2d, - 0xa8, 0x62, 0x73, 0x70, 0x4d, 0x21, 0xef, 0xf5, 0x6c, 0xd7, 0x6e, 0x53, 0xbf, 0xfa, 0x45, 0x03, - 0xb5, 0x57, 0x89, 0x15, 0x59, 0x5b, 0x99, 0x6d, 0xc5, 0x98, 0x7f, 0x65, 0xb6, 0x15, 0xe3, 0x16, - 0x7e, 0xc0, 0x8a, 0x8f, 0x08, 0x16, 0x32, 0x9f, 0x24, 0xbc, 0x36, 0x6a, 0xad, 0x47, 0xbd, 0x81, - 0xa5, 0xf5, 0x7f, 0x60, 0x9c, 0x6f, 0xa4, 0x7e, 0xfb, 0xe0, 0x44, 0xcf, 0x1d, 0x9d, 0xe8, 0xb9, - 0x77, 0xa1, 0x8e, 0x0e, 0x42, 0x1d, 0x1d, 0x86, 0x3a, 0xfa, 0x15, 0xea, 0xe8, 0xd3, 0xa9, 0x9e, - 0x3b, 0x3c, 0xd5, 0x73, 0x47, 0xa7, 0x7a, 0xae, 0x99, 0x57, 0xaf, 0xf1, 0xfd, 0x3f, 0x01, 0x00, - 0x00, 0xff, 0xff, 0xd2, 0x82, 0x20, 0x1b, 0x73, 0x06, 0x00, 0x00, -} - -type authenticatedWrapperCAServer struct { - local CAServer - authorize func(context.Context, []string) error -} - -func NewAuthenticatedWrapperCAServer(local CAServer, authorize func(context.Context, []string) error) CAServer { - return &authenticatedWrapperCAServer{ - local: local, - authorize: authorize, - } -} - -func (p *authenticatedWrapperCAServer) GetRootCACertificate(ctx context.Context, r *GetRootCACertificateRequest) (*GetRootCACertificateResponse, error) { - - return p.local.GetRootCACertificate(ctx, r) -} - -func (p *authenticatedWrapperCAServer) GetUnlockKey(ctx context.Context, r *GetUnlockKeyRequest) (*GetUnlockKeyResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.GetUnlockKey(ctx, r) -} - -type authenticatedWrapperNodeCAServer struct { - local NodeCAServer - authorize func(context.Context, []string) error -} - -func NewAuthenticatedWrapperNodeCAServer(local NodeCAServer, authorize func(context.Context, []string) error) NodeCAServer { - return &authenticatedWrapperNodeCAServer{ - local: local, - authorize: authorize, - } -} - -func (p *authenticatedWrapperNodeCAServer) IssueNodeCertificate(ctx context.Context, r *IssueNodeCertificateRequest) (*IssueNodeCertificateResponse, error) { - - return p.local.IssueNodeCertificate(ctx, r) -} - -func (p *authenticatedWrapperNodeCAServer) NodeCertificateStatus(ctx context.Context, r *NodeCertificateStatusRequest) (*NodeCertificateStatusResponse, error) { - - return p.local.NodeCertificateStatus(ctx, r) -} - -func (m *NodeCertificateStatusRequest) Copy() *NodeCertificateStatusRequest { - if m == nil { - return nil - } - o := &NodeCertificateStatusRequest{} - o.CopyFrom(m) - return o -} - -func (m *NodeCertificateStatusRequest) CopyFrom(src interface{}) { - - o := src.(*NodeCertificateStatusRequest) - *m = *o -} - -func (m *NodeCertificateStatusResponse) Copy() *NodeCertificateStatusResponse { - if m == nil { - return nil - } - o := &NodeCertificateStatusResponse{} - o.CopyFrom(m) - return o -} - -func (m *NodeCertificateStatusResponse) CopyFrom(src interface{}) { - - o := src.(*NodeCertificateStatusResponse) - *m = *o - if o.Status != nil { - m.Status = &IssuanceStatus{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Status, o.Status) - } - if o.Certificate != nil { - m.Certificate = &Certificate{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Certificate, o.Certificate) - } -} - -func (m *IssueNodeCertificateRequest) Copy() *IssueNodeCertificateRequest { - if m == nil { - return nil - } - o := &IssueNodeCertificateRequest{} - o.CopyFrom(m) - return o -} - -func (m *IssueNodeCertificateRequest) CopyFrom(src interface{}) { - - o := src.(*IssueNodeCertificateRequest) - *m = *o - if o.CSR != nil { - m.CSR = make([]byte, len(o.CSR)) - copy(m.CSR, o.CSR) - } -} - -func (m *IssueNodeCertificateResponse) Copy() *IssueNodeCertificateResponse { - if m == nil { - return nil - } - o := &IssueNodeCertificateResponse{} - o.CopyFrom(m) - return o -} - -func (m *IssueNodeCertificateResponse) CopyFrom(src interface{}) { - - o := src.(*IssueNodeCertificateResponse) - *m = *o -} - -func (m *GetRootCACertificateRequest) Copy() *GetRootCACertificateRequest { - if m == nil { - return nil - } - o := &GetRootCACertificateRequest{} - o.CopyFrom(m) - return o -} - -func (m *GetRootCACertificateRequest) CopyFrom(src interface{}) {} -func (m *GetRootCACertificateResponse) Copy() *GetRootCACertificateResponse { - if m == nil { - return nil - } - o := &GetRootCACertificateResponse{} - o.CopyFrom(m) - return o -} - -func (m *GetRootCACertificateResponse) CopyFrom(src interface{}) { - - o := src.(*GetRootCACertificateResponse) - *m = *o - if o.Certificate != nil { - m.Certificate = make([]byte, len(o.Certificate)) - copy(m.Certificate, o.Certificate) - } -} - -func (m *GetUnlockKeyRequest) Copy() *GetUnlockKeyRequest { - if m == nil { - return nil - } - o := &GetUnlockKeyRequest{} - o.CopyFrom(m) - return o -} - -func (m *GetUnlockKeyRequest) CopyFrom(src interface{}) {} -func (m *GetUnlockKeyResponse) Copy() *GetUnlockKeyResponse { - if m == nil { - return nil - } - o := &GetUnlockKeyResponse{} - o.CopyFrom(m) - return o -} - -func (m *GetUnlockKeyResponse) CopyFrom(src interface{}) { - - o := src.(*GetUnlockKeyResponse) - *m = *o - if o.UnlockKey != nil { - m.UnlockKey = make([]byte, len(o.UnlockKey)) - copy(m.UnlockKey, o.UnlockKey) - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Version, &o.Version) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// CAClient is the client API for CA service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type CAClient interface { - GetRootCACertificate(ctx context.Context, in *GetRootCACertificateRequest, opts ...grpc.CallOption) (*GetRootCACertificateResponse, error) - // GetUnlockKey returns the current unlock key for the cluster for the role of the client - // asking. - GetUnlockKey(ctx context.Context, in *GetUnlockKeyRequest, opts ...grpc.CallOption) (*GetUnlockKeyResponse, error) -} - -type cAClient struct { - cc *grpc.ClientConn -} - -func NewCAClient(cc *grpc.ClientConn) CAClient { - return &cAClient{cc} -} - -func (c *cAClient) GetRootCACertificate(ctx context.Context, in *GetRootCACertificateRequest, opts ...grpc.CallOption) (*GetRootCACertificateResponse, error) { - out := new(GetRootCACertificateResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.CA/GetRootCACertificate", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *cAClient) GetUnlockKey(ctx context.Context, in *GetUnlockKeyRequest, opts ...grpc.CallOption) (*GetUnlockKeyResponse, error) { - out := new(GetUnlockKeyResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.CA/GetUnlockKey", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// CAServer is the server API for CA service. -type CAServer interface { - GetRootCACertificate(context.Context, *GetRootCACertificateRequest) (*GetRootCACertificateResponse, error) - // GetUnlockKey returns the current unlock key for the cluster for the role of the client - // asking. - GetUnlockKey(context.Context, *GetUnlockKeyRequest) (*GetUnlockKeyResponse, error) -} - -// UnimplementedCAServer can be embedded to have forward compatible implementations. -type UnimplementedCAServer struct { -} - -func (*UnimplementedCAServer) GetRootCACertificate(ctx context.Context, req *GetRootCACertificateRequest) (*GetRootCACertificateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetRootCACertificate not implemented") -} -func (*UnimplementedCAServer) GetUnlockKey(ctx context.Context, req *GetUnlockKeyRequest) (*GetUnlockKeyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetUnlockKey not implemented") -} - -func RegisterCAServer(s *grpc.Server, srv CAServer) { - s.RegisterService(&_CA_serviceDesc, srv) -} - -func _CA_GetRootCACertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRootCACertificateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CAServer).GetRootCACertificate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.CA/GetRootCACertificate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CAServer).GetRootCACertificate(ctx, req.(*GetRootCACertificateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CA_GetUnlockKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUnlockKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CAServer).GetUnlockKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.CA/GetUnlockKey", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CAServer).GetUnlockKey(ctx, req.(*GetUnlockKeyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _CA_serviceDesc = grpc.ServiceDesc{ - ServiceName: "docker.swarmkit.v1.CA", - HandlerType: (*CAServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetRootCACertificate", - Handler: _CA_GetRootCACertificate_Handler, - }, - { - MethodName: "GetUnlockKey", - Handler: _CA_GetUnlockKey_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/docker/swarmkit/api/ca.proto", -} - -// NodeCAClient is the client API for NodeCA service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type NodeCAClient interface { - IssueNodeCertificate(ctx context.Context, in *IssueNodeCertificateRequest, opts ...grpc.CallOption) (*IssueNodeCertificateResponse, error) - NodeCertificateStatus(ctx context.Context, in *NodeCertificateStatusRequest, opts ...grpc.CallOption) (*NodeCertificateStatusResponse, error) -} - -type nodeCAClient struct { - cc *grpc.ClientConn -} - -func NewNodeCAClient(cc *grpc.ClientConn) NodeCAClient { - return &nodeCAClient{cc} -} - -func (c *nodeCAClient) IssueNodeCertificate(ctx context.Context, in *IssueNodeCertificateRequest, opts ...grpc.CallOption) (*IssueNodeCertificateResponse, error) { - out := new(IssueNodeCertificateResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.NodeCA/IssueNodeCertificate", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeCAClient) NodeCertificateStatus(ctx context.Context, in *NodeCertificateStatusRequest, opts ...grpc.CallOption) (*NodeCertificateStatusResponse, error) { - out := new(NodeCertificateStatusResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.NodeCA/NodeCertificateStatus", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// NodeCAServer is the server API for NodeCA service. -type NodeCAServer interface { - IssueNodeCertificate(context.Context, *IssueNodeCertificateRequest) (*IssueNodeCertificateResponse, error) - NodeCertificateStatus(context.Context, *NodeCertificateStatusRequest) (*NodeCertificateStatusResponse, error) -} - -// UnimplementedNodeCAServer can be embedded to have forward compatible implementations. -type UnimplementedNodeCAServer struct { -} - -func (*UnimplementedNodeCAServer) IssueNodeCertificate(ctx context.Context, req *IssueNodeCertificateRequest) (*IssueNodeCertificateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IssueNodeCertificate not implemented") -} -func (*UnimplementedNodeCAServer) NodeCertificateStatus(ctx context.Context, req *NodeCertificateStatusRequest) (*NodeCertificateStatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method NodeCertificateStatus not implemented") -} - -func RegisterNodeCAServer(s *grpc.Server, srv NodeCAServer) { - s.RegisterService(&_NodeCA_serviceDesc, srv) -} - -func _NodeCA_IssueNodeCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(IssueNodeCertificateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeCAServer).IssueNodeCertificate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.NodeCA/IssueNodeCertificate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeCAServer).IssueNodeCertificate(ctx, req.(*IssueNodeCertificateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeCA_NodeCertificateStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NodeCertificateStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeCAServer).NodeCertificateStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.NodeCA/NodeCertificateStatus", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeCAServer).NodeCertificateStatus(ctx, req.(*NodeCertificateStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _NodeCA_serviceDesc = grpc.ServiceDesc{ - ServiceName: "docker.swarmkit.v1.NodeCA", - HandlerType: (*NodeCAServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "IssueNodeCertificate", - Handler: _NodeCA_IssueNodeCertificate_Handler, - }, - { - MethodName: "NodeCertificateStatus", - Handler: _NodeCA_NodeCertificateStatus_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/docker/swarmkit/api/ca.proto", -} - -func (m *NodeCertificateStatusRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NodeCertificateStatusRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodeCertificateStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NodeID) > 0 { - i -= len(m.NodeID) - copy(dAtA[i:], m.NodeID) - i = encodeVarintCa(dAtA, i, uint64(len(m.NodeID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *NodeCertificateStatusResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NodeCertificateStatusResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodeCertificateStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Certificate != nil { - { - size, err := m.Certificate.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCa(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Status != nil { - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCa(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *IssueNodeCertificateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *IssueNodeCertificateRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *IssueNodeCertificateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Availability != 0 { - i = encodeVarintCa(dAtA, i, uint64(m.Availability)) - i-- - dAtA[i] = 0x20 - } - if len(m.Token) > 0 { - i -= len(m.Token) - copy(dAtA[i:], m.Token) - i = encodeVarintCa(dAtA, i, uint64(len(m.Token))) - i-- - dAtA[i] = 0x1a - } - if len(m.CSR) > 0 { - i -= len(m.CSR) - copy(dAtA[i:], m.CSR) - i = encodeVarintCa(dAtA, i, uint64(len(m.CSR))) - i-- - dAtA[i] = 0x12 - } - if m.Role != 0 { - i = encodeVarintCa(dAtA, i, uint64(m.Role)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *IssueNodeCertificateResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *IssueNodeCertificateResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *IssueNodeCertificateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NodeMembership != 0 { - i = encodeVarintCa(dAtA, i, uint64(m.NodeMembership)) - i-- - dAtA[i] = 0x10 - } - if len(m.NodeID) > 0 { - i -= len(m.NodeID) - copy(dAtA[i:], m.NodeID) - i = encodeVarintCa(dAtA, i, uint64(len(m.NodeID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetRootCACertificateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetRootCACertificateRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetRootCACertificateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *GetRootCACertificateResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetRootCACertificateResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetRootCACertificateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Certificate) > 0 { - i -= len(m.Certificate) - copy(dAtA[i:], m.Certificate) - i = encodeVarintCa(dAtA, i, uint64(len(m.Certificate))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetUnlockKeyRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetUnlockKeyRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetUnlockKeyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *GetUnlockKeyResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetUnlockKeyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetUnlockKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCa(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.UnlockKey) > 0 { - i -= len(m.UnlockKey) - copy(dAtA[i:], m.UnlockKey) - i = encodeVarintCa(dAtA, i, uint64(len(m.UnlockKey))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintCa(dAtA []byte, offset int, v uint64) int { - offset -= sovCa(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -type raftProxyCAServer struct { - local CAServer - connSelector raftselector.ConnProvider - localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error) -} - -func NewRaftProxyCAServer(local CAServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) CAServer { - redirectChecker := func(ctx context.Context) (context.Context, error) { - p, ok := peer.FromContext(ctx) - if !ok { - return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context") - } - addr := p.Addr.String() - md, ok := metadata.FromIncomingContext(ctx) - if ok && len(md["redirect"]) != 0 { - return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"]) - } - if !ok { - md = metadata.New(map[string]string{}) - } - md["redirect"] = append(md["redirect"], addr) - return metadata.NewOutgoingContext(ctx, md), nil - } - remoteMods := []func(context.Context) (context.Context, error){redirectChecker} - remoteMods = append(remoteMods, remoteCtxMod) - - var localMods []func(context.Context) (context.Context, error) - if localCtxMod != nil { - localMods = []func(context.Context) (context.Context, error){localCtxMod} - } - - return &raftProxyCAServer{ - local: local, - connSelector: connSelector, - localCtxMods: localMods, - remoteCtxMods: remoteMods, - } -} -func (p *raftProxyCAServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) { - var err error - for _, mod := range ctxMods { - ctx, err = mod(ctx) - if err != nil { - return ctx, err - } - } - return ctx, nil -} -func (p *raftProxyCAServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) { - ticker := rafttime.NewTicker(500 * rafttime.Millisecond) - defer ticker.Stop() - for { - select { - case <-ticker.C: - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - return nil, err - } - - client := NewHealthClient(conn) - - resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"}) - if err != nil || resp.Status != HealthCheckResponse_SERVING { - continue - } - return conn, nil - case <-ctx.Done(): - return nil, ctx.Err() - } - } -} - -func (p *raftProxyCAServer) GetRootCACertificate(ctx context.Context, r *GetRootCACertificateRequest) (*GetRootCACertificateResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.GetRootCACertificate(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewCAClient(conn).GetRootCACertificate(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.GetRootCACertificate(ctx, r) - } - return nil, err - } - return NewCAClient(conn).GetRootCACertificate(modCtx, r) - } - return resp, err -} - -func (p *raftProxyCAServer) GetUnlockKey(ctx context.Context, r *GetUnlockKeyRequest) (*GetUnlockKeyResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.GetUnlockKey(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewCAClient(conn).GetUnlockKey(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.GetUnlockKey(ctx, r) - } - return nil, err - } - return NewCAClient(conn).GetUnlockKey(modCtx, r) - } - return resp, err -} - -type raftProxyNodeCAServer struct { - local NodeCAServer - connSelector raftselector.ConnProvider - localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error) -} - -func NewRaftProxyNodeCAServer(local NodeCAServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) NodeCAServer { - redirectChecker := func(ctx context.Context) (context.Context, error) { - p, ok := peer.FromContext(ctx) - if !ok { - return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context") - } - addr := p.Addr.String() - md, ok := metadata.FromIncomingContext(ctx) - if ok && len(md["redirect"]) != 0 { - return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"]) - } - if !ok { - md = metadata.New(map[string]string{}) - } - md["redirect"] = append(md["redirect"], addr) - return metadata.NewOutgoingContext(ctx, md), nil - } - remoteMods := []func(context.Context) (context.Context, error){redirectChecker} - remoteMods = append(remoteMods, remoteCtxMod) - - var localMods []func(context.Context) (context.Context, error) - if localCtxMod != nil { - localMods = []func(context.Context) (context.Context, error){localCtxMod} - } - - return &raftProxyNodeCAServer{ - local: local, - connSelector: connSelector, - localCtxMods: localMods, - remoteCtxMods: remoteMods, - } -} -func (p *raftProxyNodeCAServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) { - var err error - for _, mod := range ctxMods { - ctx, err = mod(ctx) - if err != nil { - return ctx, err - } - } - return ctx, nil -} -func (p *raftProxyNodeCAServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) { - ticker := rafttime.NewTicker(500 * rafttime.Millisecond) - defer ticker.Stop() - for { - select { - case <-ticker.C: - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - return nil, err - } - - client := NewHealthClient(conn) - - resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"}) - if err != nil || resp.Status != HealthCheckResponse_SERVING { - continue - } - return conn, nil - case <-ctx.Done(): - return nil, ctx.Err() - } - } -} - -func (p *raftProxyNodeCAServer) IssueNodeCertificate(ctx context.Context, r *IssueNodeCertificateRequest) (*IssueNodeCertificateResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.IssueNodeCertificate(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewNodeCAClient(conn).IssueNodeCertificate(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.IssueNodeCertificate(ctx, r) - } - return nil, err - } - return NewNodeCAClient(conn).IssueNodeCertificate(modCtx, r) - } - return resp, err -} - -func (p *raftProxyNodeCAServer) NodeCertificateStatus(ctx context.Context, r *NodeCertificateStatusRequest) (*NodeCertificateStatusResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.NodeCertificateStatus(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewNodeCAClient(conn).NodeCertificateStatus(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.NodeCertificateStatus(ctx, r) - } - return nil, err - } - return NewNodeCAClient(conn).NodeCertificateStatus(modCtx, r) - } - return resp, err -} - -func (m *NodeCertificateStatusRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.NodeID) - if l > 0 { - n += 1 + l + sovCa(uint64(l)) - } - return n -} - -func (m *NodeCertificateStatusResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovCa(uint64(l)) - } - if m.Certificate != nil { - l = m.Certificate.Size() - n += 1 + l + sovCa(uint64(l)) - } - return n -} - -func (m *IssueNodeCertificateRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Role != 0 { - n += 1 + sovCa(uint64(m.Role)) - } - l = len(m.CSR) - if l > 0 { - n += 1 + l + sovCa(uint64(l)) - } - l = len(m.Token) - if l > 0 { - n += 1 + l + sovCa(uint64(l)) - } - if m.Availability != 0 { - n += 1 + sovCa(uint64(m.Availability)) - } - return n -} - -func (m *IssueNodeCertificateResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.NodeID) - if l > 0 { - n += 1 + l + sovCa(uint64(l)) - } - if m.NodeMembership != 0 { - n += 1 + sovCa(uint64(m.NodeMembership)) - } - return n -} - -func (m *GetRootCACertificateRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *GetRootCACertificateResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Certificate) - if l > 0 { - n += 1 + l + sovCa(uint64(l)) - } - return n -} - -func (m *GetUnlockKeyRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *GetUnlockKeyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.UnlockKey) - if l > 0 { - n += 1 + l + sovCa(uint64(l)) - } - l = m.Version.Size() - n += 1 + l + sovCa(uint64(l)) - return n -} - -func sovCa(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozCa(x uint64) (n int) { - return sovCa(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *NodeCertificateStatusRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NodeCertificateStatusRequest{`, - `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, - `}`, - }, "") - return s -} -func (this *NodeCertificateStatusResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NodeCertificateStatusResponse{`, - `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "IssuanceStatus", "IssuanceStatus", 1) + `,`, - `Certificate:` + strings.Replace(fmt.Sprintf("%v", this.Certificate), "Certificate", "Certificate", 1) + `,`, - `}`, - }, "") - return s -} -func (this *IssueNodeCertificateRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&IssueNodeCertificateRequest{`, - `Role:` + fmt.Sprintf("%v", this.Role) + `,`, - `CSR:` + fmt.Sprintf("%v", this.CSR) + `,`, - `Token:` + fmt.Sprintf("%v", this.Token) + `,`, - `Availability:` + fmt.Sprintf("%v", this.Availability) + `,`, - `}`, - }, "") - return s -} -func (this *IssueNodeCertificateResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&IssueNodeCertificateResponse{`, - `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, - `NodeMembership:` + fmt.Sprintf("%v", this.NodeMembership) + `,`, - `}`, - }, "") - return s -} -func (this *GetRootCACertificateRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetRootCACertificateRequest{`, - `}`, - }, "") - return s -} -func (this *GetRootCACertificateResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetRootCACertificateResponse{`, - `Certificate:` + fmt.Sprintf("%v", this.Certificate) + `,`, - `}`, - }, "") - return s -} -func (this *GetUnlockKeyRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetUnlockKeyRequest{`, - `}`, - }, "") - return s -} -func (this *GetUnlockKeyResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetUnlockKeyResponse{`, - `UnlockKey:` + fmt.Sprintf("%v", this.UnlockKey) + `,`, - `Version:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Version), "Version", "Version", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func valueToStringCa(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *NodeCertificateStatusRequest) Unmarshal(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 ErrIntOverflowCa - } - 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: NodeCertificateStatusRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodeCertificateStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCa - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCa - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCa - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NodeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCa(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NodeCertificateStatusResponse) Unmarshal(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 ErrIntOverflowCa - } - 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: NodeCertificateStatusResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodeCertificateStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCa - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCa - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCa - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Status == nil { - m.Status = &IssuanceStatus{} - } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Certificate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCa - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCa - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCa - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Certificate == nil { - m.Certificate = &Certificate{} - } - if err := m.Certificate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCa(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IssueNodeCertificateRequest) Unmarshal(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 ErrIntOverflowCa - } - 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: IssueNodeCertificateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IssueNodeCertificateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - m.Role = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCa - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Role |= NodeRole(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CSR", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCa - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthCa - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthCa - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CSR = append(m.CSR[:0], dAtA[iNdEx:postIndex]...) - if m.CSR == nil { - m.CSR = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCa - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCa - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCa - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Token = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Availability", wireType) - } - m.Availability = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCa - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Availability |= NodeSpec_Availability(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipCa(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IssueNodeCertificateResponse) Unmarshal(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 ErrIntOverflowCa - } - 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: IssueNodeCertificateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IssueNodeCertificateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCa - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCa - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCa - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NodeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeMembership", wireType) - } - m.NodeMembership = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCa - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NodeMembership |= NodeSpec_Membership(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipCa(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetRootCACertificateRequest) Unmarshal(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 ErrIntOverflowCa - } - 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: GetRootCACertificateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetRootCACertificateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipCa(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetRootCACertificateResponse) Unmarshal(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 ErrIntOverflowCa - } - 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: GetRootCACertificateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetRootCACertificateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Certificate", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCa - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthCa - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthCa - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Certificate = append(m.Certificate[:0], dAtA[iNdEx:postIndex]...) - if m.Certificate == nil { - m.Certificate = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCa(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetUnlockKeyRequest) Unmarshal(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 ErrIntOverflowCa - } - 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: GetUnlockKeyRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetUnlockKeyRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipCa(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetUnlockKeyResponse) Unmarshal(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 ErrIntOverflowCa - } - 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: GetUnlockKeyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetUnlockKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UnlockKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCa - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthCa - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthCa - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.UnlockKey = append(m.UnlockKey[:0], dAtA[iNdEx:postIndex]...) - if m.UnlockKey == nil { - m.UnlockKey = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCa - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCa - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCa - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCa(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipCa(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCa - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCa - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCa - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthCa - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupCa - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthCa - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthCa = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCa = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupCa = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/moby/swarmkit/v2/api/ca.proto b/vendor/github.com/moby/swarmkit/v2/api/ca.proto deleted file mode 100644 index e26c8f35a9..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/ca.proto +++ /dev/null @@ -1,72 +0,0 @@ -syntax = "proto3"; - -package docker.swarmkit.v1; - -import "github.com/docker/swarmkit/api/types.proto"; -import "github.com/docker/swarmkit/api/specs.proto"; -import "gogoproto/gogo.proto"; -import "github.com/docker/swarmkit/protobuf/plugin/plugin.proto"; - -// CA defines the RPC methods for requesting certificates from a CA. - -service CA { - rpc GetRootCACertificate(GetRootCACertificateRequest) returns (GetRootCACertificateResponse) { - option (docker.protobuf.plugin.tls_authorization) = { insecure: true }; - }; - // GetUnlockKey returns the current unlock key for the cluster for the role of the client - // asking. - rpc GetUnlockKey(GetUnlockKeyRequest) returns (GetUnlockKeyResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: ["swarm-manager"] }; - }; -} - -service NodeCA { - rpc IssueNodeCertificate(IssueNodeCertificateRequest) returns (IssueNodeCertificateResponse) { - option (docker.protobuf.plugin.tls_authorization) = { insecure: true }; - }; - rpc NodeCertificateStatus(NodeCertificateStatusRequest) returns (NodeCertificateStatusResponse) { - option (docker.protobuf.plugin.tls_authorization) = { insecure: true }; - }; -} - -message NodeCertificateStatusRequest { - string node_id = 1; -} - -message NodeCertificateStatusResponse { - IssuanceStatus status = 1; - Certificate certificate = 2; -} - -message IssueNodeCertificateRequest { - // DEPRECATED: Role is now selected based on which secret is matched. - NodeRole role = 1 [deprecated=true]; - - // CSR is the certificate signing request. - bytes csr = 2 [(gogoproto.customname) = "CSR"]; - - // Token represents a user-provided string that is necessary for new - // nodes to join the cluster - string token = 3; - - // Availability allows a user to control the current scheduling status of a node - NodeSpec.Availability availability = 4; -} - -message IssueNodeCertificateResponse { - string node_id = 1; - NodeSpec.Membership node_membership = 2; -} - -message GetRootCACertificateRequest {} - -message GetRootCACertificateResponse { - bytes certificate = 1; -} - -message GetUnlockKeyRequest {} - -message GetUnlockKeyResponse { - bytes unlock_key = 1; - Version version = 2 [(gogoproto.nullable) = false]; -} diff --git a/vendor/github.com/moby/swarmkit/v2/api/control.pb.go b/vendor/github.com/moby/swarmkit/v2/api/control.pb.go deleted file mode 100644 index a040b9c1fc..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/control.pb.go +++ /dev/null @@ -1,27581 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/docker/swarmkit/api/control.proto - -package api - -import ( - context "context" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - types "github.com/gogo/protobuf/types" - github_com_moby_swarmkit_v2_api_deepcopy "github.com/moby/swarmkit/v2/api/deepcopy" - raftselector "github.com/moby/swarmkit/v2/manager/raftselector" - _ "github.com/moby/swarmkit/v2/protobuf/plugin" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - metadata "google.golang.org/grpc/metadata" - peer "google.golang.org/grpc/peer" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" - rafttime "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type UpdateServiceRequest_Rollback int32 - -const ( - // This is not a rollback. The spec field of the request will - // be honored. - UpdateServiceRequest_NONE UpdateServiceRequest_Rollback = 0 - // Roll back the service - get spec from the service's - // previous_spec. - UpdateServiceRequest_PREVIOUS UpdateServiceRequest_Rollback = 1 -) - -var UpdateServiceRequest_Rollback_name = map[int32]string{ - 0: "NONE", - 1: "PREVIOUS", -} - -var UpdateServiceRequest_Rollback_value = map[string]int32{ - "NONE": 0, - "PREVIOUS": 1, -} - -func (x UpdateServiceRequest_Rollback) String() string { - return proto.EnumName(UpdateServiceRequest_Rollback_name, int32(x)) -} - -func (UpdateServiceRequest_Rollback) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{18, 0} -} - -type GetNodeRequest struct { - NodeID string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` -} - -func (m *GetNodeRequest) Reset() { *m = GetNodeRequest{} } -func (*GetNodeRequest) ProtoMessage() {} -func (*GetNodeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{0} -} -func (m *GetNodeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetNodeRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetNodeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetNodeRequest.Merge(m, src) -} -func (m *GetNodeRequest) XXX_Size() int { - return m.Size() -} -func (m *GetNodeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetNodeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetNodeRequest proto.InternalMessageInfo - -type GetNodeResponse struct { - Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` -} - -func (m *GetNodeResponse) Reset() { *m = GetNodeResponse{} } -func (*GetNodeResponse) ProtoMessage() {} -func (*GetNodeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{1} -} -func (m *GetNodeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetNodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetNodeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetNodeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetNodeResponse.Merge(m, src) -} -func (m *GetNodeResponse) XXX_Size() int { - return m.Size() -} -func (m *GetNodeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetNodeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetNodeResponse proto.InternalMessageInfo - -type ListNodesRequest struct { - Filters *ListNodesRequest_Filters `protobuf:"bytes,1,opt,name=filters,proto3" json:"filters,omitempty"` -} - -func (m *ListNodesRequest) Reset() { *m = ListNodesRequest{} } -func (*ListNodesRequest) ProtoMessage() {} -func (*ListNodesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{2} -} -func (m *ListNodesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListNodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListNodesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListNodesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListNodesRequest.Merge(m, src) -} -func (m *ListNodesRequest) XXX_Size() int { - return m.Size() -} -func (m *ListNodesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListNodesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListNodesRequest proto.InternalMessageInfo - -type ListNodesRequest_Filters struct { - Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` - IDPrefixes []string `protobuf:"bytes,2,rep,name=id_prefixes,json=idPrefixes,proto3" json:"id_prefixes,omitempty"` - // Labels refers to engine labels, which are labels set by the user on the - // node and reported back to the managers - Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // NodeLabels are labels set on the node object on the managers. - NodeLabels map[string]string `protobuf:"bytes,7,rep,name=node_labels,json=nodeLabels,proto3" json:"node_labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Memberships []NodeSpec_Membership `protobuf:"varint,4,rep,name=memberships,proto3,enum=docker.swarmkit.v1.NodeSpec_Membership" json:"memberships,omitempty"` - Roles []NodeRole `protobuf:"varint,5,rep,name=roles,proto3,enum=docker.swarmkit.v1.NodeRole" json:"roles,omitempty"` - // NamePrefixes matches all objects with the given prefixes - NamePrefixes []string `protobuf:"bytes,6,rep,name=name_prefixes,json=namePrefixes,proto3" json:"name_prefixes,omitempty"` -} - -func (m *ListNodesRequest_Filters) Reset() { *m = ListNodesRequest_Filters{} } -func (*ListNodesRequest_Filters) ProtoMessage() {} -func (*ListNodesRequest_Filters) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{2, 0} -} -func (m *ListNodesRequest_Filters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListNodesRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListNodesRequest_Filters.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListNodesRequest_Filters) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListNodesRequest_Filters.Merge(m, src) -} -func (m *ListNodesRequest_Filters) XXX_Size() int { - return m.Size() -} -func (m *ListNodesRequest_Filters) XXX_DiscardUnknown() { - xxx_messageInfo_ListNodesRequest_Filters.DiscardUnknown(m) -} - -var xxx_messageInfo_ListNodesRequest_Filters proto.InternalMessageInfo - -type ListNodesResponse struct { - Nodes []*Node `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` -} - -func (m *ListNodesResponse) Reset() { *m = ListNodesResponse{} } -func (*ListNodesResponse) ProtoMessage() {} -func (*ListNodesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{3} -} -func (m *ListNodesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListNodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListNodesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListNodesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListNodesResponse.Merge(m, src) -} -func (m *ListNodesResponse) XXX_Size() int { - return m.Size() -} -func (m *ListNodesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListNodesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListNodesResponse proto.InternalMessageInfo - -// UpdateNodeRequest requests an update to the specified node. This may be used -// to request a new availability for a node, such as PAUSE. Invalid updates -// will be denied and cause an error. -type UpdateNodeRequest struct { - NodeID string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - NodeVersion *Version `protobuf:"bytes,2,opt,name=node_version,json=nodeVersion,proto3" json:"node_version,omitempty"` - Spec *NodeSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` -} - -func (m *UpdateNodeRequest) Reset() { *m = UpdateNodeRequest{} } -func (*UpdateNodeRequest) ProtoMessage() {} -func (*UpdateNodeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{4} -} -func (m *UpdateNodeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateNodeRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateNodeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateNodeRequest.Merge(m, src) -} -func (m *UpdateNodeRequest) XXX_Size() int { - return m.Size() -} -func (m *UpdateNodeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateNodeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateNodeRequest proto.InternalMessageInfo - -type UpdateNodeResponse struct { - Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` -} - -func (m *UpdateNodeResponse) Reset() { *m = UpdateNodeResponse{} } -func (*UpdateNodeResponse) ProtoMessage() {} -func (*UpdateNodeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{5} -} -func (m *UpdateNodeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateNodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateNodeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateNodeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateNodeResponse.Merge(m, src) -} -func (m *UpdateNodeResponse) XXX_Size() int { - return m.Size() -} -func (m *UpdateNodeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateNodeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateNodeResponse proto.InternalMessageInfo - -// RemoveNodeRequest requests to delete the specified node from store. -type RemoveNodeRequest struct { - NodeID string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` -} - -func (m *RemoveNodeRequest) Reset() { *m = RemoveNodeRequest{} } -func (*RemoveNodeRequest) ProtoMessage() {} -func (*RemoveNodeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{6} -} -func (m *RemoveNodeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveNodeRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveNodeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveNodeRequest.Merge(m, src) -} -func (m *RemoveNodeRequest) XXX_Size() int { - return m.Size() -} -func (m *RemoveNodeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveNodeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveNodeRequest proto.InternalMessageInfo - -type RemoveNodeResponse struct { -} - -func (m *RemoveNodeResponse) Reset() { *m = RemoveNodeResponse{} } -func (*RemoveNodeResponse) ProtoMessage() {} -func (*RemoveNodeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{7} -} -func (m *RemoveNodeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveNodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveNodeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveNodeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveNodeResponse.Merge(m, src) -} -func (m *RemoveNodeResponse) XXX_Size() int { - return m.Size() -} -func (m *RemoveNodeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveNodeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveNodeResponse proto.InternalMessageInfo - -type GetTaskRequest struct { - TaskID string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` -} - -func (m *GetTaskRequest) Reset() { *m = GetTaskRequest{} } -func (*GetTaskRequest) ProtoMessage() {} -func (*GetTaskRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{8} -} -func (m *GetTaskRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetTaskRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetTaskRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTaskRequest.Merge(m, src) -} -func (m *GetTaskRequest) XXX_Size() int { - return m.Size() -} -func (m *GetTaskRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetTaskRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetTaskRequest proto.InternalMessageInfo - -type GetTaskResponse struct { - Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` -} - -func (m *GetTaskResponse) Reset() { *m = GetTaskResponse{} } -func (*GetTaskResponse) ProtoMessage() {} -func (*GetTaskResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{9} -} -func (m *GetTaskResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetTaskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetTaskResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetTaskResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTaskResponse.Merge(m, src) -} -func (m *GetTaskResponse) XXX_Size() int { - return m.Size() -} -func (m *GetTaskResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetTaskResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetTaskResponse proto.InternalMessageInfo - -type RemoveTaskRequest struct { - TaskID string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` -} - -func (m *RemoveTaskRequest) Reset() { *m = RemoveTaskRequest{} } -func (*RemoveTaskRequest) ProtoMessage() {} -func (*RemoveTaskRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{10} -} -func (m *RemoveTaskRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveTaskRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveTaskRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveTaskRequest.Merge(m, src) -} -func (m *RemoveTaskRequest) XXX_Size() int { - return m.Size() -} -func (m *RemoveTaskRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveTaskRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveTaskRequest proto.InternalMessageInfo - -type RemoveTaskResponse struct { -} - -func (m *RemoveTaskResponse) Reset() { *m = RemoveTaskResponse{} } -func (*RemoveTaskResponse) ProtoMessage() {} -func (*RemoveTaskResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{11} -} -func (m *RemoveTaskResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveTaskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveTaskResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveTaskResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveTaskResponse.Merge(m, src) -} -func (m *RemoveTaskResponse) XXX_Size() int { - return m.Size() -} -func (m *RemoveTaskResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveTaskResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveTaskResponse proto.InternalMessageInfo - -type ListTasksRequest struct { - Filters *ListTasksRequest_Filters `protobuf:"bytes,1,opt,name=filters,proto3" json:"filters,omitempty"` -} - -func (m *ListTasksRequest) Reset() { *m = ListTasksRequest{} } -func (*ListTasksRequest) ProtoMessage() {} -func (*ListTasksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{12} -} -func (m *ListTasksRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListTasksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListTasksRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListTasksRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListTasksRequest.Merge(m, src) -} -func (m *ListTasksRequest) XXX_Size() int { - return m.Size() -} -func (m *ListTasksRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListTasksRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListTasksRequest proto.InternalMessageInfo - -type ListTasksRequest_Filters struct { - Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` - IDPrefixes []string `protobuf:"bytes,2,rep,name=id_prefixes,json=idPrefixes,proto3" json:"id_prefixes,omitempty"` - Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - ServiceIDs []string `protobuf:"bytes,4,rep,name=service_ids,json=serviceIds,proto3" json:"service_ids,omitempty"` - NodeIDs []string `protobuf:"bytes,5,rep,name=node_ids,json=nodeIds,proto3" json:"node_ids,omitempty"` - DesiredStates []TaskState `protobuf:"varint,6,rep,name=desired_states,json=desiredStates,proto3,enum=docker.swarmkit.v1.TaskState" json:"desired_states,omitempty"` - // NamePrefixes matches all objects with the given prefixes - NamePrefixes []string `protobuf:"bytes,7,rep,name=name_prefixes,json=namePrefixes,proto3" json:"name_prefixes,omitempty"` - Runtimes []string `protobuf:"bytes,9,rep,name=runtimes,proto3" json:"runtimes,omitempty"` - // UpToDate matches tasks that are consistent with the current - // service definition. - // Note: this is intended for internal status reporting rather - // than being exposed to users. It may be removed in the future. - UpToDate bool `protobuf:"varint,8,opt,name=up_to_date,json=upToDate,proto3" json:"up_to_date,omitempty"` -} - -func (m *ListTasksRequest_Filters) Reset() { *m = ListTasksRequest_Filters{} } -func (*ListTasksRequest_Filters) ProtoMessage() {} -func (*ListTasksRequest_Filters) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{12, 0} -} -func (m *ListTasksRequest_Filters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListTasksRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListTasksRequest_Filters.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListTasksRequest_Filters) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListTasksRequest_Filters.Merge(m, src) -} -func (m *ListTasksRequest_Filters) XXX_Size() int { - return m.Size() -} -func (m *ListTasksRequest_Filters) XXX_DiscardUnknown() { - xxx_messageInfo_ListTasksRequest_Filters.DiscardUnknown(m) -} - -var xxx_messageInfo_ListTasksRequest_Filters proto.InternalMessageInfo - -type ListTasksResponse struct { - Tasks []*Task `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks,omitempty"` -} - -func (m *ListTasksResponse) Reset() { *m = ListTasksResponse{} } -func (*ListTasksResponse) ProtoMessage() {} -func (*ListTasksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{13} -} -func (m *ListTasksResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListTasksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListTasksResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListTasksResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListTasksResponse.Merge(m, src) -} -func (m *ListTasksResponse) XXX_Size() int { - return m.Size() -} -func (m *ListTasksResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListTasksResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListTasksResponse proto.InternalMessageInfo - -type CreateServiceRequest struct { - Spec *ServiceSpec `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"` -} - -func (m *CreateServiceRequest) Reset() { *m = CreateServiceRequest{} } -func (*CreateServiceRequest) ProtoMessage() {} -func (*CreateServiceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{14} -} -func (m *CreateServiceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CreateServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CreateServiceRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CreateServiceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateServiceRequest.Merge(m, src) -} -func (m *CreateServiceRequest) XXX_Size() int { - return m.Size() -} -func (m *CreateServiceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateServiceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateServiceRequest proto.InternalMessageInfo - -type CreateServiceResponse struct { - Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` -} - -func (m *CreateServiceResponse) Reset() { *m = CreateServiceResponse{} } -func (*CreateServiceResponse) ProtoMessage() {} -func (*CreateServiceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{15} -} -func (m *CreateServiceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CreateServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CreateServiceResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CreateServiceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateServiceResponse.Merge(m, src) -} -func (m *CreateServiceResponse) XXX_Size() int { - return m.Size() -} -func (m *CreateServiceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateServiceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateServiceResponse proto.InternalMessageInfo - -type GetServiceRequest struct { - ServiceID string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - InsertDefaults bool `protobuf:"varint,2,opt,name=insert_defaults,json=insertDefaults,proto3" json:"insert_defaults,omitempty"` -} - -func (m *GetServiceRequest) Reset() { *m = GetServiceRequest{} } -func (*GetServiceRequest) ProtoMessage() {} -func (*GetServiceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{16} -} -func (m *GetServiceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetServiceRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetServiceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetServiceRequest.Merge(m, src) -} -func (m *GetServiceRequest) XXX_Size() int { - return m.Size() -} -func (m *GetServiceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetServiceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetServiceRequest proto.InternalMessageInfo - -type GetServiceResponse struct { - Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` -} - -func (m *GetServiceResponse) Reset() { *m = GetServiceResponse{} } -func (*GetServiceResponse) ProtoMessage() {} -func (*GetServiceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{17} -} -func (m *GetServiceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetServiceResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetServiceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetServiceResponse.Merge(m, src) -} -func (m *GetServiceResponse) XXX_Size() int { - return m.Size() -} -func (m *GetServiceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetServiceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetServiceResponse proto.InternalMessageInfo - -type UpdateServiceRequest struct { - ServiceID string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - ServiceVersion *Version `protobuf:"bytes,2,opt,name=service_version,json=serviceVersion,proto3" json:"service_version,omitempty"` - Spec *ServiceSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` - // Rollback may be set to PREVIOUS to request a rollback (the service's - // spec will be set to the value of its previous_spec field). In this - // case, the spec field of this request is ignored. - Rollback UpdateServiceRequest_Rollback `protobuf:"varint,4,opt,name=rollback,proto3,enum=docker.swarmkit.v1.UpdateServiceRequest_Rollback" json:"rollback,omitempty"` -} - -func (m *UpdateServiceRequest) Reset() { *m = UpdateServiceRequest{} } -func (*UpdateServiceRequest) ProtoMessage() {} -func (*UpdateServiceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{18} -} -func (m *UpdateServiceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateServiceRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateServiceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateServiceRequest.Merge(m, src) -} -func (m *UpdateServiceRequest) XXX_Size() int { - return m.Size() -} -func (m *UpdateServiceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateServiceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateServiceRequest proto.InternalMessageInfo - -type UpdateServiceResponse struct { - Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` -} - -func (m *UpdateServiceResponse) Reset() { *m = UpdateServiceResponse{} } -func (*UpdateServiceResponse) ProtoMessage() {} -func (*UpdateServiceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{19} -} -func (m *UpdateServiceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateServiceResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateServiceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateServiceResponse.Merge(m, src) -} -func (m *UpdateServiceResponse) XXX_Size() int { - return m.Size() -} -func (m *UpdateServiceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateServiceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateServiceResponse proto.InternalMessageInfo - -type RemoveServiceRequest struct { - ServiceID string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` -} - -func (m *RemoveServiceRequest) Reset() { *m = RemoveServiceRequest{} } -func (*RemoveServiceRequest) ProtoMessage() {} -func (*RemoveServiceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{20} -} -func (m *RemoveServiceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveServiceRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveServiceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveServiceRequest.Merge(m, src) -} -func (m *RemoveServiceRequest) XXX_Size() int { - return m.Size() -} -func (m *RemoveServiceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveServiceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveServiceRequest proto.InternalMessageInfo - -type RemoveServiceResponse struct { -} - -func (m *RemoveServiceResponse) Reset() { *m = RemoveServiceResponse{} } -func (*RemoveServiceResponse) ProtoMessage() {} -func (*RemoveServiceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{21} -} -func (m *RemoveServiceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveServiceResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveServiceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveServiceResponse.Merge(m, src) -} -func (m *RemoveServiceResponse) XXX_Size() int { - return m.Size() -} -func (m *RemoveServiceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveServiceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveServiceResponse proto.InternalMessageInfo - -type ListServicesRequest struct { - Filters *ListServicesRequest_Filters `protobuf:"bytes,1,opt,name=filters,proto3" json:"filters,omitempty"` -} - -func (m *ListServicesRequest) Reset() { *m = ListServicesRequest{} } -func (*ListServicesRequest) ProtoMessage() {} -func (*ListServicesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{22} -} -func (m *ListServicesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListServicesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListServicesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListServicesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListServicesRequest.Merge(m, src) -} -func (m *ListServicesRequest) XXX_Size() int { - return m.Size() -} -func (m *ListServicesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListServicesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListServicesRequest proto.InternalMessageInfo - -type ListServicesRequest_Filters struct { - Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` - IDPrefixes []string `protobuf:"bytes,2,rep,name=id_prefixes,json=idPrefixes,proto3" json:"id_prefixes,omitempty"` - Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // NamePrefixes matches all objects with the given prefixes - NamePrefixes []string `protobuf:"bytes,4,rep,name=name_prefixes,json=namePrefixes,proto3" json:"name_prefixes,omitempty"` - Runtimes []string `protobuf:"bytes,5,rep,name=runtimes,proto3" json:"runtimes,omitempty"` -} - -func (m *ListServicesRequest_Filters) Reset() { *m = ListServicesRequest_Filters{} } -func (*ListServicesRequest_Filters) ProtoMessage() {} -func (*ListServicesRequest_Filters) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{22, 0} -} -func (m *ListServicesRequest_Filters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListServicesRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListServicesRequest_Filters.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListServicesRequest_Filters) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListServicesRequest_Filters.Merge(m, src) -} -func (m *ListServicesRequest_Filters) XXX_Size() int { - return m.Size() -} -func (m *ListServicesRequest_Filters) XXX_DiscardUnknown() { - xxx_messageInfo_ListServicesRequest_Filters.DiscardUnknown(m) -} - -var xxx_messageInfo_ListServicesRequest_Filters proto.InternalMessageInfo - -type ListServicesResponse struct { - Services []*Service `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"` -} - -func (m *ListServicesResponse) Reset() { *m = ListServicesResponse{} } -func (*ListServicesResponse) ProtoMessage() {} -func (*ListServicesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{23} -} -func (m *ListServicesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListServicesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListServicesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListServicesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListServicesResponse.Merge(m, src) -} -func (m *ListServicesResponse) XXX_Size() int { - return m.Size() -} -func (m *ListServicesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListServicesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListServicesResponse proto.InternalMessageInfo - -// ListServiceStatusesRequest is a request to get the aggregate status of a -// service by computing the number of running vs desired tasks. It includes -// only a service ID. -type ListServiceStatusesRequest struct { - // Services is a list of service IDs to get statuses for. - Services []string `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"` -} - -func (m *ListServiceStatusesRequest) Reset() { *m = ListServiceStatusesRequest{} } -func (*ListServiceStatusesRequest) ProtoMessage() {} -func (*ListServiceStatusesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{24} -} -func (m *ListServiceStatusesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListServiceStatusesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListServiceStatusesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListServiceStatusesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListServiceStatusesRequest.Merge(m, src) -} -func (m *ListServiceStatusesRequest) XXX_Size() int { - return m.Size() -} -func (m *ListServiceStatusesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListServiceStatusesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListServiceStatusesRequest proto.InternalMessageInfo - -// ListServiceStatusesResponse is a response containing the aggregate status of -// a service, formed by computing the number of running vs desired tasks. The -// values returned are only valid for the point in time at which the request is -// made. -type ListServiceStatusesResponse struct { - Statuses []*ListServiceStatusesResponse_ServiceStatus `protobuf:"bytes,1,rep,name=statuses,proto3" json:"statuses,omitempty"` -} - -func (m *ListServiceStatusesResponse) Reset() { *m = ListServiceStatusesResponse{} } -func (*ListServiceStatusesResponse) ProtoMessage() {} -func (*ListServiceStatusesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{25} -} -func (m *ListServiceStatusesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListServiceStatusesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListServiceStatusesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListServiceStatusesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListServiceStatusesResponse.Merge(m, src) -} -func (m *ListServiceStatusesResponse) XXX_Size() int { - return m.Size() -} -func (m *ListServiceStatusesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListServiceStatusesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListServiceStatusesResponse proto.InternalMessageInfo - -type ListServiceStatusesResponse_ServiceStatus struct { - // ServiceID is the ID of the service this status describes - ServiceID string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // DesiredTasks is the number of tasks desired to be running according to the - // service definition at request time. It is a uint64 because that is what - // the replicas field on the service spec is - DesiredTasks uint64 `protobuf:"varint,2,opt,name=desired_tasks,json=desiredTasks,proto3" json:"desired_tasks,omitempty"` - // RunningTasks is the number of tasks currently in the Running state at - // request time. This may be larger than desired tasks if, for example, a - // service has been scaled down. - RunningTasks uint64 `protobuf:"varint,3,opt,name=running_tasks,json=runningTasks,proto3" json:"running_tasks,omitempty"` - // CompletedTasks is the number of tasks in state Completed, if this - // service is in mode ReplicatedJob or GlobalJob. This must be - // cross-referenced with the service type, because the default value of 0 - // may mean that a service is not in a Job mode, or it may mean the Job has - // yet to complete any Tasks. - CompletedTasks uint64 `protobuf:"varint,4,opt,name=completed_tasks,json=completedTasks,proto3" json:"completed_tasks,omitempty"` -} - -func (m *ListServiceStatusesResponse_ServiceStatus) Reset() { - *m = ListServiceStatusesResponse_ServiceStatus{} -} -func (*ListServiceStatusesResponse_ServiceStatus) ProtoMessage() {} -func (*ListServiceStatusesResponse_ServiceStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{25, 0} -} -func (m *ListServiceStatusesResponse_ServiceStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListServiceStatusesResponse_ServiceStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListServiceStatusesResponse_ServiceStatus.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListServiceStatusesResponse_ServiceStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListServiceStatusesResponse_ServiceStatus.Merge(m, src) -} -func (m *ListServiceStatusesResponse_ServiceStatus) XXX_Size() int { - return m.Size() -} -func (m *ListServiceStatusesResponse_ServiceStatus) XXX_DiscardUnknown() { - xxx_messageInfo_ListServiceStatusesResponse_ServiceStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_ListServiceStatusesResponse_ServiceStatus proto.InternalMessageInfo - -type CreateNetworkRequest struct { - Spec *NetworkSpec `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"` -} - -func (m *CreateNetworkRequest) Reset() { *m = CreateNetworkRequest{} } -func (*CreateNetworkRequest) ProtoMessage() {} -func (*CreateNetworkRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{26} -} -func (m *CreateNetworkRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CreateNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CreateNetworkRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CreateNetworkRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateNetworkRequest.Merge(m, src) -} -func (m *CreateNetworkRequest) XXX_Size() int { - return m.Size() -} -func (m *CreateNetworkRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateNetworkRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateNetworkRequest proto.InternalMessageInfo - -type CreateNetworkResponse struct { - Network *Network `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` -} - -func (m *CreateNetworkResponse) Reset() { *m = CreateNetworkResponse{} } -func (*CreateNetworkResponse) ProtoMessage() {} -func (*CreateNetworkResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{27} -} -func (m *CreateNetworkResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CreateNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CreateNetworkResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CreateNetworkResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateNetworkResponse.Merge(m, src) -} -func (m *CreateNetworkResponse) XXX_Size() int { - return m.Size() -} -func (m *CreateNetworkResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateNetworkResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateNetworkResponse proto.InternalMessageInfo - -type GetNetworkRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - NetworkID string `protobuf:"bytes,2,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` -} - -func (m *GetNetworkRequest) Reset() { *m = GetNetworkRequest{} } -func (*GetNetworkRequest) ProtoMessage() {} -func (*GetNetworkRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{28} -} -func (m *GetNetworkRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetNetworkRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetNetworkRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetNetworkRequest.Merge(m, src) -} -func (m *GetNetworkRequest) XXX_Size() int { - return m.Size() -} -func (m *GetNetworkRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetNetworkRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetNetworkRequest proto.InternalMessageInfo - -type GetNetworkResponse struct { - Network *Network `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` -} - -func (m *GetNetworkResponse) Reset() { *m = GetNetworkResponse{} } -func (*GetNetworkResponse) ProtoMessage() {} -func (*GetNetworkResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{29} -} -func (m *GetNetworkResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetNetworkResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetNetworkResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetNetworkResponse.Merge(m, src) -} -func (m *GetNetworkResponse) XXX_Size() int { - return m.Size() -} -func (m *GetNetworkResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetNetworkResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetNetworkResponse proto.InternalMessageInfo - -type RemoveNetworkRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - NetworkID string `protobuf:"bytes,2,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` -} - -func (m *RemoveNetworkRequest) Reset() { *m = RemoveNetworkRequest{} } -func (*RemoveNetworkRequest) ProtoMessage() {} -func (*RemoveNetworkRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{30} -} -func (m *RemoveNetworkRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveNetworkRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveNetworkRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveNetworkRequest.Merge(m, src) -} -func (m *RemoveNetworkRequest) XXX_Size() int { - return m.Size() -} -func (m *RemoveNetworkRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveNetworkRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveNetworkRequest proto.InternalMessageInfo - -type RemoveNetworkResponse struct { -} - -func (m *RemoveNetworkResponse) Reset() { *m = RemoveNetworkResponse{} } -func (*RemoveNetworkResponse) ProtoMessage() {} -func (*RemoveNetworkResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{31} -} -func (m *RemoveNetworkResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveNetworkResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveNetworkResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveNetworkResponse.Merge(m, src) -} -func (m *RemoveNetworkResponse) XXX_Size() int { - return m.Size() -} -func (m *RemoveNetworkResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveNetworkResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveNetworkResponse proto.InternalMessageInfo - -type ListNetworksRequest struct { - Filters *ListNetworksRequest_Filters `protobuf:"bytes,1,opt,name=filters,proto3" json:"filters,omitempty"` -} - -func (m *ListNetworksRequest) Reset() { *m = ListNetworksRequest{} } -func (*ListNetworksRequest) ProtoMessage() {} -func (*ListNetworksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{32} -} -func (m *ListNetworksRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListNetworksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListNetworksRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListNetworksRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListNetworksRequest.Merge(m, src) -} -func (m *ListNetworksRequest) XXX_Size() int { - return m.Size() -} -func (m *ListNetworksRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListNetworksRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListNetworksRequest proto.InternalMessageInfo - -type ListNetworksRequest_Filters struct { - Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` - IDPrefixes []string `protobuf:"bytes,2,rep,name=id_prefixes,json=idPrefixes,proto3" json:"id_prefixes,omitempty"` - Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // NamePrefixes matches all objects with the given prefixes - NamePrefixes []string `protobuf:"bytes,4,rep,name=name_prefixes,json=namePrefixes,proto3" json:"name_prefixes,omitempty"` -} - -func (m *ListNetworksRequest_Filters) Reset() { *m = ListNetworksRequest_Filters{} } -func (*ListNetworksRequest_Filters) ProtoMessage() {} -func (*ListNetworksRequest_Filters) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{32, 0} -} -func (m *ListNetworksRequest_Filters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListNetworksRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListNetworksRequest_Filters.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListNetworksRequest_Filters) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListNetworksRequest_Filters.Merge(m, src) -} -func (m *ListNetworksRequest_Filters) XXX_Size() int { - return m.Size() -} -func (m *ListNetworksRequest_Filters) XXX_DiscardUnknown() { - xxx_messageInfo_ListNetworksRequest_Filters.DiscardUnknown(m) -} - -var xxx_messageInfo_ListNetworksRequest_Filters proto.InternalMessageInfo - -type ListNetworksResponse struct { - Networks []*Network `protobuf:"bytes,1,rep,name=networks,proto3" json:"networks,omitempty"` -} - -func (m *ListNetworksResponse) Reset() { *m = ListNetworksResponse{} } -func (*ListNetworksResponse) ProtoMessage() {} -func (*ListNetworksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{33} -} -func (m *ListNetworksResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListNetworksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListNetworksResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListNetworksResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListNetworksResponse.Merge(m, src) -} -func (m *ListNetworksResponse) XXX_Size() int { - return m.Size() -} -func (m *ListNetworksResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListNetworksResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListNetworksResponse proto.InternalMessageInfo - -type GetClusterRequest struct { - ClusterID string `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` -} - -func (m *GetClusterRequest) Reset() { *m = GetClusterRequest{} } -func (*GetClusterRequest) ProtoMessage() {} -func (*GetClusterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{34} -} -func (m *GetClusterRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetClusterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetClusterRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetClusterRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetClusterRequest.Merge(m, src) -} -func (m *GetClusterRequest) XXX_Size() int { - return m.Size() -} -func (m *GetClusterRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetClusterRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetClusterRequest proto.InternalMessageInfo - -type GetClusterResponse struct { - Cluster *Cluster `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` -} - -func (m *GetClusterResponse) Reset() { *m = GetClusterResponse{} } -func (*GetClusterResponse) ProtoMessage() {} -func (*GetClusterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{35} -} -func (m *GetClusterResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetClusterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetClusterResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetClusterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetClusterResponse.Merge(m, src) -} -func (m *GetClusterResponse) XXX_Size() int { - return m.Size() -} -func (m *GetClusterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetClusterResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetClusterResponse proto.InternalMessageInfo - -type ListClustersRequest struct { - Filters *ListClustersRequest_Filters `protobuf:"bytes,1,opt,name=filters,proto3" json:"filters,omitempty"` -} - -func (m *ListClustersRequest) Reset() { *m = ListClustersRequest{} } -func (*ListClustersRequest) ProtoMessage() {} -func (*ListClustersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{36} -} -func (m *ListClustersRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListClustersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListClustersRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListClustersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListClustersRequest.Merge(m, src) -} -func (m *ListClustersRequest) XXX_Size() int { - return m.Size() -} -func (m *ListClustersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListClustersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListClustersRequest proto.InternalMessageInfo - -type ListClustersRequest_Filters struct { - Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` - IDPrefixes []string `protobuf:"bytes,2,rep,name=id_prefixes,json=idPrefixes,proto3" json:"id_prefixes,omitempty"` - Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // NamePrefixes matches all objects with the given prefixes - NamePrefixes []string `protobuf:"bytes,4,rep,name=name_prefixes,json=namePrefixes,proto3" json:"name_prefixes,omitempty"` -} - -func (m *ListClustersRequest_Filters) Reset() { *m = ListClustersRequest_Filters{} } -func (*ListClustersRequest_Filters) ProtoMessage() {} -func (*ListClustersRequest_Filters) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{36, 0} -} -func (m *ListClustersRequest_Filters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListClustersRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListClustersRequest_Filters.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListClustersRequest_Filters) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListClustersRequest_Filters.Merge(m, src) -} -func (m *ListClustersRequest_Filters) XXX_Size() int { - return m.Size() -} -func (m *ListClustersRequest_Filters) XXX_DiscardUnknown() { - xxx_messageInfo_ListClustersRequest_Filters.DiscardUnknown(m) -} - -var xxx_messageInfo_ListClustersRequest_Filters proto.InternalMessageInfo - -type ListClustersResponse struct { - Clusters []*Cluster `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` -} - -func (m *ListClustersResponse) Reset() { *m = ListClustersResponse{} } -func (*ListClustersResponse) ProtoMessage() {} -func (*ListClustersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{37} -} -func (m *ListClustersResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListClustersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListClustersResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListClustersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListClustersResponse.Merge(m, src) -} -func (m *ListClustersResponse) XXX_Size() int { - return m.Size() -} -func (m *ListClustersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListClustersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListClustersResponse proto.InternalMessageInfo - -// KeyRotation tells UpdateCluster what items to rotate -type KeyRotation struct { - // WorkerJoinToken tells UpdateCluster to rotate the worker secret token. - WorkerJoinToken bool `protobuf:"varint,1,opt,name=worker_join_token,json=workerJoinToken,proto3" json:"worker_join_token,omitempty"` - // ManagerJoinToken tells UpdateCluster to rotate the manager secret token. - ManagerJoinToken bool `protobuf:"varint,2,opt,name=manager_join_token,json=managerJoinToken,proto3" json:"manager_join_token,omitempty"` - // ManagerUnlockKey tells UpdateCluster to rotate the manager unlock key - ManagerUnlockKey bool `protobuf:"varint,3,opt,name=manager_unlock_key,json=managerUnlockKey,proto3" json:"manager_unlock_key,omitempty"` -} - -func (m *KeyRotation) Reset() { *m = KeyRotation{} } -func (*KeyRotation) ProtoMessage() {} -func (*KeyRotation) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{38} -} -func (m *KeyRotation) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *KeyRotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_KeyRotation.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *KeyRotation) XXX_Merge(src proto.Message) { - xxx_messageInfo_KeyRotation.Merge(m, src) -} -func (m *KeyRotation) XXX_Size() int { - return m.Size() -} -func (m *KeyRotation) XXX_DiscardUnknown() { - xxx_messageInfo_KeyRotation.DiscardUnknown(m) -} - -var xxx_messageInfo_KeyRotation proto.InternalMessageInfo - -type UpdateClusterRequest struct { - // ClusterID is the cluster ID to update. - ClusterID string `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // ClusterVersion is the version of the cluster being updated. - ClusterVersion *Version `protobuf:"bytes,2,opt,name=cluster_version,json=clusterVersion,proto3" json:"cluster_version,omitempty"` - // Spec is the new spec to apply to the cluster. - Spec *ClusterSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` - // Rotation contains flags for join token and unlock key rotation - Rotation KeyRotation `protobuf:"bytes,4,opt,name=rotation,proto3" json:"rotation"` -} - -func (m *UpdateClusterRequest) Reset() { *m = UpdateClusterRequest{} } -func (*UpdateClusterRequest) ProtoMessage() {} -func (*UpdateClusterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{39} -} -func (m *UpdateClusterRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateClusterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateClusterRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateClusterRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateClusterRequest.Merge(m, src) -} -func (m *UpdateClusterRequest) XXX_Size() int { - return m.Size() -} -func (m *UpdateClusterRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateClusterRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateClusterRequest proto.InternalMessageInfo - -type UpdateClusterResponse struct { - Cluster *Cluster `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` -} - -func (m *UpdateClusterResponse) Reset() { *m = UpdateClusterResponse{} } -func (*UpdateClusterResponse) ProtoMessage() {} -func (*UpdateClusterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{40} -} -func (m *UpdateClusterResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateClusterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateClusterResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateClusterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateClusterResponse.Merge(m, src) -} -func (m *UpdateClusterResponse) XXX_Size() int { - return m.Size() -} -func (m *UpdateClusterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateClusterResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateClusterResponse proto.InternalMessageInfo - -// GetSecretRequest is the request to get a `Secret` object given a secret id. -type GetSecretRequest struct { - SecretID string `protobuf:"bytes,1,opt,name=secret_id,json=secretId,proto3" json:"secret_id,omitempty"` -} - -func (m *GetSecretRequest) Reset() { *m = GetSecretRequest{} } -func (*GetSecretRequest) ProtoMessage() {} -func (*GetSecretRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{41} -} -func (m *GetSecretRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetSecretRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetSecretRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetSecretRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetSecretRequest.Merge(m, src) -} -func (m *GetSecretRequest) XXX_Size() int { - return m.Size() -} -func (m *GetSecretRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetSecretRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetSecretRequest proto.InternalMessageInfo - -// GetSecretResponse contains the Secret corresponding to the id in -// `GetSecretRequest`, but the `Secret.Spec.Data` field in each `Secret` -// object should be nil instead of actually containing the secret bytes. -type GetSecretResponse struct { - Secret *Secret `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"` -} - -func (m *GetSecretResponse) Reset() { *m = GetSecretResponse{} } -func (*GetSecretResponse) ProtoMessage() {} -func (*GetSecretResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{42} -} -func (m *GetSecretResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetSecretResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetSecretResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetSecretResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetSecretResponse.Merge(m, src) -} -func (m *GetSecretResponse) XXX_Size() int { - return m.Size() -} -func (m *GetSecretResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetSecretResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetSecretResponse proto.InternalMessageInfo - -type UpdateSecretRequest struct { - // SecretID is the secret ID to update. - SecretID string `protobuf:"bytes,1,opt,name=secret_id,json=secretId,proto3" json:"secret_id,omitempty"` - // SecretVersion is the version of the secret being updated. - SecretVersion *Version `protobuf:"bytes,2,opt,name=secret_version,json=secretVersion,proto3" json:"secret_version,omitempty"` - // Spec is the new spec to apply to the Secret - // Only some fields are allowed to be updated. - Spec *SecretSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` -} - -func (m *UpdateSecretRequest) Reset() { *m = UpdateSecretRequest{} } -func (*UpdateSecretRequest) ProtoMessage() {} -func (*UpdateSecretRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{43} -} -func (m *UpdateSecretRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateSecretRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateSecretRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateSecretRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateSecretRequest.Merge(m, src) -} -func (m *UpdateSecretRequest) XXX_Size() int { - return m.Size() -} -func (m *UpdateSecretRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateSecretRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateSecretRequest proto.InternalMessageInfo - -type UpdateSecretResponse struct { - Secret *Secret `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"` -} - -func (m *UpdateSecretResponse) Reset() { *m = UpdateSecretResponse{} } -func (*UpdateSecretResponse) ProtoMessage() {} -func (*UpdateSecretResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{44} -} -func (m *UpdateSecretResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateSecretResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateSecretResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateSecretResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateSecretResponse.Merge(m, src) -} -func (m *UpdateSecretResponse) XXX_Size() int { - return m.Size() -} -func (m *UpdateSecretResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateSecretResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateSecretResponse proto.InternalMessageInfo - -// ListSecretRequest is the request to list all non-internal secrets in the secret store, -// or all secrets filtered by (name or name prefix or id prefix) and labels. -type ListSecretsRequest struct { - Filters *ListSecretsRequest_Filters `protobuf:"bytes,1,opt,name=filters,proto3" json:"filters,omitempty"` -} - -func (m *ListSecretsRequest) Reset() { *m = ListSecretsRequest{} } -func (*ListSecretsRequest) ProtoMessage() {} -func (*ListSecretsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{45} -} -func (m *ListSecretsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListSecretsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListSecretsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListSecretsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListSecretsRequest.Merge(m, src) -} -func (m *ListSecretsRequest) XXX_Size() int { - return m.Size() -} -func (m *ListSecretsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListSecretsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListSecretsRequest proto.InternalMessageInfo - -type ListSecretsRequest_Filters struct { - Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` - IDPrefixes []string `protobuf:"bytes,2,rep,name=id_prefixes,json=idPrefixes,proto3" json:"id_prefixes,omitempty"` - Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - NamePrefixes []string `protobuf:"bytes,4,rep,name=name_prefixes,json=namePrefixes,proto3" json:"name_prefixes,omitempty"` -} - -func (m *ListSecretsRequest_Filters) Reset() { *m = ListSecretsRequest_Filters{} } -func (*ListSecretsRequest_Filters) ProtoMessage() {} -func (*ListSecretsRequest_Filters) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{45, 0} -} -func (m *ListSecretsRequest_Filters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListSecretsRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListSecretsRequest_Filters.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListSecretsRequest_Filters) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListSecretsRequest_Filters.Merge(m, src) -} -func (m *ListSecretsRequest_Filters) XXX_Size() int { - return m.Size() -} -func (m *ListSecretsRequest_Filters) XXX_DiscardUnknown() { - xxx_messageInfo_ListSecretsRequest_Filters.DiscardUnknown(m) -} - -var xxx_messageInfo_ListSecretsRequest_Filters proto.InternalMessageInfo - -// ListSecretResponse contains a list of all the secrets that match the name or -// name prefix filters provided in `ListSecretRequest`. The `Secret.Spec.Data` -// field in each `Secret` object should be nil instead of actually containing -// the secret bytes. -type ListSecretsResponse struct { - Secrets []*Secret `protobuf:"bytes,1,rep,name=secrets,proto3" json:"secrets,omitempty"` -} - -func (m *ListSecretsResponse) Reset() { *m = ListSecretsResponse{} } -func (*ListSecretsResponse) ProtoMessage() {} -func (*ListSecretsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{46} -} -func (m *ListSecretsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListSecretsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListSecretsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListSecretsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListSecretsResponse.Merge(m, src) -} -func (m *ListSecretsResponse) XXX_Size() int { - return m.Size() -} -func (m *ListSecretsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListSecretsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListSecretsResponse proto.InternalMessageInfo - -// CreateSecretRequest specifies a new secret (it will not update an existing -// secret) to create. -type CreateSecretRequest struct { - Spec *SecretSpec `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"` -} - -func (m *CreateSecretRequest) Reset() { *m = CreateSecretRequest{} } -func (*CreateSecretRequest) ProtoMessage() {} -func (*CreateSecretRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{47} -} -func (m *CreateSecretRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CreateSecretRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CreateSecretRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CreateSecretRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateSecretRequest.Merge(m, src) -} -func (m *CreateSecretRequest) XXX_Size() int { - return m.Size() -} -func (m *CreateSecretRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateSecretRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateSecretRequest proto.InternalMessageInfo - -// CreateSecretResponse contains the newly created `Secret` corresponding to the -// name in `CreateSecretRequest`. The `Secret.Spec.Data` field should be nil instead -// of actually containing the secret bytes. -type CreateSecretResponse struct { - Secret *Secret `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"` -} - -func (m *CreateSecretResponse) Reset() { *m = CreateSecretResponse{} } -func (*CreateSecretResponse) ProtoMessage() {} -func (*CreateSecretResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{48} -} -func (m *CreateSecretResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CreateSecretResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CreateSecretResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CreateSecretResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateSecretResponse.Merge(m, src) -} -func (m *CreateSecretResponse) XXX_Size() int { - return m.Size() -} -func (m *CreateSecretResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateSecretResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateSecretResponse proto.InternalMessageInfo - -// RemoveSecretRequest contains the ID of the secret that should be removed. This -// removes all versions of the secret. -type RemoveSecretRequest struct { - SecretID string `protobuf:"bytes,1,opt,name=secret_id,json=secretId,proto3" json:"secret_id,omitempty"` -} - -func (m *RemoveSecretRequest) Reset() { *m = RemoveSecretRequest{} } -func (*RemoveSecretRequest) ProtoMessage() {} -func (*RemoveSecretRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{49} -} -func (m *RemoveSecretRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveSecretRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveSecretRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveSecretRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveSecretRequest.Merge(m, src) -} -func (m *RemoveSecretRequest) XXX_Size() int { - return m.Size() -} -func (m *RemoveSecretRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveSecretRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveSecretRequest proto.InternalMessageInfo - -// RemoveSecretResponse is an empty object indicating the successful removal of -// a secret. -type RemoveSecretResponse struct { -} - -func (m *RemoveSecretResponse) Reset() { *m = RemoveSecretResponse{} } -func (*RemoveSecretResponse) ProtoMessage() {} -func (*RemoveSecretResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{50} -} -func (m *RemoveSecretResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveSecretResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveSecretResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveSecretResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveSecretResponse.Merge(m, src) -} -func (m *RemoveSecretResponse) XXX_Size() int { - return m.Size() -} -func (m *RemoveSecretResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveSecretResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveSecretResponse proto.InternalMessageInfo - -// GetConfigRequest is the request to get a `Config` object given a config id. -type GetConfigRequest struct { - ConfigID string `protobuf:"bytes,1,opt,name=config_id,json=configId,proto3" json:"config_id,omitempty"` -} - -func (m *GetConfigRequest) Reset() { *m = GetConfigRequest{} } -func (*GetConfigRequest) ProtoMessage() {} -func (*GetConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{51} -} -func (m *GetConfigRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetConfigRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetConfigRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetConfigRequest.Merge(m, src) -} -func (m *GetConfigRequest) XXX_Size() int { - return m.Size() -} -func (m *GetConfigRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetConfigRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetConfigRequest proto.InternalMessageInfo - -// GetConfigResponse contains the Config corresponding to the id in -// `GetConfigRequest`. -type GetConfigResponse struct { - Config *Config `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` -} - -func (m *GetConfigResponse) Reset() { *m = GetConfigResponse{} } -func (*GetConfigResponse) ProtoMessage() {} -func (*GetConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{52} -} -func (m *GetConfigResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetConfigResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetConfigResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetConfigResponse.Merge(m, src) -} -func (m *GetConfigResponse) XXX_Size() int { - return m.Size() -} -func (m *GetConfigResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetConfigResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetConfigResponse proto.InternalMessageInfo - -type UpdateConfigRequest struct { - // ConfigID is the config ID to update. - ConfigID string `protobuf:"bytes,1,opt,name=config_id,json=configId,proto3" json:"config_id,omitempty"` - // ConfigVersion is the version of the config being updated. - ConfigVersion *Version `protobuf:"bytes,2,opt,name=config_version,json=configVersion,proto3" json:"config_version,omitempty"` - // Spec is the new spec to apply to the Config - // Only some fields are allowed to be updated. - Spec *ConfigSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` -} - -func (m *UpdateConfigRequest) Reset() { *m = UpdateConfigRequest{} } -func (*UpdateConfigRequest) ProtoMessage() {} -func (*UpdateConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{53} -} -func (m *UpdateConfigRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateConfigRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateConfigRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateConfigRequest.Merge(m, src) -} -func (m *UpdateConfigRequest) XXX_Size() int { - return m.Size() -} -func (m *UpdateConfigRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateConfigRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateConfigRequest proto.InternalMessageInfo - -type UpdateConfigResponse struct { - Config *Config `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` -} - -func (m *UpdateConfigResponse) Reset() { *m = UpdateConfigResponse{} } -func (*UpdateConfigResponse) ProtoMessage() {} -func (*UpdateConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{54} -} -func (m *UpdateConfigResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateConfigResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateConfigResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateConfigResponse.Merge(m, src) -} -func (m *UpdateConfigResponse) XXX_Size() int { - return m.Size() -} -func (m *UpdateConfigResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateConfigResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateConfigResponse proto.InternalMessageInfo - -// ListConfigRequest is the request to list all configs in the config store, -// or all configs filtered by (name or name prefix or id prefix) and labels. -type ListConfigsRequest struct { - Filters *ListConfigsRequest_Filters `protobuf:"bytes,1,opt,name=filters,proto3" json:"filters,omitempty"` -} - -func (m *ListConfigsRequest) Reset() { *m = ListConfigsRequest{} } -func (*ListConfigsRequest) ProtoMessage() {} -func (*ListConfigsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{55} -} -func (m *ListConfigsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListConfigsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListConfigsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListConfigsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListConfigsRequest.Merge(m, src) -} -func (m *ListConfigsRequest) XXX_Size() int { - return m.Size() -} -func (m *ListConfigsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListConfigsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListConfigsRequest proto.InternalMessageInfo - -type ListConfigsRequest_Filters struct { - Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` - IDPrefixes []string `protobuf:"bytes,2,rep,name=id_prefixes,json=idPrefixes,proto3" json:"id_prefixes,omitempty"` - Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - NamePrefixes []string `protobuf:"bytes,4,rep,name=name_prefixes,json=namePrefixes,proto3" json:"name_prefixes,omitempty"` -} - -func (m *ListConfigsRequest_Filters) Reset() { *m = ListConfigsRequest_Filters{} } -func (*ListConfigsRequest_Filters) ProtoMessage() {} -func (*ListConfigsRequest_Filters) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{55, 0} -} -func (m *ListConfigsRequest_Filters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListConfigsRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListConfigsRequest_Filters.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListConfigsRequest_Filters) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListConfigsRequest_Filters.Merge(m, src) -} -func (m *ListConfigsRequest_Filters) XXX_Size() int { - return m.Size() -} -func (m *ListConfigsRequest_Filters) XXX_DiscardUnknown() { - xxx_messageInfo_ListConfigsRequest_Filters.DiscardUnknown(m) -} - -var xxx_messageInfo_ListConfigsRequest_Filters proto.InternalMessageInfo - -// ListConfigResponse contains a list of all the configs that match the name or -// name prefix filters provided in `ListConfigRequest`. -type ListConfigsResponse struct { - Configs []*Config `protobuf:"bytes,1,rep,name=configs,proto3" json:"configs,omitempty"` -} - -func (m *ListConfigsResponse) Reset() { *m = ListConfigsResponse{} } -func (*ListConfigsResponse) ProtoMessage() {} -func (*ListConfigsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{56} -} -func (m *ListConfigsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListConfigsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListConfigsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListConfigsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListConfigsResponse.Merge(m, src) -} -func (m *ListConfigsResponse) XXX_Size() int { - return m.Size() -} -func (m *ListConfigsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListConfigsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListConfigsResponse proto.InternalMessageInfo - -// CreateConfigRequest specifies a new config (it will not update an existing -// config) to create. -type CreateConfigRequest struct { - Spec *ConfigSpec `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"` -} - -func (m *CreateConfigRequest) Reset() { *m = CreateConfigRequest{} } -func (*CreateConfigRequest) ProtoMessage() {} -func (*CreateConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{57} -} -func (m *CreateConfigRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CreateConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CreateConfigRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CreateConfigRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateConfigRequest.Merge(m, src) -} -func (m *CreateConfigRequest) XXX_Size() int { - return m.Size() -} -func (m *CreateConfigRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateConfigRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateConfigRequest proto.InternalMessageInfo - -// CreateConfigResponse contains the newly created `Config` corresponding to the -// name in `CreateConfigRequest`. -type CreateConfigResponse struct { - Config *Config `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` -} - -func (m *CreateConfigResponse) Reset() { *m = CreateConfigResponse{} } -func (*CreateConfigResponse) ProtoMessage() {} -func (*CreateConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{58} -} -func (m *CreateConfigResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CreateConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CreateConfigResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CreateConfigResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateConfigResponse.Merge(m, src) -} -func (m *CreateConfigResponse) XXX_Size() int { - return m.Size() -} -func (m *CreateConfigResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateConfigResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateConfigResponse proto.InternalMessageInfo - -// RemoveConfigRequest contains the ID of the config that should be removed. This -// removes all versions of the config. -type RemoveConfigRequest struct { - ConfigID string `protobuf:"bytes,1,opt,name=config_id,json=configId,proto3" json:"config_id,omitempty"` -} - -func (m *RemoveConfigRequest) Reset() { *m = RemoveConfigRequest{} } -func (*RemoveConfigRequest) ProtoMessage() {} -func (*RemoveConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{59} -} -func (m *RemoveConfigRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveConfigRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveConfigRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveConfigRequest.Merge(m, src) -} -func (m *RemoveConfigRequest) XXX_Size() int { - return m.Size() -} -func (m *RemoveConfigRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveConfigRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveConfigRequest proto.InternalMessageInfo - -// RemoveConfigResponse is an empty object indicating the successful removal of -// a config. -type RemoveConfigResponse struct { -} - -func (m *RemoveConfigResponse) Reset() { *m = RemoveConfigResponse{} } -func (*RemoveConfigResponse) ProtoMessage() {} -func (*RemoveConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{60} -} -func (m *RemoveConfigResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveConfigResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveConfigResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveConfigResponse.Merge(m, src) -} -func (m *RemoveConfigResponse) XXX_Size() int { - return m.Size() -} -func (m *RemoveConfigResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveConfigResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveConfigResponse proto.InternalMessageInfo - -// CreateExtensionRequest creates a new extension as specified by the provided -// parameters -type CreateExtensionRequest struct { - Annotations *Annotations `protobuf:"bytes,1,opt,name=annotations,proto3" json:"annotations,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` -} - -func (m *CreateExtensionRequest) Reset() { *m = CreateExtensionRequest{} } -func (*CreateExtensionRequest) ProtoMessage() {} -func (*CreateExtensionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{61} -} -func (m *CreateExtensionRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CreateExtensionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CreateExtensionRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CreateExtensionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateExtensionRequest.Merge(m, src) -} -func (m *CreateExtensionRequest) XXX_Size() int { - return m.Size() -} -func (m *CreateExtensionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateExtensionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateExtensionRequest proto.InternalMessageInfo - -// CreateExtensionResponse contains the newly created `Extension` corresponding -// to the parameters in the CreateExtensionRequest. -type CreateExtensionResponse struct { - Extension *Extension `protobuf:"bytes,1,opt,name=extension,proto3" json:"extension,omitempty"` -} - -func (m *CreateExtensionResponse) Reset() { *m = CreateExtensionResponse{} } -func (*CreateExtensionResponse) ProtoMessage() {} -func (*CreateExtensionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{62} -} -func (m *CreateExtensionResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CreateExtensionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CreateExtensionResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CreateExtensionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateExtensionResponse.Merge(m, src) -} -func (m *CreateExtensionResponse) XXX_Size() int { - return m.Size() -} -func (m *CreateExtensionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateExtensionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateExtensionResponse proto.InternalMessageInfo - -// RemoveExtensionRequest contains the ID of the extension that should be removed. This -// removes all versions of the extension. -type RemoveExtensionRequest struct { - ExtensionID string `protobuf:"bytes,1,opt,name=extension_id,json=extensionId,proto3" json:"extension_id,omitempty"` -} - -func (m *RemoveExtensionRequest) Reset() { *m = RemoveExtensionRequest{} } -func (*RemoveExtensionRequest) ProtoMessage() {} -func (*RemoveExtensionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{63} -} -func (m *RemoveExtensionRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveExtensionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveExtensionRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveExtensionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveExtensionRequest.Merge(m, src) -} -func (m *RemoveExtensionRequest) XXX_Size() int { - return m.Size() -} -func (m *RemoveExtensionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveExtensionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveExtensionRequest proto.InternalMessageInfo - -// RemoveExtensionResponse is an empty object indicating the successful removal -// of an extension. -type RemoveExtensionResponse struct { -} - -func (m *RemoveExtensionResponse) Reset() { *m = RemoveExtensionResponse{} } -func (*RemoveExtensionResponse) ProtoMessage() {} -func (*RemoveExtensionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{64} -} -func (m *RemoveExtensionResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveExtensionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveExtensionResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveExtensionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveExtensionResponse.Merge(m, src) -} -func (m *RemoveExtensionResponse) XXX_Size() int { - return m.Size() -} -func (m *RemoveExtensionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveExtensionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveExtensionResponse proto.InternalMessageInfo - -// GetResourceRequest is the request to get a Extension object given a extension id. -type GetExtensionRequest struct { - ExtensionID string `protobuf:"bytes,1,opt,name=extension_id,json=extensionId,proto3" json:"extension_id,omitempty"` -} - -func (m *GetExtensionRequest) Reset() { *m = GetExtensionRequest{} } -func (*GetExtensionRequest) ProtoMessage() {} -func (*GetExtensionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{65} -} -func (m *GetExtensionRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetExtensionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetExtensionRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetExtensionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetExtensionRequest.Merge(m, src) -} -func (m *GetExtensionRequest) XXX_Size() int { - return m.Size() -} -func (m *GetExtensionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetExtensionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetExtensionRequest proto.InternalMessageInfo - -// GetExtensionResponse contains the Extension corresponding to the id in -// `GetExtensionRequest`. -type GetExtensionResponse struct { - Extension *Extension `protobuf:"bytes,1,opt,name=extension,proto3" json:"extension,omitempty"` -} - -func (m *GetExtensionResponse) Reset() { *m = GetExtensionResponse{} } -func (*GetExtensionResponse) ProtoMessage() {} -func (*GetExtensionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{66} -} -func (m *GetExtensionResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetExtensionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetExtensionResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetExtensionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetExtensionResponse.Merge(m, src) -} -func (m *GetExtensionResponse) XXX_Size() int { - return m.Size() -} -func (m *GetExtensionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetExtensionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetExtensionResponse proto.InternalMessageInfo - -// CreateResourceRequest creates a new resource specified by the included -// resource object. An existing resource will not be updated. -type CreateResourceRequest struct { - Annotations *Annotations `protobuf:"bytes,1,opt,name=annotations,proto3" json:"annotations,omitempty"` - Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` - Payload *types.Any `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (m *CreateResourceRequest) Reset() { *m = CreateResourceRequest{} } -func (*CreateResourceRequest) ProtoMessage() {} -func (*CreateResourceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{67} -} -func (m *CreateResourceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CreateResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CreateResourceRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CreateResourceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateResourceRequest.Merge(m, src) -} -func (m *CreateResourceRequest) XXX_Size() int { - return m.Size() -} -func (m *CreateResourceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateResourceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateResourceRequest proto.InternalMessageInfo - -// CreateResourceResponse contains the newly created `Resource` corresponding -// to the resource in the CreateResourceRequest. -type CreateResourceResponse struct { - Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` -} - -func (m *CreateResourceResponse) Reset() { *m = CreateResourceResponse{} } -func (*CreateResourceResponse) ProtoMessage() {} -func (*CreateResourceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{68} -} -func (m *CreateResourceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CreateResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CreateResourceResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CreateResourceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateResourceResponse.Merge(m, src) -} -func (m *CreateResourceResponse) XXX_Size() int { - return m.Size() -} -func (m *CreateResourceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateResourceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateResourceResponse proto.InternalMessageInfo - -// RemoveResourceRequest contains the ID of the resource that should be removed. This -// removes all versions of the resource. -type RemoveResourceRequest struct { - ResourceID string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` -} - -func (m *RemoveResourceRequest) Reset() { *m = RemoveResourceRequest{} } -func (*RemoveResourceRequest) ProtoMessage() {} -func (*RemoveResourceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{69} -} -func (m *RemoveResourceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveResourceRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveResourceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveResourceRequest.Merge(m, src) -} -func (m *RemoveResourceRequest) XXX_Size() int { - return m.Size() -} -func (m *RemoveResourceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveResourceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveResourceRequest proto.InternalMessageInfo - -// RemoveResourceResponse is an empty object indicating the successful removal -// of a resource. -type RemoveResourceResponse struct { -} - -func (m *RemoveResourceResponse) Reset() { *m = RemoveResourceResponse{} } -func (*RemoveResourceResponse) ProtoMessage() {} -func (*RemoveResourceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{70} -} -func (m *RemoveResourceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveResourceResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveResourceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveResourceResponse.Merge(m, src) -} -func (m *RemoveResourceResponse) XXX_Size() int { - return m.Size() -} -func (m *RemoveResourceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveResourceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveResourceResponse proto.InternalMessageInfo - -// UpdateResourceRequest updates the resource specified by the given resource object. -type UpdateResourceRequest struct { - ResourceID string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` - ResourceVersion *Version `protobuf:"bytes,2,opt,name=resource_version,json=resourceVersion,proto3" json:"resource_version,omitempty"` - // Annotations describes the annotations to update. If the Annotations should - // be unchanged, then this field should be left empty. Note that the name of - // a Resource cannot be changed, only its labels. - Annotations *Annotations `protobuf:"bytes,3,opt,name=annotations,proto3" json:"annotations,omitempty"` - // Payload describes the new payload of the resource. If the Payload should - // be unchanged, then this field should be left empty. - Payload *types.Any `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (m *UpdateResourceRequest) Reset() { *m = UpdateResourceRequest{} } -func (*UpdateResourceRequest) ProtoMessage() {} -func (*UpdateResourceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{71} -} -func (m *UpdateResourceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateResourceRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateResourceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateResourceRequest.Merge(m, src) -} -func (m *UpdateResourceRequest) XXX_Size() int { - return m.Size() -} -func (m *UpdateResourceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateResourceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateResourceRequest proto.InternalMessageInfo - -type UpdateResourceResponse struct { - Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` -} - -func (m *UpdateResourceResponse) Reset() { *m = UpdateResourceResponse{} } -func (*UpdateResourceResponse) ProtoMessage() {} -func (*UpdateResourceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{72} -} -func (m *UpdateResourceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateResourceResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateResourceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateResourceResponse.Merge(m, src) -} -func (m *UpdateResourceResponse) XXX_Size() int { - return m.Size() -} -func (m *UpdateResourceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateResourceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateResourceResponse proto.InternalMessageInfo - -// GetResourceRequest is the request to get a Resource object given a resource id. -type GetResourceRequest struct { - ResourceID string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` -} - -func (m *GetResourceRequest) Reset() { *m = GetResourceRequest{} } -func (*GetResourceRequest) ProtoMessage() {} -func (*GetResourceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{73} -} -func (m *GetResourceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetResourceRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetResourceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetResourceRequest.Merge(m, src) -} -func (m *GetResourceRequest) XXX_Size() int { - return m.Size() -} -func (m *GetResourceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetResourceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetResourceRequest proto.InternalMessageInfo - -// GetResourceResponse contains the Resource corresponding to the id in -// `GetResourceRequest`. -type GetResourceResponse struct { - Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` -} - -func (m *GetResourceResponse) Reset() { *m = GetResourceResponse{} } -func (*GetResourceResponse) ProtoMessage() {} -func (*GetResourceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{74} -} -func (m *GetResourceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetResourceResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetResourceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetResourceResponse.Merge(m, src) -} -func (m *GetResourceResponse) XXX_Size() int { - return m.Size() -} -func (m *GetResourceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetResourceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetResourceResponse proto.InternalMessageInfo - -// ListResourcesRequest is the request to list all resources in the raft store, -// or all resources filtered by (name or name prefix or id prefix), labels and extension. -type ListResourcesRequest struct { - Filters *ListResourcesRequest_Filters `protobuf:"bytes,1,opt,name=filters,proto3" json:"filters,omitempty"` -} - -func (m *ListResourcesRequest) Reset() { *m = ListResourcesRequest{} } -func (*ListResourcesRequest) ProtoMessage() {} -func (*ListResourcesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{75} -} -func (m *ListResourcesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListResourcesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListResourcesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListResourcesRequest.Merge(m, src) -} -func (m *ListResourcesRequest) XXX_Size() int { - return m.Size() -} -func (m *ListResourcesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListResourcesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListResourcesRequest proto.InternalMessageInfo - -type ListResourcesRequest_Filters struct { - Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` - IDPrefixes []string `protobuf:"bytes,2,rep,name=id_prefixes,json=idPrefixes,proto3" json:"id_prefixes,omitempty"` - Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - NamePrefixes []string `protobuf:"bytes,4,rep,name=name_prefixes,json=namePrefixes,proto3" json:"name_prefixes,omitempty"` - Kind string `protobuf:"bytes,5,opt,name=kind,proto3" json:"kind,omitempty"` -} - -func (m *ListResourcesRequest_Filters) Reset() { *m = ListResourcesRequest_Filters{} } -func (*ListResourcesRequest_Filters) ProtoMessage() {} -func (*ListResourcesRequest_Filters) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{75, 0} -} -func (m *ListResourcesRequest_Filters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListResourcesRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListResourcesRequest_Filters.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListResourcesRequest_Filters) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListResourcesRequest_Filters.Merge(m, src) -} -func (m *ListResourcesRequest_Filters) XXX_Size() int { - return m.Size() -} -func (m *ListResourcesRequest_Filters) XXX_DiscardUnknown() { - xxx_messageInfo_ListResourcesRequest_Filters.DiscardUnknown(m) -} - -var xxx_messageInfo_ListResourcesRequest_Filters proto.InternalMessageInfo - -// ListResourcesResponse contains a list of all the resources that match the name or -// name prefix filters provided in `ListResourcesRequest`. -type ListResourcesResponse struct { - Resources []*Resource `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` -} - -func (m *ListResourcesResponse) Reset() { *m = ListResourcesResponse{} } -func (*ListResourcesResponse) ProtoMessage() {} -func (*ListResourcesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{76} -} -func (m *ListResourcesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListResourcesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListResourcesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListResourcesResponse.Merge(m, src) -} -func (m *ListResourcesResponse) XXX_Size() int { - return m.Size() -} -func (m *ListResourcesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListResourcesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListResourcesResponse proto.InternalMessageInfo - -type CreateVolumeRequest struct { - Spec *VolumeSpec `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"` -} - -func (m *CreateVolumeRequest) Reset() { *m = CreateVolumeRequest{} } -func (*CreateVolumeRequest) ProtoMessage() {} -func (*CreateVolumeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{77} -} -func (m *CreateVolumeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CreateVolumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CreateVolumeRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CreateVolumeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateVolumeRequest.Merge(m, src) -} -func (m *CreateVolumeRequest) XXX_Size() int { - return m.Size() -} -func (m *CreateVolumeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateVolumeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateVolumeRequest proto.InternalMessageInfo - -type CreateVolumeResponse struct { - Volume *Volume `protobuf:"bytes,1,opt,name=volume,proto3" json:"volume,omitempty"` -} - -func (m *CreateVolumeResponse) Reset() { *m = CreateVolumeResponse{} } -func (*CreateVolumeResponse) ProtoMessage() {} -func (*CreateVolumeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{78} -} -func (m *CreateVolumeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CreateVolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CreateVolumeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CreateVolumeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateVolumeResponse.Merge(m, src) -} -func (m *CreateVolumeResponse) XXX_Size() int { - return m.Size() -} -func (m *CreateVolumeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateVolumeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateVolumeResponse proto.InternalMessageInfo - -type GetVolumeRequest struct { - VolumeID string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` -} - -func (m *GetVolumeRequest) Reset() { *m = GetVolumeRequest{} } -func (*GetVolumeRequest) ProtoMessage() {} -func (*GetVolumeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{79} -} -func (m *GetVolumeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetVolumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetVolumeRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetVolumeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetVolumeRequest.Merge(m, src) -} -func (m *GetVolumeRequest) XXX_Size() int { - return m.Size() -} -func (m *GetVolumeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetVolumeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetVolumeRequest proto.InternalMessageInfo - -type GetVolumeResponse struct { - Volume *Volume `protobuf:"bytes,1,opt,name=volume,proto3" json:"volume,omitempty"` -} - -func (m *GetVolumeResponse) Reset() { *m = GetVolumeResponse{} } -func (*GetVolumeResponse) ProtoMessage() {} -func (*GetVolumeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{80} -} -func (m *GetVolumeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetVolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetVolumeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetVolumeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetVolumeResponse.Merge(m, src) -} -func (m *GetVolumeResponse) XXX_Size() int { - return m.Size() -} -func (m *GetVolumeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetVolumeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetVolumeResponse proto.InternalMessageInfo - -type UpdateVolumeRequest struct { - VolumeID string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` - VolumeVersion *Version `protobuf:"bytes,2,opt,name=volume_version,json=volumeVersion,proto3" json:"volume_version,omitempty"` - Spec *VolumeSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` -} - -func (m *UpdateVolumeRequest) Reset() { *m = UpdateVolumeRequest{} } -func (*UpdateVolumeRequest) ProtoMessage() {} -func (*UpdateVolumeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{81} -} -func (m *UpdateVolumeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateVolumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateVolumeRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateVolumeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateVolumeRequest.Merge(m, src) -} -func (m *UpdateVolumeRequest) XXX_Size() int { - return m.Size() -} -func (m *UpdateVolumeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateVolumeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateVolumeRequest proto.InternalMessageInfo - -type UpdateVolumeResponse struct { - Volume *Volume `protobuf:"bytes,1,opt,name=volume,proto3" json:"volume,omitempty"` -} - -func (m *UpdateVolumeResponse) Reset() { *m = UpdateVolumeResponse{} } -func (*UpdateVolumeResponse) ProtoMessage() {} -func (*UpdateVolumeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{82} -} -func (m *UpdateVolumeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateVolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateVolumeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateVolumeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateVolumeResponse.Merge(m, src) -} -func (m *UpdateVolumeResponse) XXX_Size() int { - return m.Size() -} -func (m *UpdateVolumeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateVolumeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateVolumeResponse proto.InternalMessageInfo - -type ListVolumesRequest struct { - Filters *ListVolumesRequest_Filters `protobuf:"bytes,1,opt,name=filters,proto3" json:"filters,omitempty"` -} - -func (m *ListVolumesRequest) Reset() { *m = ListVolumesRequest{} } -func (*ListVolumesRequest) ProtoMessage() {} -func (*ListVolumesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{83} -} -func (m *ListVolumesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListVolumesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListVolumesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListVolumesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListVolumesRequest.Merge(m, src) -} -func (m *ListVolumesRequest) XXX_Size() int { - return m.Size() -} -func (m *ListVolumesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListVolumesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListVolumesRequest proto.InternalMessageInfo - -type ListVolumesRequest_Filters struct { - Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` - IDPrefixes []string `protobuf:"bytes,2,rep,name=id_prefixes,json=idPrefixes,proto3" json:"id_prefixes,omitempty"` - Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - NamePrefixes []string `protobuf:"bytes,4,rep,name=name_prefixes,json=namePrefixes,proto3" json:"name_prefixes,omitempty"` - Groups []string `protobuf:"bytes,5,rep,name=groups,proto3" json:"groups,omitempty"` - Drivers []string `protobuf:"bytes,6,rep,name=drivers,proto3" json:"drivers,omitempty"` -} - -func (m *ListVolumesRequest_Filters) Reset() { *m = ListVolumesRequest_Filters{} } -func (*ListVolumesRequest_Filters) ProtoMessage() {} -func (*ListVolumesRequest_Filters) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{83, 0} -} -func (m *ListVolumesRequest_Filters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListVolumesRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListVolumesRequest_Filters.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListVolumesRequest_Filters) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListVolumesRequest_Filters.Merge(m, src) -} -func (m *ListVolumesRequest_Filters) XXX_Size() int { - return m.Size() -} -func (m *ListVolumesRequest_Filters) XXX_DiscardUnknown() { - xxx_messageInfo_ListVolumesRequest_Filters.DiscardUnknown(m) -} - -var xxx_messageInfo_ListVolumesRequest_Filters proto.InternalMessageInfo - -type ListVolumesResponse struct { - Volumes []*Volume `protobuf:"bytes,1,rep,name=volumes,proto3" json:"volumes,omitempty"` -} - -func (m *ListVolumesResponse) Reset() { *m = ListVolumesResponse{} } -func (*ListVolumesResponse) ProtoMessage() {} -func (*ListVolumesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{84} -} -func (m *ListVolumesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListVolumesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListVolumesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListVolumesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListVolumesResponse.Merge(m, src) -} -func (m *ListVolumesResponse) XXX_Size() int { - return m.Size() -} -func (m *ListVolumesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListVolumesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListVolumesResponse proto.InternalMessageInfo - -type RemoveVolumeRequest struct { - VolumeID string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` - // Force forces the volume to be deleted from swarmkit, regardless of - // whether its current state would permit such an action. - Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` -} - -func (m *RemoveVolumeRequest) Reset() { *m = RemoveVolumeRequest{} } -func (*RemoveVolumeRequest) ProtoMessage() {} -func (*RemoveVolumeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{85} -} -func (m *RemoveVolumeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveVolumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveVolumeRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveVolumeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveVolumeRequest.Merge(m, src) -} -func (m *RemoveVolumeRequest) XXX_Size() int { - return m.Size() -} -func (m *RemoveVolumeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveVolumeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveVolumeRequest proto.InternalMessageInfo - -type RemoveVolumeResponse struct { -} - -func (m *RemoveVolumeResponse) Reset() { *m = RemoveVolumeResponse{} } -func (*RemoveVolumeResponse) ProtoMessage() {} -func (*RemoveVolumeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b37401dd08bf8930, []int{86} -} -func (m *RemoveVolumeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoveVolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoveVolumeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoveVolumeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveVolumeResponse.Merge(m, src) -} -func (m *RemoveVolumeResponse) XXX_Size() int { - return m.Size() -} -func (m *RemoveVolumeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveVolumeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoveVolumeResponse proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("docker.swarmkit.v1.UpdateServiceRequest_Rollback", UpdateServiceRequest_Rollback_name, UpdateServiceRequest_Rollback_value) - proto.RegisterType((*GetNodeRequest)(nil), "docker.swarmkit.v1.GetNodeRequest") - proto.RegisterType((*GetNodeResponse)(nil), "docker.swarmkit.v1.GetNodeResponse") - proto.RegisterType((*ListNodesRequest)(nil), "docker.swarmkit.v1.ListNodesRequest") - proto.RegisterType((*ListNodesRequest_Filters)(nil), "docker.swarmkit.v1.ListNodesRequest.Filters") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.ListNodesRequest.Filters.LabelsEntry") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.ListNodesRequest.Filters.NodeLabelsEntry") - proto.RegisterType((*ListNodesResponse)(nil), "docker.swarmkit.v1.ListNodesResponse") - proto.RegisterType((*UpdateNodeRequest)(nil), "docker.swarmkit.v1.UpdateNodeRequest") - proto.RegisterType((*UpdateNodeResponse)(nil), "docker.swarmkit.v1.UpdateNodeResponse") - proto.RegisterType((*RemoveNodeRequest)(nil), "docker.swarmkit.v1.RemoveNodeRequest") - proto.RegisterType((*RemoveNodeResponse)(nil), "docker.swarmkit.v1.RemoveNodeResponse") - proto.RegisterType((*GetTaskRequest)(nil), "docker.swarmkit.v1.GetTaskRequest") - proto.RegisterType((*GetTaskResponse)(nil), "docker.swarmkit.v1.GetTaskResponse") - proto.RegisterType((*RemoveTaskRequest)(nil), "docker.swarmkit.v1.RemoveTaskRequest") - proto.RegisterType((*RemoveTaskResponse)(nil), "docker.swarmkit.v1.RemoveTaskResponse") - proto.RegisterType((*ListTasksRequest)(nil), "docker.swarmkit.v1.ListTasksRequest") - proto.RegisterType((*ListTasksRequest_Filters)(nil), "docker.swarmkit.v1.ListTasksRequest.Filters") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.ListTasksRequest.Filters.LabelsEntry") - proto.RegisterType((*ListTasksResponse)(nil), "docker.swarmkit.v1.ListTasksResponse") - proto.RegisterType((*CreateServiceRequest)(nil), "docker.swarmkit.v1.CreateServiceRequest") - proto.RegisterType((*CreateServiceResponse)(nil), "docker.swarmkit.v1.CreateServiceResponse") - proto.RegisterType((*GetServiceRequest)(nil), "docker.swarmkit.v1.GetServiceRequest") - proto.RegisterType((*GetServiceResponse)(nil), "docker.swarmkit.v1.GetServiceResponse") - proto.RegisterType((*UpdateServiceRequest)(nil), "docker.swarmkit.v1.UpdateServiceRequest") - proto.RegisterType((*UpdateServiceResponse)(nil), "docker.swarmkit.v1.UpdateServiceResponse") - proto.RegisterType((*RemoveServiceRequest)(nil), "docker.swarmkit.v1.RemoveServiceRequest") - proto.RegisterType((*RemoveServiceResponse)(nil), "docker.swarmkit.v1.RemoveServiceResponse") - proto.RegisterType((*ListServicesRequest)(nil), "docker.swarmkit.v1.ListServicesRequest") - proto.RegisterType((*ListServicesRequest_Filters)(nil), "docker.swarmkit.v1.ListServicesRequest.Filters") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.ListServicesRequest.Filters.LabelsEntry") - proto.RegisterType((*ListServicesResponse)(nil), "docker.swarmkit.v1.ListServicesResponse") - proto.RegisterType((*ListServiceStatusesRequest)(nil), "docker.swarmkit.v1.ListServiceStatusesRequest") - proto.RegisterType((*ListServiceStatusesResponse)(nil), "docker.swarmkit.v1.ListServiceStatusesResponse") - proto.RegisterType((*ListServiceStatusesResponse_ServiceStatus)(nil), "docker.swarmkit.v1.ListServiceStatusesResponse.ServiceStatus") - proto.RegisterType((*CreateNetworkRequest)(nil), "docker.swarmkit.v1.CreateNetworkRequest") - proto.RegisterType((*CreateNetworkResponse)(nil), "docker.swarmkit.v1.CreateNetworkResponse") - proto.RegisterType((*GetNetworkRequest)(nil), "docker.swarmkit.v1.GetNetworkRequest") - proto.RegisterType((*GetNetworkResponse)(nil), "docker.swarmkit.v1.GetNetworkResponse") - proto.RegisterType((*RemoveNetworkRequest)(nil), "docker.swarmkit.v1.RemoveNetworkRequest") - proto.RegisterType((*RemoveNetworkResponse)(nil), "docker.swarmkit.v1.RemoveNetworkResponse") - proto.RegisterType((*ListNetworksRequest)(nil), "docker.swarmkit.v1.ListNetworksRequest") - proto.RegisterType((*ListNetworksRequest_Filters)(nil), "docker.swarmkit.v1.ListNetworksRequest.Filters") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.ListNetworksRequest.Filters.LabelsEntry") - proto.RegisterType((*ListNetworksResponse)(nil), "docker.swarmkit.v1.ListNetworksResponse") - proto.RegisterType((*GetClusterRequest)(nil), "docker.swarmkit.v1.GetClusterRequest") - proto.RegisterType((*GetClusterResponse)(nil), "docker.swarmkit.v1.GetClusterResponse") - proto.RegisterType((*ListClustersRequest)(nil), "docker.swarmkit.v1.ListClustersRequest") - proto.RegisterType((*ListClustersRequest_Filters)(nil), "docker.swarmkit.v1.ListClustersRequest.Filters") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.ListClustersRequest.Filters.LabelsEntry") - proto.RegisterType((*ListClustersResponse)(nil), "docker.swarmkit.v1.ListClustersResponse") - proto.RegisterType((*KeyRotation)(nil), "docker.swarmkit.v1.KeyRotation") - proto.RegisterType((*UpdateClusterRequest)(nil), "docker.swarmkit.v1.UpdateClusterRequest") - proto.RegisterType((*UpdateClusterResponse)(nil), "docker.swarmkit.v1.UpdateClusterResponse") - proto.RegisterType((*GetSecretRequest)(nil), "docker.swarmkit.v1.GetSecretRequest") - proto.RegisterType((*GetSecretResponse)(nil), "docker.swarmkit.v1.GetSecretResponse") - proto.RegisterType((*UpdateSecretRequest)(nil), "docker.swarmkit.v1.UpdateSecretRequest") - proto.RegisterType((*UpdateSecretResponse)(nil), "docker.swarmkit.v1.UpdateSecretResponse") - proto.RegisterType((*ListSecretsRequest)(nil), "docker.swarmkit.v1.ListSecretsRequest") - proto.RegisterType((*ListSecretsRequest_Filters)(nil), "docker.swarmkit.v1.ListSecretsRequest.Filters") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.ListSecretsRequest.Filters.LabelsEntry") - proto.RegisterType((*ListSecretsResponse)(nil), "docker.swarmkit.v1.ListSecretsResponse") - proto.RegisterType((*CreateSecretRequest)(nil), "docker.swarmkit.v1.CreateSecretRequest") - proto.RegisterType((*CreateSecretResponse)(nil), "docker.swarmkit.v1.CreateSecretResponse") - proto.RegisterType((*RemoveSecretRequest)(nil), "docker.swarmkit.v1.RemoveSecretRequest") - proto.RegisterType((*RemoveSecretResponse)(nil), "docker.swarmkit.v1.RemoveSecretResponse") - proto.RegisterType((*GetConfigRequest)(nil), "docker.swarmkit.v1.GetConfigRequest") - proto.RegisterType((*GetConfigResponse)(nil), "docker.swarmkit.v1.GetConfigResponse") - proto.RegisterType((*UpdateConfigRequest)(nil), "docker.swarmkit.v1.UpdateConfigRequest") - proto.RegisterType((*UpdateConfigResponse)(nil), "docker.swarmkit.v1.UpdateConfigResponse") - proto.RegisterType((*ListConfigsRequest)(nil), "docker.swarmkit.v1.ListConfigsRequest") - proto.RegisterType((*ListConfigsRequest_Filters)(nil), "docker.swarmkit.v1.ListConfigsRequest.Filters") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.ListConfigsRequest.Filters.LabelsEntry") - proto.RegisterType((*ListConfigsResponse)(nil), "docker.swarmkit.v1.ListConfigsResponse") - proto.RegisterType((*CreateConfigRequest)(nil), "docker.swarmkit.v1.CreateConfigRequest") - proto.RegisterType((*CreateConfigResponse)(nil), "docker.swarmkit.v1.CreateConfigResponse") - proto.RegisterType((*RemoveConfigRequest)(nil), "docker.swarmkit.v1.RemoveConfigRequest") - proto.RegisterType((*RemoveConfigResponse)(nil), "docker.swarmkit.v1.RemoveConfigResponse") - proto.RegisterType((*CreateExtensionRequest)(nil), "docker.swarmkit.v1.CreateExtensionRequest") - proto.RegisterType((*CreateExtensionResponse)(nil), "docker.swarmkit.v1.CreateExtensionResponse") - proto.RegisterType((*RemoveExtensionRequest)(nil), "docker.swarmkit.v1.RemoveExtensionRequest") - proto.RegisterType((*RemoveExtensionResponse)(nil), "docker.swarmkit.v1.RemoveExtensionResponse") - proto.RegisterType((*GetExtensionRequest)(nil), "docker.swarmkit.v1.GetExtensionRequest") - proto.RegisterType((*GetExtensionResponse)(nil), "docker.swarmkit.v1.GetExtensionResponse") - proto.RegisterType((*CreateResourceRequest)(nil), "docker.swarmkit.v1.CreateResourceRequest") - proto.RegisterType((*CreateResourceResponse)(nil), "docker.swarmkit.v1.CreateResourceResponse") - proto.RegisterType((*RemoveResourceRequest)(nil), "docker.swarmkit.v1.RemoveResourceRequest") - proto.RegisterType((*RemoveResourceResponse)(nil), "docker.swarmkit.v1.RemoveResourceResponse") - proto.RegisterType((*UpdateResourceRequest)(nil), "docker.swarmkit.v1.UpdateResourceRequest") - proto.RegisterType((*UpdateResourceResponse)(nil), "docker.swarmkit.v1.UpdateResourceResponse") - proto.RegisterType((*GetResourceRequest)(nil), "docker.swarmkit.v1.GetResourceRequest") - proto.RegisterType((*GetResourceResponse)(nil), "docker.swarmkit.v1.GetResourceResponse") - proto.RegisterType((*ListResourcesRequest)(nil), "docker.swarmkit.v1.ListResourcesRequest") - proto.RegisterType((*ListResourcesRequest_Filters)(nil), "docker.swarmkit.v1.ListResourcesRequest.Filters") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.ListResourcesRequest.Filters.LabelsEntry") - proto.RegisterType((*ListResourcesResponse)(nil), "docker.swarmkit.v1.ListResourcesResponse") - proto.RegisterType((*CreateVolumeRequest)(nil), "docker.swarmkit.v1.CreateVolumeRequest") - proto.RegisterType((*CreateVolumeResponse)(nil), "docker.swarmkit.v1.CreateVolumeResponse") - proto.RegisterType((*GetVolumeRequest)(nil), "docker.swarmkit.v1.GetVolumeRequest") - proto.RegisterType((*GetVolumeResponse)(nil), "docker.swarmkit.v1.GetVolumeResponse") - proto.RegisterType((*UpdateVolumeRequest)(nil), "docker.swarmkit.v1.UpdateVolumeRequest") - proto.RegisterType((*UpdateVolumeResponse)(nil), "docker.swarmkit.v1.UpdateVolumeResponse") - proto.RegisterType((*ListVolumesRequest)(nil), "docker.swarmkit.v1.ListVolumesRequest") - proto.RegisterType((*ListVolumesRequest_Filters)(nil), "docker.swarmkit.v1.ListVolumesRequest.Filters") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.ListVolumesRequest.Filters.LabelsEntry") - proto.RegisterType((*ListVolumesResponse)(nil), "docker.swarmkit.v1.ListVolumesResponse") - proto.RegisterType((*RemoveVolumeRequest)(nil), "docker.swarmkit.v1.RemoveVolumeRequest") - proto.RegisterType((*RemoveVolumeResponse)(nil), "docker.swarmkit.v1.RemoveVolumeResponse") -} - -func init() { - proto.RegisterFile("github.com/docker/swarmkit/api/control.proto", fileDescriptor_b37401dd08bf8930) -} - -var fileDescriptor_b37401dd08bf8930 = []byte{ - // 3006 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0x4b, 0x6f, 0x1c, 0xc7, - 0xf1, 0xe7, 0x3e, 0xc8, 0xdd, 0xad, 0xe5, 0x4b, 0x2d, 0x4a, 0x5e, 0xaf, 0xfd, 0x27, 0x85, 0x91, - 0x25, 0xad, 0xf4, 0x57, 0x76, 0x6d, 0x3a, 0x8e, 0x15, 0x3f, 0x92, 0x88, 0xa2, 0x2c, 0xaf, 0x65, - 0x4b, 0xc6, 0x50, 0x12, 0x92, 0x43, 0x40, 0x2c, 0x77, 0x5b, 0xf4, 0x98, 0xcb, 0x99, 0xcd, 0xcc, - 0xac, 0x6c, 0x22, 0x48, 0x90, 0x87, 0x73, 0x0c, 0x90, 0x4b, 0x90, 0x20, 0x87, 0x00, 0x39, 0x05, - 0x48, 0x80, 0x20, 0xc8, 0x21, 0xc8, 0x21, 0x1f, 0xc0, 0xc8, 0xc9, 0x47, 0x5f, 0xc2, 0xc4, 0x34, - 0x02, 0xe4, 0x94, 0xaf, 0x90, 0x60, 0xba, 0xab, 0xe7, 0xb5, 0x3d, 0x3d, 0xb3, 0x0f, 0x80, 0x3e, - 0x91, 0xdb, 0xf3, 0xab, 0xae, 0xea, 0xae, 0x9a, 0x5f, 0xf5, 0x74, 0x15, 0x5c, 0xdf, 0x37, 0xdc, - 0xf7, 0x86, 0x7b, 0xcd, 0xae, 0x75, 0xd8, 0xea, 0x59, 0xdd, 0x03, 0x6a, 0xb7, 0x9c, 0x0f, 0x3a, - 0xf6, 0xe1, 0x81, 0xe1, 0xb6, 0x3a, 0x03, 0xa3, 0xd5, 0xb5, 0x4c, 0xd7, 0xb6, 0xfa, 0xcd, 0x81, - 0x6d, 0xb9, 0x16, 0x21, 0x1c, 0xd2, 0x14, 0x90, 0xe6, 0x93, 0x17, 0xea, 0xd7, 0x52, 0x66, 0x70, - 0x06, 0xb4, 0xeb, 0x70, 0xf9, 0x7a, 0x9a, 0x36, 0x6b, 0xef, 0x7d, 0xda, 0x75, 0x05, 0x3a, 0x6d, - 0x66, 0xf7, 0x68, 0x40, 0x05, 0x76, 0x6d, 0xdf, 0xda, 0xb7, 0xd8, 0xbf, 0x2d, 0xef, 0x3f, 0x1c, - 0x7d, 0x7a, 0xdf, 0xb2, 0xf6, 0xfb, 0xb4, 0xc5, 0x7e, 0xed, 0x0d, 0x1f, 0xb7, 0x3a, 0xe6, 0x11, - 0x3e, 0x7a, 0x59, 0x31, 0xb9, 0x0f, 0x1f, 0xf4, 0x87, 0xfb, 0x86, 0x89, 0x7f, 0xb8, 0xa0, 0xf6, - 0x12, 0x2c, 0xdf, 0xa1, 0xee, 0x3d, 0xab, 0x47, 0x75, 0xfa, 0x9d, 0x21, 0x75, 0x5c, 0x72, 0x11, - 0x4a, 0xa6, 0xd5, 0xa3, 0xbb, 0x46, 0xaf, 0x96, 0xbb, 0x90, 0x6b, 0x54, 0xb6, 0xe0, 0xe4, 0x78, - 0x63, 0xc1, 0x43, 0xb4, 0xb7, 0xf5, 0x05, 0xef, 0x51, 0xbb, 0xa7, 0x7d, 0x1d, 0x56, 0x7c, 0x31, - 0x67, 0x60, 0x99, 0x0e, 0x25, 0xd7, 0xa1, 0xe8, 0x3d, 0x64, 0x42, 0xd5, 0xcd, 0x5a, 0x73, 0x74, - 0x73, 0x9b, 0x0c, 0xcf, 0x50, 0xda, 0x47, 0xf3, 0xb0, 0xfa, 0xb6, 0xe1, 0xb0, 0x29, 0x1c, 0xa1, - 0xfa, 0x0d, 0x28, 0x3d, 0x36, 0xfa, 0x2e, 0xb5, 0x1d, 0x9c, 0xe5, 0xba, 0x6c, 0x96, 0xb8, 0x58, - 0xf3, 0x0d, 0x2e, 0xa3, 0x0b, 0xe1, 0xfa, 0x6f, 0x8b, 0x50, 0xc2, 0x41, 0xb2, 0x06, 0xf3, 0x66, - 0xe7, 0x90, 0x7a, 0x33, 0x16, 0x1a, 0x15, 0x9d, 0xff, 0x20, 0x2d, 0xa8, 0x1a, 0xbd, 0xdd, 0x81, - 0x4d, 0x1f, 0x1b, 0x1f, 0x52, 0xa7, 0x96, 0xf7, 0x9e, 0x6d, 0x2d, 0x9f, 0x1c, 0x6f, 0x40, 0x7b, - 0xfb, 0x5d, 0x1c, 0xd5, 0xc1, 0xe8, 0x89, 0xff, 0xc9, 0xbb, 0xb0, 0xd0, 0xef, 0xec, 0xd1, 0xbe, - 0x53, 0x2b, 0x5c, 0x28, 0x34, 0xaa, 0x9b, 0x37, 0xc6, 0xb1, 0xac, 0xf9, 0x36, 0x13, 0xbd, 0x6d, - 0xba, 0xf6, 0x91, 0x8e, 0xf3, 0x90, 0x6f, 0x43, 0x95, 0xed, 0x33, 0x4e, 0x5b, 0x62, 0xd3, 0xbe, - 0x36, 0xd6, 0xb4, 0xde, 0x60, 0x78, 0x6a, 0x30, 0xfd, 0x01, 0xf2, 0x0e, 0x54, 0x0f, 0xe9, 0xe1, - 0x1e, 0xb5, 0x9d, 0xf7, 0x8c, 0x81, 0x53, 0x2b, 0x5e, 0x28, 0x34, 0x96, 0x37, 0xaf, 0x24, 0x79, - 0x65, 0x67, 0x40, 0xbb, 0xcd, 0x77, 0x7c, 0xfc, 0x56, 0x7e, 0x75, 0x4e, 0x0f, 0xcb, 0x93, 0xaf, - 0xc0, 0xbc, 0x6d, 0xf5, 0xa9, 0x53, 0x9b, 0x67, 0x13, 0x3d, 0x9b, 0xe8, 0x5e, 0xab, 0x4f, 0x99, - 0x34, 0x87, 0x93, 0x8b, 0xb0, 0xe4, 0xed, 0x78, 0xb0, 0xd5, 0x0b, 0xcc, 0x0d, 0x8b, 0xde, 0xa0, - 0xd8, 0xdc, 0xfa, 0x57, 0xa1, 0x1a, 0x5a, 0x06, 0x59, 0x85, 0xc2, 0x01, 0x3d, 0xe2, 0xd1, 0xa7, - 0x7b, 0xff, 0x7a, 0x4e, 0x7c, 0xd2, 0xe9, 0x0f, 0x69, 0x2d, 0xcf, 0xc6, 0xf8, 0x8f, 0x57, 0xf2, - 0x37, 0x72, 0xf5, 0xd7, 0x61, 0x25, 0xb6, 0x0b, 0xe3, 0x88, 0x6b, 0xb7, 0xe0, 0x4c, 0x68, 0x77, - 0x31, 0x92, 0x9b, 0x30, 0xef, 0x6d, 0x24, 0x0f, 0x19, 0x55, 0x28, 0x73, 0x98, 0xf6, 0xbb, 0x1c, - 0x9c, 0x79, 0x38, 0xe8, 0x75, 0x5c, 0x3a, 0xee, 0x7b, 0x44, 0xbe, 0x06, 0x8b, 0x0c, 0xf4, 0x84, - 0xda, 0x8e, 0x61, 0x99, 0xcc, 0xc0, 0xea, 0xe6, 0x33, 0x32, 0x8d, 0x8f, 0x38, 0x44, 0x67, 0x51, - 0x83, 0x3f, 0xc8, 0xf3, 0x50, 0xf4, 0x18, 0xa9, 0x56, 0x60, 0x72, 0xcf, 0xaa, 0xdc, 0xab, 0x33, - 0xa4, 0xb6, 0x05, 0x24, 0x6c, 0xeb, 0x44, 0x2f, 0xef, 0x3d, 0x38, 0xa3, 0xd3, 0x43, 0xeb, 0xc9, - 0xf8, 0xeb, 0x5d, 0x83, 0xf9, 0xc7, 0x96, 0xdd, 0xe5, 0x9e, 0x28, 0xeb, 0xfc, 0x87, 0xb6, 0x06, - 0x24, 0x3c, 0x1f, 0xb7, 0x09, 0xa9, 0xe9, 0x41, 0xc7, 0x39, 0x08, 0xa9, 0x70, 0x3b, 0xce, 0x41, - 0x4c, 0x85, 0x87, 0xf0, 0x54, 0x78, 0x8f, 0x7c, 0x6a, 0xe2, 0x62, 0xc1, 0xea, 0xbc, 0x87, 0xaa, - 0xd5, 0x31, 0x3c, 0x43, 0x69, 0x37, 0xc4, 0xea, 0xc6, 0x56, 0xed, 0xaf, 0x23, 0xac, 0x5d, 0xfb, - 0x6b, 0x91, 0x53, 0x9d, 0x37, 0x38, 0x01, 0xd5, 0x85, 0xc5, 0x46, 0xa9, 0xee, 0x1f, 0x85, 0xd3, - 0xa3, 0x3a, 0x99, 0x65, 0x52, 0xaa, 0x6b, 0x41, 0xd5, 0xa1, 0xf6, 0x13, 0xa3, 0xeb, 0x45, 0x07, - 0xe7, 0x22, 0x34, 0x61, 0x87, 0x0f, 0xb7, 0xb7, 0x1d, 0x1d, 0x10, 0xd2, 0xee, 0x39, 0xe4, 0x32, - 0x94, 0x31, 0x96, 0x38, 0xe1, 0x54, 0xb6, 0xaa, 0x27, 0xc7, 0x1b, 0x25, 0x1e, 0x4c, 0x8e, 0x5e, - 0xe2, 0xd1, 0xe4, 0x90, 0x37, 0x61, 0xb9, 0x47, 0x1d, 0xc3, 0xa6, 0xbd, 0x5d, 0xc7, 0xed, 0xb8, - 0x48, 0x2f, 0xcb, 0x9b, 0xff, 0x97, 0xe4, 0xe2, 0x1d, 0x0f, 0xc5, 0xf8, 0x69, 0x09, 0x05, 0xd9, - 0x88, 0x84, 0xa7, 0x4a, 0xa3, 0x3c, 0x45, 0xea, 0x50, 0xb6, 0x87, 0xa6, 0x6b, 0x78, 0x7b, 0x5c, - 0x61, 0xcf, 0xfd, 0xdf, 0xe4, 0x59, 0x80, 0xe1, 0x60, 0xd7, 0xb5, 0x76, 0xbd, 0x77, 0xab, 0x56, - 0x66, 0xe1, 0x5d, 0x1e, 0x0e, 0x1e, 0x58, 0xdb, 0x1d, 0x97, 0x4e, 0xc1, 0x70, 0x82, 0xa2, 0x70, - 0xb3, 0x03, 0x8a, 0xf2, 0x62, 0x4e, 0x49, 0x51, 0x2c, 0x08, 0x39, 0x4c, 0xbb, 0x0b, 0x6b, 0xb7, - 0x6c, 0xda, 0x71, 0x29, 0x6e, 0xb8, 0x08, 0xc3, 0x17, 0x91, 0x3f, 0x78, 0x0c, 0x6e, 0xc8, 0xa6, - 0x41, 0x89, 0x10, 0x85, 0xdc, 0x83, 0x73, 0xb1, 0xc9, 0xd0, 0xaa, 0x97, 0xa0, 0x84, 0x4e, 0xc4, - 0x09, 0x9f, 0x51, 0x4c, 0xa8, 0x0b, 0xac, 0xf6, 0x3e, 0x9c, 0xb9, 0x43, 0xdd, 0x98, 0x65, 0xd7, - 0x01, 0x82, 0x98, 0xc1, 0x77, 0x6e, 0xe9, 0xe4, 0x78, 0xa3, 0xe2, 0x87, 0x8c, 0x5e, 0xf1, 0x23, - 0x86, 0x5c, 0x81, 0x15, 0xc3, 0x74, 0xa8, 0xed, 0xee, 0xf6, 0xe8, 0xe3, 0xce, 0xb0, 0xef, 0x3a, - 0xc8, 0x30, 0xcb, 0x7c, 0x78, 0x1b, 0x47, 0xb5, 0xbb, 0x40, 0xc2, 0xba, 0xa6, 0x33, 0xfc, 0x4f, - 0x79, 0x58, 0xe3, 0x64, 0x3a, 0x95, 0xf1, 0xdb, 0xb0, 0x22, 0xd0, 0x63, 0xe4, 0x81, 0x65, 0x94, - 0x11, 0xa9, 0xe0, 0xc5, 0x48, 0x2a, 0xc8, 0xe6, 0x4a, 0xf2, 0x0e, 0x94, 0x6d, 0xab, 0xdf, 0xdf, - 0xeb, 0x74, 0x0f, 0x6a, 0xc5, 0x0b, 0xb9, 0xc6, 0xf2, 0xe6, 0x0b, 0x32, 0x41, 0xd9, 0x22, 0x9b, - 0x3a, 0x0a, 0xea, 0xfe, 0x14, 0x9a, 0x06, 0x65, 0x31, 0x4a, 0xca, 0x50, 0xbc, 0x77, 0xff, 0xde, - 0xed, 0xd5, 0x39, 0xb2, 0x08, 0xe5, 0x77, 0xf5, 0xdb, 0x8f, 0xda, 0xf7, 0x1f, 0xee, 0xac, 0xe6, - 0xbc, 0xe8, 0x89, 0x4d, 0x37, 0x9d, 0x13, 0xb6, 0x61, 0x8d, 0x93, 0xee, 0x34, 0x3e, 0xd0, 0x9e, - 0x82, 0x73, 0xb1, 0x59, 0x90, 0xbd, 0x3f, 0x2a, 0xc0, 0x59, 0xef, 0xfd, 0xc3, 0x71, 0x9f, 0xc0, - 0xdb, 0x71, 0x02, 0x6f, 0x25, 0xd1, 0x64, 0x4c, 0x72, 0x94, 0xc3, 0x7f, 0x93, 0x9f, 0x39, 0x87, - 0xef, 0xc4, 0x38, 0xfc, 0xd5, 0x31, 0x8d, 0x93, 0xd2, 0xf8, 0x08, 0x47, 0x16, 0x53, 0x38, 0x72, - 0x3e, 0xca, 0x91, 0xd3, 0xb0, 0xe0, 0x7d, 0x58, 0x8b, 0x9a, 0x8b, 0x41, 0xf3, 0x32, 0x94, 0xd1, - 0x89, 0x82, 0x0b, 0x95, 0x51, 0xe3, 0x83, 0xb5, 0x1b, 0x50, 0x0f, 0x4d, 0xe8, 0x65, 0x81, 0xa1, - 0x13, 0x78, 0xb7, 0x1e, 0x9b, 0xb6, 0x12, 0x92, 0xfc, 0x7d, 0x1e, 0x9e, 0x91, 0x8a, 0xa2, 0x49, - 0xdf, 0x82, 0xb2, 0x83, 0x63, 0x68, 0xd2, 0xeb, 0x29, 0xbb, 0x1f, 0x9f, 0xa2, 0x19, 0x19, 0xd7, - 0xfd, 0xe9, 0xea, 0x7f, 0xcc, 0xc1, 0x52, 0xe4, 0xd9, 0x98, 0x4c, 0x73, 0x11, 0x44, 0xda, 0xdb, - 0xe5, 0xe9, 0xc3, 0xdb, 0xe7, 0xa2, 0xbe, 0x88, 0x83, 0x2c, 0xc7, 0x78, 0x20, 0x7b, 0x68, 0x9a, - 0x86, 0xb9, 0x8f, 0xa0, 0x02, 0x07, 0xe1, 0x20, 0x07, 0x5d, 0x81, 0x95, 0xae, 0x75, 0x38, 0xe8, - 0x53, 0xd7, 0x9f, 0xab, 0xc8, 0x60, 0xcb, 0xfe, 0xf0, 0x83, 0x68, 0xe6, 0xb9, 0x47, 0xdd, 0x0f, - 0x2c, 0xfb, 0x60, 0x8c, 0xcc, 0x83, 0x12, 0xb2, 0xcc, 0xe3, 0x4f, 0x16, 0x70, 0x87, 0xc9, 0x87, - 0x54, 0xdc, 0x21, 0xa4, 0x04, 0x56, 0x7b, 0xc8, 0x32, 0x4f, 0xcc, 0x32, 0x02, 0x45, 0x2f, 0xa2, - 0x31, 0x2e, 0xd9, 0xff, 0xde, 0x36, 0xa3, 0x8c, 0xb7, 0xcd, 0xf9, 0x60, 0x9b, 0x51, 0xd6, 0xdb, - 0x66, 0x04, 0xb4, 0x7b, 0x98, 0x64, 0x66, 0x64, 0xe3, 0x37, 0x05, 0xbf, 0xcd, 0xdc, 0x4c, 0x9f, - 0xf3, 0x62, 0x96, 0x6a, 0xff, 0xce, 0x73, 0xce, 0xc3, 0xf1, 0x09, 0x38, 0x2f, 0x26, 0x39, 0xca, - 0x79, 0x3f, 0x39, 0x45, 0xce, 0x4b, 0x30, 0x6e, 0x62, 0xce, 0x9b, 0x01, 0xaf, 0x05, 0x26, 0x05, - 0xbc, 0x86, 0x8e, 0x52, 0xf2, 0x9a, 0xf0, 0x9c, 0x0f, 0xd6, 0x6e, 0xb2, 0x90, 0xbe, 0xd5, 0x1f, - 0x3a, 0x2e, 0xb5, 0x43, 0xb9, 0xb0, 0xcb, 0x47, 0x62, 0x2c, 0x81, 0x38, 0x2f, 0x2e, 0x10, 0xe0, - 0x87, 0xaf, 0x3f, 0x45, 0x10, 0xbe, 0x08, 0x51, 0x85, 0xaf, 0x90, 0x12, 0x58, 0x3f, 0x96, 0xf0, - 0xc1, 0x04, 0xb1, 0x14, 0x93, 0xfc, 0x62, 0xc5, 0x52, 0x82, 0x71, 0xa7, 0x19, 0x4b, 0x81, 0x49, - 0x41, 0x2c, 0xa1, 0x37, 0x94, 0xb1, 0x24, 0x5c, 0xe7, 0x83, 0xb5, 0x9f, 0xe7, 0xa0, 0x7a, 0x97, - 0x1e, 0xe9, 0x96, 0xdb, 0x71, 0xbd, 0x23, 0xe6, 0x35, 0x38, 0xe3, 0x05, 0x19, 0xb5, 0x77, 0xdf, - 0xb7, 0x0c, 0x73, 0xd7, 0xb5, 0x0e, 0xa8, 0xc9, 0x4c, 0x2b, 0xeb, 0x2b, 0xfc, 0xc1, 0x5b, 0x96, - 0x61, 0x3e, 0xf0, 0x86, 0xc9, 0x75, 0x20, 0x87, 0x1d, 0xb3, 0xb3, 0x1f, 0x05, 0xf3, 0x43, 0xf9, - 0x2a, 0x3e, 0x91, 0xa2, 0x87, 0x66, 0xdf, 0xea, 0x1e, 0xec, 0x7a, 0xab, 0x2e, 0x44, 0xd0, 0x0f, - 0xd9, 0x83, 0xbb, 0xf4, 0x48, 0xfb, 0x91, 0x7f, 0xee, 0x9e, 0x26, 0xce, 0xbd, 0x73, 0xb7, 0x40, - 0x8f, 0x73, 0xee, 0x46, 0x99, 0x31, 0xce, 0xdd, 0xa8, 0x3d, 0x74, 0xee, 0xbe, 0xe9, 0x9d, 0xbb, - 0xf9, 0xae, 0xb2, 0xbc, 0x99, 0x20, 0x18, 0xda, 0xfc, 0xad, 0xe2, 0xc7, 0xc7, 0x1b, 0x73, 0xba, - 0x2f, 0x16, 0x9c, 0xa3, 0x67, 0xf4, 0xa2, 0xbe, 0x0e, 0xab, 0xec, 0xcb, 0xa8, 0x6b, 0x53, 0x57, - 0xec, 0xe7, 0x55, 0xa8, 0x38, 0x6c, 0x20, 0xd8, 0xce, 0xc5, 0x93, 0xe3, 0x8d, 0x32, 0x47, 0xb5, - 0xb7, 0xbd, 0x53, 0x11, 0xfb, 0xaf, 0xa7, 0xdd, 0xc1, 0x8f, 0x38, 0x2e, 0x8e, 0xa6, 0x6c, 0xc2, - 0x02, 0x07, 0xa0, 0x25, 0x75, 0xf9, 0xd9, 0x8c, 0xc9, 0x20, 0x52, 0xfb, 0x4b, 0x0e, 0xce, 0x8a, - 0x0f, 0x84, 0xc9, 0x6c, 0x21, 0x5b, 0xb0, 0x8c, 0xd0, 0x31, 0xfc, 0xba, 0xc4, 0x45, 0x84, 0x5b, - 0x37, 0x23, 0x6e, 0x5d, 0x4f, 0x36, 0x3c, 0x74, 0x3c, 0x79, 0x2b, 0xf8, 0x1c, 0x9c, 0x7a, 0x1b, - 0xfe, 0x95, 0x07, 0xc2, 0x8f, 0x88, 0xde, 0x4f, 0x9f, 0x36, 0xdf, 0x8c, 0xd3, 0x66, 0x33, 0xf9, - 0x6c, 0x19, 0x16, 0x1c, 0x65, 0xcd, 0x8f, 0x66, 0xcf, 0x9a, 0x7a, 0x8c, 0x35, 0x5f, 0x19, 0xcf, - 0xb6, 0x53, 0x21, 0xcd, 0xbb, 0xe2, 0xf3, 0x0e, 0x2d, 0x42, 0x97, 0x7d, 0xd9, 0xfb, 0x18, 0x65, - 0x43, 0x48, 0x99, 0x2a, 0x9f, 0x09, 0xa8, 0xd6, 0x86, 0xb3, 0xe2, 0x66, 0x24, 0x1c, 0xba, 0x9b, - 0x91, 0xb3, 0x6e, 0xe6, 0x58, 0x8a, 0x4e, 0x35, 0x45, 0x2c, 0x7d, 0x03, 0xce, 0x8a, 0x8f, 0xdb, - 0x09, 0xdf, 0xee, 0xf3, 0xc1, 0x47, 0x76, 0xd8, 0x1a, 0x24, 0x8d, 0x5b, 0x96, 0xf9, 0xd8, 0xd8, - 0x0f, 0x4d, 0xdb, 0x65, 0x03, 0xb1, 0x69, 0x39, 0xca, 0x9b, 0x96, 0x3f, 0xf6, 0x49, 0x43, 0x88, - 0x07, 0x2b, 0xe4, 0x00, 0xd5, 0x0a, 0x51, 0x06, 0x91, 0x21, 0xd2, 0x98, 0xd4, 0x16, 0x8f, 0x34, - 0x10, 0x3a, 0x0e, 0x69, 0x70, 0x91, 0x31, 0x48, 0x83, 0x6b, 0x96, 0x91, 0xc6, 0x0c, 0xb6, 0x41, - 0x90, 0x06, 0x1f, 0x9e, 0x80, 0x34, 0xa2, 0x82, 0x5f, 0x2c, 0xd2, 0x90, 0xdb, 0x76, 0x9a, 0xa4, - 0xe1, 0x5b, 0x14, 0x90, 0x06, 0x77, 0x84, 0x92, 0x34, 0xd0, 0x67, 0x02, 0x1a, 0x90, 0x46, 0x34, - 0x74, 0x33, 0x90, 0x86, 0x2c, 0x96, 0xa2, 0x53, 0x4d, 0x11, 0x4b, 0x3e, 0x69, 0x4c, 0xfc, 0x76, - 0xfb, 0xa4, 0x11, 0xb5, 0x46, 0xfb, 0x1e, 0x9c, 0xe7, 0x56, 0xde, 0xfe, 0xd0, 0xa5, 0x26, 0x7b, - 0x8f, 0x70, 0xf2, 0x9b, 0x50, 0xed, 0x98, 0x26, 0x9e, 0x70, 0x1c, 0xd5, 0xdd, 0xc0, 0xcd, 0x00, - 0xa6, 0x87, 0x65, 0xc8, 0x05, 0xa8, 0xf6, 0xa8, 0xd3, 0xb5, 0x8d, 0x81, 0x2b, 0xde, 0xe1, 0x8a, - 0x1e, 0x1e, 0xd2, 0x1e, 0xc1, 0x53, 0x23, 0xea, 0x71, 0x9f, 0x5e, 0x85, 0x0a, 0x15, 0x83, 0xa8, - 0x5d, 0x5a, 0x4a, 0x08, 0x24, 0x03, 0xbc, 0xf6, 0x36, 0x9c, 0xe7, 0xcb, 0x1d, 0x59, 0xd6, 0x26, - 0x2c, 0xfa, 0xb0, 0x60, 0xdb, 0x56, 0x4e, 0x8e, 0x37, 0xaa, 0x3e, 0xb6, 0xbd, 0xad, 0x57, 0x7d, - 0x50, 0xbb, 0xa7, 0x3d, 0x0d, 0x4f, 0x8d, 0xcc, 0x86, 0xfb, 0xd7, 0x86, 0xb3, 0x77, 0xa8, 0x3b, - 0x13, 0x2d, 0x3b, 0xb0, 0x16, 0x9d, 0x6a, 0x16, 0x1b, 0xf1, 0xeb, 0x9c, 0xb8, 0xa6, 0xd1, 0xa9, - 0x63, 0x0d, 0xed, 0xe0, 0x4e, 0x76, 0x06, 0xfe, 0x25, 0x50, 0x3c, 0x30, 0x4c, 0xbc, 0xdc, 0xd0, - 0xd9, 0xff, 0xa4, 0x09, 0xa5, 0x41, 0xe7, 0xa8, 0x6f, 0x75, 0x7a, 0xc8, 0xbc, 0x6b, 0x4d, 0xde, - 0x2a, 0xd1, 0x14, 0xbd, 0x0f, 0xcd, 0x9b, 0xe6, 0x91, 0x2e, 0x40, 0x9a, 0x2e, 0x02, 0x30, 0xb0, - 0x0f, 0xd7, 0x7d, 0x03, 0xca, 0x36, 0x8e, 0xa1, 0x75, 0xd2, 0x9a, 0xaa, 0x2f, 0xe7, 0xa3, 0xb5, - 0x37, 0xc5, 0x65, 0x4a, 0x7c, 0xcd, 0x2d, 0xa8, 0x0a, 0x50, 0xe0, 0x15, 0x46, 0x88, 0x02, 0xd9, - 0xde, 0xd6, 0x41, 0x40, 0xda, 0x3d, 0xad, 0x26, 0xe2, 0x28, 0x6e, 0x9d, 0xf6, 0xe3, 0xbc, 0x38, - 0xf3, 0x4f, 0xab, 0x84, 0xbc, 0x01, 0xab, 0xbe, 0xc0, 0x18, 0xf9, 0x6e, 0x45, 0x08, 0x89, 0x8c, - 0x17, 0xf3, 0x68, 0x61, 0x02, 0x8f, 0x86, 0xbc, 0x57, 0xcc, 0xe8, 0xbd, 0xf8, 0x26, 0x4c, 0xed, - 0xbd, 0xdb, 0xec, 0xca, 0x63, 0x6a, 0xd7, 0xdd, 0x67, 0x6f, 0xe6, 0x0c, 0xed, 0xfa, 0x6f, 0x9e, - 0x7f, 0xd3, 0x8b, 0x47, 0x7e, 0x4a, 0x7f, 0x2b, 0x9e, 0xd2, 0x9f, 0x4f, 0x4a, 0x9b, 0x71, 0xd1, - 0xd1, 0xa4, 0xfe, 0xab, 0xd9, 0x27, 0xf5, 0x07, 0xb1, 0xa4, 0xfe, 0xda, 0xb8, 0xd6, 0x4d, 0x5e, - 0x80, 0x10, 0x04, 0x31, 0x1f, 0x10, 0xc4, 0x34, 0xa9, 0x7e, 0x07, 0xce, 0xc5, 0xec, 0x44, 0xa7, - 0xbe, 0x02, 0x15, 0xe1, 0x26, 0x91, 0xee, 0xd5, 0x5e, 0x0d, 0xe0, 0x41, 0xca, 0x7f, 0x64, 0xf5, - 0x87, 0x87, 0x74, 0x8c, 0x94, 0xcf, 0x05, 0x64, 0x29, 0x5f, 0x4c, 0x15, 0xa4, 0xfc, 0x27, 0x6c, - 0x44, 0x95, 0xf2, 0x51, 0x06, 0x91, 0x78, 0x9a, 0x8f, 0xda, 0x74, 0x15, 0x2a, 0xfc, 0x69, 0x2c, - 0xdf, 0x73, 0x94, 0x97, 0xef, 0xf9, 0x63, 0xff, 0x34, 0x3f, 0x03, 0x3b, 0x82, 0xd3, 0xfc, 0xa4, - 0xb6, 0x78, 0xa7, 0x79, 0x84, 0x8e, 0x73, 0x9a, 0xe7, 0x22, 0x63, 0x9c, 0xe6, 0x65, 0xee, 0x88, - 0x5a, 0x3e, 0xc5, 0x36, 0xfc, 0xa2, 0xc0, 0x4f, 0xf3, 0x7c, 0x78, 0x82, 0xd3, 0x7c, 0x54, 0x70, - 0xf4, 0xc5, 0xff, 0xf3, 0x29, 0x9e, 0xe6, 0xe5, 0xb6, 0x4d, 0xfe, 0xda, 0x9f, 0x87, 0x85, 0x7d, - 0xdb, 0x1a, 0x0e, 0x44, 0xd5, 0x11, 0x7f, 0x91, 0x1a, 0x94, 0x7a, 0xb6, 0xe1, 0x05, 0x01, 0xb6, - 0x9e, 0x89, 0x9f, 0x33, 0x38, 0xff, 0xfb, 0x6b, 0x08, 0xce, 0xff, 0xdc, 0x75, 0xca, 0xf3, 0x3f, - 0x7a, 0x59, 0x40, 0xb5, 0x47, 0xe2, 0xa0, 0x3d, 0x71, 0xb0, 0xcb, 0xbb, 0xaa, 0xfc, 0xe3, 0x77, - 0x34, 0x14, 0x37, 0xff, 0xde, 0x80, 0xd2, 0x2d, 0xde, 0x08, 0x4b, 0x0c, 0x28, 0x61, 0x1f, 0x27, - 0xd1, 0x64, 0xb6, 0x46, 0x7b, 0x43, 0xeb, 0x17, 0x95, 0x18, 0x3c, 0xa5, 0x9c, 0xfb, 0xdb, 0x1f, - 0xfe, 0xf3, 0xcb, 0xfc, 0x0a, 0x2c, 0x31, 0xd0, 0x97, 0xf0, 0xf6, 0x96, 0x58, 0x50, 0xf1, 0x5b, - 0xed, 0xc8, 0x73, 0x59, 0xfa, 0x1c, 0xeb, 0x97, 0x52, 0x50, 0x6a, 0x85, 0x36, 0x40, 0xd0, 0xe9, - 0x46, 0x2e, 0x25, 0xf7, 0x35, 0x84, 0x57, 0x78, 0x39, 0x0d, 0x96, 0xaa, 0x33, 0xe8, 0x64, 0x93, - 0xeb, 0x1c, 0xe9, 0x9c, 0x93, 0xeb, 0x94, 0x34, 0xc4, 0x25, 0xe8, 0xe4, 0x3e, 0x7c, 0xd0, 0x71, - 0x0e, 0x12, 0x7d, 0x18, 0xea, 0x64, 0x4b, 0xf4, 0x61, 0xa4, 0x67, 0x4d, 0xed, 0x43, 0x5e, 0x02, - 0x7e, 0x2e, 0x4b, 0x5f, 0x58, 0xb2, 0x0f, 0x23, 0x0d, 0x4d, 0xa9, 0xfb, 0xc9, 0x96, 0xa7, 0xd8, - 0xcf, 0xf0, 0x0a, 0x2f, 0xa7, 0xc1, 0x52, 0x75, 0x06, 0x2d, 0x42, 0x72, 0x9d, 0x23, 0xed, 0x4a, - 0x72, 0x9d, 0xa3, 0x9d, 0x46, 0x49, 0x3a, 0x3f, 0x84, 0xc5, 0x70, 0x7b, 0x03, 0xb9, 0x92, 0xb1, - 0x5f, 0xa3, 0xde, 0x48, 0x07, 0xaa, 0x35, 0x7f, 0x17, 0x96, 0x22, 0xcd, 0x5c, 0x44, 0x3a, 0xa3, - 0xac, 0x79, 0xac, 0x7e, 0x35, 0x03, 0x32, 0x55, 0x79, 0xa4, 0x17, 0x48, 0xae, 0x5c, 0xd6, 0x7d, - 0x24, 0x57, 0x2e, 0x6d, 0x2c, 0x52, 0x28, 0x8f, 0xb4, 0xfc, 0xc8, 0x95, 0xcb, 0x7a, 0x8b, 0xe4, - 0xca, 0xe5, 0xfd, 0x43, 0x09, 0xca, 0x7f, 0x9a, 0x8b, 0xb4, 0x15, 0x89, 0x0e, 0x10, 0xd2, 0xcc, - 0xdc, 0x2a, 0xc2, 0x2d, 0x69, 0x8d, 0xd9, 0x5a, 0xa2, 0x0e, 0x7a, 0x2c, 0x27, 0x27, 0x06, 0x7d, - 0xb4, 0x05, 0x21, 0x31, 0xe8, 0xe3, 0xfd, 0x04, 0xea, 0xa0, 0x17, 0xb5, 0xef, 0xe4, 0xa0, 0x8f, - 0x15, 0xec, 0x93, 0x83, 0x3e, 0x5e, 0x46, 0x4f, 0x0d, 0x7a, 0xb1, 0x60, 0x45, 0xd0, 0xc7, 0xd6, - 0x7c, 0x35, 0x03, 0x32, 0x63, 0xdc, 0x29, 0x95, 0xcb, 0x7a, 0x3e, 0x54, 0x71, 0x97, 0x51, 0x39, - 0xf7, 0x33, 0x16, 0xff, 0x12, 0xfd, 0x1c, 0x2d, 0xab, 0x26, 0xfa, 0x39, 0x56, 0x79, 0x4c, 0xf1, - 0xb3, 0xa8, 0x4b, 0x27, 0xfb, 0x39, 0x56, 0x4c, 0x4f, 0xf6, 0x73, 0xbc, 0xc4, 0x9d, 0xca, 0x2f, - 0x62, 0xc1, 0x0a, 0x7e, 0x89, 0xad, 0xf9, 0x6a, 0x06, 0x64, 0x6a, 0xb2, 0xf4, 0x2b, 0xa2, 0xf2, - 0x64, 0x19, 0xaf, 0xb7, 0xd6, 0x2f, 0xa5, 0xa0, 0x52, 0xf7, 0x39, 0x5c, 0x7e, 0x94, 0xef, 0xb3, - 0xa4, 0xb4, 0x5a, 0x6f, 0xa4, 0x03, 0xd5, 0x9a, 0x87, 0x50, 0x0d, 0x15, 0xd1, 0xc8, 0xe5, 0x6c, - 0x75, 0xbf, 0xfa, 0x95, 0x54, 0x5c, 0xea, 0x82, 0xc3, 0x35, 0x32, 0xf9, 0x82, 0x25, 0x05, 0xb9, - 0x7a, 0x23, 0x1d, 0x98, 0xaa, 0x39, 0x5c, 0x0f, 0x93, 0x6b, 0x96, 0xd4, 0xdc, 0xea, 0x8d, 0x74, - 0x60, 0x96, 0xa8, 0xe2, 0x37, 0xea, 0x89, 0x51, 0x15, 0xb9, 0xb2, 0x4f, 0x8c, 0xaa, 0xd8, 0xb5, - 0x7c, 0x5a, 0x54, 0xa1, 0x4e, 0x45, 0x54, 0x45, 0xd5, 0x36, 0xd2, 0x81, 0x99, 0xa2, 0x0a, 0xab, - 0x2c, 0xc9, 0x51, 0x15, 0x2d, 0x0c, 0x25, 0x47, 0x55, 0xac, 0x5c, 0x93, 0x1a, 0x55, 0xaa, 0x05, - 0x4b, 0x2a, 0x36, 0xaa, 0xa8, 0xca, 0xbc, 0xd5, 0xe1, 0x82, 0x89, 0x2a, 0xaa, 0x32, 0x68, 0x96, - 0xd6, 0x5e, 0x92, 0x35, 0x87, 0xeb, 0x00, 0x72, 0xcd, 0x92, 0xa2, 0x83, 0x5c, 0xb3, 0xac, 0xa4, - 0x90, 0xa4, 0xf9, 0x87, 0x39, 0x58, 0x89, 0x95, 0x63, 0xc8, 0xb5, 0xe4, 0x8d, 0x1c, 0x31, 0xe0, - 0xff, 0x33, 0x61, 0xd3, 0x6d, 0x88, 0x15, 0x5b, 0xe4, 0x36, 0xc8, 0xeb, 0x3b, 0x72, 0x1b, 0x92, - 0xaa, 0x37, 0xc9, 0xc1, 0x1e, 0xba, 0x3a, 0x26, 0x49, 0x29, 0x37, 0x76, 0x45, 0x5d, 0xbf, 0x92, - 0x8a, 0x53, 0xab, 0xfd, 0x3e, 0x2c, 0x47, 0x2f, 0xd3, 0x89, 0x22, 0xf1, 0xc5, 0x95, 0x5f, 0xcb, - 0x02, 0x4d, 0xcd, 0xd0, 0x91, 0xeb, 0x55, 0xd2, 0xc8, 0x7a, 0x53, 0x2c, 0xcf, 0xd0, 0xd2, 0xbb, - 0x5a, 0xc5, 0xe2, 0xa3, 0x75, 0x20, 0xa2, 0x38, 0xdd, 0x65, 0x5a, 0xbc, 0xbc, 0xac, 0xa4, 0xd0, - 0x1f, 0xad, 0xf4, 0x10, 0xc5, 0x01, 0x2f, 0x93, 0xfe, 0x84, 0xc2, 0x51, 0x1a, 0xd3, 0xf1, 0x1b, - 0x22, 0x15, 0xd3, 0x45, 0xee, 0xa6, 0x54, 0x4c, 0x17, 0xbd, 0x6c, 0x52, 0x67, 0x31, 0x54, 0x9b, - 0x94, 0xc5, 0xa2, 0x3a, 0x2f, 0xa5, 0xa0, 0x32, 0x66, 0x31, 0xd5, 0x52, 0x25, 0x77, 0xce, 0xaa, - 0x2c, 0x96, 0x4d, 0x33, 0x66, 0x31, 0xbc, 0x2b, 0x4c, 0xce, 0x62, 0xd1, 0x0b, 0xd1, 0xe4, 0x2c, - 0x16, 0xbb, 0x74, 0x4c, 0xcd, 0x25, 0xaa, 0x05, 0x4b, 0xee, 0x1d, 0x55, 0xb9, 0x24, 0xd3, 0x82, - 0xb7, 0x9e, 0xfb, 0xf8, 0xb3, 0xf5, 0xb9, 0x4f, 0x3f, 0x5b, 0x9f, 0xfb, 0xc1, 0xc9, 0x7a, 0xee, - 0xe3, 0x93, 0xf5, 0xdc, 0x27, 0x27, 0xeb, 0xb9, 0x7f, 0x9e, 0xac, 0xe7, 0x7e, 0xf6, 0xf9, 0xfa, - 0xdc, 0x27, 0x9f, 0xaf, 0xcf, 0x7d, 0xfa, 0xf9, 0xfa, 0xdc, 0xde, 0x02, 0x2b, 0xee, 0xbd, 0xf8, - 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x56, 0xde, 0x67, 0x4f, 0xb3, 0x3f, 0x00, 0x00, -} - -type authenticatedWrapperControlServer struct { - local ControlServer - authorize func(context.Context, []string) error -} - -func NewAuthenticatedWrapperControlServer(local ControlServer, authorize func(context.Context, []string) error) ControlServer { - return &authenticatedWrapperControlServer{ - local: local, - authorize: authorize, - } -} - -func (p *authenticatedWrapperControlServer) GetNode(ctx context.Context, r *GetNodeRequest) (*GetNodeResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.GetNode(ctx, r) -} - -func (p *authenticatedWrapperControlServer) ListNodes(ctx context.Context, r *ListNodesRequest) (*ListNodesResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.ListNodes(ctx, r) -} - -func (p *authenticatedWrapperControlServer) UpdateNode(ctx context.Context, r *UpdateNodeRequest) (*UpdateNodeResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.UpdateNode(ctx, r) -} - -func (p *authenticatedWrapperControlServer) RemoveNode(ctx context.Context, r *RemoveNodeRequest) (*RemoveNodeResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.RemoveNode(ctx, r) -} - -func (p *authenticatedWrapperControlServer) GetTask(ctx context.Context, r *GetTaskRequest) (*GetTaskResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.GetTask(ctx, r) -} - -func (p *authenticatedWrapperControlServer) ListTasks(ctx context.Context, r *ListTasksRequest) (*ListTasksResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.ListTasks(ctx, r) -} - -func (p *authenticatedWrapperControlServer) RemoveTask(ctx context.Context, r *RemoveTaskRequest) (*RemoveTaskResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.RemoveTask(ctx, r) -} - -func (p *authenticatedWrapperControlServer) GetService(ctx context.Context, r *GetServiceRequest) (*GetServiceResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.GetService(ctx, r) -} - -func (p *authenticatedWrapperControlServer) ListServices(ctx context.Context, r *ListServicesRequest) (*ListServicesResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.ListServices(ctx, r) -} - -func (p *authenticatedWrapperControlServer) CreateService(ctx context.Context, r *CreateServiceRequest) (*CreateServiceResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.CreateService(ctx, r) -} - -func (p *authenticatedWrapperControlServer) UpdateService(ctx context.Context, r *UpdateServiceRequest) (*UpdateServiceResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.UpdateService(ctx, r) -} - -func (p *authenticatedWrapperControlServer) RemoveService(ctx context.Context, r *RemoveServiceRequest) (*RemoveServiceResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.RemoveService(ctx, r) -} - -func (p *authenticatedWrapperControlServer) ListServiceStatuses(ctx context.Context, r *ListServiceStatusesRequest) (*ListServiceStatusesResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.ListServiceStatuses(ctx, r) -} - -func (p *authenticatedWrapperControlServer) GetNetwork(ctx context.Context, r *GetNetworkRequest) (*GetNetworkResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.GetNetwork(ctx, r) -} - -func (p *authenticatedWrapperControlServer) ListNetworks(ctx context.Context, r *ListNetworksRequest) (*ListNetworksResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.ListNetworks(ctx, r) -} - -func (p *authenticatedWrapperControlServer) CreateNetwork(ctx context.Context, r *CreateNetworkRequest) (*CreateNetworkResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.CreateNetwork(ctx, r) -} - -func (p *authenticatedWrapperControlServer) RemoveNetwork(ctx context.Context, r *RemoveNetworkRequest) (*RemoveNetworkResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.RemoveNetwork(ctx, r) -} - -func (p *authenticatedWrapperControlServer) GetCluster(ctx context.Context, r *GetClusterRequest) (*GetClusterResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.GetCluster(ctx, r) -} - -func (p *authenticatedWrapperControlServer) ListClusters(ctx context.Context, r *ListClustersRequest) (*ListClustersResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.ListClusters(ctx, r) -} - -func (p *authenticatedWrapperControlServer) UpdateCluster(ctx context.Context, r *UpdateClusterRequest) (*UpdateClusterResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.UpdateCluster(ctx, r) -} - -func (p *authenticatedWrapperControlServer) GetSecret(ctx context.Context, r *GetSecretRequest) (*GetSecretResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.GetSecret(ctx, r) -} - -func (p *authenticatedWrapperControlServer) UpdateSecret(ctx context.Context, r *UpdateSecretRequest) (*UpdateSecretResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.UpdateSecret(ctx, r) -} - -func (p *authenticatedWrapperControlServer) ListSecrets(ctx context.Context, r *ListSecretsRequest) (*ListSecretsResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.ListSecrets(ctx, r) -} - -func (p *authenticatedWrapperControlServer) CreateSecret(ctx context.Context, r *CreateSecretRequest) (*CreateSecretResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.CreateSecret(ctx, r) -} - -func (p *authenticatedWrapperControlServer) RemoveSecret(ctx context.Context, r *RemoveSecretRequest) (*RemoveSecretResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.RemoveSecret(ctx, r) -} - -func (p *authenticatedWrapperControlServer) GetConfig(ctx context.Context, r *GetConfigRequest) (*GetConfigResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.GetConfig(ctx, r) -} - -func (p *authenticatedWrapperControlServer) UpdateConfig(ctx context.Context, r *UpdateConfigRequest) (*UpdateConfigResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.UpdateConfig(ctx, r) -} - -func (p *authenticatedWrapperControlServer) ListConfigs(ctx context.Context, r *ListConfigsRequest) (*ListConfigsResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.ListConfigs(ctx, r) -} - -func (p *authenticatedWrapperControlServer) CreateConfig(ctx context.Context, r *CreateConfigRequest) (*CreateConfigResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.CreateConfig(ctx, r) -} - -func (p *authenticatedWrapperControlServer) RemoveConfig(ctx context.Context, r *RemoveConfigRequest) (*RemoveConfigResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.RemoveConfig(ctx, r) -} - -func (p *authenticatedWrapperControlServer) GetExtension(ctx context.Context, r *GetExtensionRequest) (*GetExtensionResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.GetExtension(ctx, r) -} - -func (p *authenticatedWrapperControlServer) CreateExtension(ctx context.Context, r *CreateExtensionRequest) (*CreateExtensionResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.CreateExtension(ctx, r) -} - -func (p *authenticatedWrapperControlServer) RemoveExtension(ctx context.Context, r *RemoveExtensionRequest) (*RemoveExtensionResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.RemoveExtension(ctx, r) -} - -func (p *authenticatedWrapperControlServer) GetResource(ctx context.Context, r *GetResourceRequest) (*GetResourceResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.GetResource(ctx, r) -} - -func (p *authenticatedWrapperControlServer) UpdateResource(ctx context.Context, r *UpdateResourceRequest) (*UpdateResourceResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.UpdateResource(ctx, r) -} - -func (p *authenticatedWrapperControlServer) ListResources(ctx context.Context, r *ListResourcesRequest) (*ListResourcesResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.ListResources(ctx, r) -} - -func (p *authenticatedWrapperControlServer) CreateResource(ctx context.Context, r *CreateResourceRequest) (*CreateResourceResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.CreateResource(ctx, r) -} - -func (p *authenticatedWrapperControlServer) RemoveResource(ctx context.Context, r *RemoveResourceRequest) (*RemoveResourceResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.RemoveResource(ctx, r) -} - -func (p *authenticatedWrapperControlServer) CreateVolume(ctx context.Context, r *CreateVolumeRequest) (*CreateVolumeResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.CreateVolume(ctx, r) -} - -func (p *authenticatedWrapperControlServer) GetVolume(ctx context.Context, r *GetVolumeRequest) (*GetVolumeResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.GetVolume(ctx, r) -} - -func (p *authenticatedWrapperControlServer) UpdateVolume(ctx context.Context, r *UpdateVolumeRequest) (*UpdateVolumeResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.UpdateVolume(ctx, r) -} - -func (p *authenticatedWrapperControlServer) ListVolumes(ctx context.Context, r *ListVolumesRequest) (*ListVolumesResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.ListVolumes(ctx, r) -} - -func (p *authenticatedWrapperControlServer) RemoveVolume(ctx context.Context, r *RemoveVolumeRequest) (*RemoveVolumeResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.RemoveVolume(ctx, r) -} - -func (m *GetNodeRequest) Copy() *GetNodeRequest { - if m == nil { - return nil - } - o := &GetNodeRequest{} - o.CopyFrom(m) - return o -} - -func (m *GetNodeRequest) CopyFrom(src interface{}) { - - o := src.(*GetNodeRequest) - *m = *o -} - -func (m *GetNodeResponse) Copy() *GetNodeResponse { - if m == nil { - return nil - } - o := &GetNodeResponse{} - o.CopyFrom(m) - return o -} - -func (m *GetNodeResponse) CopyFrom(src interface{}) { - - o := src.(*GetNodeResponse) - *m = *o - if o.Node != nil { - m.Node = &Node{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Node, o.Node) - } -} - -func (m *ListNodesRequest) Copy() *ListNodesRequest { - if m == nil { - return nil - } - o := &ListNodesRequest{} - o.CopyFrom(m) - return o -} - -func (m *ListNodesRequest) CopyFrom(src interface{}) { - - o := src.(*ListNodesRequest) - *m = *o - if o.Filters != nil { - m.Filters = &ListNodesRequest_Filters{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Filters, o.Filters) - } -} - -func (m *ListNodesRequest_Filters) Copy() *ListNodesRequest_Filters { - if m == nil { - return nil - } - o := &ListNodesRequest_Filters{} - o.CopyFrom(m) - return o -} - -func (m *ListNodesRequest_Filters) CopyFrom(src interface{}) { - - o := src.(*ListNodesRequest_Filters) - *m = *o - if o.Names != nil { - m.Names = make([]string, len(o.Names)) - copy(m.Names, o.Names) - } - - if o.IDPrefixes != nil { - m.IDPrefixes = make([]string, len(o.IDPrefixes)) - copy(m.IDPrefixes, o.IDPrefixes) - } - - if o.Labels != nil { - m.Labels = make(map[string]string, len(o.Labels)) - for k, v := range o.Labels { - m.Labels[k] = v - } - } - - if o.NodeLabels != nil { - m.NodeLabels = make(map[string]string, len(o.NodeLabels)) - for k, v := range o.NodeLabels { - m.NodeLabels[k] = v - } - } - - if o.Memberships != nil { - m.Memberships = make([]NodeSpec_Membership, len(o.Memberships)) - copy(m.Memberships, o.Memberships) - } - - if o.Roles != nil { - m.Roles = make([]NodeRole, len(o.Roles)) - copy(m.Roles, o.Roles) - } - - if o.NamePrefixes != nil { - m.NamePrefixes = make([]string, len(o.NamePrefixes)) - copy(m.NamePrefixes, o.NamePrefixes) - } - -} - -func (m *ListNodesResponse) Copy() *ListNodesResponse { - if m == nil { - return nil - } - o := &ListNodesResponse{} - o.CopyFrom(m) - return o -} - -func (m *ListNodesResponse) CopyFrom(src interface{}) { - - o := src.(*ListNodesResponse) - *m = *o - if o.Nodes != nil { - m.Nodes = make([]*Node, len(o.Nodes)) - for i := range m.Nodes { - m.Nodes[i] = &Node{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Nodes[i], o.Nodes[i]) - } - } - -} - -func (m *UpdateNodeRequest) Copy() *UpdateNodeRequest { - if m == nil { - return nil - } - o := &UpdateNodeRequest{} - o.CopyFrom(m) - return o -} - -func (m *UpdateNodeRequest) CopyFrom(src interface{}) { - - o := src.(*UpdateNodeRequest) - *m = *o - if o.NodeVersion != nil { - m.NodeVersion = &Version{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.NodeVersion, o.NodeVersion) - } - if o.Spec != nil { - m.Spec = &NodeSpec{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Spec, o.Spec) - } -} - -func (m *UpdateNodeResponse) Copy() *UpdateNodeResponse { - if m == nil { - return nil - } - o := &UpdateNodeResponse{} - o.CopyFrom(m) - return o -} - -func (m *UpdateNodeResponse) CopyFrom(src interface{}) { - - o := src.(*UpdateNodeResponse) - *m = *o - if o.Node != nil { - m.Node = &Node{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Node, o.Node) - } -} - -func (m *RemoveNodeRequest) Copy() *RemoveNodeRequest { - if m == nil { - return nil - } - o := &RemoveNodeRequest{} - o.CopyFrom(m) - return o -} - -func (m *RemoveNodeRequest) CopyFrom(src interface{}) { - - o := src.(*RemoveNodeRequest) - *m = *o -} - -func (m *RemoveNodeResponse) Copy() *RemoveNodeResponse { - if m == nil { - return nil - } - o := &RemoveNodeResponse{} - o.CopyFrom(m) - return o -} - -func (m *RemoveNodeResponse) CopyFrom(src interface{}) {} -func (m *GetTaskRequest) Copy() *GetTaskRequest { - if m == nil { - return nil - } - o := &GetTaskRequest{} - o.CopyFrom(m) - return o -} - -func (m *GetTaskRequest) CopyFrom(src interface{}) { - - o := src.(*GetTaskRequest) - *m = *o -} - -func (m *GetTaskResponse) Copy() *GetTaskResponse { - if m == nil { - return nil - } - o := &GetTaskResponse{} - o.CopyFrom(m) - return o -} - -func (m *GetTaskResponse) CopyFrom(src interface{}) { - - o := src.(*GetTaskResponse) - *m = *o - if o.Task != nil { - m.Task = &Task{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Task, o.Task) - } -} - -func (m *RemoveTaskRequest) Copy() *RemoveTaskRequest { - if m == nil { - return nil - } - o := &RemoveTaskRequest{} - o.CopyFrom(m) - return o -} - -func (m *RemoveTaskRequest) CopyFrom(src interface{}) { - - o := src.(*RemoveTaskRequest) - *m = *o -} - -func (m *RemoveTaskResponse) Copy() *RemoveTaskResponse { - if m == nil { - return nil - } - o := &RemoveTaskResponse{} - o.CopyFrom(m) - return o -} - -func (m *RemoveTaskResponse) CopyFrom(src interface{}) {} -func (m *ListTasksRequest) Copy() *ListTasksRequest { - if m == nil { - return nil - } - o := &ListTasksRequest{} - o.CopyFrom(m) - return o -} - -func (m *ListTasksRequest) CopyFrom(src interface{}) { - - o := src.(*ListTasksRequest) - *m = *o - if o.Filters != nil { - m.Filters = &ListTasksRequest_Filters{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Filters, o.Filters) - } -} - -func (m *ListTasksRequest_Filters) Copy() *ListTasksRequest_Filters { - if m == nil { - return nil - } - o := &ListTasksRequest_Filters{} - o.CopyFrom(m) - return o -} - -func (m *ListTasksRequest_Filters) CopyFrom(src interface{}) { - - o := src.(*ListTasksRequest_Filters) - *m = *o - if o.Names != nil { - m.Names = make([]string, len(o.Names)) - copy(m.Names, o.Names) - } - - if o.IDPrefixes != nil { - m.IDPrefixes = make([]string, len(o.IDPrefixes)) - copy(m.IDPrefixes, o.IDPrefixes) - } - - if o.Labels != nil { - m.Labels = make(map[string]string, len(o.Labels)) - for k, v := range o.Labels { - m.Labels[k] = v - } - } - - if o.ServiceIDs != nil { - m.ServiceIDs = make([]string, len(o.ServiceIDs)) - copy(m.ServiceIDs, o.ServiceIDs) - } - - if o.NodeIDs != nil { - m.NodeIDs = make([]string, len(o.NodeIDs)) - copy(m.NodeIDs, o.NodeIDs) - } - - if o.DesiredStates != nil { - m.DesiredStates = make([]TaskState, len(o.DesiredStates)) - copy(m.DesiredStates, o.DesiredStates) - } - - if o.NamePrefixes != nil { - m.NamePrefixes = make([]string, len(o.NamePrefixes)) - copy(m.NamePrefixes, o.NamePrefixes) - } - - if o.Runtimes != nil { - m.Runtimes = make([]string, len(o.Runtimes)) - copy(m.Runtimes, o.Runtimes) - } - -} - -func (m *ListTasksResponse) Copy() *ListTasksResponse { - if m == nil { - return nil - } - o := &ListTasksResponse{} - o.CopyFrom(m) - return o -} - -func (m *ListTasksResponse) CopyFrom(src interface{}) { - - o := src.(*ListTasksResponse) - *m = *o - if o.Tasks != nil { - m.Tasks = make([]*Task, len(o.Tasks)) - for i := range m.Tasks { - m.Tasks[i] = &Task{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Tasks[i], o.Tasks[i]) - } - } - -} - -func (m *CreateServiceRequest) Copy() *CreateServiceRequest { - if m == nil { - return nil - } - o := &CreateServiceRequest{} - o.CopyFrom(m) - return o -} - -func (m *CreateServiceRequest) CopyFrom(src interface{}) { - - o := src.(*CreateServiceRequest) - *m = *o - if o.Spec != nil { - m.Spec = &ServiceSpec{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Spec, o.Spec) - } -} - -func (m *CreateServiceResponse) Copy() *CreateServiceResponse { - if m == nil { - return nil - } - o := &CreateServiceResponse{} - o.CopyFrom(m) - return o -} - -func (m *CreateServiceResponse) CopyFrom(src interface{}) { - - o := src.(*CreateServiceResponse) - *m = *o - if o.Service != nil { - m.Service = &Service{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Service, o.Service) - } -} - -func (m *GetServiceRequest) Copy() *GetServiceRequest { - if m == nil { - return nil - } - o := &GetServiceRequest{} - o.CopyFrom(m) - return o -} - -func (m *GetServiceRequest) CopyFrom(src interface{}) { - - o := src.(*GetServiceRequest) - *m = *o -} - -func (m *GetServiceResponse) Copy() *GetServiceResponse { - if m == nil { - return nil - } - o := &GetServiceResponse{} - o.CopyFrom(m) - return o -} - -func (m *GetServiceResponse) CopyFrom(src interface{}) { - - o := src.(*GetServiceResponse) - *m = *o - if o.Service != nil { - m.Service = &Service{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Service, o.Service) - } -} - -func (m *UpdateServiceRequest) Copy() *UpdateServiceRequest { - if m == nil { - return nil - } - o := &UpdateServiceRequest{} - o.CopyFrom(m) - return o -} - -func (m *UpdateServiceRequest) CopyFrom(src interface{}) { - - o := src.(*UpdateServiceRequest) - *m = *o - if o.ServiceVersion != nil { - m.ServiceVersion = &Version{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.ServiceVersion, o.ServiceVersion) - } - if o.Spec != nil { - m.Spec = &ServiceSpec{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Spec, o.Spec) - } -} - -func (m *UpdateServiceResponse) Copy() *UpdateServiceResponse { - if m == nil { - return nil - } - o := &UpdateServiceResponse{} - o.CopyFrom(m) - return o -} - -func (m *UpdateServiceResponse) CopyFrom(src interface{}) { - - o := src.(*UpdateServiceResponse) - *m = *o - if o.Service != nil { - m.Service = &Service{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Service, o.Service) - } -} - -func (m *RemoveServiceRequest) Copy() *RemoveServiceRequest { - if m == nil { - return nil - } - o := &RemoveServiceRequest{} - o.CopyFrom(m) - return o -} - -func (m *RemoveServiceRequest) CopyFrom(src interface{}) { - - o := src.(*RemoveServiceRequest) - *m = *o -} - -func (m *RemoveServiceResponse) Copy() *RemoveServiceResponse { - if m == nil { - return nil - } - o := &RemoveServiceResponse{} - o.CopyFrom(m) - return o -} - -func (m *RemoveServiceResponse) CopyFrom(src interface{}) {} -func (m *ListServicesRequest) Copy() *ListServicesRequest { - if m == nil { - return nil - } - o := &ListServicesRequest{} - o.CopyFrom(m) - return o -} - -func (m *ListServicesRequest) CopyFrom(src interface{}) { - - o := src.(*ListServicesRequest) - *m = *o - if o.Filters != nil { - m.Filters = &ListServicesRequest_Filters{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Filters, o.Filters) - } -} - -func (m *ListServicesRequest_Filters) Copy() *ListServicesRequest_Filters { - if m == nil { - return nil - } - o := &ListServicesRequest_Filters{} - o.CopyFrom(m) - return o -} - -func (m *ListServicesRequest_Filters) CopyFrom(src interface{}) { - - o := src.(*ListServicesRequest_Filters) - *m = *o - if o.Names != nil { - m.Names = make([]string, len(o.Names)) - copy(m.Names, o.Names) - } - - if o.IDPrefixes != nil { - m.IDPrefixes = make([]string, len(o.IDPrefixes)) - copy(m.IDPrefixes, o.IDPrefixes) - } - - if o.Labels != nil { - m.Labels = make(map[string]string, len(o.Labels)) - for k, v := range o.Labels { - m.Labels[k] = v - } - } - - if o.NamePrefixes != nil { - m.NamePrefixes = make([]string, len(o.NamePrefixes)) - copy(m.NamePrefixes, o.NamePrefixes) - } - - if o.Runtimes != nil { - m.Runtimes = make([]string, len(o.Runtimes)) - copy(m.Runtimes, o.Runtimes) - } - -} - -func (m *ListServicesResponse) Copy() *ListServicesResponse { - if m == nil { - return nil - } - o := &ListServicesResponse{} - o.CopyFrom(m) - return o -} - -func (m *ListServicesResponse) CopyFrom(src interface{}) { - - o := src.(*ListServicesResponse) - *m = *o - if o.Services != nil { - m.Services = make([]*Service, len(o.Services)) - for i := range m.Services { - m.Services[i] = &Service{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Services[i], o.Services[i]) - } - } - -} - -func (m *ListServiceStatusesRequest) Copy() *ListServiceStatusesRequest { - if m == nil { - return nil - } - o := &ListServiceStatusesRequest{} - o.CopyFrom(m) - return o -} - -func (m *ListServiceStatusesRequest) CopyFrom(src interface{}) { - - o := src.(*ListServiceStatusesRequest) - *m = *o - if o.Services != nil { - m.Services = make([]string, len(o.Services)) - copy(m.Services, o.Services) - } - -} - -func (m *ListServiceStatusesResponse) Copy() *ListServiceStatusesResponse { - if m == nil { - return nil - } - o := &ListServiceStatusesResponse{} - o.CopyFrom(m) - return o -} - -func (m *ListServiceStatusesResponse) CopyFrom(src interface{}) { - - o := src.(*ListServiceStatusesResponse) - *m = *o - if o.Statuses != nil { - m.Statuses = make([]*ListServiceStatusesResponse_ServiceStatus, len(o.Statuses)) - for i := range m.Statuses { - m.Statuses[i] = &ListServiceStatusesResponse_ServiceStatus{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Statuses[i], o.Statuses[i]) - } - } - -} - -func (m *ListServiceStatusesResponse_ServiceStatus) Copy() *ListServiceStatusesResponse_ServiceStatus { - if m == nil { - return nil - } - o := &ListServiceStatusesResponse_ServiceStatus{} - o.CopyFrom(m) - return o -} - -func (m *ListServiceStatusesResponse_ServiceStatus) CopyFrom(src interface{}) { - - o := src.(*ListServiceStatusesResponse_ServiceStatus) - *m = *o -} - -func (m *CreateNetworkRequest) Copy() *CreateNetworkRequest { - if m == nil { - return nil - } - o := &CreateNetworkRequest{} - o.CopyFrom(m) - return o -} - -func (m *CreateNetworkRequest) CopyFrom(src interface{}) { - - o := src.(*CreateNetworkRequest) - *m = *o - if o.Spec != nil { - m.Spec = &NetworkSpec{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Spec, o.Spec) - } -} - -func (m *CreateNetworkResponse) Copy() *CreateNetworkResponse { - if m == nil { - return nil - } - o := &CreateNetworkResponse{} - o.CopyFrom(m) - return o -} - -func (m *CreateNetworkResponse) CopyFrom(src interface{}) { - - o := src.(*CreateNetworkResponse) - *m = *o - if o.Network != nil { - m.Network = &Network{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Network, o.Network) - } -} - -func (m *GetNetworkRequest) Copy() *GetNetworkRequest { - if m == nil { - return nil - } - o := &GetNetworkRequest{} - o.CopyFrom(m) - return o -} - -func (m *GetNetworkRequest) CopyFrom(src interface{}) { - - o := src.(*GetNetworkRequest) - *m = *o -} - -func (m *GetNetworkResponse) Copy() *GetNetworkResponse { - if m == nil { - return nil - } - o := &GetNetworkResponse{} - o.CopyFrom(m) - return o -} - -func (m *GetNetworkResponse) CopyFrom(src interface{}) { - - o := src.(*GetNetworkResponse) - *m = *o - if o.Network != nil { - m.Network = &Network{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Network, o.Network) - } -} - -func (m *RemoveNetworkRequest) Copy() *RemoveNetworkRequest { - if m == nil { - return nil - } - o := &RemoveNetworkRequest{} - o.CopyFrom(m) - return o -} - -func (m *RemoveNetworkRequest) CopyFrom(src interface{}) { - - o := src.(*RemoveNetworkRequest) - *m = *o -} - -func (m *RemoveNetworkResponse) Copy() *RemoveNetworkResponse { - if m == nil { - return nil - } - o := &RemoveNetworkResponse{} - o.CopyFrom(m) - return o -} - -func (m *RemoveNetworkResponse) CopyFrom(src interface{}) {} -func (m *ListNetworksRequest) Copy() *ListNetworksRequest { - if m == nil { - return nil - } - o := &ListNetworksRequest{} - o.CopyFrom(m) - return o -} - -func (m *ListNetworksRequest) CopyFrom(src interface{}) { - - o := src.(*ListNetworksRequest) - *m = *o - if o.Filters != nil { - m.Filters = &ListNetworksRequest_Filters{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Filters, o.Filters) - } -} - -func (m *ListNetworksRequest_Filters) Copy() *ListNetworksRequest_Filters { - if m == nil { - return nil - } - o := &ListNetworksRequest_Filters{} - o.CopyFrom(m) - return o -} - -func (m *ListNetworksRequest_Filters) CopyFrom(src interface{}) { - - o := src.(*ListNetworksRequest_Filters) - *m = *o - if o.Names != nil { - m.Names = make([]string, len(o.Names)) - copy(m.Names, o.Names) - } - - if o.IDPrefixes != nil { - m.IDPrefixes = make([]string, len(o.IDPrefixes)) - copy(m.IDPrefixes, o.IDPrefixes) - } - - if o.Labels != nil { - m.Labels = make(map[string]string, len(o.Labels)) - for k, v := range o.Labels { - m.Labels[k] = v - } - } - - if o.NamePrefixes != nil { - m.NamePrefixes = make([]string, len(o.NamePrefixes)) - copy(m.NamePrefixes, o.NamePrefixes) - } - -} - -func (m *ListNetworksResponse) Copy() *ListNetworksResponse { - if m == nil { - return nil - } - o := &ListNetworksResponse{} - o.CopyFrom(m) - return o -} - -func (m *ListNetworksResponse) CopyFrom(src interface{}) { - - o := src.(*ListNetworksResponse) - *m = *o - if o.Networks != nil { - m.Networks = make([]*Network, len(o.Networks)) - for i := range m.Networks { - m.Networks[i] = &Network{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Networks[i], o.Networks[i]) - } - } - -} - -func (m *GetClusterRequest) Copy() *GetClusterRequest { - if m == nil { - return nil - } - o := &GetClusterRequest{} - o.CopyFrom(m) - return o -} - -func (m *GetClusterRequest) CopyFrom(src interface{}) { - - o := src.(*GetClusterRequest) - *m = *o -} - -func (m *GetClusterResponse) Copy() *GetClusterResponse { - if m == nil { - return nil - } - o := &GetClusterResponse{} - o.CopyFrom(m) - return o -} - -func (m *GetClusterResponse) CopyFrom(src interface{}) { - - o := src.(*GetClusterResponse) - *m = *o - if o.Cluster != nil { - m.Cluster = &Cluster{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Cluster, o.Cluster) - } -} - -func (m *ListClustersRequest) Copy() *ListClustersRequest { - if m == nil { - return nil - } - o := &ListClustersRequest{} - o.CopyFrom(m) - return o -} - -func (m *ListClustersRequest) CopyFrom(src interface{}) { - - o := src.(*ListClustersRequest) - *m = *o - if o.Filters != nil { - m.Filters = &ListClustersRequest_Filters{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Filters, o.Filters) - } -} - -func (m *ListClustersRequest_Filters) Copy() *ListClustersRequest_Filters { - if m == nil { - return nil - } - o := &ListClustersRequest_Filters{} - o.CopyFrom(m) - return o -} - -func (m *ListClustersRequest_Filters) CopyFrom(src interface{}) { - - o := src.(*ListClustersRequest_Filters) - *m = *o - if o.Names != nil { - m.Names = make([]string, len(o.Names)) - copy(m.Names, o.Names) - } - - if o.IDPrefixes != nil { - m.IDPrefixes = make([]string, len(o.IDPrefixes)) - copy(m.IDPrefixes, o.IDPrefixes) - } - - if o.Labels != nil { - m.Labels = make(map[string]string, len(o.Labels)) - for k, v := range o.Labels { - m.Labels[k] = v - } - } - - if o.NamePrefixes != nil { - m.NamePrefixes = make([]string, len(o.NamePrefixes)) - copy(m.NamePrefixes, o.NamePrefixes) - } - -} - -func (m *ListClustersResponse) Copy() *ListClustersResponse { - if m == nil { - return nil - } - o := &ListClustersResponse{} - o.CopyFrom(m) - return o -} - -func (m *ListClustersResponse) CopyFrom(src interface{}) { - - o := src.(*ListClustersResponse) - *m = *o - if o.Clusters != nil { - m.Clusters = make([]*Cluster, len(o.Clusters)) - for i := range m.Clusters { - m.Clusters[i] = &Cluster{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Clusters[i], o.Clusters[i]) - } - } - -} - -func (m *KeyRotation) Copy() *KeyRotation { - if m == nil { - return nil - } - o := &KeyRotation{} - o.CopyFrom(m) - return o -} - -func (m *KeyRotation) CopyFrom(src interface{}) { - - o := src.(*KeyRotation) - *m = *o -} - -func (m *UpdateClusterRequest) Copy() *UpdateClusterRequest { - if m == nil { - return nil - } - o := &UpdateClusterRequest{} - o.CopyFrom(m) - return o -} - -func (m *UpdateClusterRequest) CopyFrom(src interface{}) { - - o := src.(*UpdateClusterRequest) - *m = *o - if o.ClusterVersion != nil { - m.ClusterVersion = &Version{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.ClusterVersion, o.ClusterVersion) - } - if o.Spec != nil { - m.Spec = &ClusterSpec{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Spec, o.Spec) - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Rotation, &o.Rotation) -} - -func (m *UpdateClusterResponse) Copy() *UpdateClusterResponse { - if m == nil { - return nil - } - o := &UpdateClusterResponse{} - o.CopyFrom(m) - return o -} - -func (m *UpdateClusterResponse) CopyFrom(src interface{}) { - - o := src.(*UpdateClusterResponse) - *m = *o - if o.Cluster != nil { - m.Cluster = &Cluster{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Cluster, o.Cluster) - } -} - -func (m *GetSecretRequest) Copy() *GetSecretRequest { - if m == nil { - return nil - } - o := &GetSecretRequest{} - o.CopyFrom(m) - return o -} - -func (m *GetSecretRequest) CopyFrom(src interface{}) { - - o := src.(*GetSecretRequest) - *m = *o -} - -func (m *GetSecretResponse) Copy() *GetSecretResponse { - if m == nil { - return nil - } - o := &GetSecretResponse{} - o.CopyFrom(m) - return o -} - -func (m *GetSecretResponse) CopyFrom(src interface{}) { - - o := src.(*GetSecretResponse) - *m = *o - if o.Secret != nil { - m.Secret = &Secret{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Secret, o.Secret) - } -} - -func (m *UpdateSecretRequest) Copy() *UpdateSecretRequest { - if m == nil { - return nil - } - o := &UpdateSecretRequest{} - o.CopyFrom(m) - return o -} - -func (m *UpdateSecretRequest) CopyFrom(src interface{}) { - - o := src.(*UpdateSecretRequest) - *m = *o - if o.SecretVersion != nil { - m.SecretVersion = &Version{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.SecretVersion, o.SecretVersion) - } - if o.Spec != nil { - m.Spec = &SecretSpec{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Spec, o.Spec) - } -} - -func (m *UpdateSecretResponse) Copy() *UpdateSecretResponse { - if m == nil { - return nil - } - o := &UpdateSecretResponse{} - o.CopyFrom(m) - return o -} - -func (m *UpdateSecretResponse) CopyFrom(src interface{}) { - - o := src.(*UpdateSecretResponse) - *m = *o - if o.Secret != nil { - m.Secret = &Secret{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Secret, o.Secret) - } -} - -func (m *ListSecretsRequest) Copy() *ListSecretsRequest { - if m == nil { - return nil - } - o := &ListSecretsRequest{} - o.CopyFrom(m) - return o -} - -func (m *ListSecretsRequest) CopyFrom(src interface{}) { - - o := src.(*ListSecretsRequest) - *m = *o - if o.Filters != nil { - m.Filters = &ListSecretsRequest_Filters{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Filters, o.Filters) - } -} - -func (m *ListSecretsRequest_Filters) Copy() *ListSecretsRequest_Filters { - if m == nil { - return nil - } - o := &ListSecretsRequest_Filters{} - o.CopyFrom(m) - return o -} - -func (m *ListSecretsRequest_Filters) CopyFrom(src interface{}) { - - o := src.(*ListSecretsRequest_Filters) - *m = *o - if o.Names != nil { - m.Names = make([]string, len(o.Names)) - copy(m.Names, o.Names) - } - - if o.IDPrefixes != nil { - m.IDPrefixes = make([]string, len(o.IDPrefixes)) - copy(m.IDPrefixes, o.IDPrefixes) - } - - if o.Labels != nil { - m.Labels = make(map[string]string, len(o.Labels)) - for k, v := range o.Labels { - m.Labels[k] = v - } - } - - if o.NamePrefixes != nil { - m.NamePrefixes = make([]string, len(o.NamePrefixes)) - copy(m.NamePrefixes, o.NamePrefixes) - } - -} - -func (m *ListSecretsResponse) Copy() *ListSecretsResponse { - if m == nil { - return nil - } - o := &ListSecretsResponse{} - o.CopyFrom(m) - return o -} - -func (m *ListSecretsResponse) CopyFrom(src interface{}) { - - o := src.(*ListSecretsResponse) - *m = *o - if o.Secrets != nil { - m.Secrets = make([]*Secret, len(o.Secrets)) - for i := range m.Secrets { - m.Secrets[i] = &Secret{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Secrets[i], o.Secrets[i]) - } - } - -} - -func (m *CreateSecretRequest) Copy() *CreateSecretRequest { - if m == nil { - return nil - } - o := &CreateSecretRequest{} - o.CopyFrom(m) - return o -} - -func (m *CreateSecretRequest) CopyFrom(src interface{}) { - - o := src.(*CreateSecretRequest) - *m = *o - if o.Spec != nil { - m.Spec = &SecretSpec{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Spec, o.Spec) - } -} - -func (m *CreateSecretResponse) Copy() *CreateSecretResponse { - if m == nil { - return nil - } - o := &CreateSecretResponse{} - o.CopyFrom(m) - return o -} - -func (m *CreateSecretResponse) CopyFrom(src interface{}) { - - o := src.(*CreateSecretResponse) - *m = *o - if o.Secret != nil { - m.Secret = &Secret{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Secret, o.Secret) - } -} - -func (m *RemoveSecretRequest) Copy() *RemoveSecretRequest { - if m == nil { - return nil - } - o := &RemoveSecretRequest{} - o.CopyFrom(m) - return o -} - -func (m *RemoveSecretRequest) CopyFrom(src interface{}) { - - o := src.(*RemoveSecretRequest) - *m = *o -} - -func (m *RemoveSecretResponse) Copy() *RemoveSecretResponse { - if m == nil { - return nil - } - o := &RemoveSecretResponse{} - o.CopyFrom(m) - return o -} - -func (m *RemoveSecretResponse) CopyFrom(src interface{}) {} -func (m *GetConfigRequest) Copy() *GetConfigRequest { - if m == nil { - return nil - } - o := &GetConfigRequest{} - o.CopyFrom(m) - return o -} - -func (m *GetConfigRequest) CopyFrom(src interface{}) { - - o := src.(*GetConfigRequest) - *m = *o -} - -func (m *GetConfigResponse) Copy() *GetConfigResponse { - if m == nil { - return nil - } - o := &GetConfigResponse{} - o.CopyFrom(m) - return o -} - -func (m *GetConfigResponse) CopyFrom(src interface{}) { - - o := src.(*GetConfigResponse) - *m = *o - if o.Config != nil { - m.Config = &Config{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Config, o.Config) - } -} - -func (m *UpdateConfigRequest) Copy() *UpdateConfigRequest { - if m == nil { - return nil - } - o := &UpdateConfigRequest{} - o.CopyFrom(m) - return o -} - -func (m *UpdateConfigRequest) CopyFrom(src interface{}) { - - o := src.(*UpdateConfigRequest) - *m = *o - if o.ConfigVersion != nil { - m.ConfigVersion = &Version{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.ConfigVersion, o.ConfigVersion) - } - if o.Spec != nil { - m.Spec = &ConfigSpec{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Spec, o.Spec) - } -} - -func (m *UpdateConfigResponse) Copy() *UpdateConfigResponse { - if m == nil { - return nil - } - o := &UpdateConfigResponse{} - o.CopyFrom(m) - return o -} - -func (m *UpdateConfigResponse) CopyFrom(src interface{}) { - - o := src.(*UpdateConfigResponse) - *m = *o - if o.Config != nil { - m.Config = &Config{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Config, o.Config) - } -} - -func (m *ListConfigsRequest) Copy() *ListConfigsRequest { - if m == nil { - return nil - } - o := &ListConfigsRequest{} - o.CopyFrom(m) - return o -} - -func (m *ListConfigsRequest) CopyFrom(src interface{}) { - - o := src.(*ListConfigsRequest) - *m = *o - if o.Filters != nil { - m.Filters = &ListConfigsRequest_Filters{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Filters, o.Filters) - } -} - -func (m *ListConfigsRequest_Filters) Copy() *ListConfigsRequest_Filters { - if m == nil { - return nil - } - o := &ListConfigsRequest_Filters{} - o.CopyFrom(m) - return o -} - -func (m *ListConfigsRequest_Filters) CopyFrom(src interface{}) { - - o := src.(*ListConfigsRequest_Filters) - *m = *o - if o.Names != nil { - m.Names = make([]string, len(o.Names)) - copy(m.Names, o.Names) - } - - if o.IDPrefixes != nil { - m.IDPrefixes = make([]string, len(o.IDPrefixes)) - copy(m.IDPrefixes, o.IDPrefixes) - } - - if o.Labels != nil { - m.Labels = make(map[string]string, len(o.Labels)) - for k, v := range o.Labels { - m.Labels[k] = v - } - } - - if o.NamePrefixes != nil { - m.NamePrefixes = make([]string, len(o.NamePrefixes)) - copy(m.NamePrefixes, o.NamePrefixes) - } - -} - -func (m *ListConfigsResponse) Copy() *ListConfigsResponse { - if m == nil { - return nil - } - o := &ListConfigsResponse{} - o.CopyFrom(m) - return o -} - -func (m *ListConfigsResponse) CopyFrom(src interface{}) { - - o := src.(*ListConfigsResponse) - *m = *o - if o.Configs != nil { - m.Configs = make([]*Config, len(o.Configs)) - for i := range m.Configs { - m.Configs[i] = &Config{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Configs[i], o.Configs[i]) - } - } - -} - -func (m *CreateConfigRequest) Copy() *CreateConfigRequest { - if m == nil { - return nil - } - o := &CreateConfigRequest{} - o.CopyFrom(m) - return o -} - -func (m *CreateConfigRequest) CopyFrom(src interface{}) { - - o := src.(*CreateConfigRequest) - *m = *o - if o.Spec != nil { - m.Spec = &ConfigSpec{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Spec, o.Spec) - } -} - -func (m *CreateConfigResponse) Copy() *CreateConfigResponse { - if m == nil { - return nil - } - o := &CreateConfigResponse{} - o.CopyFrom(m) - return o -} - -func (m *CreateConfigResponse) CopyFrom(src interface{}) { - - o := src.(*CreateConfigResponse) - *m = *o - if o.Config != nil { - m.Config = &Config{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Config, o.Config) - } -} - -func (m *RemoveConfigRequest) Copy() *RemoveConfigRequest { - if m == nil { - return nil - } - o := &RemoveConfigRequest{} - o.CopyFrom(m) - return o -} - -func (m *RemoveConfigRequest) CopyFrom(src interface{}) { - - o := src.(*RemoveConfigRequest) - *m = *o -} - -func (m *RemoveConfigResponse) Copy() *RemoveConfigResponse { - if m == nil { - return nil - } - o := &RemoveConfigResponse{} - o.CopyFrom(m) - return o -} - -func (m *RemoveConfigResponse) CopyFrom(src interface{}) {} -func (m *CreateExtensionRequest) Copy() *CreateExtensionRequest { - if m == nil { - return nil - } - o := &CreateExtensionRequest{} - o.CopyFrom(m) - return o -} - -func (m *CreateExtensionRequest) CopyFrom(src interface{}) { - - o := src.(*CreateExtensionRequest) - *m = *o - if o.Annotations != nil { - m.Annotations = &Annotations{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Annotations, o.Annotations) - } -} - -func (m *CreateExtensionResponse) Copy() *CreateExtensionResponse { - if m == nil { - return nil - } - o := &CreateExtensionResponse{} - o.CopyFrom(m) - return o -} - -func (m *CreateExtensionResponse) CopyFrom(src interface{}) { - - o := src.(*CreateExtensionResponse) - *m = *o - if o.Extension != nil { - m.Extension = &Extension{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Extension, o.Extension) - } -} - -func (m *RemoveExtensionRequest) Copy() *RemoveExtensionRequest { - if m == nil { - return nil - } - o := &RemoveExtensionRequest{} - o.CopyFrom(m) - return o -} - -func (m *RemoveExtensionRequest) CopyFrom(src interface{}) { - - o := src.(*RemoveExtensionRequest) - *m = *o -} - -func (m *RemoveExtensionResponse) Copy() *RemoveExtensionResponse { - if m == nil { - return nil - } - o := &RemoveExtensionResponse{} - o.CopyFrom(m) - return o -} - -func (m *RemoveExtensionResponse) CopyFrom(src interface{}) {} -func (m *GetExtensionRequest) Copy() *GetExtensionRequest { - if m == nil { - return nil - } - o := &GetExtensionRequest{} - o.CopyFrom(m) - return o -} - -func (m *GetExtensionRequest) CopyFrom(src interface{}) { - - o := src.(*GetExtensionRequest) - *m = *o -} - -func (m *GetExtensionResponse) Copy() *GetExtensionResponse { - if m == nil { - return nil - } - o := &GetExtensionResponse{} - o.CopyFrom(m) - return o -} - -func (m *GetExtensionResponse) CopyFrom(src interface{}) { - - o := src.(*GetExtensionResponse) - *m = *o - if o.Extension != nil { - m.Extension = &Extension{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Extension, o.Extension) - } -} - -func (m *CreateResourceRequest) Copy() *CreateResourceRequest { - if m == nil { - return nil - } - o := &CreateResourceRequest{} - o.CopyFrom(m) - return o -} - -func (m *CreateResourceRequest) CopyFrom(src interface{}) { - - o := src.(*CreateResourceRequest) - *m = *o - if o.Annotations != nil { - m.Annotations = &Annotations{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Annotations, o.Annotations) - } - if o.Payload != nil { - m.Payload = &types.Any{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Payload, o.Payload) - } -} - -func (m *CreateResourceResponse) Copy() *CreateResourceResponse { - if m == nil { - return nil - } - o := &CreateResourceResponse{} - o.CopyFrom(m) - return o -} - -func (m *CreateResourceResponse) CopyFrom(src interface{}) { - - o := src.(*CreateResourceResponse) - *m = *o - if o.Resource != nil { - m.Resource = &Resource{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Resource, o.Resource) - } -} - -func (m *RemoveResourceRequest) Copy() *RemoveResourceRequest { - if m == nil { - return nil - } - o := &RemoveResourceRequest{} - o.CopyFrom(m) - return o -} - -func (m *RemoveResourceRequest) CopyFrom(src interface{}) { - - o := src.(*RemoveResourceRequest) - *m = *o -} - -func (m *RemoveResourceResponse) Copy() *RemoveResourceResponse { - if m == nil { - return nil - } - o := &RemoveResourceResponse{} - o.CopyFrom(m) - return o -} - -func (m *RemoveResourceResponse) CopyFrom(src interface{}) {} -func (m *UpdateResourceRequest) Copy() *UpdateResourceRequest { - if m == nil { - return nil - } - o := &UpdateResourceRequest{} - o.CopyFrom(m) - return o -} - -func (m *UpdateResourceRequest) CopyFrom(src interface{}) { - - o := src.(*UpdateResourceRequest) - *m = *o - if o.ResourceVersion != nil { - m.ResourceVersion = &Version{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.ResourceVersion, o.ResourceVersion) - } - if o.Annotations != nil { - m.Annotations = &Annotations{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Annotations, o.Annotations) - } - if o.Payload != nil { - m.Payload = &types.Any{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Payload, o.Payload) - } -} - -func (m *UpdateResourceResponse) Copy() *UpdateResourceResponse { - if m == nil { - return nil - } - o := &UpdateResourceResponse{} - o.CopyFrom(m) - return o -} - -func (m *UpdateResourceResponse) CopyFrom(src interface{}) { - - o := src.(*UpdateResourceResponse) - *m = *o - if o.Resource != nil { - m.Resource = &Resource{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Resource, o.Resource) - } -} - -func (m *GetResourceRequest) Copy() *GetResourceRequest { - if m == nil { - return nil - } - o := &GetResourceRequest{} - o.CopyFrom(m) - return o -} - -func (m *GetResourceRequest) CopyFrom(src interface{}) { - - o := src.(*GetResourceRequest) - *m = *o -} - -func (m *GetResourceResponse) Copy() *GetResourceResponse { - if m == nil { - return nil - } - o := &GetResourceResponse{} - o.CopyFrom(m) - return o -} - -func (m *GetResourceResponse) CopyFrom(src interface{}) { - - o := src.(*GetResourceResponse) - *m = *o - if o.Resource != nil { - m.Resource = &Resource{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Resource, o.Resource) - } -} - -func (m *ListResourcesRequest) Copy() *ListResourcesRequest { - if m == nil { - return nil - } - o := &ListResourcesRequest{} - o.CopyFrom(m) - return o -} - -func (m *ListResourcesRequest) CopyFrom(src interface{}) { - - o := src.(*ListResourcesRequest) - *m = *o - if o.Filters != nil { - m.Filters = &ListResourcesRequest_Filters{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Filters, o.Filters) - } -} - -func (m *ListResourcesRequest_Filters) Copy() *ListResourcesRequest_Filters { - if m == nil { - return nil - } - o := &ListResourcesRequest_Filters{} - o.CopyFrom(m) - return o -} - -func (m *ListResourcesRequest_Filters) CopyFrom(src interface{}) { - - o := src.(*ListResourcesRequest_Filters) - *m = *o - if o.Names != nil { - m.Names = make([]string, len(o.Names)) - copy(m.Names, o.Names) - } - - if o.IDPrefixes != nil { - m.IDPrefixes = make([]string, len(o.IDPrefixes)) - copy(m.IDPrefixes, o.IDPrefixes) - } - - if o.Labels != nil { - m.Labels = make(map[string]string, len(o.Labels)) - for k, v := range o.Labels { - m.Labels[k] = v - } - } - - if o.NamePrefixes != nil { - m.NamePrefixes = make([]string, len(o.NamePrefixes)) - copy(m.NamePrefixes, o.NamePrefixes) - } - -} - -func (m *ListResourcesResponse) Copy() *ListResourcesResponse { - if m == nil { - return nil - } - o := &ListResourcesResponse{} - o.CopyFrom(m) - return o -} - -func (m *ListResourcesResponse) CopyFrom(src interface{}) { - - o := src.(*ListResourcesResponse) - *m = *o - if o.Resources != nil { - m.Resources = make([]*Resource, len(o.Resources)) - for i := range m.Resources { - m.Resources[i] = &Resource{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Resources[i], o.Resources[i]) - } - } - -} - -func (m *CreateVolumeRequest) Copy() *CreateVolumeRequest { - if m == nil { - return nil - } - o := &CreateVolumeRequest{} - o.CopyFrom(m) - return o -} - -func (m *CreateVolumeRequest) CopyFrom(src interface{}) { - - o := src.(*CreateVolumeRequest) - *m = *o - if o.Spec != nil { - m.Spec = &VolumeSpec{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Spec, o.Spec) - } -} - -func (m *CreateVolumeResponse) Copy() *CreateVolumeResponse { - if m == nil { - return nil - } - o := &CreateVolumeResponse{} - o.CopyFrom(m) - return o -} - -func (m *CreateVolumeResponse) CopyFrom(src interface{}) { - - o := src.(*CreateVolumeResponse) - *m = *o - if o.Volume != nil { - m.Volume = &Volume{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Volume, o.Volume) - } -} - -func (m *GetVolumeRequest) Copy() *GetVolumeRequest { - if m == nil { - return nil - } - o := &GetVolumeRequest{} - o.CopyFrom(m) - return o -} - -func (m *GetVolumeRequest) CopyFrom(src interface{}) { - - o := src.(*GetVolumeRequest) - *m = *o -} - -func (m *GetVolumeResponse) Copy() *GetVolumeResponse { - if m == nil { - return nil - } - o := &GetVolumeResponse{} - o.CopyFrom(m) - return o -} - -func (m *GetVolumeResponse) CopyFrom(src interface{}) { - - o := src.(*GetVolumeResponse) - *m = *o - if o.Volume != nil { - m.Volume = &Volume{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Volume, o.Volume) - } -} - -func (m *UpdateVolumeRequest) Copy() *UpdateVolumeRequest { - if m == nil { - return nil - } - o := &UpdateVolumeRequest{} - o.CopyFrom(m) - return o -} - -func (m *UpdateVolumeRequest) CopyFrom(src interface{}) { - - o := src.(*UpdateVolumeRequest) - *m = *o - if o.VolumeVersion != nil { - m.VolumeVersion = &Version{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.VolumeVersion, o.VolumeVersion) - } - if o.Spec != nil { - m.Spec = &VolumeSpec{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Spec, o.Spec) - } -} - -func (m *UpdateVolumeResponse) Copy() *UpdateVolumeResponse { - if m == nil { - return nil - } - o := &UpdateVolumeResponse{} - o.CopyFrom(m) - return o -} - -func (m *UpdateVolumeResponse) CopyFrom(src interface{}) { - - o := src.(*UpdateVolumeResponse) - *m = *o - if o.Volume != nil { - m.Volume = &Volume{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Volume, o.Volume) - } -} - -func (m *ListVolumesRequest) Copy() *ListVolumesRequest { - if m == nil { - return nil - } - o := &ListVolumesRequest{} - o.CopyFrom(m) - return o -} - -func (m *ListVolumesRequest) CopyFrom(src interface{}) { - - o := src.(*ListVolumesRequest) - *m = *o - if o.Filters != nil { - m.Filters = &ListVolumesRequest_Filters{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Filters, o.Filters) - } -} - -func (m *ListVolumesRequest_Filters) Copy() *ListVolumesRequest_Filters { - if m == nil { - return nil - } - o := &ListVolumesRequest_Filters{} - o.CopyFrom(m) - return o -} - -func (m *ListVolumesRequest_Filters) CopyFrom(src interface{}) { - - o := src.(*ListVolumesRequest_Filters) - *m = *o - if o.Names != nil { - m.Names = make([]string, len(o.Names)) - copy(m.Names, o.Names) - } - - if o.IDPrefixes != nil { - m.IDPrefixes = make([]string, len(o.IDPrefixes)) - copy(m.IDPrefixes, o.IDPrefixes) - } - - if o.Labels != nil { - m.Labels = make(map[string]string, len(o.Labels)) - for k, v := range o.Labels { - m.Labels[k] = v - } - } - - if o.NamePrefixes != nil { - m.NamePrefixes = make([]string, len(o.NamePrefixes)) - copy(m.NamePrefixes, o.NamePrefixes) - } - - if o.Groups != nil { - m.Groups = make([]string, len(o.Groups)) - copy(m.Groups, o.Groups) - } - - if o.Drivers != nil { - m.Drivers = make([]string, len(o.Drivers)) - copy(m.Drivers, o.Drivers) - } - -} - -func (m *ListVolumesResponse) Copy() *ListVolumesResponse { - if m == nil { - return nil - } - o := &ListVolumesResponse{} - o.CopyFrom(m) - return o -} - -func (m *ListVolumesResponse) CopyFrom(src interface{}) { - - o := src.(*ListVolumesResponse) - *m = *o - if o.Volumes != nil { - m.Volumes = make([]*Volume, len(o.Volumes)) - for i := range m.Volumes { - m.Volumes[i] = &Volume{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Volumes[i], o.Volumes[i]) - } - } - -} - -func (m *RemoveVolumeRequest) Copy() *RemoveVolumeRequest { - if m == nil { - return nil - } - o := &RemoveVolumeRequest{} - o.CopyFrom(m) - return o -} - -func (m *RemoveVolumeRequest) CopyFrom(src interface{}) { - - o := src.(*RemoveVolumeRequest) - *m = *o -} - -func (m *RemoveVolumeResponse) Copy() *RemoveVolumeResponse { - if m == nil { - return nil - } - o := &RemoveVolumeResponse{} - o.CopyFrom(m) - return o -} - -func (m *RemoveVolumeResponse) CopyFrom(src interface{}) {} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// ControlClient is the client API for Control service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ControlClient interface { - GetNode(ctx context.Context, in *GetNodeRequest, opts ...grpc.CallOption) (*GetNodeResponse, error) - ListNodes(ctx context.Context, in *ListNodesRequest, opts ...grpc.CallOption) (*ListNodesResponse, error) - UpdateNode(ctx context.Context, in *UpdateNodeRequest, opts ...grpc.CallOption) (*UpdateNodeResponse, error) - RemoveNode(ctx context.Context, in *RemoveNodeRequest, opts ...grpc.CallOption) (*RemoveNodeResponse, error) - GetTask(ctx context.Context, in *GetTaskRequest, opts ...grpc.CallOption) (*GetTaskResponse, error) - ListTasks(ctx context.Context, in *ListTasksRequest, opts ...grpc.CallOption) (*ListTasksResponse, error) - RemoveTask(ctx context.Context, in *RemoveTaskRequest, opts ...grpc.CallOption) (*RemoveTaskResponse, error) - GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceResponse, error) - ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) - CreateService(ctx context.Context, in *CreateServiceRequest, opts ...grpc.CallOption) (*CreateServiceResponse, error) - UpdateService(ctx context.Context, in *UpdateServiceRequest, opts ...grpc.CallOption) (*UpdateServiceResponse, error) - RemoveService(ctx context.Context, in *RemoveServiceRequest, opts ...grpc.CallOption) (*RemoveServiceResponse, error) - // ListServiceStatuses returns a `ListServiceStatusesResponse` with the - // status of the requested services, formed by computing the number of - // running vs desired tasks. It is provided as a shortcut or helper method, - // which allows a client to avoid having to calculate this value by listing - // all Tasks. If any service requested does not exist, it will be returned - // but with empty status values. - ListServiceStatuses(ctx context.Context, in *ListServiceStatusesRequest, opts ...grpc.CallOption) (*ListServiceStatusesResponse, error) - GetNetwork(ctx context.Context, in *GetNetworkRequest, opts ...grpc.CallOption) (*GetNetworkResponse, error) - ListNetworks(ctx context.Context, in *ListNetworksRequest, opts ...grpc.CallOption) (*ListNetworksResponse, error) - CreateNetwork(ctx context.Context, in *CreateNetworkRequest, opts ...grpc.CallOption) (*CreateNetworkResponse, error) - RemoveNetwork(ctx context.Context, in *RemoveNetworkRequest, opts ...grpc.CallOption) (*RemoveNetworkResponse, error) - GetCluster(ctx context.Context, in *GetClusterRequest, opts ...grpc.CallOption) (*GetClusterResponse, error) - ListClusters(ctx context.Context, in *ListClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) - UpdateCluster(ctx context.Context, in *UpdateClusterRequest, opts ...grpc.CallOption) (*UpdateClusterResponse, error) - // GetSecret returns a `GetSecretResponse` with a `Secret` with the same - // id as `GetSecretRequest.SecretID` - // - Returns `NotFound` if the Secret with the given id is not found. - // - Returns `InvalidArgument` if the `GetSecretRequest.SecretID` is empty. - // - Returns an error if getting fails. - GetSecret(ctx context.Context, in *GetSecretRequest, opts ...grpc.CallOption) (*GetSecretResponse, error) - // UpdateSecret returns a `UpdateSecretResponse` with a `Secret` with the same - // id as `GetSecretRequest.SecretID` - // - Returns `NotFound` if the Secret with the given id is not found. - // - Returns `InvalidArgument` if the `GetSecretRequest.SecretID` is empty. - // - Returns an error if updating fails. - UpdateSecret(ctx context.Context, in *UpdateSecretRequest, opts ...grpc.CallOption) (*UpdateSecretResponse, error) - // ListSecrets returns a `ListSecretResponse` with a list of all non-internal `Secret`s being - // managed, or all secrets matching any name in `ListSecretsRequest.Names`, any - // name prefix in `ListSecretsRequest.NamePrefixes`, any id in - // `ListSecretsRequest.SecretIDs`, or any id prefix in `ListSecretsRequest.IDPrefixes`. - // - Returns an error if listing fails. - ListSecrets(ctx context.Context, in *ListSecretsRequest, opts ...grpc.CallOption) (*ListSecretsResponse, error) - // CreateSecret creates and return a `CreateSecretResponse` with a `Secret` based - // on the provided `CreateSecretRequest.SecretSpec`. - // - Returns `InvalidArgument` if the `CreateSecretRequest.SecretSpec` is malformed, - // or if the secret data is too long or contains invalid characters. - // - Returns an error if the creation fails. - CreateSecret(ctx context.Context, in *CreateSecretRequest, opts ...grpc.CallOption) (*CreateSecretResponse, error) - // RemoveSecret removes the secret referenced by `RemoveSecretRequest.ID`. - // - Returns `InvalidArgument` if `RemoveSecretRequest.ID` is empty. - // - Returns `NotFound` if the a secret named `RemoveSecretRequest.ID` is not found. - // - Returns an error if the deletion fails. - RemoveSecret(ctx context.Context, in *RemoveSecretRequest, opts ...grpc.CallOption) (*RemoveSecretResponse, error) - // GetConfig returns a `GetConfigResponse` with a `Config` with the same - // id as `GetConfigRequest.ConfigID` - // - Returns `NotFound` if the Config with the given id is not found. - // - Returns `InvalidArgument` if the `GetConfigRequest.ConfigID` is empty. - // - Returns an error if getting fails. - GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*GetConfigResponse, error) - // UpdateConfig returns a `UpdateConfigResponse` with a `Config` with the same - // id as `GetConfigRequest.ConfigID` - // - Returns `NotFound` if the Config with the given id is not found. - // - Returns `InvalidArgument` if the `GetConfigRequest.ConfigID` is empty. - // - Returns an error if updating fails. - UpdateConfig(ctx context.Context, in *UpdateConfigRequest, opts ...grpc.CallOption) (*UpdateConfigResponse, error) - // ListConfigs returns a `ListConfigResponse` with a list of `Config`s being - // managed, or all configs matching any name in `ListConfigsRequest.Names`, any - // name prefix in `ListConfigsRequest.NamePrefixes`, any id in - // `ListConfigsRequest.ConfigIDs`, or any id prefix in `ListConfigsRequest.IDPrefixes`. - // - Returns an error if listing fails. - ListConfigs(ctx context.Context, in *ListConfigsRequest, opts ...grpc.CallOption) (*ListConfigsResponse, error) - // CreateConfig creates and return a `CreateConfigResponse` with a `Config` based - // on the provided `CreateConfigRequest.ConfigSpec`. - // - Returns `InvalidArgument` if the `CreateConfigRequest.ConfigSpec` is malformed, - // or if the config data is too long or contains invalid characters. - // - Returns an error if the creation fails. - CreateConfig(ctx context.Context, in *CreateConfigRequest, opts ...grpc.CallOption) (*CreateConfigResponse, error) - // RemoveConfig removes the config referenced by `RemoveConfigRequest.ID`. - // - Returns `InvalidArgument` if `RemoveConfigRequest.ID` is empty. - // - Returns `NotFound` if the a config named `RemoveConfigRequest.ID` is not found. - // - Returns an error if the deletion fails. - RemoveConfig(ctx context.Context, in *RemoveConfigRequest, opts ...grpc.CallOption) (*RemoveConfigResponse, error) - // GetExtension returns a `GetExtensionResponse` with a `Extension` with the same - // id as `GetExtensionRequest.ExtensionId` - // - Returns `NotFound` if the Extension with the given id is not found. - // - Returns `InvalidArgument` if the `GetExtensionRequest.ExtensionId` is empty. - // - Returns an error if the get fails. - GetExtension(ctx context.Context, in *GetExtensionRequest, opts ...grpc.CallOption) (*GetExtensionResponse, error) - // CreateExtension creates an `Extension` based on the provided `CreateExtensionRequest.Extension` - // and returns a `CreateExtensionResponse`. - // - Returns `InvalidArgument` if the `CreateExtensionRequest.Extension` is malformed, - // or fails validation. - // - Returns an error if the creation fails. - CreateExtension(ctx context.Context, in *CreateExtensionRequest, opts ...grpc.CallOption) (*CreateExtensionResponse, error) - // RemoveExtension removes the extension referenced by `RemoveExtensionRequest.ID`. - // - Returns `InvalidArgument` if `RemoveExtensionRequest.ExtensionId` is empty. - // - Returns `NotFound` if the an extension named `RemoveExtensionRequest.ExtensionId` is not found. - // - Returns an error if the deletion fails. - RemoveExtension(ctx context.Context, in *RemoveExtensionRequest, opts ...grpc.CallOption) (*RemoveExtensionResponse, error) - // GetResource returns a `GetResourceResponse` with a `Resource` with the same - // id as `GetResourceRequest.Resource` - // - Returns `NotFound` if the Resource with the given id is not found. - // - Returns `InvalidArgument` if the `GetResourceRequest.Resource` is empty. - // - Returns an error if getting fails. - GetResource(ctx context.Context, in *GetResourceRequest, opts ...grpc.CallOption) (*GetResourceResponse, error) - // UpdateResource updates the resource with the given `UpdateResourceRequest.Resource.Id` using the given `UpdateResourceRequest.Resource` and returns a `UpdateResourceResponse`. - // - Returns `NotFound` if the Resource with the given `UpdateResourceRequest.Resource.Id` is not found. - // - Returns `InvalidArgument` if the UpdateResourceRequest.Resource.Id` is empty. - // - Returns an error if updating fails. - UpdateResource(ctx context.Context, in *UpdateResourceRequest, opts ...grpc.CallOption) (*UpdateResourceResponse, error) - // ListResources returns a `ListResourcesResponse` with a list of `Resource`s stored in the raft store, - // or all resources matching any name in `ListConfigsRequest.Names`, any - // name prefix in `ListResourcesRequest.NamePrefixes`, any id in - // `ListResourcesRequest.ResourceIDs`, or any id prefix in `ListResourcesRequest.IDPrefixes`, - // extension name equal to `ListResourcesRequest.Extension`. - // - Returns an error if listing fails. - ListResources(ctx context.Context, in *ListResourcesRequest, opts ...grpc.CallOption) (*ListResourcesResponse, error) - // CreateResource returns a `CreateResourceResponse` after creating a `Resource` based - // on the provided `CreateResourceRequest.Resource`. - // - Returns `InvalidArgument` if the `CreateResourceRequest.Resource` is malformed, - // or if the config data is too long or contains invalid characters. - // - Returns an error if the creation fails. - CreateResource(ctx context.Context, in *CreateResourceRequest, opts ...grpc.CallOption) (*CreateResourceResponse, error) - // RemoveResource removes the `Resource` referenced by `RemoveResourceRequest.ResourceID`. - // - Returns `InvalidArgument` if `RemoveResourceRequest.ResourceID` is empty. - // - Returns `NotFound` if the a resource named `RemoveResourceRequest.ResourceID` is not found. - // - Returns an error if the deletion fails. - RemoveResource(ctx context.Context, in *RemoveResourceRequest, opts ...grpc.CallOption) (*RemoveResourceResponse, error) - // CreateVolume returns a `CreateVolumeResponse` with a `Volume` based on the - // provided `CreateVolumeRequest.VolumeSpec`. - // - Returns `InvalidArgument` if the `CreateVolumeRequest.VolumeSpec` is - // malformed. - CreateVolume(ctx context.Context, in *CreateVolumeRequest, opts ...grpc.CallOption) (*CreateVolumeResponse, error) - // GetVolume returns a `GetVolumeResponse` with a Volume with the same ID - // as `GetVolumeRequest.ID` - GetVolume(ctx context.Context, in *GetVolumeRequest, opts ...grpc.CallOption) (*GetVolumeResponse, error) - UpdateVolume(ctx context.Context, in *UpdateVolumeRequest, opts ...grpc.CallOption) (*UpdateVolumeResponse, error) - ListVolumes(ctx context.Context, in *ListVolumesRequest, opts ...grpc.CallOption) (*ListVolumesResponse, error) - RemoveVolume(ctx context.Context, in *RemoveVolumeRequest, opts ...grpc.CallOption) (*RemoveVolumeResponse, error) -} - -type controlClient struct { - cc *grpc.ClientConn -} - -func NewControlClient(cc *grpc.ClientConn) ControlClient { - return &controlClient{cc} -} - -func (c *controlClient) GetNode(ctx context.Context, in *GetNodeRequest, opts ...grpc.CallOption) (*GetNodeResponse, error) { - out := new(GetNodeResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/GetNode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) ListNodes(ctx context.Context, in *ListNodesRequest, opts ...grpc.CallOption) (*ListNodesResponse, error) { - out := new(ListNodesResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/ListNodes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) UpdateNode(ctx context.Context, in *UpdateNodeRequest, opts ...grpc.CallOption) (*UpdateNodeResponse, error) { - out := new(UpdateNodeResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/UpdateNode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) RemoveNode(ctx context.Context, in *RemoveNodeRequest, opts ...grpc.CallOption) (*RemoveNodeResponse, error) { - out := new(RemoveNodeResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/RemoveNode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) GetTask(ctx context.Context, in *GetTaskRequest, opts ...grpc.CallOption) (*GetTaskResponse, error) { - out := new(GetTaskResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/GetTask", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) ListTasks(ctx context.Context, in *ListTasksRequest, opts ...grpc.CallOption) (*ListTasksResponse, error) { - out := new(ListTasksResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/ListTasks", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) RemoveTask(ctx context.Context, in *RemoveTaskRequest, opts ...grpc.CallOption) (*RemoveTaskResponse, error) { - out := new(RemoveTaskResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/RemoveTask", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceResponse, error) { - out := new(GetServiceResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/GetService", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) { - out := new(ListServicesResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/ListServices", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) CreateService(ctx context.Context, in *CreateServiceRequest, opts ...grpc.CallOption) (*CreateServiceResponse, error) { - out := new(CreateServiceResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/CreateService", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) UpdateService(ctx context.Context, in *UpdateServiceRequest, opts ...grpc.CallOption) (*UpdateServiceResponse, error) { - out := new(UpdateServiceResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/UpdateService", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) RemoveService(ctx context.Context, in *RemoveServiceRequest, opts ...grpc.CallOption) (*RemoveServiceResponse, error) { - out := new(RemoveServiceResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/RemoveService", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) ListServiceStatuses(ctx context.Context, in *ListServiceStatusesRequest, opts ...grpc.CallOption) (*ListServiceStatusesResponse, error) { - out := new(ListServiceStatusesResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/ListServiceStatuses", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) GetNetwork(ctx context.Context, in *GetNetworkRequest, opts ...grpc.CallOption) (*GetNetworkResponse, error) { - out := new(GetNetworkResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/GetNetwork", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) ListNetworks(ctx context.Context, in *ListNetworksRequest, opts ...grpc.CallOption) (*ListNetworksResponse, error) { - out := new(ListNetworksResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/ListNetworks", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) CreateNetwork(ctx context.Context, in *CreateNetworkRequest, opts ...grpc.CallOption) (*CreateNetworkResponse, error) { - out := new(CreateNetworkResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/CreateNetwork", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) RemoveNetwork(ctx context.Context, in *RemoveNetworkRequest, opts ...grpc.CallOption) (*RemoveNetworkResponse, error) { - out := new(RemoveNetworkResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/RemoveNetwork", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) GetCluster(ctx context.Context, in *GetClusterRequest, opts ...grpc.CallOption) (*GetClusterResponse, error) { - out := new(GetClusterResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/GetCluster", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) ListClusters(ctx context.Context, in *ListClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) { - out := new(ListClustersResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/ListClusters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) UpdateCluster(ctx context.Context, in *UpdateClusterRequest, opts ...grpc.CallOption) (*UpdateClusterResponse, error) { - out := new(UpdateClusterResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/UpdateCluster", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) GetSecret(ctx context.Context, in *GetSecretRequest, opts ...grpc.CallOption) (*GetSecretResponse, error) { - out := new(GetSecretResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/GetSecret", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) UpdateSecret(ctx context.Context, in *UpdateSecretRequest, opts ...grpc.CallOption) (*UpdateSecretResponse, error) { - out := new(UpdateSecretResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/UpdateSecret", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) ListSecrets(ctx context.Context, in *ListSecretsRequest, opts ...grpc.CallOption) (*ListSecretsResponse, error) { - out := new(ListSecretsResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/ListSecrets", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) CreateSecret(ctx context.Context, in *CreateSecretRequest, opts ...grpc.CallOption) (*CreateSecretResponse, error) { - out := new(CreateSecretResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/CreateSecret", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) RemoveSecret(ctx context.Context, in *RemoveSecretRequest, opts ...grpc.CallOption) (*RemoveSecretResponse, error) { - out := new(RemoveSecretResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/RemoveSecret", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*GetConfigResponse, error) { - out := new(GetConfigResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/GetConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) UpdateConfig(ctx context.Context, in *UpdateConfigRequest, opts ...grpc.CallOption) (*UpdateConfigResponse, error) { - out := new(UpdateConfigResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/UpdateConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) ListConfigs(ctx context.Context, in *ListConfigsRequest, opts ...grpc.CallOption) (*ListConfigsResponse, error) { - out := new(ListConfigsResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/ListConfigs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) CreateConfig(ctx context.Context, in *CreateConfigRequest, opts ...grpc.CallOption) (*CreateConfigResponse, error) { - out := new(CreateConfigResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/CreateConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) RemoveConfig(ctx context.Context, in *RemoveConfigRequest, opts ...grpc.CallOption) (*RemoveConfigResponse, error) { - out := new(RemoveConfigResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/RemoveConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) GetExtension(ctx context.Context, in *GetExtensionRequest, opts ...grpc.CallOption) (*GetExtensionResponse, error) { - out := new(GetExtensionResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/GetExtension", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) CreateExtension(ctx context.Context, in *CreateExtensionRequest, opts ...grpc.CallOption) (*CreateExtensionResponse, error) { - out := new(CreateExtensionResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/CreateExtension", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) RemoveExtension(ctx context.Context, in *RemoveExtensionRequest, opts ...grpc.CallOption) (*RemoveExtensionResponse, error) { - out := new(RemoveExtensionResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/RemoveExtension", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) GetResource(ctx context.Context, in *GetResourceRequest, opts ...grpc.CallOption) (*GetResourceResponse, error) { - out := new(GetResourceResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/GetResource", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) UpdateResource(ctx context.Context, in *UpdateResourceRequest, opts ...grpc.CallOption) (*UpdateResourceResponse, error) { - out := new(UpdateResourceResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/UpdateResource", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) ListResources(ctx context.Context, in *ListResourcesRequest, opts ...grpc.CallOption) (*ListResourcesResponse, error) { - out := new(ListResourcesResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/ListResources", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) CreateResource(ctx context.Context, in *CreateResourceRequest, opts ...grpc.CallOption) (*CreateResourceResponse, error) { - out := new(CreateResourceResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/CreateResource", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) RemoveResource(ctx context.Context, in *RemoveResourceRequest, opts ...grpc.CallOption) (*RemoveResourceResponse, error) { - out := new(RemoveResourceResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/RemoveResource", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) CreateVolume(ctx context.Context, in *CreateVolumeRequest, opts ...grpc.CallOption) (*CreateVolumeResponse, error) { - out := new(CreateVolumeResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/CreateVolume", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) GetVolume(ctx context.Context, in *GetVolumeRequest, opts ...grpc.CallOption) (*GetVolumeResponse, error) { - out := new(GetVolumeResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/GetVolume", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) UpdateVolume(ctx context.Context, in *UpdateVolumeRequest, opts ...grpc.CallOption) (*UpdateVolumeResponse, error) { - out := new(UpdateVolumeResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/UpdateVolume", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) ListVolumes(ctx context.Context, in *ListVolumesRequest, opts ...grpc.CallOption) (*ListVolumesResponse, error) { - out := new(ListVolumesResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/ListVolumes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *controlClient) RemoveVolume(ctx context.Context, in *RemoveVolumeRequest, opts ...grpc.CallOption) (*RemoveVolumeResponse, error) { - out := new(RemoveVolumeResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Control/RemoveVolume", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ControlServer is the server API for Control service. -type ControlServer interface { - GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error) - ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) - UpdateNode(context.Context, *UpdateNodeRequest) (*UpdateNodeResponse, error) - RemoveNode(context.Context, *RemoveNodeRequest) (*RemoveNodeResponse, error) - GetTask(context.Context, *GetTaskRequest) (*GetTaskResponse, error) - ListTasks(context.Context, *ListTasksRequest) (*ListTasksResponse, error) - RemoveTask(context.Context, *RemoveTaskRequest) (*RemoveTaskResponse, error) - GetService(context.Context, *GetServiceRequest) (*GetServiceResponse, error) - ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) - CreateService(context.Context, *CreateServiceRequest) (*CreateServiceResponse, error) - UpdateService(context.Context, *UpdateServiceRequest) (*UpdateServiceResponse, error) - RemoveService(context.Context, *RemoveServiceRequest) (*RemoveServiceResponse, error) - // ListServiceStatuses returns a `ListServiceStatusesResponse` with the - // status of the requested services, formed by computing the number of - // running vs desired tasks. It is provided as a shortcut or helper method, - // which allows a client to avoid having to calculate this value by listing - // all Tasks. If any service requested does not exist, it will be returned - // but with empty status values. - ListServiceStatuses(context.Context, *ListServiceStatusesRequest) (*ListServiceStatusesResponse, error) - GetNetwork(context.Context, *GetNetworkRequest) (*GetNetworkResponse, error) - ListNetworks(context.Context, *ListNetworksRequest) (*ListNetworksResponse, error) - CreateNetwork(context.Context, *CreateNetworkRequest) (*CreateNetworkResponse, error) - RemoveNetwork(context.Context, *RemoveNetworkRequest) (*RemoveNetworkResponse, error) - GetCluster(context.Context, *GetClusterRequest) (*GetClusterResponse, error) - ListClusters(context.Context, *ListClustersRequest) (*ListClustersResponse, error) - UpdateCluster(context.Context, *UpdateClusterRequest) (*UpdateClusterResponse, error) - // GetSecret returns a `GetSecretResponse` with a `Secret` with the same - // id as `GetSecretRequest.SecretID` - // - Returns `NotFound` if the Secret with the given id is not found. - // - Returns `InvalidArgument` if the `GetSecretRequest.SecretID` is empty. - // - Returns an error if getting fails. - GetSecret(context.Context, *GetSecretRequest) (*GetSecretResponse, error) - // UpdateSecret returns a `UpdateSecretResponse` with a `Secret` with the same - // id as `GetSecretRequest.SecretID` - // - Returns `NotFound` if the Secret with the given id is not found. - // - Returns `InvalidArgument` if the `GetSecretRequest.SecretID` is empty. - // - Returns an error if updating fails. - UpdateSecret(context.Context, *UpdateSecretRequest) (*UpdateSecretResponse, error) - // ListSecrets returns a `ListSecretResponse` with a list of all non-internal `Secret`s being - // managed, or all secrets matching any name in `ListSecretsRequest.Names`, any - // name prefix in `ListSecretsRequest.NamePrefixes`, any id in - // `ListSecretsRequest.SecretIDs`, or any id prefix in `ListSecretsRequest.IDPrefixes`. - // - Returns an error if listing fails. - ListSecrets(context.Context, *ListSecretsRequest) (*ListSecretsResponse, error) - // CreateSecret creates and return a `CreateSecretResponse` with a `Secret` based - // on the provided `CreateSecretRequest.SecretSpec`. - // - Returns `InvalidArgument` if the `CreateSecretRequest.SecretSpec` is malformed, - // or if the secret data is too long or contains invalid characters. - // - Returns an error if the creation fails. - CreateSecret(context.Context, *CreateSecretRequest) (*CreateSecretResponse, error) - // RemoveSecret removes the secret referenced by `RemoveSecretRequest.ID`. - // - Returns `InvalidArgument` if `RemoveSecretRequest.ID` is empty. - // - Returns `NotFound` if the a secret named `RemoveSecretRequest.ID` is not found. - // - Returns an error if the deletion fails. - RemoveSecret(context.Context, *RemoveSecretRequest) (*RemoveSecretResponse, error) - // GetConfig returns a `GetConfigResponse` with a `Config` with the same - // id as `GetConfigRequest.ConfigID` - // - Returns `NotFound` if the Config with the given id is not found. - // - Returns `InvalidArgument` if the `GetConfigRequest.ConfigID` is empty. - // - Returns an error if getting fails. - GetConfig(context.Context, *GetConfigRequest) (*GetConfigResponse, error) - // UpdateConfig returns a `UpdateConfigResponse` with a `Config` with the same - // id as `GetConfigRequest.ConfigID` - // - Returns `NotFound` if the Config with the given id is not found. - // - Returns `InvalidArgument` if the `GetConfigRequest.ConfigID` is empty. - // - Returns an error if updating fails. - UpdateConfig(context.Context, *UpdateConfigRequest) (*UpdateConfigResponse, error) - // ListConfigs returns a `ListConfigResponse` with a list of `Config`s being - // managed, or all configs matching any name in `ListConfigsRequest.Names`, any - // name prefix in `ListConfigsRequest.NamePrefixes`, any id in - // `ListConfigsRequest.ConfigIDs`, or any id prefix in `ListConfigsRequest.IDPrefixes`. - // - Returns an error if listing fails. - ListConfigs(context.Context, *ListConfigsRequest) (*ListConfigsResponse, error) - // CreateConfig creates and return a `CreateConfigResponse` with a `Config` based - // on the provided `CreateConfigRequest.ConfigSpec`. - // - Returns `InvalidArgument` if the `CreateConfigRequest.ConfigSpec` is malformed, - // or if the config data is too long or contains invalid characters. - // - Returns an error if the creation fails. - CreateConfig(context.Context, *CreateConfigRequest) (*CreateConfigResponse, error) - // RemoveConfig removes the config referenced by `RemoveConfigRequest.ID`. - // - Returns `InvalidArgument` if `RemoveConfigRequest.ID` is empty. - // - Returns `NotFound` if the a config named `RemoveConfigRequest.ID` is not found. - // - Returns an error if the deletion fails. - RemoveConfig(context.Context, *RemoveConfigRequest) (*RemoveConfigResponse, error) - // GetExtension returns a `GetExtensionResponse` with a `Extension` with the same - // id as `GetExtensionRequest.ExtensionId` - // - Returns `NotFound` if the Extension with the given id is not found. - // - Returns `InvalidArgument` if the `GetExtensionRequest.ExtensionId` is empty. - // - Returns an error if the get fails. - GetExtension(context.Context, *GetExtensionRequest) (*GetExtensionResponse, error) - // CreateExtension creates an `Extension` based on the provided `CreateExtensionRequest.Extension` - // and returns a `CreateExtensionResponse`. - // - Returns `InvalidArgument` if the `CreateExtensionRequest.Extension` is malformed, - // or fails validation. - // - Returns an error if the creation fails. - CreateExtension(context.Context, *CreateExtensionRequest) (*CreateExtensionResponse, error) - // RemoveExtension removes the extension referenced by `RemoveExtensionRequest.ID`. - // - Returns `InvalidArgument` if `RemoveExtensionRequest.ExtensionId` is empty. - // - Returns `NotFound` if the an extension named `RemoveExtensionRequest.ExtensionId` is not found. - // - Returns an error if the deletion fails. - RemoveExtension(context.Context, *RemoveExtensionRequest) (*RemoveExtensionResponse, error) - // GetResource returns a `GetResourceResponse` with a `Resource` with the same - // id as `GetResourceRequest.Resource` - // - Returns `NotFound` if the Resource with the given id is not found. - // - Returns `InvalidArgument` if the `GetResourceRequest.Resource` is empty. - // - Returns an error if getting fails. - GetResource(context.Context, *GetResourceRequest) (*GetResourceResponse, error) - // UpdateResource updates the resource with the given `UpdateResourceRequest.Resource.Id` using the given `UpdateResourceRequest.Resource` and returns a `UpdateResourceResponse`. - // - Returns `NotFound` if the Resource with the given `UpdateResourceRequest.Resource.Id` is not found. - // - Returns `InvalidArgument` if the UpdateResourceRequest.Resource.Id` is empty. - // - Returns an error if updating fails. - UpdateResource(context.Context, *UpdateResourceRequest) (*UpdateResourceResponse, error) - // ListResources returns a `ListResourcesResponse` with a list of `Resource`s stored in the raft store, - // or all resources matching any name in `ListConfigsRequest.Names`, any - // name prefix in `ListResourcesRequest.NamePrefixes`, any id in - // `ListResourcesRequest.ResourceIDs`, or any id prefix in `ListResourcesRequest.IDPrefixes`, - // extension name equal to `ListResourcesRequest.Extension`. - // - Returns an error if listing fails. - ListResources(context.Context, *ListResourcesRequest) (*ListResourcesResponse, error) - // CreateResource returns a `CreateResourceResponse` after creating a `Resource` based - // on the provided `CreateResourceRequest.Resource`. - // - Returns `InvalidArgument` if the `CreateResourceRequest.Resource` is malformed, - // or if the config data is too long or contains invalid characters. - // - Returns an error if the creation fails. - CreateResource(context.Context, *CreateResourceRequest) (*CreateResourceResponse, error) - // RemoveResource removes the `Resource` referenced by `RemoveResourceRequest.ResourceID`. - // - Returns `InvalidArgument` if `RemoveResourceRequest.ResourceID` is empty. - // - Returns `NotFound` if the a resource named `RemoveResourceRequest.ResourceID` is not found. - // - Returns an error if the deletion fails. - RemoveResource(context.Context, *RemoveResourceRequest) (*RemoveResourceResponse, error) - // CreateVolume returns a `CreateVolumeResponse` with a `Volume` based on the - // provided `CreateVolumeRequest.VolumeSpec`. - // - Returns `InvalidArgument` if the `CreateVolumeRequest.VolumeSpec` is - // malformed. - CreateVolume(context.Context, *CreateVolumeRequest) (*CreateVolumeResponse, error) - // GetVolume returns a `GetVolumeResponse` with a Volume with the same ID - // as `GetVolumeRequest.ID` - GetVolume(context.Context, *GetVolumeRequest) (*GetVolumeResponse, error) - UpdateVolume(context.Context, *UpdateVolumeRequest) (*UpdateVolumeResponse, error) - ListVolumes(context.Context, *ListVolumesRequest) (*ListVolumesResponse, error) - RemoveVolume(context.Context, *RemoveVolumeRequest) (*RemoveVolumeResponse, error) -} - -// UnimplementedControlServer can be embedded to have forward compatible implementations. -type UnimplementedControlServer struct { -} - -func (*UnimplementedControlServer) GetNode(ctx context.Context, req *GetNodeRequest) (*GetNodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetNode not implemented") -} -func (*UnimplementedControlServer) ListNodes(ctx context.Context, req *ListNodesRequest) (*ListNodesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListNodes not implemented") -} -func (*UnimplementedControlServer) UpdateNode(ctx context.Context, req *UpdateNodeRequest) (*UpdateNodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateNode not implemented") -} -func (*UnimplementedControlServer) RemoveNode(ctx context.Context, req *RemoveNodeRequest) (*RemoveNodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveNode not implemented") -} -func (*UnimplementedControlServer) GetTask(ctx context.Context, req *GetTaskRequest) (*GetTaskResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTask not implemented") -} -func (*UnimplementedControlServer) ListTasks(ctx context.Context, req *ListTasksRequest) (*ListTasksResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListTasks not implemented") -} -func (*UnimplementedControlServer) RemoveTask(ctx context.Context, req *RemoveTaskRequest) (*RemoveTaskResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveTask not implemented") -} -func (*UnimplementedControlServer) GetService(ctx context.Context, req *GetServiceRequest) (*GetServiceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetService not implemented") -} -func (*UnimplementedControlServer) ListServices(ctx context.Context, req *ListServicesRequest) (*ListServicesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListServices not implemented") -} -func (*UnimplementedControlServer) CreateService(ctx context.Context, req *CreateServiceRequest) (*CreateServiceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateService not implemented") -} -func (*UnimplementedControlServer) UpdateService(ctx context.Context, req *UpdateServiceRequest) (*UpdateServiceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateService not implemented") -} -func (*UnimplementedControlServer) RemoveService(ctx context.Context, req *RemoveServiceRequest) (*RemoveServiceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveService not implemented") -} -func (*UnimplementedControlServer) ListServiceStatuses(ctx context.Context, req *ListServiceStatusesRequest) (*ListServiceStatusesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListServiceStatuses not implemented") -} -func (*UnimplementedControlServer) GetNetwork(ctx context.Context, req *GetNetworkRequest) (*GetNetworkResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetNetwork not implemented") -} -func (*UnimplementedControlServer) ListNetworks(ctx context.Context, req *ListNetworksRequest) (*ListNetworksResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListNetworks not implemented") -} -func (*UnimplementedControlServer) CreateNetwork(ctx context.Context, req *CreateNetworkRequest) (*CreateNetworkResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateNetwork not implemented") -} -func (*UnimplementedControlServer) RemoveNetwork(ctx context.Context, req *RemoveNetworkRequest) (*RemoveNetworkResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveNetwork not implemented") -} -func (*UnimplementedControlServer) GetCluster(ctx context.Context, req *GetClusterRequest) (*GetClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetCluster not implemented") -} -func (*UnimplementedControlServer) ListClusters(ctx context.Context, req *ListClustersRequest) (*ListClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListClusters not implemented") -} -func (*UnimplementedControlServer) UpdateCluster(ctx context.Context, req *UpdateClusterRequest) (*UpdateClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateCluster not implemented") -} -func (*UnimplementedControlServer) GetSecret(ctx context.Context, req *GetSecretRequest) (*GetSecretResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSecret not implemented") -} -func (*UnimplementedControlServer) UpdateSecret(ctx context.Context, req *UpdateSecretRequest) (*UpdateSecretResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateSecret not implemented") -} -func (*UnimplementedControlServer) ListSecrets(ctx context.Context, req *ListSecretsRequest) (*ListSecretsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListSecrets not implemented") -} -func (*UnimplementedControlServer) CreateSecret(ctx context.Context, req *CreateSecretRequest) (*CreateSecretResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateSecret not implemented") -} -func (*UnimplementedControlServer) RemoveSecret(ctx context.Context, req *RemoveSecretRequest) (*RemoveSecretResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveSecret not implemented") -} -func (*UnimplementedControlServer) GetConfig(ctx context.Context, req *GetConfigRequest) (*GetConfigResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetConfig not implemented") -} -func (*UnimplementedControlServer) UpdateConfig(ctx context.Context, req *UpdateConfigRequest) (*UpdateConfigResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateConfig not implemented") -} -func (*UnimplementedControlServer) ListConfigs(ctx context.Context, req *ListConfigsRequest) (*ListConfigsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListConfigs not implemented") -} -func (*UnimplementedControlServer) CreateConfig(ctx context.Context, req *CreateConfigRequest) (*CreateConfigResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateConfig not implemented") -} -func (*UnimplementedControlServer) RemoveConfig(ctx context.Context, req *RemoveConfigRequest) (*RemoveConfigResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveConfig not implemented") -} -func (*UnimplementedControlServer) GetExtension(ctx context.Context, req *GetExtensionRequest) (*GetExtensionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExtension not implemented") -} -func (*UnimplementedControlServer) CreateExtension(ctx context.Context, req *CreateExtensionRequest) (*CreateExtensionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateExtension not implemented") -} -func (*UnimplementedControlServer) RemoveExtension(ctx context.Context, req *RemoveExtensionRequest) (*RemoveExtensionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveExtension not implemented") -} -func (*UnimplementedControlServer) GetResource(ctx context.Context, req *GetResourceRequest) (*GetResourceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetResource not implemented") -} -func (*UnimplementedControlServer) UpdateResource(ctx context.Context, req *UpdateResourceRequest) (*UpdateResourceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateResource not implemented") -} -func (*UnimplementedControlServer) ListResources(ctx context.Context, req *ListResourcesRequest) (*ListResourcesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListResources not implemented") -} -func (*UnimplementedControlServer) CreateResource(ctx context.Context, req *CreateResourceRequest) (*CreateResourceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateResource not implemented") -} -func (*UnimplementedControlServer) RemoveResource(ctx context.Context, req *RemoveResourceRequest) (*RemoveResourceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveResource not implemented") -} -func (*UnimplementedControlServer) CreateVolume(ctx context.Context, req *CreateVolumeRequest) (*CreateVolumeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateVolume not implemented") -} -func (*UnimplementedControlServer) GetVolume(ctx context.Context, req *GetVolumeRequest) (*GetVolumeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetVolume not implemented") -} -func (*UnimplementedControlServer) UpdateVolume(ctx context.Context, req *UpdateVolumeRequest) (*UpdateVolumeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateVolume not implemented") -} -func (*UnimplementedControlServer) ListVolumes(ctx context.Context, req *ListVolumesRequest) (*ListVolumesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListVolumes not implemented") -} -func (*UnimplementedControlServer) RemoveVolume(ctx context.Context, req *RemoveVolumeRequest) (*RemoveVolumeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveVolume not implemented") -} - -func RegisterControlServer(s *grpc.Server, srv ControlServer) { - s.RegisterService(&_Control_serviceDesc, srv) -} - -func _Control_GetNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetNodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).GetNode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/GetNode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).GetNode(ctx, req.(*GetNodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_ListNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListNodesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).ListNodes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/ListNodes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).ListNodes(ctx, req.(*ListNodesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_UpdateNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateNodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).UpdateNode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/UpdateNode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).UpdateNode(ctx, req.(*UpdateNodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_RemoveNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveNodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).RemoveNode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/RemoveNode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).RemoveNode(ctx, req.(*RemoveNodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_GetTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetTaskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).GetTask(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/GetTask", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).GetTask(ctx, req.(*GetTaskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_ListTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListTasksRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).ListTasks(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/ListTasks", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).ListTasks(ctx, req.(*ListTasksRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_RemoveTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveTaskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).RemoveTask(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/RemoveTask", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).RemoveTask(ctx, req.(*RemoveTaskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_GetService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).GetService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/GetService", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).GetService(ctx, req.(*GetServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_ListServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListServicesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).ListServices(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/ListServices", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).ListServices(ctx, req.(*ListServicesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_CreateService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).CreateService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/CreateService", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).CreateService(ctx, req.(*CreateServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_UpdateService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).UpdateService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/UpdateService", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).UpdateService(ctx, req.(*UpdateServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_RemoveService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).RemoveService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/RemoveService", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).RemoveService(ctx, req.(*RemoveServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_ListServiceStatuses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListServiceStatusesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).ListServiceStatuses(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/ListServiceStatuses", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).ListServiceStatuses(ctx, req.(*ListServiceStatusesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_GetNetwork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetNetworkRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).GetNetwork(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/GetNetwork", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).GetNetwork(ctx, req.(*GetNetworkRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_ListNetworks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListNetworksRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).ListNetworks(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/ListNetworks", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).ListNetworks(ctx, req.(*ListNetworksRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_CreateNetwork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateNetworkRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).CreateNetwork(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/CreateNetwork", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).CreateNetwork(ctx, req.(*CreateNetworkRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_RemoveNetwork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveNetworkRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).RemoveNetwork(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/RemoveNetwork", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).RemoveNetwork(ctx, req.(*RemoveNetworkRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_GetCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).GetCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/GetCluster", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).GetCluster(ctx, req.(*GetClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_ListClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListClustersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).ListClusters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/ListClusters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).ListClusters(ctx, req.(*ListClustersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_UpdateCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).UpdateCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/UpdateCluster", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).UpdateCluster(ctx, req.(*UpdateClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_GetSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSecretRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).GetSecret(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/GetSecret", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).GetSecret(ctx, req.(*GetSecretRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_UpdateSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateSecretRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).UpdateSecret(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/UpdateSecret", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).UpdateSecret(ctx, req.(*UpdateSecretRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_ListSecrets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListSecretsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).ListSecrets(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/ListSecrets", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).ListSecrets(ctx, req.(*ListSecretsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_CreateSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateSecretRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).CreateSecret(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/CreateSecret", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).CreateSecret(ctx, req.(*CreateSecretRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_RemoveSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveSecretRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).RemoveSecret(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/RemoveSecret", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).RemoveSecret(ctx, req.(*RemoveSecretRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_GetConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).GetConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/GetConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).GetConfig(ctx, req.(*GetConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_UpdateConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).UpdateConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/UpdateConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).UpdateConfig(ctx, req.(*UpdateConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_ListConfigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListConfigsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).ListConfigs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/ListConfigs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).ListConfigs(ctx, req.(*ListConfigsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_CreateConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).CreateConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/CreateConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).CreateConfig(ctx, req.(*CreateConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_RemoveConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).RemoveConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/RemoveConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).RemoveConfig(ctx, req.(*RemoveConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_GetExtension_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExtensionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).GetExtension(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/GetExtension", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).GetExtension(ctx, req.(*GetExtensionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_CreateExtension_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateExtensionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).CreateExtension(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/CreateExtension", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).CreateExtension(ctx, req.(*CreateExtensionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_RemoveExtension_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveExtensionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).RemoveExtension(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/RemoveExtension", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).RemoveExtension(ctx, req.(*RemoveExtensionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_GetResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetResourceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).GetResource(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/GetResource", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).GetResource(ctx, req.(*GetResourceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_UpdateResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateResourceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).UpdateResource(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/UpdateResource", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).UpdateResource(ctx, req.(*UpdateResourceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_ListResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListResourcesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).ListResources(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/ListResources", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).ListResources(ctx, req.(*ListResourcesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_CreateResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateResourceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).CreateResource(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/CreateResource", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).CreateResource(ctx, req.(*CreateResourceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_RemoveResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveResourceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).RemoveResource(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/RemoveResource", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).RemoveResource(ctx, req.(*RemoveResourceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_CreateVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateVolumeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).CreateVolume(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/CreateVolume", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).CreateVolume(ctx, req.(*CreateVolumeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_GetVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetVolumeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).GetVolume(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/GetVolume", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).GetVolume(ctx, req.(*GetVolumeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_UpdateVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateVolumeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).UpdateVolume(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/UpdateVolume", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).UpdateVolume(ctx, req.(*UpdateVolumeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_ListVolumes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListVolumesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).ListVolumes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/ListVolumes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).ListVolumes(ctx, req.(*ListVolumesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Control_RemoveVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveVolumeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).RemoveVolume(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Control/RemoveVolume", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).RemoveVolume(ctx, req.(*RemoveVolumeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Control_serviceDesc = grpc.ServiceDesc{ - ServiceName: "docker.swarmkit.v1.Control", - HandlerType: (*ControlServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetNode", - Handler: _Control_GetNode_Handler, - }, - { - MethodName: "ListNodes", - Handler: _Control_ListNodes_Handler, - }, - { - MethodName: "UpdateNode", - Handler: _Control_UpdateNode_Handler, - }, - { - MethodName: "RemoveNode", - Handler: _Control_RemoveNode_Handler, - }, - { - MethodName: "GetTask", - Handler: _Control_GetTask_Handler, - }, - { - MethodName: "ListTasks", - Handler: _Control_ListTasks_Handler, - }, - { - MethodName: "RemoveTask", - Handler: _Control_RemoveTask_Handler, - }, - { - MethodName: "GetService", - Handler: _Control_GetService_Handler, - }, - { - MethodName: "ListServices", - Handler: _Control_ListServices_Handler, - }, - { - MethodName: "CreateService", - Handler: _Control_CreateService_Handler, - }, - { - MethodName: "UpdateService", - Handler: _Control_UpdateService_Handler, - }, - { - MethodName: "RemoveService", - Handler: _Control_RemoveService_Handler, - }, - { - MethodName: "ListServiceStatuses", - Handler: _Control_ListServiceStatuses_Handler, - }, - { - MethodName: "GetNetwork", - Handler: _Control_GetNetwork_Handler, - }, - { - MethodName: "ListNetworks", - Handler: _Control_ListNetworks_Handler, - }, - { - MethodName: "CreateNetwork", - Handler: _Control_CreateNetwork_Handler, - }, - { - MethodName: "RemoveNetwork", - Handler: _Control_RemoveNetwork_Handler, - }, - { - MethodName: "GetCluster", - Handler: _Control_GetCluster_Handler, - }, - { - MethodName: "ListClusters", - Handler: _Control_ListClusters_Handler, - }, - { - MethodName: "UpdateCluster", - Handler: _Control_UpdateCluster_Handler, - }, - { - MethodName: "GetSecret", - Handler: _Control_GetSecret_Handler, - }, - { - MethodName: "UpdateSecret", - Handler: _Control_UpdateSecret_Handler, - }, - { - MethodName: "ListSecrets", - Handler: _Control_ListSecrets_Handler, - }, - { - MethodName: "CreateSecret", - Handler: _Control_CreateSecret_Handler, - }, - { - MethodName: "RemoveSecret", - Handler: _Control_RemoveSecret_Handler, - }, - { - MethodName: "GetConfig", - Handler: _Control_GetConfig_Handler, - }, - { - MethodName: "UpdateConfig", - Handler: _Control_UpdateConfig_Handler, - }, - { - MethodName: "ListConfigs", - Handler: _Control_ListConfigs_Handler, - }, - { - MethodName: "CreateConfig", - Handler: _Control_CreateConfig_Handler, - }, - { - MethodName: "RemoveConfig", - Handler: _Control_RemoveConfig_Handler, - }, - { - MethodName: "GetExtension", - Handler: _Control_GetExtension_Handler, - }, - { - MethodName: "CreateExtension", - Handler: _Control_CreateExtension_Handler, - }, - { - MethodName: "RemoveExtension", - Handler: _Control_RemoveExtension_Handler, - }, - { - MethodName: "GetResource", - Handler: _Control_GetResource_Handler, - }, - { - MethodName: "UpdateResource", - Handler: _Control_UpdateResource_Handler, - }, - { - MethodName: "ListResources", - Handler: _Control_ListResources_Handler, - }, - { - MethodName: "CreateResource", - Handler: _Control_CreateResource_Handler, - }, - { - MethodName: "RemoveResource", - Handler: _Control_RemoveResource_Handler, - }, - { - MethodName: "CreateVolume", - Handler: _Control_CreateVolume_Handler, - }, - { - MethodName: "GetVolume", - Handler: _Control_GetVolume_Handler, - }, - { - MethodName: "UpdateVolume", - Handler: _Control_UpdateVolume_Handler, - }, - { - MethodName: "ListVolumes", - Handler: _Control_ListVolumes_Handler, - }, - { - MethodName: "RemoveVolume", - Handler: _Control_RemoveVolume_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/docker/swarmkit/api/control.proto", -} - -func (m *GetNodeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetNodeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetNodeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NodeID) > 0 { - i -= len(m.NodeID) - copy(dAtA[i:], m.NodeID) - i = encodeVarintControl(dAtA, i, uint64(len(m.NodeID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetNodeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetNodeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetNodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Node != nil { - { - size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListNodesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListNodesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListNodesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Filters != nil { - { - size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListNodesRequest_Filters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListNodesRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListNodesRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NodeLabels) > 0 { - for k := range m.NodeLabels { - v := m.NodeLabels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintControl(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintControl(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x3a - } - } - if len(m.NamePrefixes) > 0 { - for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.NamePrefixes[iNdEx]) - copy(dAtA[i:], m.NamePrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.Roles) > 0 { - for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarintControl(dAtA, i, uint64(m.Roles[iNdEx])) - i-- - dAtA[i] = 0x28 - } - } - if len(m.Memberships) > 0 { - for iNdEx := len(m.Memberships) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarintControl(dAtA, i, uint64(m.Memberships[iNdEx])) - i-- - dAtA[i] = 0x20 - } - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintControl(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintControl(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.IDPrefixes) > 0 { - for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.IDPrefixes[iNdEx]) - copy(dAtA[i:], m.IDPrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Names) > 0 { - for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Names[iNdEx]) - copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ListNodesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListNodesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListNodesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Nodes) > 0 { - for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *UpdateNodeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateNodeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateNodeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Spec != nil { - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.NodeVersion != nil { - { - size, err := m.NodeVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.NodeID) > 0 { - i -= len(m.NodeID) - copy(dAtA[i:], m.NodeID) - i = encodeVarintControl(dAtA, i, uint64(len(m.NodeID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateNodeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateNodeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateNodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Node != nil { - { - size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveNodeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveNodeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveNodeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Force { - i-- - if m.Force { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.NodeID) > 0 { - i -= len(m.NodeID) - copy(dAtA[i:], m.NodeID) - i = encodeVarintControl(dAtA, i, uint64(len(m.NodeID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveNodeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveNodeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveNodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *GetTaskRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetTaskRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TaskID) > 0 { - i -= len(m.TaskID) - copy(dAtA[i:], m.TaskID) - i = encodeVarintControl(dAtA, i, uint64(len(m.TaskID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetTaskResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetTaskResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetTaskResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Task != nil { - { - size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveTaskRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveTaskRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TaskID) > 0 { - i -= len(m.TaskID) - copy(dAtA[i:], m.TaskID) - i = encodeVarintControl(dAtA, i, uint64(len(m.TaskID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveTaskResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveTaskResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveTaskResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *ListTasksRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListTasksRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListTasksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Filters != nil { - { - size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListTasksRequest_Filters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListTasksRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListTasksRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Runtimes) > 0 { - for iNdEx := len(m.Runtimes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Runtimes[iNdEx]) - copy(dAtA[i:], m.Runtimes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.Runtimes[iNdEx]))) - i-- - dAtA[i] = 0x4a - } - } - if m.UpToDate { - i-- - if m.UpToDate { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if len(m.NamePrefixes) > 0 { - for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.NamePrefixes[iNdEx]) - copy(dAtA[i:], m.NamePrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) - i-- - dAtA[i] = 0x3a - } - } - if len(m.DesiredStates) > 0 { - for iNdEx := len(m.DesiredStates) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarintControl(dAtA, i, uint64(m.DesiredStates[iNdEx])) - i-- - dAtA[i] = 0x30 - } - } - if len(m.NodeIDs) > 0 { - for iNdEx := len(m.NodeIDs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.NodeIDs[iNdEx]) - copy(dAtA[i:], m.NodeIDs[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.NodeIDs[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(m.ServiceIDs) > 0 { - for iNdEx := len(m.ServiceIDs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ServiceIDs[iNdEx]) - copy(dAtA[i:], m.ServiceIDs[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceIDs[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintControl(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintControl(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.IDPrefixes) > 0 { - for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.IDPrefixes[iNdEx]) - copy(dAtA[i:], m.IDPrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Names) > 0 { - for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Names[iNdEx]) - copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ListTasksResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListTasksResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListTasksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Tasks) > 0 { - for iNdEx := len(m.Tasks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Tasks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *CreateServiceRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CreateServiceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CreateServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Spec != nil { - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CreateServiceResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CreateServiceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CreateServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Service != nil { - { - size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetServiceRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetServiceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.InsertDefaults { - i-- - if m.InsertDefaults { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.ServiceID) > 0 { - i -= len(m.ServiceID) - copy(dAtA[i:], m.ServiceID) - i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetServiceResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetServiceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Service != nil { - { - size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateServiceRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateServiceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Rollback != 0 { - i = encodeVarintControl(dAtA, i, uint64(m.Rollback)) - i-- - dAtA[i] = 0x20 - } - if m.Spec != nil { - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.ServiceVersion != nil { - { - size, err := m.ServiceVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ServiceID) > 0 { - i -= len(m.ServiceID) - copy(dAtA[i:], m.ServiceID) - i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateServiceResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateServiceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Service != nil { - { - size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveServiceRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveServiceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ServiceID) > 0 { - i -= len(m.ServiceID) - copy(dAtA[i:], m.ServiceID) - i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveServiceResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveServiceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *ListServicesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListServicesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListServicesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Filters != nil { - { - size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListServicesRequest_Filters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListServicesRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListServicesRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Runtimes) > 0 { - for iNdEx := len(m.Runtimes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Runtimes[iNdEx]) - copy(dAtA[i:], m.Runtimes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.Runtimes[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(m.NamePrefixes) > 0 { - for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.NamePrefixes[iNdEx]) - copy(dAtA[i:], m.NamePrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintControl(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintControl(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.IDPrefixes) > 0 { - for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.IDPrefixes[iNdEx]) - copy(dAtA[i:], m.IDPrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Names) > 0 { - for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Names[iNdEx]) - copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ListServicesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListServicesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListServicesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Services) > 0 { - for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Services[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ListServiceStatusesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListServiceStatusesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListServiceStatusesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Services) > 0 { - for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Services[iNdEx]) - copy(dAtA[i:], m.Services[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.Services[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ListServiceStatusesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListServiceStatusesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListServiceStatusesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Statuses) > 0 { - for iNdEx := len(m.Statuses) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Statuses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ListServiceStatusesResponse_ServiceStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListServiceStatusesResponse_ServiceStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListServiceStatusesResponse_ServiceStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.CompletedTasks != 0 { - i = encodeVarintControl(dAtA, i, uint64(m.CompletedTasks)) - i-- - dAtA[i] = 0x20 - } - if m.RunningTasks != 0 { - i = encodeVarintControl(dAtA, i, uint64(m.RunningTasks)) - i-- - dAtA[i] = 0x18 - } - if m.DesiredTasks != 0 { - i = encodeVarintControl(dAtA, i, uint64(m.DesiredTasks)) - i-- - dAtA[i] = 0x10 - } - if len(m.ServiceID) > 0 { - i -= len(m.ServiceID) - copy(dAtA[i:], m.ServiceID) - i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CreateNetworkRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CreateNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CreateNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Spec != nil { - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CreateNetworkResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CreateNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CreateNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Network != nil { - { - size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetNetworkRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NetworkID) > 0 { - i -= len(m.NetworkID) - copy(dAtA[i:], m.NetworkID) - i = encodeVarintControl(dAtA, i, uint64(len(m.NetworkID))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintControl(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetNetworkResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Network != nil { - { - size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveNetworkRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NetworkID) > 0 { - i -= len(m.NetworkID) - copy(dAtA[i:], m.NetworkID) - i = encodeVarintControl(dAtA, i, uint64(len(m.NetworkID))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintControl(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveNetworkResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *ListNetworksRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListNetworksRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListNetworksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Filters != nil { - { - size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListNetworksRequest_Filters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListNetworksRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListNetworksRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NamePrefixes) > 0 { - for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.NamePrefixes[iNdEx]) - copy(dAtA[i:], m.NamePrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintControl(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintControl(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.IDPrefixes) > 0 { - for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.IDPrefixes[iNdEx]) - copy(dAtA[i:], m.IDPrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Names) > 0 { - for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Names[iNdEx]) - copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ListNetworksResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListNetworksResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListNetworksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Networks) > 0 { - for iNdEx := len(m.Networks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Networks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *GetClusterRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetClusterRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetClusterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ClusterID) > 0 { - i -= len(m.ClusterID) - copy(dAtA[i:], m.ClusterID) - i = encodeVarintControl(dAtA, i, uint64(len(m.ClusterID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetClusterResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetClusterResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetClusterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Cluster != nil { - { - size, err := m.Cluster.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListClustersRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListClustersRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListClustersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Filters != nil { - { - size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListClustersRequest_Filters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListClustersRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListClustersRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NamePrefixes) > 0 { - for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.NamePrefixes[iNdEx]) - copy(dAtA[i:], m.NamePrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintControl(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintControl(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.IDPrefixes) > 0 { - for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.IDPrefixes[iNdEx]) - copy(dAtA[i:], m.IDPrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Names) > 0 { - for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Names[iNdEx]) - copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ListClustersResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListClustersResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListClustersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Clusters) > 0 { - for iNdEx := len(m.Clusters) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Clusters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *KeyRotation) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *KeyRotation) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *KeyRotation) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ManagerUnlockKey { - i-- - if m.ManagerUnlockKey { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.ManagerJoinToken { - i-- - if m.ManagerJoinToken { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.WorkerJoinToken { - i-- - if m.WorkerJoinToken { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *UpdateClusterRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateClusterRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateClusterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Rotation.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.Spec != nil { - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.ClusterVersion != nil { - { - size, err := m.ClusterVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ClusterID) > 0 { - i -= len(m.ClusterID) - copy(dAtA[i:], m.ClusterID) - i = encodeVarintControl(dAtA, i, uint64(len(m.ClusterID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateClusterResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateClusterResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateClusterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Cluster != nil { - { - size, err := m.Cluster.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetSecretRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetSecretRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetSecretRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SecretID) > 0 { - i -= len(m.SecretID) - copy(dAtA[i:], m.SecretID) - i = encodeVarintControl(dAtA, i, uint64(len(m.SecretID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetSecretResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetSecretResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetSecretResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Secret != nil { - { - size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateSecretRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateSecretRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateSecretRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Spec != nil { - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.SecretVersion != nil { - { - size, err := m.SecretVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.SecretID) > 0 { - i -= len(m.SecretID) - copy(dAtA[i:], m.SecretID) - i = encodeVarintControl(dAtA, i, uint64(len(m.SecretID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateSecretResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateSecretResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateSecretResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Secret != nil { - { - size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListSecretsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListSecretsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListSecretsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Filters != nil { - { - size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListSecretsRequest_Filters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListSecretsRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListSecretsRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NamePrefixes) > 0 { - for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.NamePrefixes[iNdEx]) - copy(dAtA[i:], m.NamePrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintControl(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintControl(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.IDPrefixes) > 0 { - for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.IDPrefixes[iNdEx]) - copy(dAtA[i:], m.IDPrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Names) > 0 { - for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Names[iNdEx]) - copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ListSecretsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListSecretsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListSecretsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Secrets) > 0 { - for iNdEx := len(m.Secrets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Secrets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *CreateSecretRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CreateSecretRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CreateSecretRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Spec != nil { - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CreateSecretResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CreateSecretResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CreateSecretResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Secret != nil { - { - size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveSecretRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveSecretRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveSecretRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SecretID) > 0 { - i -= len(m.SecretID) - copy(dAtA[i:], m.SecretID) - i = encodeVarintControl(dAtA, i, uint64(len(m.SecretID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveSecretResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveSecretResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveSecretResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *GetConfigRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetConfigRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ConfigID) > 0 { - i -= len(m.ConfigID) - copy(dAtA[i:], m.ConfigID) - i = encodeVarintControl(dAtA, i, uint64(len(m.ConfigID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetConfigResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetConfigResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Config != nil { - { - size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateConfigRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateConfigRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Spec != nil { - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.ConfigVersion != nil { - { - size, err := m.ConfigVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ConfigID) > 0 { - i -= len(m.ConfigID) - copy(dAtA[i:], m.ConfigID) - i = encodeVarintControl(dAtA, i, uint64(len(m.ConfigID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateConfigResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateConfigResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Config != nil { - { - size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListConfigsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListConfigsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListConfigsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Filters != nil { - { - size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListConfigsRequest_Filters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListConfigsRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListConfigsRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NamePrefixes) > 0 { - for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.NamePrefixes[iNdEx]) - copy(dAtA[i:], m.NamePrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintControl(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintControl(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.IDPrefixes) > 0 { - for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.IDPrefixes[iNdEx]) - copy(dAtA[i:], m.IDPrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Names) > 0 { - for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Names[iNdEx]) - copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ListConfigsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListConfigsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListConfigsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Configs) > 0 { - for iNdEx := len(m.Configs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Configs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *CreateConfigRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CreateConfigRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CreateConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Spec != nil { - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CreateConfigResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CreateConfigResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CreateConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Config != nil { - { - size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveConfigRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveConfigRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ConfigID) > 0 { - i -= len(m.ConfigID) - copy(dAtA[i:], m.ConfigID) - i = encodeVarintControl(dAtA, i, uint64(len(m.ConfigID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveConfigResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveConfigResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *CreateExtensionRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CreateExtensionRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CreateExtensionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintControl(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if m.Annotations != nil { - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CreateExtensionResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CreateExtensionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CreateExtensionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Extension != nil { - { - size, err := m.Extension.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveExtensionRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveExtensionRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveExtensionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ExtensionID) > 0 { - i -= len(m.ExtensionID) - copy(dAtA[i:], m.ExtensionID) - i = encodeVarintControl(dAtA, i, uint64(len(m.ExtensionID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveExtensionResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveExtensionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveExtensionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *GetExtensionRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetExtensionRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetExtensionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ExtensionID) > 0 { - i -= len(m.ExtensionID) - copy(dAtA[i:], m.ExtensionID) - i = encodeVarintControl(dAtA, i, uint64(len(m.ExtensionID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetExtensionResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetExtensionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetExtensionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Extension != nil { - { - size, err := m.Extension.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CreateResourceRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CreateResourceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CreateResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Payload != nil { - { - size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Kind) > 0 { - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintControl(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0x12 - } - if m.Annotations != nil { - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CreateResourceResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CreateResourceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CreateResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Resource != nil { - { - size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveResourceRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveResourceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ResourceID) > 0 { - i -= len(m.ResourceID) - copy(dAtA[i:], m.ResourceID) - i = encodeVarintControl(dAtA, i, uint64(len(m.ResourceID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveResourceResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveResourceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *UpdateResourceRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateResourceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Payload != nil { - { - size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Annotations != nil { - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.ResourceVersion != nil { - { - size, err := m.ResourceVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ResourceID) > 0 { - i -= len(m.ResourceID) - copy(dAtA[i:], m.ResourceID) - i = encodeVarintControl(dAtA, i, uint64(len(m.ResourceID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateResourceResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateResourceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Resource != nil { - { - size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetResourceRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetResourceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ResourceID) > 0 { - i -= len(m.ResourceID) - copy(dAtA[i:], m.ResourceID) - i = encodeVarintControl(dAtA, i, uint64(len(m.ResourceID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetResourceResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetResourceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Resource != nil { - { - size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListResourcesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListResourcesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Filters != nil { - { - size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListResourcesRequest_Filters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListResourcesRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListResourcesRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Kind) > 0 { - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintControl(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0x2a - } - if len(m.NamePrefixes) > 0 { - for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.NamePrefixes[iNdEx]) - copy(dAtA[i:], m.NamePrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintControl(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintControl(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.IDPrefixes) > 0 { - for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.IDPrefixes[iNdEx]) - copy(dAtA[i:], m.IDPrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Names) > 0 { - for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Names[iNdEx]) - copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ListResourcesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListResourcesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Resources) > 0 { - for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *CreateVolumeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CreateVolumeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CreateVolumeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Spec != nil { - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CreateVolumeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CreateVolumeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CreateVolumeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Volume != nil { - { - size, err := m.Volume.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetVolumeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetVolumeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetVolumeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.VolumeID) > 0 { - i -= len(m.VolumeID) - copy(dAtA[i:], m.VolumeID) - i = encodeVarintControl(dAtA, i, uint64(len(m.VolumeID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetVolumeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetVolumeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetVolumeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Volume != nil { - { - size, err := m.Volume.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateVolumeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateVolumeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateVolumeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Spec != nil { - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.VolumeVersion != nil { - { - size, err := m.VolumeVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.VolumeID) > 0 { - i -= len(m.VolumeID) - copy(dAtA[i:], m.VolumeID) - i = encodeVarintControl(dAtA, i, uint64(len(m.VolumeID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateVolumeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateVolumeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateVolumeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Volume != nil { - { - size, err := m.Volume.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListVolumesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListVolumesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListVolumesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Filters != nil { - { - size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListVolumesRequest_Filters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListVolumesRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListVolumesRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Drivers) > 0 { - for iNdEx := len(m.Drivers) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Drivers[iNdEx]) - copy(dAtA[i:], m.Drivers[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.Drivers[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.Groups) > 0 { - for iNdEx := len(m.Groups) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Groups[iNdEx]) - copy(dAtA[i:], m.Groups[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.Groups[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(m.NamePrefixes) > 0 { - for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.NamePrefixes[iNdEx]) - copy(dAtA[i:], m.NamePrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintControl(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintControl(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.IDPrefixes) > 0 { - for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.IDPrefixes[iNdEx]) - copy(dAtA[i:], m.IDPrefixes[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Names) > 0 { - for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Names[iNdEx]) - copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ListVolumesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListVolumesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListVolumesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Volumes) > 0 { - for iNdEx := len(m.Volumes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Volumes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *RemoveVolumeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveVolumeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveVolumeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Force { - i-- - if m.Force { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.VolumeID) > 0 { - i -= len(m.VolumeID) - copy(dAtA[i:], m.VolumeID) - i = encodeVarintControl(dAtA, i, uint64(len(m.VolumeID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RemoveVolumeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoveVolumeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoveVolumeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintControl(dAtA []byte, offset int, v uint64) int { - offset -= sovControl(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -type raftProxyControlServer struct { - local ControlServer - connSelector raftselector.ConnProvider - localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error) -} - -func NewRaftProxyControlServer(local ControlServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) ControlServer { - redirectChecker := func(ctx context.Context) (context.Context, error) { - p, ok := peer.FromContext(ctx) - if !ok { - return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context") - } - addr := p.Addr.String() - md, ok := metadata.FromIncomingContext(ctx) - if ok && len(md["redirect"]) != 0 { - return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"]) - } - if !ok { - md = metadata.New(map[string]string{}) - } - md["redirect"] = append(md["redirect"], addr) - return metadata.NewOutgoingContext(ctx, md), nil - } - remoteMods := []func(context.Context) (context.Context, error){redirectChecker} - remoteMods = append(remoteMods, remoteCtxMod) - - var localMods []func(context.Context) (context.Context, error) - if localCtxMod != nil { - localMods = []func(context.Context) (context.Context, error){localCtxMod} - } - - return &raftProxyControlServer{ - local: local, - connSelector: connSelector, - localCtxMods: localMods, - remoteCtxMods: remoteMods, - } -} -func (p *raftProxyControlServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) { - var err error - for _, mod := range ctxMods { - ctx, err = mod(ctx) - if err != nil { - return ctx, err - } - } - return ctx, nil -} -func (p *raftProxyControlServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) { - ticker := rafttime.NewTicker(500 * rafttime.Millisecond) - defer ticker.Stop() - for { - select { - case <-ticker.C: - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - return nil, err - } - - client := NewHealthClient(conn) - - resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"}) - if err != nil || resp.Status != HealthCheckResponse_SERVING { - continue - } - return conn, nil - case <-ctx.Done(): - return nil, ctx.Err() - } - } -} - -func (p *raftProxyControlServer) GetNode(ctx context.Context, r *GetNodeRequest) (*GetNodeResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.GetNode(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).GetNode(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.GetNode(ctx, r) - } - return nil, err - } - return NewControlClient(conn).GetNode(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) ListNodes(ctx context.Context, r *ListNodesRequest) (*ListNodesResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.ListNodes(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).ListNodes(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.ListNodes(ctx, r) - } - return nil, err - } - return NewControlClient(conn).ListNodes(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) UpdateNode(ctx context.Context, r *UpdateNodeRequest) (*UpdateNodeResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.UpdateNode(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).UpdateNode(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.UpdateNode(ctx, r) - } - return nil, err - } - return NewControlClient(conn).UpdateNode(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) RemoveNode(ctx context.Context, r *RemoveNodeRequest) (*RemoveNodeResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.RemoveNode(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).RemoveNode(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.RemoveNode(ctx, r) - } - return nil, err - } - return NewControlClient(conn).RemoveNode(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) GetTask(ctx context.Context, r *GetTaskRequest) (*GetTaskResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.GetTask(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).GetTask(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.GetTask(ctx, r) - } - return nil, err - } - return NewControlClient(conn).GetTask(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) ListTasks(ctx context.Context, r *ListTasksRequest) (*ListTasksResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.ListTasks(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).ListTasks(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.ListTasks(ctx, r) - } - return nil, err - } - return NewControlClient(conn).ListTasks(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) RemoveTask(ctx context.Context, r *RemoveTaskRequest) (*RemoveTaskResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.RemoveTask(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).RemoveTask(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.RemoveTask(ctx, r) - } - return nil, err - } - return NewControlClient(conn).RemoveTask(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) GetService(ctx context.Context, r *GetServiceRequest) (*GetServiceResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.GetService(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).GetService(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.GetService(ctx, r) - } - return nil, err - } - return NewControlClient(conn).GetService(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) ListServices(ctx context.Context, r *ListServicesRequest) (*ListServicesResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.ListServices(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).ListServices(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.ListServices(ctx, r) - } - return nil, err - } - return NewControlClient(conn).ListServices(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) CreateService(ctx context.Context, r *CreateServiceRequest) (*CreateServiceResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.CreateService(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).CreateService(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.CreateService(ctx, r) - } - return nil, err - } - return NewControlClient(conn).CreateService(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) UpdateService(ctx context.Context, r *UpdateServiceRequest) (*UpdateServiceResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.UpdateService(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).UpdateService(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.UpdateService(ctx, r) - } - return nil, err - } - return NewControlClient(conn).UpdateService(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) RemoveService(ctx context.Context, r *RemoveServiceRequest) (*RemoveServiceResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.RemoveService(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).RemoveService(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.RemoveService(ctx, r) - } - return nil, err - } - return NewControlClient(conn).RemoveService(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) ListServiceStatuses(ctx context.Context, r *ListServiceStatusesRequest) (*ListServiceStatusesResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.ListServiceStatuses(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).ListServiceStatuses(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.ListServiceStatuses(ctx, r) - } - return nil, err - } - return NewControlClient(conn).ListServiceStatuses(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) GetNetwork(ctx context.Context, r *GetNetworkRequest) (*GetNetworkResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.GetNetwork(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).GetNetwork(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.GetNetwork(ctx, r) - } - return nil, err - } - return NewControlClient(conn).GetNetwork(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) ListNetworks(ctx context.Context, r *ListNetworksRequest) (*ListNetworksResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.ListNetworks(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).ListNetworks(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.ListNetworks(ctx, r) - } - return nil, err - } - return NewControlClient(conn).ListNetworks(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) CreateNetwork(ctx context.Context, r *CreateNetworkRequest) (*CreateNetworkResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.CreateNetwork(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).CreateNetwork(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.CreateNetwork(ctx, r) - } - return nil, err - } - return NewControlClient(conn).CreateNetwork(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) RemoveNetwork(ctx context.Context, r *RemoveNetworkRequest) (*RemoveNetworkResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.RemoveNetwork(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).RemoveNetwork(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.RemoveNetwork(ctx, r) - } - return nil, err - } - return NewControlClient(conn).RemoveNetwork(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) GetCluster(ctx context.Context, r *GetClusterRequest) (*GetClusterResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.GetCluster(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).GetCluster(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.GetCluster(ctx, r) - } - return nil, err - } - return NewControlClient(conn).GetCluster(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) ListClusters(ctx context.Context, r *ListClustersRequest) (*ListClustersResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.ListClusters(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).ListClusters(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.ListClusters(ctx, r) - } - return nil, err - } - return NewControlClient(conn).ListClusters(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) UpdateCluster(ctx context.Context, r *UpdateClusterRequest) (*UpdateClusterResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.UpdateCluster(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).UpdateCluster(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.UpdateCluster(ctx, r) - } - return nil, err - } - return NewControlClient(conn).UpdateCluster(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) GetSecret(ctx context.Context, r *GetSecretRequest) (*GetSecretResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.GetSecret(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).GetSecret(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.GetSecret(ctx, r) - } - return nil, err - } - return NewControlClient(conn).GetSecret(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) UpdateSecret(ctx context.Context, r *UpdateSecretRequest) (*UpdateSecretResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.UpdateSecret(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).UpdateSecret(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.UpdateSecret(ctx, r) - } - return nil, err - } - return NewControlClient(conn).UpdateSecret(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) ListSecrets(ctx context.Context, r *ListSecretsRequest) (*ListSecretsResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.ListSecrets(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).ListSecrets(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.ListSecrets(ctx, r) - } - return nil, err - } - return NewControlClient(conn).ListSecrets(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) CreateSecret(ctx context.Context, r *CreateSecretRequest) (*CreateSecretResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.CreateSecret(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).CreateSecret(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.CreateSecret(ctx, r) - } - return nil, err - } - return NewControlClient(conn).CreateSecret(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) RemoveSecret(ctx context.Context, r *RemoveSecretRequest) (*RemoveSecretResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.RemoveSecret(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).RemoveSecret(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.RemoveSecret(ctx, r) - } - return nil, err - } - return NewControlClient(conn).RemoveSecret(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) GetConfig(ctx context.Context, r *GetConfigRequest) (*GetConfigResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.GetConfig(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).GetConfig(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.GetConfig(ctx, r) - } - return nil, err - } - return NewControlClient(conn).GetConfig(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) UpdateConfig(ctx context.Context, r *UpdateConfigRequest) (*UpdateConfigResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.UpdateConfig(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).UpdateConfig(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.UpdateConfig(ctx, r) - } - return nil, err - } - return NewControlClient(conn).UpdateConfig(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) ListConfigs(ctx context.Context, r *ListConfigsRequest) (*ListConfigsResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.ListConfigs(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).ListConfigs(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.ListConfigs(ctx, r) - } - return nil, err - } - return NewControlClient(conn).ListConfigs(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) CreateConfig(ctx context.Context, r *CreateConfigRequest) (*CreateConfigResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.CreateConfig(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).CreateConfig(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.CreateConfig(ctx, r) - } - return nil, err - } - return NewControlClient(conn).CreateConfig(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) RemoveConfig(ctx context.Context, r *RemoveConfigRequest) (*RemoveConfigResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.RemoveConfig(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).RemoveConfig(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.RemoveConfig(ctx, r) - } - return nil, err - } - return NewControlClient(conn).RemoveConfig(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) GetExtension(ctx context.Context, r *GetExtensionRequest) (*GetExtensionResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.GetExtension(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).GetExtension(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.GetExtension(ctx, r) - } - return nil, err - } - return NewControlClient(conn).GetExtension(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) CreateExtension(ctx context.Context, r *CreateExtensionRequest) (*CreateExtensionResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.CreateExtension(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).CreateExtension(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.CreateExtension(ctx, r) - } - return nil, err - } - return NewControlClient(conn).CreateExtension(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) RemoveExtension(ctx context.Context, r *RemoveExtensionRequest) (*RemoveExtensionResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.RemoveExtension(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).RemoveExtension(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.RemoveExtension(ctx, r) - } - return nil, err - } - return NewControlClient(conn).RemoveExtension(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) GetResource(ctx context.Context, r *GetResourceRequest) (*GetResourceResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.GetResource(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).GetResource(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.GetResource(ctx, r) - } - return nil, err - } - return NewControlClient(conn).GetResource(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) UpdateResource(ctx context.Context, r *UpdateResourceRequest) (*UpdateResourceResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.UpdateResource(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).UpdateResource(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.UpdateResource(ctx, r) - } - return nil, err - } - return NewControlClient(conn).UpdateResource(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) ListResources(ctx context.Context, r *ListResourcesRequest) (*ListResourcesResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.ListResources(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).ListResources(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.ListResources(ctx, r) - } - return nil, err - } - return NewControlClient(conn).ListResources(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) CreateResource(ctx context.Context, r *CreateResourceRequest) (*CreateResourceResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.CreateResource(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).CreateResource(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.CreateResource(ctx, r) - } - return nil, err - } - return NewControlClient(conn).CreateResource(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) RemoveResource(ctx context.Context, r *RemoveResourceRequest) (*RemoveResourceResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.RemoveResource(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).RemoveResource(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.RemoveResource(ctx, r) - } - return nil, err - } - return NewControlClient(conn).RemoveResource(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) CreateVolume(ctx context.Context, r *CreateVolumeRequest) (*CreateVolumeResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.CreateVolume(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).CreateVolume(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.CreateVolume(ctx, r) - } - return nil, err - } - return NewControlClient(conn).CreateVolume(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) GetVolume(ctx context.Context, r *GetVolumeRequest) (*GetVolumeResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.GetVolume(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).GetVolume(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.GetVolume(ctx, r) - } - return nil, err - } - return NewControlClient(conn).GetVolume(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) UpdateVolume(ctx context.Context, r *UpdateVolumeRequest) (*UpdateVolumeResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.UpdateVolume(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).UpdateVolume(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.UpdateVolume(ctx, r) - } - return nil, err - } - return NewControlClient(conn).UpdateVolume(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) ListVolumes(ctx context.Context, r *ListVolumesRequest) (*ListVolumesResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.ListVolumes(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).ListVolumes(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.ListVolumes(ctx, r) - } - return nil, err - } - return NewControlClient(conn).ListVolumes(modCtx, r) - } - return resp, err -} - -func (p *raftProxyControlServer) RemoveVolume(ctx context.Context, r *RemoveVolumeRequest) (*RemoveVolumeResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.RemoveVolume(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewControlClient(conn).RemoveVolume(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.RemoveVolume(ctx, r) - } - return nil, err - } - return NewControlClient(conn).RemoveVolume(modCtx, r) - } - return resp, err -} - -func (m *GetNodeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.NodeID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *GetNodeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Node != nil { - l = m.Node.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *ListNodesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Filters != nil { - l = m.Filters.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *ListNodesRequest_Filters) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - n += mapEntrySize + 1 + sovControl(uint64(mapEntrySize)) - } - } - if len(m.Memberships) > 0 { - for _, e := range m.Memberships { - n += 1 + sovControl(uint64(e)) - } - } - if len(m.Roles) > 0 { - for _, e := range m.Roles { - n += 1 + sovControl(uint64(e)) - } - } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.NodeLabels) > 0 { - for k, v := range m.NodeLabels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - n += mapEntrySize + 1 + sovControl(uint64(mapEntrySize)) - } - } - return n -} - -func (m *ListNodesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Nodes) > 0 { - for _, e := range m.Nodes { - l = e.Size() - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *UpdateNodeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.NodeID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - if m.NodeVersion != nil { - l = m.NodeVersion.Size() - n += 1 + l + sovControl(uint64(l)) - } - if m.Spec != nil { - l = m.Spec.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *UpdateNodeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Node != nil { - l = m.Node.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *RemoveNodeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.NodeID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - if m.Force { - n += 2 - } - return n -} - -func (m *RemoveNodeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *GetTaskRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TaskID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *GetTaskResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Task != nil { - l = m.Task.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *RemoveTaskRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TaskID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *RemoveTaskResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *ListTasksRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Filters != nil { - l = m.Filters.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *ListTasksRequest_Filters) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - n += mapEntrySize + 1 + sovControl(uint64(mapEntrySize)) - } - } - if len(m.ServiceIDs) > 0 { - for _, s := range m.ServiceIDs { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.NodeIDs) > 0 { - for _, s := range m.NodeIDs { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.DesiredStates) > 0 { - for _, e := range m.DesiredStates { - n += 1 + sovControl(uint64(e)) - } - } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if m.UpToDate { - n += 2 - } - if len(m.Runtimes) > 0 { - for _, s := range m.Runtimes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *ListTasksResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Tasks) > 0 { - for _, e := range m.Tasks { - l = e.Size() - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *CreateServiceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Spec != nil { - l = m.Spec.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *CreateServiceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Service != nil { - l = m.Service.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *GetServiceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ServiceID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - if m.InsertDefaults { - n += 2 - } - return n -} - -func (m *GetServiceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Service != nil { - l = m.Service.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *UpdateServiceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ServiceID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - if m.ServiceVersion != nil { - l = m.ServiceVersion.Size() - n += 1 + l + sovControl(uint64(l)) - } - if m.Spec != nil { - l = m.Spec.Size() - n += 1 + l + sovControl(uint64(l)) - } - if m.Rollback != 0 { - n += 1 + sovControl(uint64(m.Rollback)) - } - return n -} - -func (m *UpdateServiceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Service != nil { - l = m.Service.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *RemoveServiceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ServiceID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *RemoveServiceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *ListServicesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Filters != nil { - l = m.Filters.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *ListServicesRequest_Filters) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - n += mapEntrySize + 1 + sovControl(uint64(mapEntrySize)) - } - } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.Runtimes) > 0 { - for _, s := range m.Runtimes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *ListServicesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Services) > 0 { - for _, e := range m.Services { - l = e.Size() - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *ListServiceStatusesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Services) > 0 { - for _, s := range m.Services { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *ListServiceStatusesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Statuses) > 0 { - for _, e := range m.Statuses { - l = e.Size() - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *ListServiceStatusesResponse_ServiceStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ServiceID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - if m.DesiredTasks != 0 { - n += 1 + sovControl(uint64(m.DesiredTasks)) - } - if m.RunningTasks != 0 { - n += 1 + sovControl(uint64(m.RunningTasks)) - } - if m.CompletedTasks != 0 { - n += 1 + sovControl(uint64(m.CompletedTasks)) - } - return n -} - -func (m *CreateNetworkRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Spec != nil { - l = m.Spec.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *CreateNetworkResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Network != nil { - l = m.Network.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *GetNetworkRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - l = len(m.NetworkID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *GetNetworkResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Network != nil { - l = m.Network.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *RemoveNetworkRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - l = len(m.NetworkID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *RemoveNetworkResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *ListNetworksRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Filters != nil { - l = m.Filters.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *ListNetworksRequest_Filters) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - n += mapEntrySize + 1 + sovControl(uint64(mapEntrySize)) - } - } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *ListNetworksResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Networks) > 0 { - for _, e := range m.Networks { - l = e.Size() - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *GetClusterRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClusterID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *GetClusterResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Cluster != nil { - l = m.Cluster.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *ListClustersRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Filters != nil { - l = m.Filters.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *ListClustersRequest_Filters) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - n += mapEntrySize + 1 + sovControl(uint64(mapEntrySize)) - } - } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *ListClustersResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Clusters) > 0 { - for _, e := range m.Clusters { - l = e.Size() - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *KeyRotation) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.WorkerJoinToken { - n += 2 - } - if m.ManagerJoinToken { - n += 2 - } - if m.ManagerUnlockKey { - n += 2 - } - return n -} - -func (m *UpdateClusterRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClusterID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - if m.ClusterVersion != nil { - l = m.ClusterVersion.Size() - n += 1 + l + sovControl(uint64(l)) - } - if m.Spec != nil { - l = m.Spec.Size() - n += 1 + l + sovControl(uint64(l)) - } - l = m.Rotation.Size() - n += 1 + l + sovControl(uint64(l)) - return n -} - -func (m *UpdateClusterResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Cluster != nil { - l = m.Cluster.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *GetSecretRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SecretID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *GetSecretResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Secret != nil { - l = m.Secret.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *UpdateSecretRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SecretID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - if m.SecretVersion != nil { - l = m.SecretVersion.Size() - n += 1 + l + sovControl(uint64(l)) - } - if m.Spec != nil { - l = m.Spec.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *UpdateSecretResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Secret != nil { - l = m.Secret.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *ListSecretsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Filters != nil { - l = m.Filters.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *ListSecretsRequest_Filters) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - n += mapEntrySize + 1 + sovControl(uint64(mapEntrySize)) - } - } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *ListSecretsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Secrets) > 0 { - for _, e := range m.Secrets { - l = e.Size() - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *CreateSecretRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Spec != nil { - l = m.Spec.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *CreateSecretResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Secret != nil { - l = m.Secret.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *RemoveSecretRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SecretID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *RemoveSecretResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *GetConfigRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ConfigID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *GetConfigResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Config != nil { - l = m.Config.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *UpdateConfigRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ConfigID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - if m.ConfigVersion != nil { - l = m.ConfigVersion.Size() - n += 1 + l + sovControl(uint64(l)) - } - if m.Spec != nil { - l = m.Spec.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *UpdateConfigResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Config != nil { - l = m.Config.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *ListConfigsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Filters != nil { - l = m.Filters.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *ListConfigsRequest_Filters) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - n += mapEntrySize + 1 + sovControl(uint64(mapEntrySize)) - } - } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *ListConfigsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Configs) > 0 { - for _, e := range m.Configs { - l = e.Size() - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *CreateConfigRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Spec != nil { - l = m.Spec.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *CreateConfigResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Config != nil { - l = m.Config.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *RemoveConfigRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ConfigID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *RemoveConfigResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *CreateExtensionRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Annotations != nil { - l = m.Annotations.Size() - n += 1 + l + sovControl(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *CreateExtensionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Extension != nil { - l = m.Extension.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *RemoveExtensionRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ExtensionID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *RemoveExtensionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *GetExtensionRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ExtensionID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *GetExtensionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Extension != nil { - l = m.Extension.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *CreateResourceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Annotations != nil { - l = m.Annotations.Size() - n += 1 + l + sovControl(uint64(l)) - } - l = len(m.Kind) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - if m.Payload != nil { - l = m.Payload.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *CreateResourceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Resource != nil { - l = m.Resource.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *RemoveResourceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ResourceID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *RemoveResourceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *UpdateResourceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ResourceID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - if m.ResourceVersion != nil { - l = m.ResourceVersion.Size() - n += 1 + l + sovControl(uint64(l)) - } - if m.Annotations != nil { - l = m.Annotations.Size() - n += 1 + l + sovControl(uint64(l)) - } - if m.Payload != nil { - l = m.Payload.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *UpdateResourceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Resource != nil { - l = m.Resource.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *GetResourceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ResourceID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *GetResourceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Resource != nil { - l = m.Resource.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *ListResourcesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Filters != nil { - l = m.Filters.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *ListResourcesRequest_Filters) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - n += mapEntrySize + 1 + sovControl(uint64(mapEntrySize)) - } - } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - l = len(m.Kind) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *ListResourcesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *CreateVolumeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Spec != nil { - l = m.Spec.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *CreateVolumeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Volume != nil { - l = m.Volume.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *GetVolumeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.VolumeID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *GetVolumeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Volume != nil { - l = m.Volume.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *UpdateVolumeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.VolumeID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - if m.VolumeVersion != nil { - l = m.VolumeVersion.Size() - n += 1 + l + sovControl(uint64(l)) - } - if m.Spec != nil { - l = m.Spec.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *UpdateVolumeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Volume != nil { - l = m.Volume.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *ListVolumesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Filters != nil { - l = m.Filters.Size() - n += 1 + l + sovControl(uint64(l)) - } - return n -} - -func (m *ListVolumesRequest_Filters) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - n += mapEntrySize + 1 + sovControl(uint64(mapEntrySize)) - } - } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.Groups) > 0 { - for _, s := range m.Groups { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - if len(m.Drivers) > 0 { - for _, s := range m.Drivers { - l = len(s) - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *ListVolumesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Volumes) > 0 { - for _, e := range m.Volumes { - l = e.Size() - n += 1 + l + sovControl(uint64(l)) - } - } - return n -} - -func (m *RemoveVolumeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.VolumeID) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - if m.Force { - n += 2 - } - return n -} - -func (m *RemoveVolumeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovControl(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozControl(x uint64) (n int) { - return sovControl(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *GetNodeRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetNodeRequest{`, - `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, - `}`, - }, "") - return s -} -func (this *GetNodeResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetNodeResponse{`, - `Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "Node", "Node", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ListNodesRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ListNodesRequest{`, - `Filters:` + strings.Replace(fmt.Sprintf("%v", this.Filters), "ListNodesRequest_Filters", "ListNodesRequest_Filters", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ListNodesRequest_Filters) String() string { - if this == nil { - return "nil" - } - keysForLabels := make([]string, 0, len(this.Labels)) - for k, _ := range this.Labels { - keysForLabels = append(keysForLabels, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]string{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) - } - mapStringForLabels += "}" - keysForNodeLabels := make([]string, 0, len(this.NodeLabels)) - for k, _ := range this.NodeLabels { - keysForNodeLabels = append(keysForNodeLabels, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForNodeLabels) - mapStringForNodeLabels := "map[string]string{" - for _, k := range keysForNodeLabels { - mapStringForNodeLabels += fmt.Sprintf("%v: %v,", k, this.NodeLabels[k]) - } - mapStringForNodeLabels += "}" - s := strings.Join([]string{`&ListNodesRequest_Filters{`, - `Names:` + fmt.Sprintf("%v", this.Names) + `,`, - `IDPrefixes:` + fmt.Sprintf("%v", this.IDPrefixes) + `,`, - `Labels:` + mapStringForLabels + `,`, - `Memberships:` + fmt.Sprintf("%v", this.Memberships) + `,`, - `Roles:` + fmt.Sprintf("%v", this.Roles) + `,`, - `NamePrefixes:` + fmt.Sprintf("%v", this.NamePrefixes) + `,`, - `NodeLabels:` + mapStringForNodeLabels + `,`, - `}`, - }, "") - return s -} -func (this *ListNodesResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForNodes := "[]*Node{" - for _, f := range this.Nodes { - repeatedStringForNodes += strings.Replace(fmt.Sprintf("%v", f), "Node", "Node", 1) + "," - } - repeatedStringForNodes += "}" - s := strings.Join([]string{`&ListNodesResponse{`, - `Nodes:` + repeatedStringForNodes + `,`, - `}`, - }, "") - return s -} -func (this *UpdateNodeRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateNodeRequest{`, - `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, - `NodeVersion:` + strings.Replace(fmt.Sprintf("%v", this.NodeVersion), "Version", "Version", 1) + `,`, - `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "NodeSpec", "NodeSpec", 1) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateNodeResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateNodeResponse{`, - `Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "Node", "Node", 1) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveNodeRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveNodeRequest{`, - `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, - `Force:` + fmt.Sprintf("%v", this.Force) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveNodeResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveNodeResponse{`, - `}`, - }, "") - return s -} -func (this *GetTaskRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetTaskRequest{`, - `TaskID:` + fmt.Sprintf("%v", this.TaskID) + `,`, - `}`, - }, "") - return s -} -func (this *GetTaskResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetTaskResponse{`, - `Task:` + strings.Replace(fmt.Sprintf("%v", this.Task), "Task", "Task", 1) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveTaskRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveTaskRequest{`, - `TaskID:` + fmt.Sprintf("%v", this.TaskID) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveTaskResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveTaskResponse{`, - `}`, - }, "") - return s -} -func (this *ListTasksRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ListTasksRequest{`, - `Filters:` + strings.Replace(fmt.Sprintf("%v", this.Filters), "ListTasksRequest_Filters", "ListTasksRequest_Filters", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ListTasksRequest_Filters) String() string { - if this == nil { - return "nil" - } - keysForLabels := make([]string, 0, len(this.Labels)) - for k, _ := range this.Labels { - keysForLabels = append(keysForLabels, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]string{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) - } - mapStringForLabels += "}" - s := strings.Join([]string{`&ListTasksRequest_Filters{`, - `Names:` + fmt.Sprintf("%v", this.Names) + `,`, - `IDPrefixes:` + fmt.Sprintf("%v", this.IDPrefixes) + `,`, - `Labels:` + mapStringForLabels + `,`, - `ServiceIDs:` + fmt.Sprintf("%v", this.ServiceIDs) + `,`, - `NodeIDs:` + fmt.Sprintf("%v", this.NodeIDs) + `,`, - `DesiredStates:` + fmt.Sprintf("%v", this.DesiredStates) + `,`, - `NamePrefixes:` + fmt.Sprintf("%v", this.NamePrefixes) + `,`, - `UpToDate:` + fmt.Sprintf("%v", this.UpToDate) + `,`, - `Runtimes:` + fmt.Sprintf("%v", this.Runtimes) + `,`, - `}`, - }, "") - return s -} -func (this *ListTasksResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForTasks := "[]*Task{" - for _, f := range this.Tasks { - repeatedStringForTasks += strings.Replace(fmt.Sprintf("%v", f), "Task", "Task", 1) + "," - } - repeatedStringForTasks += "}" - s := strings.Join([]string{`&ListTasksResponse{`, - `Tasks:` + repeatedStringForTasks + `,`, - `}`, - }, "") - return s -} -func (this *CreateServiceRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CreateServiceRequest{`, - `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "ServiceSpec", "ServiceSpec", 1) + `,`, - `}`, - }, "") - return s -} -func (this *CreateServiceResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CreateServiceResponse{`, - `Service:` + strings.Replace(fmt.Sprintf("%v", this.Service), "Service", "Service", 1) + `,`, - `}`, - }, "") - return s -} -func (this *GetServiceRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetServiceRequest{`, - `ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`, - `InsertDefaults:` + fmt.Sprintf("%v", this.InsertDefaults) + `,`, - `}`, - }, "") - return s -} -func (this *GetServiceResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetServiceResponse{`, - `Service:` + strings.Replace(fmt.Sprintf("%v", this.Service), "Service", "Service", 1) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateServiceRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateServiceRequest{`, - `ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`, - `ServiceVersion:` + strings.Replace(fmt.Sprintf("%v", this.ServiceVersion), "Version", "Version", 1) + `,`, - `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "ServiceSpec", "ServiceSpec", 1) + `,`, - `Rollback:` + fmt.Sprintf("%v", this.Rollback) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateServiceResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateServiceResponse{`, - `Service:` + strings.Replace(fmt.Sprintf("%v", this.Service), "Service", "Service", 1) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveServiceRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveServiceRequest{`, - `ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveServiceResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveServiceResponse{`, - `}`, - }, "") - return s -} -func (this *ListServicesRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ListServicesRequest{`, - `Filters:` + strings.Replace(fmt.Sprintf("%v", this.Filters), "ListServicesRequest_Filters", "ListServicesRequest_Filters", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ListServicesRequest_Filters) String() string { - if this == nil { - return "nil" - } - keysForLabels := make([]string, 0, len(this.Labels)) - for k, _ := range this.Labels { - keysForLabels = append(keysForLabels, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]string{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) - } - mapStringForLabels += "}" - s := strings.Join([]string{`&ListServicesRequest_Filters{`, - `Names:` + fmt.Sprintf("%v", this.Names) + `,`, - `IDPrefixes:` + fmt.Sprintf("%v", this.IDPrefixes) + `,`, - `Labels:` + mapStringForLabels + `,`, - `NamePrefixes:` + fmt.Sprintf("%v", this.NamePrefixes) + `,`, - `Runtimes:` + fmt.Sprintf("%v", this.Runtimes) + `,`, - `}`, - }, "") - return s -} -func (this *ListServicesResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForServices := "[]*Service{" - for _, f := range this.Services { - repeatedStringForServices += strings.Replace(fmt.Sprintf("%v", f), "Service", "Service", 1) + "," - } - repeatedStringForServices += "}" - s := strings.Join([]string{`&ListServicesResponse{`, - `Services:` + repeatedStringForServices + `,`, - `}`, - }, "") - return s -} -func (this *ListServiceStatusesRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ListServiceStatusesRequest{`, - `Services:` + fmt.Sprintf("%v", this.Services) + `,`, - `}`, - }, "") - return s -} -func (this *ListServiceStatusesResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForStatuses := "[]*ListServiceStatusesResponse_ServiceStatus{" - for _, f := range this.Statuses { - repeatedStringForStatuses += strings.Replace(fmt.Sprintf("%v", f), "ListServiceStatusesResponse_ServiceStatus", "ListServiceStatusesResponse_ServiceStatus", 1) + "," - } - repeatedStringForStatuses += "}" - s := strings.Join([]string{`&ListServiceStatusesResponse{`, - `Statuses:` + repeatedStringForStatuses + `,`, - `}`, - }, "") - return s -} -func (this *ListServiceStatusesResponse_ServiceStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ListServiceStatusesResponse_ServiceStatus{`, - `ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`, - `DesiredTasks:` + fmt.Sprintf("%v", this.DesiredTasks) + `,`, - `RunningTasks:` + fmt.Sprintf("%v", this.RunningTasks) + `,`, - `CompletedTasks:` + fmt.Sprintf("%v", this.CompletedTasks) + `,`, - `}`, - }, "") - return s -} -func (this *CreateNetworkRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CreateNetworkRequest{`, - `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "NetworkSpec", "NetworkSpec", 1) + `,`, - `}`, - }, "") - return s -} -func (this *CreateNetworkResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CreateNetworkResponse{`, - `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`, - `}`, - }, "") - return s -} -func (this *GetNetworkRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetNetworkRequest{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `NetworkID:` + fmt.Sprintf("%v", this.NetworkID) + `,`, - `}`, - }, "") - return s -} -func (this *GetNetworkResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetNetworkResponse{`, - `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveNetworkRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveNetworkRequest{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `NetworkID:` + fmt.Sprintf("%v", this.NetworkID) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveNetworkResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveNetworkResponse{`, - `}`, - }, "") - return s -} -func (this *ListNetworksRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ListNetworksRequest{`, - `Filters:` + strings.Replace(fmt.Sprintf("%v", this.Filters), "ListNetworksRequest_Filters", "ListNetworksRequest_Filters", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ListNetworksRequest_Filters) String() string { - if this == nil { - return "nil" - } - keysForLabels := make([]string, 0, len(this.Labels)) - for k, _ := range this.Labels { - keysForLabels = append(keysForLabels, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]string{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) - } - mapStringForLabels += "}" - s := strings.Join([]string{`&ListNetworksRequest_Filters{`, - `Names:` + fmt.Sprintf("%v", this.Names) + `,`, - `IDPrefixes:` + fmt.Sprintf("%v", this.IDPrefixes) + `,`, - `Labels:` + mapStringForLabels + `,`, - `NamePrefixes:` + fmt.Sprintf("%v", this.NamePrefixes) + `,`, - `}`, - }, "") - return s -} -func (this *ListNetworksResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForNetworks := "[]*Network{" - for _, f := range this.Networks { - repeatedStringForNetworks += strings.Replace(fmt.Sprintf("%v", f), "Network", "Network", 1) + "," - } - repeatedStringForNetworks += "}" - s := strings.Join([]string{`&ListNetworksResponse{`, - `Networks:` + repeatedStringForNetworks + `,`, - `}`, - }, "") - return s -} -func (this *GetClusterRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetClusterRequest{`, - `ClusterID:` + fmt.Sprintf("%v", this.ClusterID) + `,`, - `}`, - }, "") - return s -} -func (this *GetClusterResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetClusterResponse{`, - `Cluster:` + strings.Replace(fmt.Sprintf("%v", this.Cluster), "Cluster", "Cluster", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ListClustersRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ListClustersRequest{`, - `Filters:` + strings.Replace(fmt.Sprintf("%v", this.Filters), "ListClustersRequest_Filters", "ListClustersRequest_Filters", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ListClustersRequest_Filters) String() string { - if this == nil { - return "nil" - } - keysForLabels := make([]string, 0, len(this.Labels)) - for k, _ := range this.Labels { - keysForLabels = append(keysForLabels, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]string{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) - } - mapStringForLabels += "}" - s := strings.Join([]string{`&ListClustersRequest_Filters{`, - `Names:` + fmt.Sprintf("%v", this.Names) + `,`, - `IDPrefixes:` + fmt.Sprintf("%v", this.IDPrefixes) + `,`, - `Labels:` + mapStringForLabels + `,`, - `NamePrefixes:` + fmt.Sprintf("%v", this.NamePrefixes) + `,`, - `}`, - }, "") - return s -} -func (this *ListClustersResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForClusters := "[]*Cluster{" - for _, f := range this.Clusters { - repeatedStringForClusters += strings.Replace(fmt.Sprintf("%v", f), "Cluster", "Cluster", 1) + "," - } - repeatedStringForClusters += "}" - s := strings.Join([]string{`&ListClustersResponse{`, - `Clusters:` + repeatedStringForClusters + `,`, - `}`, - }, "") - return s -} -func (this *KeyRotation) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&KeyRotation{`, - `WorkerJoinToken:` + fmt.Sprintf("%v", this.WorkerJoinToken) + `,`, - `ManagerJoinToken:` + fmt.Sprintf("%v", this.ManagerJoinToken) + `,`, - `ManagerUnlockKey:` + fmt.Sprintf("%v", this.ManagerUnlockKey) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateClusterRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateClusterRequest{`, - `ClusterID:` + fmt.Sprintf("%v", this.ClusterID) + `,`, - `ClusterVersion:` + strings.Replace(fmt.Sprintf("%v", this.ClusterVersion), "Version", "Version", 1) + `,`, - `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "ClusterSpec", "ClusterSpec", 1) + `,`, - `Rotation:` + strings.Replace(strings.Replace(this.Rotation.String(), "KeyRotation", "KeyRotation", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateClusterResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateClusterResponse{`, - `Cluster:` + strings.Replace(fmt.Sprintf("%v", this.Cluster), "Cluster", "Cluster", 1) + `,`, - `}`, - }, "") - return s -} -func (this *GetSecretRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetSecretRequest{`, - `SecretID:` + fmt.Sprintf("%v", this.SecretID) + `,`, - `}`, - }, "") - return s -} -func (this *GetSecretResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetSecretResponse{`, - `Secret:` + strings.Replace(fmt.Sprintf("%v", this.Secret), "Secret", "Secret", 1) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateSecretRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateSecretRequest{`, - `SecretID:` + fmt.Sprintf("%v", this.SecretID) + `,`, - `SecretVersion:` + strings.Replace(fmt.Sprintf("%v", this.SecretVersion), "Version", "Version", 1) + `,`, - `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "SecretSpec", "SecretSpec", 1) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateSecretResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateSecretResponse{`, - `Secret:` + strings.Replace(fmt.Sprintf("%v", this.Secret), "Secret", "Secret", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ListSecretsRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ListSecretsRequest{`, - `Filters:` + strings.Replace(fmt.Sprintf("%v", this.Filters), "ListSecretsRequest_Filters", "ListSecretsRequest_Filters", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ListSecretsRequest_Filters) String() string { - if this == nil { - return "nil" - } - keysForLabels := make([]string, 0, len(this.Labels)) - for k, _ := range this.Labels { - keysForLabels = append(keysForLabels, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]string{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) - } - mapStringForLabels += "}" - s := strings.Join([]string{`&ListSecretsRequest_Filters{`, - `Names:` + fmt.Sprintf("%v", this.Names) + `,`, - `IDPrefixes:` + fmt.Sprintf("%v", this.IDPrefixes) + `,`, - `Labels:` + mapStringForLabels + `,`, - `NamePrefixes:` + fmt.Sprintf("%v", this.NamePrefixes) + `,`, - `}`, - }, "") - return s -} -func (this *ListSecretsResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForSecrets := "[]*Secret{" - for _, f := range this.Secrets { - repeatedStringForSecrets += strings.Replace(fmt.Sprintf("%v", f), "Secret", "Secret", 1) + "," - } - repeatedStringForSecrets += "}" - s := strings.Join([]string{`&ListSecretsResponse{`, - `Secrets:` + repeatedStringForSecrets + `,`, - `}`, - }, "") - return s -} -func (this *CreateSecretRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CreateSecretRequest{`, - `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "SecretSpec", "SecretSpec", 1) + `,`, - `}`, - }, "") - return s -} -func (this *CreateSecretResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CreateSecretResponse{`, - `Secret:` + strings.Replace(fmt.Sprintf("%v", this.Secret), "Secret", "Secret", 1) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveSecretRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveSecretRequest{`, - `SecretID:` + fmt.Sprintf("%v", this.SecretID) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveSecretResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveSecretResponse{`, - `}`, - }, "") - return s -} -func (this *GetConfigRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetConfigRequest{`, - `ConfigID:` + fmt.Sprintf("%v", this.ConfigID) + `,`, - `}`, - }, "") - return s -} -func (this *GetConfigResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetConfigResponse{`, - `Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "Config", "Config", 1) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateConfigRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateConfigRequest{`, - `ConfigID:` + fmt.Sprintf("%v", this.ConfigID) + `,`, - `ConfigVersion:` + strings.Replace(fmt.Sprintf("%v", this.ConfigVersion), "Version", "Version", 1) + `,`, - `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "ConfigSpec", "ConfigSpec", 1) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateConfigResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateConfigResponse{`, - `Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "Config", "Config", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ListConfigsRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ListConfigsRequest{`, - `Filters:` + strings.Replace(fmt.Sprintf("%v", this.Filters), "ListConfigsRequest_Filters", "ListConfigsRequest_Filters", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ListConfigsRequest_Filters) String() string { - if this == nil { - return "nil" - } - keysForLabels := make([]string, 0, len(this.Labels)) - for k, _ := range this.Labels { - keysForLabels = append(keysForLabels, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]string{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) - } - mapStringForLabels += "}" - s := strings.Join([]string{`&ListConfigsRequest_Filters{`, - `Names:` + fmt.Sprintf("%v", this.Names) + `,`, - `IDPrefixes:` + fmt.Sprintf("%v", this.IDPrefixes) + `,`, - `Labels:` + mapStringForLabels + `,`, - `NamePrefixes:` + fmt.Sprintf("%v", this.NamePrefixes) + `,`, - `}`, - }, "") - return s -} -func (this *ListConfigsResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForConfigs := "[]*Config{" - for _, f := range this.Configs { - repeatedStringForConfigs += strings.Replace(fmt.Sprintf("%v", f), "Config", "Config", 1) + "," - } - repeatedStringForConfigs += "}" - s := strings.Join([]string{`&ListConfigsResponse{`, - `Configs:` + repeatedStringForConfigs + `,`, - `}`, - }, "") - return s -} -func (this *CreateConfigRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CreateConfigRequest{`, - `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "ConfigSpec", "ConfigSpec", 1) + `,`, - `}`, - }, "") - return s -} -func (this *CreateConfigResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CreateConfigResponse{`, - `Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "Config", "Config", 1) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveConfigRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveConfigRequest{`, - `ConfigID:` + fmt.Sprintf("%v", this.ConfigID) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveConfigResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveConfigResponse{`, - `}`, - }, "") - return s -} -func (this *CreateExtensionRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CreateExtensionRequest{`, - `Annotations:` + strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1) + `,`, - `Description:` + fmt.Sprintf("%v", this.Description) + `,`, - `}`, - }, "") - return s -} -func (this *CreateExtensionResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CreateExtensionResponse{`, - `Extension:` + strings.Replace(fmt.Sprintf("%v", this.Extension), "Extension", "Extension", 1) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveExtensionRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveExtensionRequest{`, - `ExtensionID:` + fmt.Sprintf("%v", this.ExtensionID) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveExtensionResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveExtensionResponse{`, - `}`, - }, "") - return s -} -func (this *GetExtensionRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetExtensionRequest{`, - `ExtensionID:` + fmt.Sprintf("%v", this.ExtensionID) + `,`, - `}`, - }, "") - return s -} -func (this *GetExtensionResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetExtensionResponse{`, - `Extension:` + strings.Replace(fmt.Sprintf("%v", this.Extension), "Extension", "Extension", 1) + `,`, - `}`, - }, "") - return s -} -func (this *CreateResourceRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CreateResourceRequest{`, - `Annotations:` + strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1) + `,`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `Payload:` + strings.Replace(fmt.Sprintf("%v", this.Payload), "Any", "types.Any", 1) + `,`, - `}`, - }, "") - return s -} -func (this *CreateResourceResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CreateResourceResponse{`, - `Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "Resource", "Resource", 1) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveResourceRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveResourceRequest{`, - `ResourceID:` + fmt.Sprintf("%v", this.ResourceID) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveResourceResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveResourceResponse{`, - `}`, - }, "") - return s -} -func (this *UpdateResourceRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateResourceRequest{`, - `ResourceID:` + fmt.Sprintf("%v", this.ResourceID) + `,`, - `ResourceVersion:` + strings.Replace(fmt.Sprintf("%v", this.ResourceVersion), "Version", "Version", 1) + `,`, - `Annotations:` + strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1) + `,`, - `Payload:` + strings.Replace(fmt.Sprintf("%v", this.Payload), "Any", "types.Any", 1) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateResourceResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateResourceResponse{`, - `Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "Resource", "Resource", 1) + `,`, - `}`, - }, "") - return s -} -func (this *GetResourceRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetResourceRequest{`, - `ResourceID:` + fmt.Sprintf("%v", this.ResourceID) + `,`, - `}`, - }, "") - return s -} -func (this *GetResourceResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetResourceResponse{`, - `Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "Resource", "Resource", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ListResourcesRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ListResourcesRequest{`, - `Filters:` + strings.Replace(fmt.Sprintf("%v", this.Filters), "ListResourcesRequest_Filters", "ListResourcesRequest_Filters", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ListResourcesRequest_Filters) String() string { - if this == nil { - return "nil" - } - keysForLabels := make([]string, 0, len(this.Labels)) - for k, _ := range this.Labels { - keysForLabels = append(keysForLabels, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]string{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) - } - mapStringForLabels += "}" - s := strings.Join([]string{`&ListResourcesRequest_Filters{`, - `Names:` + fmt.Sprintf("%v", this.Names) + `,`, - `IDPrefixes:` + fmt.Sprintf("%v", this.IDPrefixes) + `,`, - `Labels:` + mapStringForLabels + `,`, - `NamePrefixes:` + fmt.Sprintf("%v", this.NamePrefixes) + `,`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `}`, - }, "") - return s -} -func (this *ListResourcesResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForResources := "[]*Resource{" - for _, f := range this.Resources { - repeatedStringForResources += strings.Replace(fmt.Sprintf("%v", f), "Resource", "Resource", 1) + "," - } - repeatedStringForResources += "}" - s := strings.Join([]string{`&ListResourcesResponse{`, - `Resources:` + repeatedStringForResources + `,`, - `}`, - }, "") - return s -} -func (this *CreateVolumeRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CreateVolumeRequest{`, - `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "VolumeSpec", "VolumeSpec", 1) + `,`, - `}`, - }, "") - return s -} -func (this *CreateVolumeResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CreateVolumeResponse{`, - `Volume:` + strings.Replace(fmt.Sprintf("%v", this.Volume), "Volume", "Volume", 1) + `,`, - `}`, - }, "") - return s -} -func (this *GetVolumeRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetVolumeRequest{`, - `VolumeID:` + fmt.Sprintf("%v", this.VolumeID) + `,`, - `}`, - }, "") - return s -} -func (this *GetVolumeResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetVolumeResponse{`, - `Volume:` + strings.Replace(fmt.Sprintf("%v", this.Volume), "Volume", "Volume", 1) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateVolumeRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateVolumeRequest{`, - `VolumeID:` + fmt.Sprintf("%v", this.VolumeID) + `,`, - `VolumeVersion:` + strings.Replace(fmt.Sprintf("%v", this.VolumeVersion), "Version", "Version", 1) + `,`, - `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "VolumeSpec", "VolumeSpec", 1) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateVolumeResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateVolumeResponse{`, - `Volume:` + strings.Replace(fmt.Sprintf("%v", this.Volume), "Volume", "Volume", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ListVolumesRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ListVolumesRequest{`, - `Filters:` + strings.Replace(fmt.Sprintf("%v", this.Filters), "ListVolumesRequest_Filters", "ListVolumesRequest_Filters", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ListVolumesRequest_Filters) String() string { - if this == nil { - return "nil" - } - keysForLabels := make([]string, 0, len(this.Labels)) - for k, _ := range this.Labels { - keysForLabels = append(keysForLabels, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]string{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) - } - mapStringForLabels += "}" - s := strings.Join([]string{`&ListVolumesRequest_Filters{`, - `Names:` + fmt.Sprintf("%v", this.Names) + `,`, - `IDPrefixes:` + fmt.Sprintf("%v", this.IDPrefixes) + `,`, - `Labels:` + mapStringForLabels + `,`, - `NamePrefixes:` + fmt.Sprintf("%v", this.NamePrefixes) + `,`, - `Groups:` + fmt.Sprintf("%v", this.Groups) + `,`, - `Drivers:` + fmt.Sprintf("%v", this.Drivers) + `,`, - `}`, - }, "") - return s -} -func (this *ListVolumesResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForVolumes := "[]*Volume{" - for _, f := range this.Volumes { - repeatedStringForVolumes += strings.Replace(fmt.Sprintf("%v", f), "Volume", "Volume", 1) + "," - } - repeatedStringForVolumes += "}" - s := strings.Join([]string{`&ListVolumesResponse{`, - `Volumes:` + repeatedStringForVolumes + `,`, - `}`, - }, "") - return s -} -func (this *RemoveVolumeRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveVolumeRequest{`, - `VolumeID:` + fmt.Sprintf("%v", this.VolumeID) + `,`, - `Force:` + fmt.Sprintf("%v", this.Force) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveVolumeResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveVolumeResponse{`, - `}`, - }, "") - return s -} -func valueToStringControl(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *GetNodeRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: GetNodeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetNodeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NodeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetNodeResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: GetNodeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetNodeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Node == nil { - m.Node = &Node{} - } - if err := m.Node.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListNodesRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: ListNodesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListNodesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Filters == nil { - m.Filters = &ListNodesRequest_Filters{} - } - if err := m.Filters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListNodesRequest_Filters) Unmarshal(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 ErrIntOverflowControl - } - 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: Filters: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Filters: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IDPrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IDPrefixes = append(m.IDPrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - 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 ErrIntOverflowControl - } - 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 ErrInvalidLengthControl - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthControl - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Labels[mapkey] = mapvalue - iNdEx = postIndex - case 4: - if wireType == 0 { - var v NodeSpec_Membership - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= NodeSpec_Membership(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Memberships = append(m.Memberships, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.Memberships) == 0 { - m.Memberships = make([]NodeSpec_Membership, 0, elementCount) - } - for iNdEx < postIndex { - var v NodeSpec_Membership - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= NodeSpec_Membership(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Memberships = append(m.Memberships, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Memberships", wireType) - } - case 5: - if wireType == 0 { - var v NodeRole - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= NodeRole(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Roles = append(m.Roles, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.Roles) == 0 { - m.Roles = make([]NodeRole, 0, elementCount) - } - for iNdEx < postIndex { - var v NodeRole - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= NodeRole(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Roles = append(m.Roles, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamePrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NamePrefixes = append(m.NamePrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeLabels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.NodeLabels == nil { - m.NodeLabels = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - 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 ErrIntOverflowControl - } - 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 ErrInvalidLengthControl - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthControl - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.NodeLabels[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListNodesResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: ListNodesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListNodesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Nodes = append(m.Nodes, &Node{}) - if err := m.Nodes[len(m.Nodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateNodeRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: UpdateNodeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateNodeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NodeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeVersion", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.NodeVersion == nil { - m.NodeVersion = &Version{} - } - if err := m.NodeVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Spec == nil { - m.Spec = &NodeSpec{} - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateNodeResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: UpdateNodeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateNodeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Node == nil { - m.Node = &Node{} - } - if err := m.Node.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveNodeRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveNodeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveNodeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NodeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Force", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Force = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveNodeResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveNodeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveNodeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetTaskRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: GetTaskRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TaskID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetTaskResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: GetTaskResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetTaskResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Task", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Task == nil { - m.Task = &Task{} - } - if err := m.Task.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveTaskRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveTaskRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TaskID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveTaskResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveTaskResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveTaskResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListTasksRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: ListTasksRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListTasksRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Filters == nil { - m.Filters = &ListTasksRequest_Filters{} - } - if err := m.Filters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListTasksRequest_Filters) Unmarshal(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 ErrIntOverflowControl - } - 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: Filters: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Filters: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IDPrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IDPrefixes = append(m.IDPrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - 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 ErrIntOverflowControl - } - 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 ErrInvalidLengthControl - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthControl - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Labels[mapkey] = mapvalue - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceIDs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceIDs = append(m.ServiceIDs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeIDs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NodeIDs = append(m.NodeIDs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType == 0 { - var v TaskState - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= TaskState(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.DesiredStates = append(m.DesiredStates, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.DesiredStates) == 0 { - m.DesiredStates = make([]TaskState, 0, elementCount) - } - for iNdEx < postIndex { - var v TaskState - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= TaskState(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.DesiredStates = append(m.DesiredStates, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredStates", wireType) - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamePrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NamePrefixes = append(m.NamePrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UpToDate", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.UpToDate = bool(v != 0) - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Runtimes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Runtimes = append(m.Runtimes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListTasksResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: ListTasksResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListTasksResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tasks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tasks = append(m.Tasks, &Task{}) - if err := m.Tasks[len(m.Tasks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CreateServiceRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: CreateServiceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CreateServiceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Spec == nil { - m.Spec = &ServiceSpec{} - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CreateServiceResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: CreateServiceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CreateServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Service == nil { - m.Service = &Service{} - } - if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetServiceRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: GetServiceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetServiceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field InsertDefaults", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.InsertDefaults = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetServiceResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: GetServiceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Service == nil { - m.Service = &Service{} - } - if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateServiceRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: UpdateServiceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateServiceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceVersion", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ServiceVersion == nil { - m.ServiceVersion = &Version{} - } - if err := m.ServiceVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Spec == nil { - m.Spec = &ServiceSpec{} - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Rollback", wireType) - } - m.Rollback = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Rollback |= UpdateServiceRequest_Rollback(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateServiceResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: UpdateServiceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Service == nil { - m.Service = &Service{} - } - if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveServiceRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveServiceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveServiceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveServiceResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveServiceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListServicesRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: ListServicesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListServicesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Filters == nil { - m.Filters = &ListServicesRequest_Filters{} - } - if err := m.Filters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListServicesRequest_Filters) Unmarshal(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 ErrIntOverflowControl - } - 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: Filters: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Filters: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IDPrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IDPrefixes = append(m.IDPrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - 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 ErrIntOverflowControl - } - 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 ErrInvalidLengthControl - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthControl - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Labels[mapkey] = mapvalue - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamePrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NamePrefixes = append(m.NamePrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Runtimes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Runtimes = append(m.Runtimes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListServicesResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: ListServicesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListServicesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Services = append(m.Services, &Service{}) - if err := m.Services[len(m.Services)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListServiceStatusesRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: ListServiceStatusesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListServiceStatusesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Services = append(m.Services, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListServiceStatusesResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: ListServiceStatusesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListServiceStatusesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Statuses", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Statuses = append(m.Statuses, &ListServiceStatusesResponse_ServiceStatus{}) - if err := m.Statuses[len(m.Statuses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListServiceStatusesResponse_ServiceStatus) Unmarshal(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 ErrIntOverflowControl - } - 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: ServiceStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredTasks", wireType) - } - m.DesiredTasks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DesiredTasks |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RunningTasks", wireType) - } - m.RunningTasks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RunningTasks |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CompletedTasks", wireType) - } - m.CompletedTasks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CompletedTasks |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CreateNetworkRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: CreateNetworkRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CreateNetworkRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Spec == nil { - m.Spec = &NetworkSpec{} - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CreateNetworkResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: CreateNetworkResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CreateNetworkResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Network == nil { - m.Network = &Network{} - } - if err := m.Network.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetNetworkRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: GetNetworkRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetNetworkRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NetworkID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NetworkID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetNetworkResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: GetNetworkResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetNetworkResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Network == nil { - m.Network = &Network{} - } - if err := m.Network.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveNetworkRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveNetworkRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveNetworkRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NetworkID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NetworkID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveNetworkResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveNetworkResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveNetworkResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListNetworksRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: ListNetworksRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListNetworksRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Filters == nil { - m.Filters = &ListNetworksRequest_Filters{} - } - if err := m.Filters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListNetworksRequest_Filters) Unmarshal(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 ErrIntOverflowControl - } - 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: Filters: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Filters: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IDPrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IDPrefixes = append(m.IDPrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - 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 ErrIntOverflowControl - } - 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 ErrInvalidLengthControl - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthControl - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Labels[mapkey] = mapvalue - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamePrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NamePrefixes = append(m.NamePrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListNetworksResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: ListNetworksResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListNetworksResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Networks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Networks = append(m.Networks, &Network{}) - if err := m.Networks[len(m.Networks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetClusterRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: GetClusterRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetClusterRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClusterID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetClusterResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: GetClusterResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetClusterResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Cluster == nil { - m.Cluster = &Cluster{} - } - if err := m.Cluster.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListClustersRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: ListClustersRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListClustersRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Filters == nil { - m.Filters = &ListClustersRequest_Filters{} - } - if err := m.Filters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListClustersRequest_Filters) Unmarshal(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 ErrIntOverflowControl - } - 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: Filters: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Filters: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IDPrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IDPrefixes = append(m.IDPrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - 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 ErrIntOverflowControl - } - 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 ErrInvalidLengthControl - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthControl - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Labels[mapkey] = mapvalue - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamePrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NamePrefixes = append(m.NamePrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListClustersResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: ListClustersResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListClustersResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Clusters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Clusters = append(m.Clusters, &Cluster{}) - if err := m.Clusters[len(m.Clusters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *KeyRotation) Unmarshal(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 ErrIntOverflowControl - } - 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: KeyRotation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: KeyRotation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WorkerJoinToken", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.WorkerJoinToken = bool(v != 0) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ManagerJoinToken", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ManagerJoinToken = bool(v != 0) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ManagerUnlockKey", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ManagerUnlockKey = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateClusterRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: UpdateClusterRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateClusterRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClusterID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterVersion", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ClusterVersion == nil { - m.ClusterVersion = &Version{} - } - if err := m.ClusterVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Spec == nil { - m.Spec = &ClusterSpec{} - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rotation", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Rotation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateClusterResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: UpdateClusterResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateClusterResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Cluster == nil { - m.Cluster = &Cluster{} - } - if err := m.Cluster.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetSecretRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: GetSecretRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetSecretRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SecretID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SecretID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetSecretResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: GetSecretResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetSecretResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Secret == nil { - m.Secret = &Secret{} - } - if err := m.Secret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateSecretRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: UpdateSecretRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateSecretRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SecretID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SecretID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SecretVersion", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SecretVersion == nil { - m.SecretVersion = &Version{} - } - if err := m.SecretVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Spec == nil { - m.Spec = &SecretSpec{} - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateSecretResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: UpdateSecretResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateSecretResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Secret == nil { - m.Secret = &Secret{} - } - if err := m.Secret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListSecretsRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: ListSecretsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListSecretsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Filters == nil { - m.Filters = &ListSecretsRequest_Filters{} - } - if err := m.Filters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListSecretsRequest_Filters) Unmarshal(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 ErrIntOverflowControl - } - 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: Filters: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Filters: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IDPrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IDPrefixes = append(m.IDPrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - 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 ErrIntOverflowControl - } - 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 ErrInvalidLengthControl - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthControl - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Labels[mapkey] = mapvalue - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamePrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NamePrefixes = append(m.NamePrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListSecretsResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: ListSecretsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListSecretsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secrets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Secrets = append(m.Secrets, &Secret{}) - if err := m.Secrets[len(m.Secrets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CreateSecretRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: CreateSecretRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CreateSecretRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Spec == nil { - m.Spec = &SecretSpec{} - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CreateSecretResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: CreateSecretResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CreateSecretResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Secret == nil { - m.Secret = &Secret{} - } - if err := m.Secret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveSecretRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveSecretRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveSecretRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SecretID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SecretID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveSecretResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveSecretResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveSecretResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetConfigRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: GetConfigRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetConfigRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConfigID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConfigID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetConfigResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: GetConfigResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetConfigResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Config == nil { - m.Config = &Config{} - } - if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateConfigRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: UpdateConfigRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateConfigRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConfigID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConfigID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConfigVersion", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ConfigVersion == nil { - m.ConfigVersion = &Version{} - } - if err := m.ConfigVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Spec == nil { - m.Spec = &ConfigSpec{} - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateConfigResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: UpdateConfigResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateConfigResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Config == nil { - m.Config = &Config{} - } - if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListConfigsRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: ListConfigsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListConfigsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Filters == nil { - m.Filters = &ListConfigsRequest_Filters{} - } - if err := m.Filters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListConfigsRequest_Filters) Unmarshal(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 ErrIntOverflowControl - } - 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: Filters: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Filters: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IDPrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IDPrefixes = append(m.IDPrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - 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 ErrIntOverflowControl - } - 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 ErrInvalidLengthControl - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthControl - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Labels[mapkey] = mapvalue - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamePrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NamePrefixes = append(m.NamePrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListConfigsResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: ListConfigsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListConfigsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Configs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Configs = append(m.Configs, &Config{}) - if err := m.Configs[len(m.Configs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CreateConfigRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: CreateConfigRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CreateConfigRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Spec == nil { - m.Spec = &ConfigSpec{} - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CreateConfigResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: CreateConfigResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CreateConfigResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Config == nil { - m.Config = &Config{} - } - if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveConfigRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveConfigRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveConfigRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConfigID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConfigID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveConfigResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveConfigResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveConfigResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CreateExtensionRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: CreateExtensionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CreateExtensionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Annotations == nil { - m.Annotations = &Annotations{} - } - if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CreateExtensionResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: CreateExtensionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CreateExtensionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extension", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Extension == nil { - m.Extension = &Extension{} - } - if err := m.Extension.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveExtensionRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveExtensionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveExtensionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExtensionID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExtensionID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveExtensionResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveExtensionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveExtensionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetExtensionRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: GetExtensionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetExtensionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExtensionID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExtensionID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetExtensionResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: GetExtensionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetExtensionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extension", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Extension == nil { - m.Extension = &Extension{} - } - if err := m.Extension.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CreateResourceRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: CreateResourceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CreateResourceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Annotations == nil { - m.Annotations = &Annotations{} - } - if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Payload == nil { - m.Payload = &types.Any{} - } - if err := m.Payload.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CreateResourceResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: CreateResourceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CreateResourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Resource == nil { - m.Resource = &Resource{} - } - if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveResourceRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveResourceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveResourceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResourceID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveResourceResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveResourceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveResourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateResourceRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: UpdateResourceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateResourceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResourceID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceVersion", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ResourceVersion == nil { - m.ResourceVersion = &Version{} - } - if err := m.ResourceVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Annotations == nil { - m.Annotations = &Annotations{} - } - if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Payload == nil { - m.Payload = &types.Any{} - } - if err := m.Payload.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateResourceResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: UpdateResourceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateResourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Resource == nil { - m.Resource = &Resource{} - } - if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetResourceRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: GetResourceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetResourceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResourceID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetResourceResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: GetResourceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetResourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Resource == nil { - m.Resource = &Resource{} - } - if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListResourcesRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: ListResourcesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Filters == nil { - m.Filters = &ListResourcesRequest_Filters{} - } - if err := m.Filters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListResourcesRequest_Filters) Unmarshal(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 ErrIntOverflowControl - } - 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: Filters: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Filters: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IDPrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IDPrefixes = append(m.IDPrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - 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 ErrIntOverflowControl - } - 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 ErrInvalidLengthControl - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthControl - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Labels[mapkey] = mapvalue - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamePrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NamePrefixes = append(m.NamePrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListResourcesResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: ListResourcesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CreateVolumeRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: CreateVolumeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CreateVolumeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Spec == nil { - m.Spec = &VolumeSpec{} - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CreateVolumeResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: CreateVolumeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CreateVolumeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volume", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Volume == nil { - m.Volume = &Volume{} - } - if err := m.Volume.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetVolumeRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: GetVolumeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetVolumeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VolumeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetVolumeResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: GetVolumeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetVolumeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volume", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Volume == nil { - m.Volume = &Volume{} - } - if err := m.Volume.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateVolumeRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: UpdateVolumeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateVolumeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VolumeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeVersion", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VolumeVersion == nil { - m.VolumeVersion = &Version{} - } - if err := m.VolumeVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Spec == nil { - m.Spec = &VolumeSpec{} - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateVolumeResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: UpdateVolumeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateVolumeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volume", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Volume == nil { - m.Volume = &Volume{} - } - if err := m.Volume.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListVolumesRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: ListVolumesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListVolumesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Filters == nil { - m.Filters = &ListVolumesRequest_Filters{} - } - if err := m.Filters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListVolumesRequest_Filters) Unmarshal(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 ErrIntOverflowControl - } - 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: Filters: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Filters: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IDPrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IDPrefixes = append(m.IDPrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - 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 ErrIntOverflowControl - } - 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 ErrInvalidLengthControl - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthControl - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthControl - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Labels[mapkey] = mapvalue - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamePrefixes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NamePrefixes = append(m.NamePrefixes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Groups", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Groups = append(m.Groups, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Drivers", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Drivers = append(m.Drivers, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListVolumesResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: ListVolumesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListVolumesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Volumes = append(m.Volumes, &Volume{}) - if err := m.Volumes[len(m.Volumes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveVolumeRequest) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveVolumeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveVolumeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VolumeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Force", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Force = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveVolumeResponse) Unmarshal(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 ErrIntOverflowControl - } - 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: RemoveVolumeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveVolumeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipControl(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowControl - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowControl - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowControl - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthControl - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupControl - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthControl - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthControl = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowControl = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupControl = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/moby/swarmkit/v2/api/control.proto b/vendor/github.com/moby/swarmkit/v2/api/control.proto deleted file mode 100644 index 12653f1555..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/control.proto +++ /dev/null @@ -1,871 +0,0 @@ -syntax = "proto3"; - -package docker.swarmkit.v1; - -import "github.com/docker/swarmkit/api/specs.proto"; -import "github.com/docker/swarmkit/api/objects.proto"; -import "github.com/docker/swarmkit/api/types.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "github.com/docker/swarmkit/protobuf/plugin/plugin.proto"; - -// Control defines the RPC methods for controlling a cluster. -service Control { - rpc GetNode(GetNodeRequest) returns (GetNodeResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - rpc ListNodes(ListNodesRequest) returns (ListNodesResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - rpc UpdateNode(UpdateNodeRequest) returns (UpdateNodeResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - rpc RemoveNode(RemoveNodeRequest) returns (RemoveNodeResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - - rpc GetTask(GetTaskRequest) returns (GetTaskResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - rpc RemoveTask(RemoveTaskRequest) returns (RemoveTaskResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - - rpc GetService(GetServiceRequest) returns (GetServiceResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - rpc ListServices(ListServicesRequest) returns (ListServicesResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - rpc CreateService(CreateServiceRequest) returns (CreateServiceResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - rpc UpdateService(UpdateServiceRequest) returns (UpdateServiceResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - rpc RemoveService(RemoveServiceRequest) returns (RemoveServiceResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - - // ListServiceStatuses returns a `ListServiceStatusesResponse` with the - // status of the requested services, formed by computing the number of - // running vs desired tasks. It is provided as a shortcut or helper method, - // which allows a client to avoid having to calculate this value by listing - // all Tasks. If any service requested does not exist, it will be returned - // but with empty status values. - rpc ListServiceStatuses(ListServiceStatusesRequest) returns (ListServiceStatusesResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - - rpc GetNetwork(GetNetworkRequest) returns (GetNetworkResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - rpc ListNetworks(ListNetworksRequest) returns (ListNetworksResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - rpc CreateNetwork(CreateNetworkRequest) returns (CreateNetworkResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - rpc RemoveNetwork(RemoveNetworkRequest) returns (RemoveNetworkResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - - rpc GetCluster(GetClusterRequest) returns (GetClusterResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - rpc UpdateCluster(UpdateClusterRequest) returns (UpdateClusterResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - - // --- secret APIs --- - - // GetSecret returns a `GetSecretResponse` with a `Secret` with the same - // id as `GetSecretRequest.SecretID` - // - Returns `NotFound` if the Secret with the given id is not found. - // - Returns `InvalidArgument` if the `GetSecretRequest.SecretID` is empty. - // - Returns an error if getting fails. - rpc GetSecret(GetSecretRequest) returns (GetSecretResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - // UpdateSecret returns a `UpdateSecretResponse` with a `Secret` with the same - // id as `GetSecretRequest.SecretID` - // - Returns `NotFound` if the Secret with the given id is not found. - // - Returns `InvalidArgument` if the `GetSecretRequest.SecretID` is empty. - // - Returns an error if updating fails. - rpc UpdateSecret(UpdateSecretRequest) returns (UpdateSecretResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - - // ListSecrets returns a `ListSecretResponse` with a list of all non-internal `Secret`s being - // managed, or all secrets matching any name in `ListSecretsRequest.Names`, any - // name prefix in `ListSecretsRequest.NamePrefixes`, any id in - // `ListSecretsRequest.SecretIDs`, or any id prefix in `ListSecretsRequest.IDPrefixes`. - // - Returns an error if listing fails. - rpc ListSecrets(ListSecretsRequest) returns (ListSecretsResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - // CreateSecret creates and return a `CreateSecretResponse` with a `Secret` based - // on the provided `CreateSecretRequest.SecretSpec`. - // - Returns `InvalidArgument` if the `CreateSecretRequest.SecretSpec` is malformed, - // or if the secret data is too long or contains invalid characters. - // - Returns an error if the creation fails. - rpc CreateSecret(CreateSecretRequest) returns (CreateSecretResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - // RemoveSecret removes the secret referenced by `RemoveSecretRequest.ID`. - // - Returns `InvalidArgument` if `RemoveSecretRequest.ID` is empty. - // - Returns `NotFound` if the a secret named `RemoveSecretRequest.ID` is not found. - // - Returns an error if the deletion fails. - rpc RemoveSecret(RemoveSecretRequest) returns (RemoveSecretResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - // --- config APIs --- - - // GetConfig returns a `GetConfigResponse` with a `Config` with the same - // id as `GetConfigRequest.ConfigID` - // - Returns `NotFound` if the Config with the given id is not found. - // - Returns `InvalidArgument` if the `GetConfigRequest.ConfigID` is empty. - // - Returns an error if getting fails. - rpc GetConfig(GetConfigRequest) returns (GetConfigResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - // UpdateConfig returns a `UpdateConfigResponse` with a `Config` with the same - // id as `GetConfigRequest.ConfigID` - // - Returns `NotFound` if the Config with the given id is not found. - // - Returns `InvalidArgument` if the `GetConfigRequest.ConfigID` is empty. - // - Returns an error if updating fails. - rpc UpdateConfig(UpdateConfigRequest) returns (UpdateConfigResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - - // ListConfigs returns a `ListConfigResponse` with a list of `Config`s being - // managed, or all configs matching any name in `ListConfigsRequest.Names`, any - // name prefix in `ListConfigsRequest.NamePrefixes`, any id in - // `ListConfigsRequest.ConfigIDs`, or any id prefix in `ListConfigsRequest.IDPrefixes`. - // - Returns an error if listing fails. - rpc ListConfigs(ListConfigsRequest) returns (ListConfigsResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - // CreateConfig creates and return a `CreateConfigResponse` with a `Config` based - // on the provided `CreateConfigRequest.ConfigSpec`. - // - Returns `InvalidArgument` if the `CreateConfigRequest.ConfigSpec` is malformed, - // or if the config data is too long or contains invalid characters. - // - Returns an error if the creation fails. - rpc CreateConfig(CreateConfigRequest) returns (CreateConfigResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - // RemoveConfig removes the config referenced by `RemoveConfigRequest.ID`. - // - Returns `InvalidArgument` if `RemoveConfigRequest.ID` is empty. - // - Returns `NotFound` if the a config named `RemoveConfigRequest.ID` is not found. - // - Returns an error if the deletion fails. - rpc RemoveConfig(RemoveConfigRequest) returns (RemoveConfigResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - // --- extension APIs --- - - // GetExtension returns a `GetExtensionResponse` with a `Extension` with the same - // id as `GetExtensionRequest.ExtensionId` - // - Returns `NotFound` if the Extension with the given id is not found. - // - Returns `InvalidArgument` if the `GetExtensionRequest.ExtensionId` is empty. - // - Returns an error if the get fails. - rpc GetExtension(GetExtensionRequest) returns (GetExtensionResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - // CreateExtension creates an `Extension` based on the provided `CreateExtensionRequest.Extension` - // and returns a `CreateExtensionResponse`. - // - Returns `InvalidArgument` if the `CreateExtensionRequest.Extension` is malformed, - // or fails validation. - // - Returns an error if the creation fails. - rpc CreateExtension(CreateExtensionRequest) returns (CreateExtensionResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - // RemoveExtension removes the extension referenced by `RemoveExtensionRequest.ID`. - // - Returns `InvalidArgument` if `RemoveExtensionRequest.ExtensionId` is empty. - // - Returns `NotFound` if the an extension named `RemoveExtensionRequest.ExtensionId` is not found. - // - Returns an error if the deletion fails. - rpc RemoveExtension(RemoveExtensionRequest) returns (RemoveExtensionResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - // --- resource APIs --- - - // GetResource returns a `GetResourceResponse` with a `Resource` with the same - // id as `GetResourceRequest.Resource` - // - Returns `NotFound` if the Resource with the given id is not found. - // - Returns `InvalidArgument` if the `GetResourceRequest.Resource` is empty. - // - Returns an error if getting fails. - rpc GetResource(GetResourceRequest) returns (GetResourceResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - // UpdateResource updates the resource with the given `UpdateResourceRequest.Resource.Id` using the given `UpdateResourceRequest.Resource` and returns a `UpdateResourceResponse`. - // - Returns `NotFound` if the Resource with the given `UpdateResourceRequest.Resource.Id` is not found. - // - Returns `InvalidArgument` if the UpdateResourceRequest.Resource.Id` is empty. - // - Returns an error if updating fails. - rpc UpdateResource(UpdateResourceRequest) returns (UpdateResourceResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - // ListResources returns a `ListResourcesResponse` with a list of `Resource`s stored in the raft store, - // or all resources matching any name in `ListConfigsRequest.Names`, any - // name prefix in `ListResourcesRequest.NamePrefixes`, any id in - // `ListResourcesRequest.ResourceIDs`, or any id prefix in `ListResourcesRequest.IDPrefixes`, - // extension name equal to `ListResourcesRequest.Extension`. - // - Returns an error if listing fails. - rpc ListResources(ListResourcesRequest) returns (ListResourcesResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - // CreateResource returns a `CreateResourceResponse` after creating a `Resource` based - // on the provided `CreateResourceRequest.Resource`. - // - Returns `InvalidArgument` if the `CreateResourceRequest.Resource` is malformed, - // or if the config data is too long or contains invalid characters. - // - Returns an error if the creation fails. - rpc CreateResource(CreateResourceRequest) returns (CreateResourceResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - // RemoveResource removes the `Resource` referenced by `RemoveResourceRequest.ResourceID`. - // - Returns `InvalidArgument` if `RemoveResourceRequest.ResourceID` is empty. - // - Returns `NotFound` if the a resource named `RemoveResourceRequest.ResourceID` is not found. - // - Returns an error if the deletion fails. - rpc RemoveResource(RemoveResourceRequest) returns (RemoveResourceResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - // --- volumes APIs --- - - // CreateVolume returns a `CreateVolumeResponse` with a `Volume` based on the - // provided `CreateVolumeRequest.VolumeSpec`. - // - Returns `InvalidArgument` if the `CreateVolumeRequest.VolumeSpec` is - // malformed. - rpc CreateVolume(CreateVolumeRequest) returns (CreateVolumeResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - // GetVolume returns a `GetVolumeResponse` with a Volume with the same ID - // as `GetVolumeRequest.ID` - rpc GetVolume(GetVolumeRequest) returns (GetVolumeResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - rpc UpdateVolume(UpdateVolumeRequest) returns (UpdateVolumeResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - rpc ListVolumes(ListVolumesRequest) returns (ListVolumesResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } - - rpc RemoveVolume(RemoveVolumeRequest) returns (RemoveVolumeResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } -} - -message GetNodeRequest { - string node_id = 1; -} - -message GetNodeResponse { - Node node = 1; -} - -message ListNodesRequest { - message Filters { - repeated string names = 1; - repeated string id_prefixes = 2; - // Labels refers to engine labels, which are labels set by the user on the - // node and reported back to the managers - map labels = 3; - // NodeLabels are labels set on the node object on the managers. - map node_labels = 7; - repeated NodeSpec.Membership memberships = 4 [packed=false]; - repeated NodeRole roles = 5 [packed=false]; - // NamePrefixes matches all objects with the given prefixes - repeated string name_prefixes = 6; - } - - Filters filters = 1; -} - -message ListNodesResponse { - repeated Node nodes = 1; -} - -// UpdateNodeRequest requests an update to the specified node. This may be used -// to request a new availability for a node, such as PAUSE. Invalid updates -// will be denied and cause an error. -message UpdateNodeRequest { - string node_id = 1; - Version node_version = 2; - NodeSpec spec = 3; -} - -message UpdateNodeResponse { - Node node = 1; -} - -// RemoveNodeRequest requests to delete the specified node from store. -message RemoveNodeRequest { - string node_id = 1; - bool force = 2; -} - -message RemoveNodeResponse { -} - -message GetTaskRequest { - string task_id = 1; -} - -message GetTaskResponse { - Task task = 1; -} - -message RemoveTaskRequest { - string task_id = 1; -} - -message RemoveTaskResponse { -} - -message ListTasksRequest { - message Filters { - repeated string names = 1; - repeated string id_prefixes = 2; - map labels = 3; - repeated string service_ids = 4; - repeated string node_ids = 5; - repeated docker.swarmkit.v1.TaskState desired_states = 6 [packed=false]; - // NamePrefixes matches all objects with the given prefixes - repeated string name_prefixes = 7; - repeated string runtimes = 9; - - // UpToDate matches tasks that are consistent with the current - // service definition. - // Note: this is intended for internal status reporting rather - // than being exposed to users. It may be removed in the future. - bool up_to_date = 8; - } - - Filters filters = 1; -} - -message ListTasksResponse { - repeated Task tasks = 1; -} - -message CreateServiceRequest { - ServiceSpec spec = 1; -} - -message CreateServiceResponse { - Service service = 1; -} - -message GetServiceRequest { - string service_id = 1; - bool insert_defaults = 2; -} - -message GetServiceResponse { - Service service = 1; -} - -message UpdateServiceRequest { - string service_id = 1; - Version service_version = 2; - ServiceSpec spec = 3; - - enum Rollback { - // This is not a rollback. The spec field of the request will - // be honored. - NONE = 0; - - // Roll back the service - get spec from the service's - // previous_spec. - PREVIOUS = 1; - } - - // Rollback may be set to PREVIOUS to request a rollback (the service's - // spec will be set to the value of its previous_spec field). In this - // case, the spec field of this request is ignored. - Rollback rollback = 4; -} - -message UpdateServiceResponse { - Service service = 1; -} - -message RemoveServiceRequest { - string service_id = 1; -} - -message RemoveServiceResponse { -} - -message ListServicesRequest { - message Filters { - repeated string names = 1; - repeated string id_prefixes = 2; - map labels = 3; - // NamePrefixes matches all objects with the given prefixes - repeated string name_prefixes = 4; - repeated string runtimes = 5; - } - - Filters filters = 1; -} - -message ListServicesResponse { - repeated Service services = 1; -} - -// ListServiceStatusesRequest is a request to get the aggregate status of a -// service by computing the number of running vs desired tasks. It includes -// only a service ID. -message ListServiceStatusesRequest { - // Services is a list of service IDs to get statuses for. - repeated string services = 1; -} - -// ListServiceStatusesResponse is a response containing the aggregate status of -// a service, formed by computing the number of running vs desired tasks. The -// values returned are only valid for the point in time at which the request is -// made. -message ListServiceStatusesResponse { - message ServiceStatus { - // ServiceID is the ID of the service this status describes - string service_id = 1; - - // DesiredTasks is the number of tasks desired to be running according to the - // service definition at request time. It is a uint64 because that is what - // the replicas field on the service spec is - uint64 desired_tasks = 2; - - // RunningTasks is the number of tasks currently in the Running state at - // request time. This may be larger than desired tasks if, for example, a - // service has been scaled down. - uint64 running_tasks = 3; - - // CompletedTasks is the number of tasks in state Completed, if this - // service is in mode ReplicatedJob or GlobalJob. This must be - // cross-referenced with the service type, because the default value of 0 - // may mean that a service is not in a Job mode, or it may mean the Job has - // yet to complete any Tasks. - uint64 completed_tasks = 4; - } - - repeated ServiceStatus statuses = 1; -} - -message CreateNetworkRequest { - NetworkSpec spec = 1; -} - -message CreateNetworkResponse { - Network network = 1; -} - -message GetNetworkRequest { - string name = 1; - string network_id = 2; -} - -message GetNetworkResponse { - Network network = 1; -} - -message RemoveNetworkRequest { - string name = 1; - string network_id = 2; -} - -message RemoveNetworkResponse {} - -message ListNetworksRequest { - message Filters { - repeated string names = 1; - repeated string id_prefixes = 2; - map labels = 3; - // NamePrefixes matches all objects with the given prefixes - repeated string name_prefixes = 4; - } - - Filters filters = 1; -} - -message ListNetworksResponse { - repeated Network networks = 1; -} - -message GetClusterRequest { - string cluster_id = 1; -} - -message GetClusterResponse { - Cluster cluster = 1; -} - -message ListClustersRequest { - message Filters { - repeated string names = 1; - repeated string id_prefixes = 2; - map labels = 3; - // NamePrefixes matches all objects with the given prefixes - repeated string name_prefixes = 4; - } - - Filters filters = 1; -} - -message ListClustersResponse { - repeated Cluster clusters = 1; -} - -// KeyRotation tells UpdateCluster what items to rotate -message KeyRotation { - // WorkerJoinToken tells UpdateCluster to rotate the worker secret token. - bool worker_join_token = 1; - - // ManagerJoinToken tells UpdateCluster to rotate the manager secret token. - bool manager_join_token = 2; - - // ManagerUnlockKey tells UpdateCluster to rotate the manager unlock key - bool manager_unlock_key = 3; - -} - -message UpdateClusterRequest { - // ClusterID is the cluster ID to update. - string cluster_id = 1; - - // ClusterVersion is the version of the cluster being updated. - Version cluster_version = 2; - - // Spec is the new spec to apply to the cluster. - ClusterSpec spec = 3; - - // Rotation contains flags for join token and unlock key rotation - KeyRotation rotation = 4 [(gogoproto.nullable) = false]; -} - -message UpdateClusterResponse { - Cluster cluster = 1; -} - -// GetSecretRequest is the request to get a `Secret` object given a secret id. -message GetSecretRequest { - string secret_id = 1; -} - -// GetSecretResponse contains the Secret corresponding to the id in -// `GetSecretRequest`, but the `Secret.Spec.Data` field in each `Secret` -// object should be nil instead of actually containing the secret bytes. -message GetSecretResponse { - Secret secret = 1; -} - -message UpdateSecretRequest { - // SecretID is the secret ID to update. - string secret_id = 1; - - // SecretVersion is the version of the secret being updated. - Version secret_version = 2; - - // Spec is the new spec to apply to the Secret - // Only some fields are allowed to be updated. - SecretSpec spec = 3; -} - -message UpdateSecretResponse { - Secret secret = 1; -} - -// ListSecretRequest is the request to list all non-internal secrets in the secret store, -// or all secrets filtered by (name or name prefix or id prefix) and labels. -message ListSecretsRequest { - message Filters { - repeated string names = 1; - repeated string id_prefixes = 2; - map labels = 3; - repeated string name_prefixes = 4; - } - - Filters filters = 1; -} - -// ListSecretResponse contains a list of all the secrets that match the name or -// name prefix filters provided in `ListSecretRequest`. The `Secret.Spec.Data` -// field in each `Secret` object should be nil instead of actually containing -// the secret bytes. -message ListSecretsResponse { - repeated Secret secrets = 1; -} - -// CreateSecretRequest specifies a new secret (it will not update an existing -// secret) to create. -message CreateSecretRequest { - SecretSpec spec = 1; -} - -// CreateSecretResponse contains the newly created `Secret` corresponding to the -// name in `CreateSecretRequest`. The `Secret.Spec.Data` field should be nil instead -// of actually containing the secret bytes. -message CreateSecretResponse { - Secret secret = 1; -} - -// RemoveSecretRequest contains the ID of the secret that should be removed. This -// removes all versions of the secret. -message RemoveSecretRequest { - string secret_id = 1; -} - -// RemoveSecretResponse is an empty object indicating the successful removal of -// a secret. -message RemoveSecretResponse {} - -// GetConfigRequest is the request to get a `Config` object given a config id. -message GetConfigRequest { - string config_id = 1; -} - -// GetConfigResponse contains the Config corresponding to the id in -// `GetConfigRequest`. -message GetConfigResponse { - Config config = 1; -} - -message UpdateConfigRequest { - // ConfigID is the config ID to update. - string config_id = 1; - - // ConfigVersion is the version of the config being updated. - Version config_version = 2; - - // Spec is the new spec to apply to the Config - // Only some fields are allowed to be updated. - ConfigSpec spec = 3; -} - -message UpdateConfigResponse { - Config config = 1; -} - -// ListConfigRequest is the request to list all configs in the config store, -// or all configs filtered by (name or name prefix or id prefix) and labels. -message ListConfigsRequest { - message Filters { - repeated string names = 1; - repeated string id_prefixes = 2; - map labels = 3; - repeated string name_prefixes = 4; - } - - Filters filters = 1; -} - -// ListConfigResponse contains a list of all the configs that match the name or -// name prefix filters provided in `ListConfigRequest`. -message ListConfigsResponse { - repeated Config configs = 1; -} - -// CreateConfigRequest specifies a new config (it will not update an existing -// config) to create. -message CreateConfigRequest { - ConfigSpec spec = 1; -} - -// CreateConfigResponse contains the newly created `Config` corresponding to the -// name in `CreateConfigRequest`. -message CreateConfigResponse { - Config config = 1; -} - -// RemoveConfigRequest contains the ID of the config that should be removed. This -// removes all versions of the config. -message RemoveConfigRequest { - string config_id = 1; -} - -// RemoveConfigResponse is an empty object indicating the successful removal of -// a config. -message RemoveConfigResponse {} - -// CreateExtensionRequest creates a new extension as specified by the provided -// parameters -message CreateExtensionRequest { - Annotations annotations = 1; - string description = 2; -} - -// CreateExtensionResponse contains the newly created `Extension` corresponding -// to the parameters in the CreateExtensionRequest. -message CreateExtensionResponse { - Extension extension = 1; -} - -// RemoveExtensionRequest contains the ID of the extension that should be removed. This -// removes all versions of the extension. -message RemoveExtensionRequest { - string extension_id = 1; -} - -// RemoveExtensionResponse is an empty object indicating the successful removal -// of an extension. -message RemoveExtensionResponse { -} - -// GetResourceRequest is the request to get a Extension object given a extension id. -message GetExtensionRequest { - string extension_id = 1; -} - -// GetExtensionResponse contains the Extension corresponding to the id in -// `GetExtensionRequest`. -message GetExtensionResponse { - Extension extension = 1; -} - -// CreateResourceRequest creates a new resource specified by the included -// resource object. An existing resource will not be updated. -message CreateResourceRequest { - Annotations annotations = 1; - string kind = 2; - google.protobuf.Any payload = 3; -} - -// CreateResourceResponse contains the newly created `Resource` corresponding -// to the resource in the CreateResourceRequest. -message CreateResourceResponse { - Resource resource = 1; -} - -// RemoveResourceRequest contains the ID of the resource that should be removed. This -// removes all versions of the resource. -message RemoveResourceRequest { - string resource_id = 1; -} - -// RemoveResourceResponse is an empty object indicating the successful removal -// of a resource. -message RemoveResourceResponse { -} - -// UpdateResourceRequest updates the resource specified by the given resource object. -message UpdateResourceRequest { - string resource_id = 1; - Version resource_version = 2; - // Annotations describes the annotations to update. If the Annotations should - // be unchanged, then this field should be left empty. Note that the name of - // a Resource cannot be changed, only its labels. - Annotations annotations = 3; - // Payload describes the new payload of the resource. If the Payload should - // be unchanged, then this field should be left empty. - google.protobuf.Any payload = 4; -} - -message UpdateResourceResponse { - Resource resource = 1; -} - -// GetResourceRequest is the request to get a Resource object given a resource id. -message GetResourceRequest { - string resource_id = 1; -} - -// GetResourceResponse contains the Resource corresponding to the id in -// `GetResourceRequest`. -message GetResourceResponse { - Resource resource = 1; -} - -// ListResourcesRequest is the request to list all resources in the raft store, -// or all resources filtered by (name or name prefix or id prefix), labels and extension. -message ListResourcesRequest { - message Filters { - repeated string names = 1; - repeated string id_prefixes = 2; - map labels = 3; - repeated string name_prefixes = 4; - string kind = 5; - } - - Filters filters = 1; -} - -// ListResourcesResponse contains a list of all the resources that match the name or -// name prefix filters provided in `ListResourcesRequest`. -message ListResourcesResponse { - repeated Resource resources = 1; -} - -message CreateVolumeRequest { - VolumeSpec spec = 1; -} - -message CreateVolumeResponse { - Volume volume = 1; -} - -message GetVolumeRequest { - string volume_id = 1; -} - -message GetVolumeResponse { - Volume volume = 1; -} - -message UpdateVolumeRequest { - string volume_id = 1; - - Version volume_version = 2; - - VolumeSpec spec = 3; -} - -message UpdateVolumeResponse { - Volume volume = 1; -} - -message ListVolumesRequest { - message Filters { - repeated string names = 1; - repeated string id_prefixes = 2; - map labels = 3; - repeated string name_prefixes = 4; - repeated string groups = 5; - repeated string drivers = 6; - } - - Filters filters = 1; -} - -message ListVolumesResponse { - repeated Volume volumes = 1; -} - -message RemoveVolumeRequest { - string volume_id = 1; - // Force forces the volume to be deleted from swarmkit, regardless of - // whether its current state would permit such an action. - bool force = 2; -} - -message RemoveVolumeResponse {} diff --git a/vendor/github.com/moby/swarmkit/v2/api/deepcopy/copy.go b/vendor/github.com/moby/swarmkit/v2/api/deepcopy/copy.go deleted file mode 100644 index fd44621f01..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/deepcopy/copy.go +++ /dev/null @@ -1,59 +0,0 @@ -package deepcopy - -import ( - "fmt" - "time" - - "github.com/gogo/protobuf/types" -) - -// CopierFrom can be implemented if an object knows how to copy another into itself. -type CopierFrom interface { - // Copy takes the fields from src and copies them into the target object. - // - // Calling this method with a nil receiver or a nil src may panic. - CopyFrom(src interface{}) -} - -// Copy copies src into dst. dst and src must have the same type. -// -// If the type has a copy function defined, it will be used. -// -// Default implementations for builtin types and well known protobuf types may -// be provided. -// -// If the copy cannot be performed, this function will panic. Make sure to test -// types that use this function. -func Copy(dst, src interface{}) { - switch dst := dst.(type) { - case *types.Any: - src := src.(*types.Any) - dst.TypeUrl = src.TypeUrl - if src.Value != nil { - dst.Value = make([]byte, len(src.Value)) - copy(dst.Value, src.Value) - } else { - dst.Value = nil - } - case *types.Duration: - src := src.(*types.Duration) - *dst = *src - case *time.Duration: - src := src.(*time.Duration) - *dst = *src - case *types.Timestamp: - src := src.(*types.Timestamp) - *dst = *src - case *types.BoolValue: - src := src.(*types.BoolValue) - *dst = *src - case *types.Int64Value: - src := src.(*types.Int64Value) - *dst = *src - case CopierFrom: - dst.CopyFrom(src) - default: - panic(fmt.Sprintf("Copy for %T not implemented", dst)) - } - -} diff --git a/vendor/github.com/moby/swarmkit/v2/api/dispatcher.pb.go b/vendor/github.com/moby/swarmkit/v2/api/dispatcher.pb.go deleted file mode 100644 index 00542edd9d..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/dispatcher.pb.go +++ /dev/null @@ -1,5182 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/docker/swarmkit/api/dispatcher.proto - -package api - -import ( - context "context" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - github_com_moby_swarmkit_v2_api_deepcopy "github.com/moby/swarmkit/v2/api/deepcopy" - raftselector "github.com/moby/swarmkit/v2/manager/raftselector" - _ "github.com/moby/swarmkit/v2/protobuf/plugin" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - metadata "google.golang.org/grpc/metadata" - peer "google.golang.org/grpc/peer" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" - rafttime "time" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type AssignmentChange_AssignmentAction int32 - -const ( - AssignmentChange_AssignmentActionUpdate AssignmentChange_AssignmentAction = 0 - AssignmentChange_AssignmentActionRemove AssignmentChange_AssignmentAction = 1 -) - -var AssignmentChange_AssignmentAction_name = map[int32]string{ - 0: "UPDATE", - 1: "REMOVE", -} - -var AssignmentChange_AssignmentAction_value = map[string]int32{ - "UPDATE": 0, - "REMOVE": 1, -} - -func (x AssignmentChange_AssignmentAction) String() string { - return proto.EnumName(AssignmentChange_AssignmentAction_name, int32(x)) -} - -func (AssignmentChange_AssignmentAction) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{12, 0} -} - -// AssignmentType specifies whether this assignment message carries -// the full state, or is an update to an existing state. -type AssignmentsMessage_Type int32 - -const ( - AssignmentsMessage_COMPLETE AssignmentsMessage_Type = 0 - AssignmentsMessage_INCREMENTAL AssignmentsMessage_Type = 1 -) - -var AssignmentsMessage_Type_name = map[int32]string{ - 0: "COMPLETE", - 1: "INCREMENTAL", -} - -var AssignmentsMessage_Type_value = map[string]int32{ - "COMPLETE": 0, - "INCREMENTAL": 1, -} - -func (x AssignmentsMessage_Type) String() string { - return proto.EnumName(AssignmentsMessage_Type_name, int32(x)) -} - -func (AssignmentsMessage_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{13, 0} -} - -// SessionRequest starts a session. -type SessionRequest struct { - Description *NodeDescription `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - // SessionID can be provided to attempt resuming an existing session. If the - // SessionID is empty or invalid, a new SessionID will be assigned. - // - // See SessionMessage.SessionID for details. - SessionID string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` -} - -func (m *SessionRequest) Reset() { *m = SessionRequest{} } -func (*SessionRequest) ProtoMessage() {} -func (*SessionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{0} -} -func (m *SessionRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SessionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SessionRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SessionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SessionRequest.Merge(m, src) -} -func (m *SessionRequest) XXX_Size() int { - return m.Size() -} -func (m *SessionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SessionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SessionRequest proto.InternalMessageInfo - -// SessionMessage instructs an agent on various actions as part of the current -// session. An agent should act immediately on the contents. -type SessionMessage struct { - // SessionID is allocated after a successful registration. It should be - // used on all RPC calls after registration. A dispatcher may choose to - // change the SessionID, at which time an agent must re-register and obtain - // a new one. - // - // All Dispatcher calls after register should include the SessionID. If the - // Dispatcher so chooses, it may reject the call with an InvalidArgument - // error code, at which time the agent should call Register to start a new - // session. - // - // As a rule, once an agent has a SessionID, it should never save it to - // disk or try to otherwise reuse. If the agent loses its SessionID, it - // must start a new session through a call to Register. A Dispatcher may - // choose to reuse the SessionID, if it sees fit, but it is not advised. - // - // The actual implementation of the SessionID is Dispatcher specific and - // should be treated as opaque by agents. - // - // From a Dispatcher perspective, there are many ways to use the SessionID - // to ensure uniqueness of a set of client RPC calls. One method is to keep - // the SessionID unique to every call to Register in a single Dispatcher - // instance. This ensures that the SessionID represents the unique - // session from a single Agent to Manager. If the Agent restarts, we - // allocate a new session, since the restarted Agent is not aware of the - // new SessionID. - // - // The most compelling use case is to support duplicate node detection. If - // one clones a virtual machine, including certificate material, two nodes - // may end up with the same identity. This can also happen if two identical - // agent processes are coming from the same node. If the SessionID is - // replicated through the cluster, we can immediately detect the condition - // and address it. - // - // Extending from the case above, we can actually detect a compromised - // identity. Coupled with provisions to rebuild node identity, we can ban - // the compromised node identity and have the nodes re-authenticate and - // build a new identity. At this time, an administrator can then - // re-authorize the compromised nodes, if it was a mistake or ensure that a - // misbehaved node can no longer connect to the cluster. - // - // We considered placing this field in a GRPC header. Because this is a - // critical feature of the protocol, we thought it should be represented - // directly in the RPC message set. - SessionID string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` - // Node identifies the registering node. - Node *Node `protobuf:"bytes,2,opt,name=node,proto3" json:"node,omitempty"` - // Managers provides a weight list of alternative dispatchers - Managers []*WeightedPeer `protobuf:"bytes,3,rep,name=managers,proto3" json:"managers,omitempty"` - // Symmetric encryption key distributed by the lead manager. Used by agents - // for securing network bootstrapping and communication. - NetworkBootstrapKeys []*EncryptionKey `protobuf:"bytes,4,rep,name=network_bootstrap_keys,json=networkBootstrapKeys,proto3" json:"network_bootstrap_keys,omitempty"` - // Which root certificates to trust - RootCA []byte `protobuf:"bytes,5,opt,name=RootCA,proto3" json:"RootCA,omitempty"` -} - -func (m *SessionMessage) Reset() { *m = SessionMessage{} } -func (*SessionMessage) ProtoMessage() {} -func (*SessionMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{1} -} -func (m *SessionMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SessionMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SessionMessage.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SessionMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_SessionMessage.Merge(m, src) -} -func (m *SessionMessage) XXX_Size() int { - return m.Size() -} -func (m *SessionMessage) XXX_DiscardUnknown() { - xxx_messageInfo_SessionMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_SessionMessage proto.InternalMessageInfo - -// HeartbeatRequest provides identifying properties for a single heartbeat. -type HeartbeatRequest struct { - SessionID string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` -} - -func (m *HeartbeatRequest) Reset() { *m = HeartbeatRequest{} } -func (*HeartbeatRequest) ProtoMessage() {} -func (*HeartbeatRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{2} -} -func (m *HeartbeatRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HeartbeatRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HeartbeatRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HeartbeatRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HeartbeatRequest.Merge(m, src) -} -func (m *HeartbeatRequest) XXX_Size() int { - return m.Size() -} -func (m *HeartbeatRequest) XXX_DiscardUnknown() { - xxx_messageInfo_HeartbeatRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_HeartbeatRequest proto.InternalMessageInfo - -type HeartbeatResponse struct { - // Period is the duration to wait before sending the next heartbeat. - // Well-behaved agents should update this on every heartbeat round trip. - Period time.Duration `protobuf:"bytes,1,opt,name=period,proto3,stdduration" json:"period"` -} - -func (m *HeartbeatResponse) Reset() { *m = HeartbeatResponse{} } -func (*HeartbeatResponse) ProtoMessage() {} -func (*HeartbeatResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{3} -} -func (m *HeartbeatResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HeartbeatResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HeartbeatResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HeartbeatResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_HeartbeatResponse.Merge(m, src) -} -func (m *HeartbeatResponse) XXX_Size() int { - return m.Size() -} -func (m *HeartbeatResponse) XXX_DiscardUnknown() { - xxx_messageInfo_HeartbeatResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_HeartbeatResponse proto.InternalMessageInfo - -type UpdateTaskStatusRequest struct { - // Tasks should contain all statuses for running tasks. Only the status - // field must be set. The spec is not required. - SessionID string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` - Updates []*UpdateTaskStatusRequest_TaskStatusUpdate `protobuf:"bytes,3,rep,name=updates,proto3" json:"updates,omitempty"` -} - -func (m *UpdateTaskStatusRequest) Reset() { *m = UpdateTaskStatusRequest{} } -func (*UpdateTaskStatusRequest) ProtoMessage() {} -func (*UpdateTaskStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{4} -} -func (m *UpdateTaskStatusRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateTaskStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateTaskStatusRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateTaskStatusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateTaskStatusRequest.Merge(m, src) -} -func (m *UpdateTaskStatusRequest) XXX_Size() int { - return m.Size() -} -func (m *UpdateTaskStatusRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateTaskStatusRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateTaskStatusRequest proto.InternalMessageInfo - -type UpdateTaskStatusRequest_TaskStatusUpdate struct { - TaskID string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` - Status *TaskStatus `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` -} - -func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Reset() { - *m = UpdateTaskStatusRequest_TaskStatusUpdate{} -} -func (*UpdateTaskStatusRequest_TaskStatusUpdate) ProtoMessage() {} -func (*UpdateTaskStatusRequest_TaskStatusUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{4, 0} -} -func (m *UpdateTaskStatusRequest_TaskStatusUpdate) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateTaskStatusRequest_TaskStatusUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateTaskStatusRequest_TaskStatusUpdate.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateTaskStatusRequest_TaskStatusUpdate) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateTaskStatusRequest_TaskStatusUpdate.Merge(m, src) -} -func (m *UpdateTaskStatusRequest_TaskStatusUpdate) XXX_Size() int { - return m.Size() -} -func (m *UpdateTaskStatusRequest_TaskStatusUpdate) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateTaskStatusRequest_TaskStatusUpdate.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateTaskStatusRequest_TaskStatusUpdate proto.InternalMessageInfo - -type UpdateTaskStatusResponse struct { -} - -func (m *UpdateTaskStatusResponse) Reset() { *m = UpdateTaskStatusResponse{} } -func (*UpdateTaskStatusResponse) ProtoMessage() {} -func (*UpdateTaskStatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{5} -} -func (m *UpdateTaskStatusResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateTaskStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateTaskStatusResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateTaskStatusResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateTaskStatusResponse.Merge(m, src) -} -func (m *UpdateTaskStatusResponse) XXX_Size() int { - return m.Size() -} -func (m *UpdateTaskStatusResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateTaskStatusResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateTaskStatusResponse proto.InternalMessageInfo - -type UpdateVolumeStatusRequest struct { - SessionID string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` - Updates []*UpdateVolumeStatusRequest_VolumeStatusUpdate `protobuf:"bytes,2,rep,name=updates,proto3" json:"updates,omitempty"` -} - -func (m *UpdateVolumeStatusRequest) Reset() { *m = UpdateVolumeStatusRequest{} } -func (*UpdateVolumeStatusRequest) ProtoMessage() {} -func (*UpdateVolumeStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{6} -} -func (m *UpdateVolumeStatusRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateVolumeStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateVolumeStatusRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateVolumeStatusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateVolumeStatusRequest.Merge(m, src) -} -func (m *UpdateVolumeStatusRequest) XXX_Size() int { - return m.Size() -} -func (m *UpdateVolumeStatusRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateVolumeStatusRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateVolumeStatusRequest proto.InternalMessageInfo - -type UpdateVolumeStatusRequest_VolumeStatusUpdate struct { - // ID is the ID of the volume being updated. This is the Swarmkit ID, - // not the CSI VolumeID. - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Unpublished is set to true when the volume is affirmatively - // unpublished on the Node side. We don't need to report that a Volume - // is published on the the node; as soon as the Volume is assigned to - // the Node, we must assume that it has been published until informed - // otherwise. - // - // Further, the Node must not send unpublished = true unless it will - // definitely no longer attempt to call NodePublishVolume. - Unpublished bool `protobuf:"varint,2,opt,name=unpublished,proto3" json:"unpublished,omitempty"` -} - -func (m *UpdateVolumeStatusRequest_VolumeStatusUpdate) Reset() { - *m = UpdateVolumeStatusRequest_VolumeStatusUpdate{} -} -func (*UpdateVolumeStatusRequest_VolumeStatusUpdate) ProtoMessage() {} -func (*UpdateVolumeStatusRequest_VolumeStatusUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{6, 0} -} -func (m *UpdateVolumeStatusRequest_VolumeStatusUpdate) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateVolumeStatusRequest_VolumeStatusUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateVolumeStatusRequest_VolumeStatusUpdate.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateVolumeStatusRequest_VolumeStatusUpdate) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateVolumeStatusRequest_VolumeStatusUpdate.Merge(m, src) -} -func (m *UpdateVolumeStatusRequest_VolumeStatusUpdate) XXX_Size() int { - return m.Size() -} -func (m *UpdateVolumeStatusRequest_VolumeStatusUpdate) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateVolumeStatusRequest_VolumeStatusUpdate.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateVolumeStatusRequest_VolumeStatusUpdate proto.InternalMessageInfo - -type UpdateVolumeStatusResponse struct { -} - -func (m *UpdateVolumeStatusResponse) Reset() { *m = UpdateVolumeStatusResponse{} } -func (*UpdateVolumeStatusResponse) ProtoMessage() {} -func (*UpdateVolumeStatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{7} -} -func (m *UpdateVolumeStatusResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateVolumeStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateVolumeStatusResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateVolumeStatusResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateVolumeStatusResponse.Merge(m, src) -} -func (m *UpdateVolumeStatusResponse) XXX_Size() int { - return m.Size() -} -func (m *UpdateVolumeStatusResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateVolumeStatusResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateVolumeStatusResponse proto.InternalMessageInfo - -type TasksRequest struct { - SessionID string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` -} - -func (m *TasksRequest) Reset() { *m = TasksRequest{} } -func (*TasksRequest) ProtoMessage() {} -func (*TasksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{8} -} -func (m *TasksRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TasksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TasksRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TasksRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TasksRequest.Merge(m, src) -} -func (m *TasksRequest) XXX_Size() int { - return m.Size() -} -func (m *TasksRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TasksRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_TasksRequest proto.InternalMessageInfo - -type TasksMessage struct { - // Tasks is the set of tasks that should be running on the node. - // Tasks outside of this set running on the node should be terminated. - Tasks []*Task `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks,omitempty"` -} - -func (m *TasksMessage) Reset() { *m = TasksMessage{} } -func (*TasksMessage) ProtoMessage() {} -func (*TasksMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{9} -} -func (m *TasksMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TasksMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TasksMessage.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TasksMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_TasksMessage.Merge(m, src) -} -func (m *TasksMessage) XXX_Size() int { - return m.Size() -} -func (m *TasksMessage) XXX_DiscardUnknown() { - xxx_messageInfo_TasksMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_TasksMessage proto.InternalMessageInfo - -type AssignmentsRequest struct { - SessionID string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` -} - -func (m *AssignmentsRequest) Reset() { *m = AssignmentsRequest{} } -func (*AssignmentsRequest) ProtoMessage() {} -func (*AssignmentsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{10} -} -func (m *AssignmentsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AssignmentsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AssignmentsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AssignmentsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AssignmentsRequest.Merge(m, src) -} -func (m *AssignmentsRequest) XXX_Size() int { - return m.Size() -} -func (m *AssignmentsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AssignmentsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AssignmentsRequest proto.InternalMessageInfo - -type Assignment struct { - // Types that are valid to be assigned to Item: - // *Assignment_Task - // *Assignment_Secret - // *Assignment_Config - // *Assignment_Volume - Item isAssignment_Item `protobuf_oneof:"item"` -} - -func (m *Assignment) Reset() { *m = Assignment{} } -func (*Assignment) ProtoMessage() {} -func (*Assignment) Descriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{11} -} -func (m *Assignment) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Assignment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Assignment.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Assignment) XXX_Merge(src proto.Message) { - xxx_messageInfo_Assignment.Merge(m, src) -} -func (m *Assignment) XXX_Size() int { - return m.Size() -} -func (m *Assignment) XXX_DiscardUnknown() { - xxx_messageInfo_Assignment.DiscardUnknown(m) -} - -var xxx_messageInfo_Assignment proto.InternalMessageInfo - -type isAssignment_Item interface { - isAssignment_Item() - MarshalTo([]byte) (int, error) - Size() int -} - -type Assignment_Task struct { - Task *Task `protobuf:"bytes,1,opt,name=task,proto3,oneof" json:"task,omitempty"` -} -type Assignment_Secret struct { - Secret *Secret `protobuf:"bytes,2,opt,name=secret,proto3,oneof" json:"secret,omitempty"` -} -type Assignment_Config struct { - Config *Config `protobuf:"bytes,3,opt,name=config,proto3,oneof" json:"config,omitempty"` -} -type Assignment_Volume struct { - Volume *VolumeAssignment `protobuf:"bytes,4,opt,name=volume,proto3,oneof" json:"volume,omitempty"` -} - -func (*Assignment_Task) isAssignment_Item() {} -func (*Assignment_Secret) isAssignment_Item() {} -func (*Assignment_Config) isAssignment_Item() {} -func (*Assignment_Volume) isAssignment_Item() {} - -func (m *Assignment) GetItem() isAssignment_Item { - if m != nil { - return m.Item - } - return nil -} - -func (m *Assignment) GetTask() *Task { - if x, ok := m.GetItem().(*Assignment_Task); ok { - return x.Task - } - return nil -} - -func (m *Assignment) GetSecret() *Secret { - if x, ok := m.GetItem().(*Assignment_Secret); ok { - return x.Secret - } - return nil -} - -func (m *Assignment) GetConfig() *Config { - if x, ok := m.GetItem().(*Assignment_Config); ok { - return x.Config - } - return nil -} - -func (m *Assignment) GetVolume() *VolumeAssignment { - if x, ok := m.GetItem().(*Assignment_Volume); ok { - return x.Volume - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Assignment) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Assignment_Task)(nil), - (*Assignment_Secret)(nil), - (*Assignment_Config)(nil), - (*Assignment_Volume)(nil), - } -} - -type AssignmentChange struct { - Assignment *Assignment `protobuf:"bytes,1,opt,name=assignment,proto3" json:"assignment,omitempty"` - Action AssignmentChange_AssignmentAction `protobuf:"varint,2,opt,name=action,proto3,enum=docker.swarmkit.v1.AssignmentChange_AssignmentAction" json:"action,omitempty"` -} - -func (m *AssignmentChange) Reset() { *m = AssignmentChange{} } -func (*AssignmentChange) ProtoMessage() {} -func (*AssignmentChange) Descriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{12} -} -func (m *AssignmentChange) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AssignmentChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AssignmentChange.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AssignmentChange) XXX_Merge(src proto.Message) { - xxx_messageInfo_AssignmentChange.Merge(m, src) -} -func (m *AssignmentChange) XXX_Size() int { - return m.Size() -} -func (m *AssignmentChange) XXX_DiscardUnknown() { - xxx_messageInfo_AssignmentChange.DiscardUnknown(m) -} - -var xxx_messageInfo_AssignmentChange proto.InternalMessageInfo - -type AssignmentsMessage struct { - Type AssignmentsMessage_Type `protobuf:"varint,1,opt,name=type,proto3,enum=docker.swarmkit.v1.AssignmentsMessage_Type" json:"type,omitempty"` - // AppliesTo references the previous ResultsIn value, to chain - // incremental updates together. For the first update in a stream, - // AppliesTo is empty. If AppliesTo does not match the previously - // received ResultsIn, the consumer of the stream should start a new - // Assignments stream to re-sync. - AppliesTo string `protobuf:"bytes,2,opt,name=applies_to,json=appliesTo,proto3" json:"applies_to,omitempty"` - // ResultsIn identifies the result of this assignments message, to - // match against the next message's AppliesTo value and protect - // against missed messages. - ResultsIn string `protobuf:"bytes,3,opt,name=results_in,json=resultsIn,proto3" json:"results_in,omitempty"` - // AssignmentChange is a set of changes to apply on this node. - Changes []*AssignmentChange `protobuf:"bytes,4,rep,name=changes,proto3" json:"changes,omitempty"` -} - -func (m *AssignmentsMessage) Reset() { *m = AssignmentsMessage{} } -func (*AssignmentsMessage) ProtoMessage() {} -func (*AssignmentsMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_71002346457e55a8, []int{13} -} -func (m *AssignmentsMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AssignmentsMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AssignmentsMessage.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AssignmentsMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_AssignmentsMessage.Merge(m, src) -} -func (m *AssignmentsMessage) XXX_Size() int { - return m.Size() -} -func (m *AssignmentsMessage) XXX_DiscardUnknown() { - xxx_messageInfo_AssignmentsMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_AssignmentsMessage proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("docker.swarmkit.v1.AssignmentChange_AssignmentAction", AssignmentChange_AssignmentAction_name, AssignmentChange_AssignmentAction_value) - proto.RegisterEnum("docker.swarmkit.v1.AssignmentsMessage_Type", AssignmentsMessage_Type_name, AssignmentsMessage_Type_value) - proto.RegisterType((*SessionRequest)(nil), "docker.swarmkit.v1.SessionRequest") - proto.RegisterType((*SessionMessage)(nil), "docker.swarmkit.v1.SessionMessage") - proto.RegisterType((*HeartbeatRequest)(nil), "docker.swarmkit.v1.HeartbeatRequest") - proto.RegisterType((*HeartbeatResponse)(nil), "docker.swarmkit.v1.HeartbeatResponse") - proto.RegisterType((*UpdateTaskStatusRequest)(nil), "docker.swarmkit.v1.UpdateTaskStatusRequest") - proto.RegisterType((*UpdateTaskStatusRequest_TaskStatusUpdate)(nil), "docker.swarmkit.v1.UpdateTaskStatusRequest.TaskStatusUpdate") - proto.RegisterType((*UpdateTaskStatusResponse)(nil), "docker.swarmkit.v1.UpdateTaskStatusResponse") - proto.RegisterType((*UpdateVolumeStatusRequest)(nil), "docker.swarmkit.v1.UpdateVolumeStatusRequest") - proto.RegisterType((*UpdateVolumeStatusRequest_VolumeStatusUpdate)(nil), "docker.swarmkit.v1.UpdateVolumeStatusRequest.VolumeStatusUpdate") - proto.RegisterType((*UpdateVolumeStatusResponse)(nil), "docker.swarmkit.v1.UpdateVolumeStatusResponse") - proto.RegisterType((*TasksRequest)(nil), "docker.swarmkit.v1.TasksRequest") - proto.RegisterType((*TasksMessage)(nil), "docker.swarmkit.v1.TasksMessage") - proto.RegisterType((*AssignmentsRequest)(nil), "docker.swarmkit.v1.AssignmentsRequest") - proto.RegisterType((*Assignment)(nil), "docker.swarmkit.v1.Assignment") - proto.RegisterType((*AssignmentChange)(nil), "docker.swarmkit.v1.AssignmentChange") - proto.RegisterType((*AssignmentsMessage)(nil), "docker.swarmkit.v1.AssignmentsMessage") -} - -func init() { - proto.RegisterFile("github.com/docker/swarmkit/api/dispatcher.proto", fileDescriptor_71002346457e55a8) -} - -var fileDescriptor_71002346457e55a8 = []byte{ - // 1138 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xbf, 0x6f, 0xdb, 0x46, - 0x14, 0x16, 0x15, 0x85, 0xb6, 0x9e, 0x9c, 0x54, 0x3d, 0x04, 0xae, 0x42, 0x34, 0xb2, 0xca, 0x24, - 0x86, 0xd1, 0x38, 0x54, 0xaa, 0xfe, 0x1a, 0x1a, 0xb8, 0xb1, 0x2c, 0x01, 0x11, 0x12, 0x3b, 0xc6, - 0xc5, 0x71, 0x80, 0x2e, 0x06, 0x25, 0x5e, 0x68, 0x56, 0x12, 0x8f, 0xe5, 0x1d, 0x9d, 0x6a, 0x28, - 0xd0, 0xa1, 0x01, 0x8a, 0x4e, 0x41, 0x27, 0x03, 0x45, 0xff, 0x85, 0x2e, 0xfd, 0x27, 0x8c, 0x4e, - 0x19, 0x33, 0xb9, 0x8d, 0xbc, 0x17, 0x5d, 0xba, 0x74, 0x2a, 0x78, 0x3c, 0x4a, 0xaa, 0x4c, 0xd9, - 0xb2, 0x3b, 0x49, 0x7c, 0xf7, 0x7d, 0xef, 0x3e, 0x7e, 0xf7, 0xde, 0x3d, 0x42, 0xd9, 0x76, 0xf8, - 0x6e, 0xd0, 0x34, 0x5a, 0xb4, 0x5b, 0xb6, 0x68, 0xab, 0x4d, 0xfc, 0x32, 0x7b, 0x6e, 0xfa, 0xdd, - 0xb6, 0xc3, 0xcb, 0xa6, 0xe7, 0x94, 0x2d, 0x87, 0x79, 0x26, 0x6f, 0xed, 0x12, 0xdf, 0xf0, 0x7c, - 0xca, 0x29, 0x42, 0x11, 0xca, 0x88, 0x51, 0xc6, 0xde, 0x07, 0xda, 0xfb, 0xa7, 0x24, 0xe1, 0x3d, - 0x8f, 0xb0, 0x88, 0xaf, 0x2d, 0x9f, 0x82, 0xa5, 0xcd, 0x2f, 0x49, 0x8b, 0xc7, 0xe8, 0x2b, 0x36, - 0xb5, 0xa9, 0xf8, 0x5b, 0x0e, 0xff, 0xc9, 0xe8, 0xa7, 0x27, 0xe4, 0x10, 0x88, 0x66, 0xf0, 0xac, - 0xec, 0x75, 0x02, 0xdb, 0x71, 0xe5, 0x8f, 0x24, 0x16, 0x6d, 0x4a, 0xed, 0x0e, 0x19, 0x82, 0xac, - 0xc0, 0x37, 0xb9, 0x43, 0xe5, 0xba, 0xfe, 0x42, 0x81, 0xcb, 0x8f, 0x09, 0x63, 0x0e, 0x75, 0x31, - 0xf9, 0x2a, 0x20, 0x8c, 0xa3, 0x3a, 0xe4, 0x2c, 0xc2, 0x5a, 0xbe, 0xe3, 0x85, 0xb8, 0x82, 0x52, - 0x52, 0x96, 0x72, 0x95, 0xeb, 0xc6, 0x71, 0x17, 0x8c, 0x0d, 0x6a, 0x91, 0xda, 0x10, 0x8a, 0x47, - 0x79, 0x68, 0x19, 0x80, 0x45, 0x89, 0x77, 0x1c, 0xab, 0x90, 0x2e, 0x29, 0x4b, 0xd9, 0xea, 0xa5, - 0xfe, 0xe1, 0x42, 0x56, 0x6e, 0xd7, 0xa8, 0xe1, 0xac, 0x04, 0x34, 0x2c, 0xfd, 0xa7, 0xf4, 0x40, - 0xc7, 0x3a, 0x61, 0xcc, 0xb4, 0xc9, 0x58, 0x02, 0xe5, 0xe4, 0x04, 0x68, 0x19, 0x32, 0x2e, 0xb5, - 0x88, 0xd8, 0x28, 0x57, 0x29, 0x4c, 0x92, 0x8b, 0x05, 0x0a, 0xdd, 0x85, 0xd9, 0xae, 0xe9, 0x9a, - 0x36, 0xf1, 0x59, 0xe1, 0x42, 0xe9, 0xc2, 0x52, 0xae, 0x52, 0x4a, 0x62, 0x3c, 0x25, 0x8e, 0xbd, - 0xcb, 0x89, 0xb5, 0x49, 0x88, 0x8f, 0x07, 0x0c, 0xf4, 0x14, 0xe6, 0x5d, 0xc2, 0x9f, 0x53, 0xbf, - 0xbd, 0xd3, 0xa4, 0x94, 0x33, 0xee, 0x9b, 0xde, 0x4e, 0x9b, 0xf4, 0x58, 0x21, 0x23, 0x72, 0xbd, - 0x97, 0x94, 0xab, 0xee, 0xb6, 0xfc, 0x9e, 0xb0, 0xe6, 0x01, 0xe9, 0xe1, 0x2b, 0x32, 0x41, 0x35, - 0xe6, 0x3f, 0x20, 0x3d, 0x86, 0xe6, 0x41, 0xc5, 0x94, 0xf2, 0xb5, 0xd5, 0xc2, 0xc5, 0x92, 0xb2, - 0x34, 0x87, 0xe5, 0x93, 0x7e, 0x0f, 0xf2, 0xf7, 0x89, 0xe9, 0xf3, 0x26, 0x31, 0x79, 0x7c, 0x4c, - 0x67, 0xb2, 0x47, 0xdf, 0x84, 0xb7, 0x47, 0x32, 0x30, 0x8f, 0xba, 0x8c, 0xa0, 0xcf, 0x40, 0xf5, - 0x88, 0xef, 0x50, 0x4b, 0x1e, 0xf2, 0x55, 0x23, 0xaa, 0x16, 0x23, 0xae, 0x16, 0xa3, 0x26, 0xab, - 0xa5, 0x3a, 0x7b, 0x70, 0xb8, 0x90, 0xda, 0xff, 0x7d, 0x41, 0xc1, 0x92, 0xa2, 0xbf, 0x4c, 0xc3, - 0x3b, 0x4f, 0x3c, 0xcb, 0xe4, 0x64, 0xcb, 0x64, 0xed, 0xc7, 0xdc, 0xe4, 0x01, 0x3b, 0x97, 0x36, - 0xb4, 0x0d, 0x33, 0x81, 0x48, 0x14, 0x9f, 0xc5, 0xdd, 0x24, 0xff, 0x26, 0xec, 0x65, 0x0c, 0x23, - 0x11, 0x02, 0xc7, 0xc9, 0x34, 0x0a, 0xf9, 0xf1, 0x45, 0x74, 0x1d, 0x66, 0xb8, 0xc9, 0xda, 0x43, - 0x59, 0xd0, 0x3f, 0x5c, 0x50, 0x43, 0x58, 0xa3, 0x86, 0xd5, 0x70, 0xa9, 0x61, 0xa1, 0x4f, 0x40, - 0x65, 0x82, 0x24, 0xab, 0xa9, 0x98, 0xa4, 0x67, 0x44, 0x89, 0x44, 0xeb, 0x1a, 0x14, 0x8e, 0xab, - 0x8c, 0xbc, 0xd6, 0xff, 0x56, 0xe0, 0x6a, 0xb4, 0xb8, 0x4d, 0x3b, 0x41, 0x97, 0xfc, 0x1f, 0xc3, - 0xbe, 0x18, 0x1a, 0x96, 0x16, 0x86, 0xdd, 0x9b, 0x6c, 0x58, 0xc2, 0x6e, 0xc6, 0x68, 0x6c, 0xdc, - 0xb4, 0x0d, 0x40, 0xc7, 0x97, 0xd1, 0x3c, 0xa4, 0x07, 0xba, 0xd4, 0xfe, 0xe1, 0x42, 0xba, 0x51, - 0xc3, 0x69, 0xc7, 0x42, 0x25, 0xc8, 0x05, 0xae, 0x17, 0x34, 0x3b, 0x0e, 0xdb, 0x25, 0x51, 0x97, - 0xcf, 0xe2, 0xd1, 0x90, 0xfe, 0x2e, 0x68, 0x49, 0x42, 0xa4, 0x2b, 0x77, 0x61, 0x2e, 0xf4, 0xea, - 0x7c, 0x3e, 0xe8, 0x2b, 0x92, 0x1d, 0xdf, 0x18, 0x06, 0x5c, 0x0c, 0x4f, 0x90, 0x15, 0x14, 0xe1, - 0x4a, 0x61, 0xd2, 0xb1, 0xe1, 0x08, 0xa6, 0x57, 0x01, 0xad, 0x32, 0xe6, 0xd8, 0x6e, 0x97, 0xb8, - 0xfc, 0x9c, 0x1a, 0xfe, 0x52, 0x00, 0x86, 0x49, 0x90, 0x01, 0x99, 0x30, 0xb7, 0x6c, 0xa8, 0x89, - 0x0a, 0xee, 0xa7, 0xb0, 0xc0, 0xa1, 0x8f, 0x40, 0x65, 0xa4, 0xe5, 0x13, 0x2e, 0x4b, 0x4d, 0x4b, - 0x62, 0x3c, 0x16, 0x88, 0xfb, 0x29, 0x2c, 0xb1, 0x21, 0xab, 0x45, 0xdd, 0x67, 0x8e, 0x5d, 0xb8, - 0x30, 0x99, 0xb5, 0x26, 0x10, 0x21, 0x2b, 0xc2, 0xa2, 0x15, 0x50, 0xf7, 0xc4, 0x21, 0x14, 0x32, - 0x82, 0x75, 0x23, 0x89, 0x15, 0x1d, 0xd3, 0xf0, 0x8d, 0x42, 0x7e, 0xc4, 0xaa, 0xaa, 0x90, 0x71, - 0x38, 0xe9, 0xea, 0x2f, 0xd2, 0x90, 0x1f, 0x02, 0xd6, 0x76, 0x4d, 0xd7, 0x26, 0x68, 0x05, 0xc0, - 0x1c, 0xc4, 0xe4, 0xeb, 0x27, 0xf6, 0xcd, 0x90, 0x89, 0x47, 0x18, 0x68, 0x1d, 0x54, 0xb3, 0x25, - 0x06, 0x4e, 0x68, 0xc4, 0xe5, 0xca, 0xc7, 0x27, 0x73, 0xa3, 0x5d, 0x47, 0x02, 0xab, 0x82, 0x8c, - 0x65, 0x12, 0xbd, 0x39, 0x2a, 0x31, 0x5a, 0x43, 0x8b, 0xa0, 0x3e, 0xd9, 0xac, 0xad, 0x6e, 0xd5, - 0xf3, 0x29, 0x4d, 0xfb, 0xe1, 0xe7, 0xd2, 0xfc, 0x38, 0x42, 0x16, 0xfb, 0x22, 0xa8, 0xb8, 0xbe, - 0xfe, 0x68, 0xbb, 0x9e, 0x57, 0x92, 0x71, 0x98, 0x74, 0xe9, 0x1e, 0xd1, 0xff, 0x51, 0xfe, 0x53, - 0x3f, 0x71, 0x15, 0x7e, 0x0e, 0x99, 0x70, 0xfc, 0x0b, 0x0f, 0x2e, 0x57, 0x6e, 0x9d, 0xfc, 0x1e, - 0x31, 0xcb, 0xd8, 0xea, 0x79, 0x04, 0x0b, 0x22, 0xba, 0x06, 0x60, 0x7a, 0x5e, 0xc7, 0x21, 0x6c, - 0x87, 0xd3, 0x68, 0x72, 0xe2, 0xac, 0x8c, 0x6c, 0xd1, 0x70, 0xd9, 0x27, 0x2c, 0xe8, 0x70, 0xb6, - 0xe3, 0xb8, 0xa2, 0x00, 0xb2, 0x38, 0x2b, 0x23, 0x0d, 0x17, 0xad, 0xc0, 0x4c, 0x4b, 0x98, 0x13, - 0x4f, 0xa3, 0x1b, 0xd3, 0x38, 0x89, 0x63, 0x92, 0x7e, 0x13, 0x32, 0xa1, 0x16, 0x34, 0x07, 0xb3, - 0x6b, 0x8f, 0xd6, 0x37, 0x1f, 0xd6, 0x43, 0xbf, 0xd0, 0x5b, 0x90, 0x6b, 0x6c, 0xac, 0xe1, 0xfa, - 0x7a, 0x7d, 0x63, 0x6b, 0xf5, 0x61, 0x5e, 0xa9, 0xfc, 0xaa, 0x02, 0xd4, 0x06, 0x9f, 0x4a, 0xe8, - 0x6b, 0x98, 0x91, 0xed, 0x81, 0xf4, 0xe4, 0x12, 0x1e, 0xfd, 0xc6, 0xd0, 0x4e, 0xc2, 0x48, 0x47, - 0xf4, 0xeb, 0xbf, 0xfd, 0xf2, 0xe7, 0x7e, 0xfa, 0x1a, 0xcc, 0x09, 0xcc, 0xed, 0x70, 0x5a, 0x12, - 0x1f, 0x2e, 0x45, 0x4f, 0x72, 0x16, 0xdf, 0x51, 0xd0, 0x37, 0x90, 0x1d, 0x4c, 0x36, 0x94, 0xf8, - 0xae, 0xe3, 0xa3, 0x53, 0xbb, 0x79, 0x0a, 0x4a, 0x5e, 0x4e, 0xd3, 0x08, 0x40, 0x3f, 0x2a, 0x90, - 0x1f, 0xbf, 0xf4, 0xd1, 0xad, 0x33, 0x0c, 0x30, 0x6d, 0x79, 0x3a, 0xf0, 0x59, 0x44, 0xed, 0x2b, - 0x80, 0x8e, 0xdf, 0xba, 0xe8, 0xf6, 0x99, 0xc6, 0x84, 0x66, 0x4c, 0x0b, 0x3f, 0x8b, 0xb4, 0x00, - 0x2e, 0x8a, 0x3b, 0x1b, 0x95, 0x26, 0xdd, 0x8d, 0x83, 0xfd, 0x27, 0x23, 0xe2, 0x12, 0x59, 0x9c, - 0x62, 0xc7, 0xef, 0xd3, 0xca, 0x1d, 0x05, 0x7d, 0xa7, 0x40, 0x6e, 0xa4, 0xeb, 0xd0, 0xe2, 0x29, - 0x6d, 0x19, 0x6b, 0x58, 0x9c, 0xae, 0x7d, 0xa7, 0x2c, 0xd6, 0xea, 0x8d, 0x83, 0x37, 0xc5, 0xd4, - 0xeb, 0x37, 0xc5, 0xd4, 0xb7, 0xfd, 0xa2, 0x72, 0xd0, 0x2f, 0x2a, 0xaf, 0xfa, 0x45, 0xe5, 0x8f, - 0x7e, 0x51, 0x79, 0x79, 0x54, 0x4c, 0xbd, 0x3a, 0x2a, 0xa6, 0x5e, 0x1f, 0x15, 0x53, 0x4d, 0x55, - 0x7c, 0x7f, 0x7d, 0xf8, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x3b, 0xe2, 0x0b, 0xab, 0x0c, - 0x00, 0x00, -} - -type authenticatedWrapperDispatcherServer struct { - local DispatcherServer - authorize func(context.Context, []string) error -} - -func NewAuthenticatedWrapperDispatcherServer(local DispatcherServer, authorize func(context.Context, []string) error) DispatcherServer { - return &authenticatedWrapperDispatcherServer{ - local: local, - authorize: authorize, - } -} - -func (p *authenticatedWrapperDispatcherServer) Session(r *SessionRequest, stream Dispatcher_SessionServer) error { - - if err := p.authorize(stream.Context(), []string{"swarm-worker", "swarm-manager"}); err != nil { - return err - } - return p.local.Session(r, stream) -} - -func (p *authenticatedWrapperDispatcherServer) Heartbeat(ctx context.Context, r *HeartbeatRequest) (*HeartbeatResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-worker", "swarm-manager"}); err != nil { - return nil, err - } - return p.local.Heartbeat(ctx, r) -} - -func (p *authenticatedWrapperDispatcherServer) UpdateTaskStatus(ctx context.Context, r *UpdateTaskStatusRequest) (*UpdateTaskStatusResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-worker", "swarm-manager"}); err != nil { - return nil, err - } - return p.local.UpdateTaskStatus(ctx, r) -} - -func (p *authenticatedWrapperDispatcherServer) UpdateVolumeStatus(ctx context.Context, r *UpdateVolumeStatusRequest) (*UpdateVolumeStatusResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-worker", "swarm-manager"}); err != nil { - return nil, err - } - return p.local.UpdateVolumeStatus(ctx, r) -} - -func (p *authenticatedWrapperDispatcherServer) Tasks(r *TasksRequest, stream Dispatcher_TasksServer) error { - - if err := p.authorize(stream.Context(), []string{"swarm-worker", "swarm-manager"}); err != nil { - return err - } - return p.local.Tasks(r, stream) -} - -func (p *authenticatedWrapperDispatcherServer) Assignments(r *AssignmentsRequest, stream Dispatcher_AssignmentsServer) error { - - if err := p.authorize(stream.Context(), []string{"swarm-worker", "swarm-manager"}); err != nil { - return err - } - return p.local.Assignments(r, stream) -} - -func (m *SessionRequest) Copy() *SessionRequest { - if m == nil { - return nil - } - o := &SessionRequest{} - o.CopyFrom(m) - return o -} - -func (m *SessionRequest) CopyFrom(src interface{}) { - - o := src.(*SessionRequest) - *m = *o - if o.Description != nil { - m.Description = &NodeDescription{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Description, o.Description) - } -} - -func (m *SessionMessage) Copy() *SessionMessage { - if m == nil { - return nil - } - o := &SessionMessage{} - o.CopyFrom(m) - return o -} - -func (m *SessionMessage) CopyFrom(src interface{}) { - - o := src.(*SessionMessage) - *m = *o - if o.Node != nil { - m.Node = &Node{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Node, o.Node) - } - if o.Managers != nil { - m.Managers = make([]*WeightedPeer, len(o.Managers)) - for i := range m.Managers { - m.Managers[i] = &WeightedPeer{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Managers[i], o.Managers[i]) - } - } - - if o.NetworkBootstrapKeys != nil { - m.NetworkBootstrapKeys = make([]*EncryptionKey, len(o.NetworkBootstrapKeys)) - for i := range m.NetworkBootstrapKeys { - m.NetworkBootstrapKeys[i] = &EncryptionKey{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.NetworkBootstrapKeys[i], o.NetworkBootstrapKeys[i]) - } - } - - if o.RootCA != nil { - m.RootCA = make([]byte, len(o.RootCA)) - copy(m.RootCA, o.RootCA) - } -} - -func (m *HeartbeatRequest) Copy() *HeartbeatRequest { - if m == nil { - return nil - } - o := &HeartbeatRequest{} - o.CopyFrom(m) - return o -} - -func (m *HeartbeatRequest) CopyFrom(src interface{}) { - - o := src.(*HeartbeatRequest) - *m = *o -} - -func (m *HeartbeatResponse) Copy() *HeartbeatResponse { - if m == nil { - return nil - } - o := &HeartbeatResponse{} - o.CopyFrom(m) - return o -} - -func (m *HeartbeatResponse) CopyFrom(src interface{}) { - - o := src.(*HeartbeatResponse) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Period, &o.Period) -} - -func (m *UpdateTaskStatusRequest) Copy() *UpdateTaskStatusRequest { - if m == nil { - return nil - } - o := &UpdateTaskStatusRequest{} - o.CopyFrom(m) - return o -} - -func (m *UpdateTaskStatusRequest) CopyFrom(src interface{}) { - - o := src.(*UpdateTaskStatusRequest) - *m = *o - if o.Updates != nil { - m.Updates = make([]*UpdateTaskStatusRequest_TaskStatusUpdate, len(o.Updates)) - for i := range m.Updates { - m.Updates[i] = &UpdateTaskStatusRequest_TaskStatusUpdate{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Updates[i], o.Updates[i]) - } - } - -} - -func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Copy() *UpdateTaskStatusRequest_TaskStatusUpdate { - if m == nil { - return nil - } - o := &UpdateTaskStatusRequest_TaskStatusUpdate{} - o.CopyFrom(m) - return o -} - -func (m *UpdateTaskStatusRequest_TaskStatusUpdate) CopyFrom(src interface{}) { - - o := src.(*UpdateTaskStatusRequest_TaskStatusUpdate) - *m = *o - if o.Status != nil { - m.Status = &TaskStatus{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Status, o.Status) - } -} - -func (m *UpdateTaskStatusResponse) Copy() *UpdateTaskStatusResponse { - if m == nil { - return nil - } - o := &UpdateTaskStatusResponse{} - o.CopyFrom(m) - return o -} - -func (m *UpdateTaskStatusResponse) CopyFrom(src interface{}) {} -func (m *UpdateVolumeStatusRequest) Copy() *UpdateVolumeStatusRequest { - if m == nil { - return nil - } - o := &UpdateVolumeStatusRequest{} - o.CopyFrom(m) - return o -} - -func (m *UpdateVolumeStatusRequest) CopyFrom(src interface{}) { - - o := src.(*UpdateVolumeStatusRequest) - *m = *o - if o.Updates != nil { - m.Updates = make([]*UpdateVolumeStatusRequest_VolumeStatusUpdate, len(o.Updates)) - for i := range m.Updates { - m.Updates[i] = &UpdateVolumeStatusRequest_VolumeStatusUpdate{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Updates[i], o.Updates[i]) - } - } - -} - -func (m *UpdateVolumeStatusRequest_VolumeStatusUpdate) Copy() *UpdateVolumeStatusRequest_VolumeStatusUpdate { - if m == nil { - return nil - } - o := &UpdateVolumeStatusRequest_VolumeStatusUpdate{} - o.CopyFrom(m) - return o -} - -func (m *UpdateVolumeStatusRequest_VolumeStatusUpdate) CopyFrom(src interface{}) { - - o := src.(*UpdateVolumeStatusRequest_VolumeStatusUpdate) - *m = *o -} - -func (m *UpdateVolumeStatusResponse) Copy() *UpdateVolumeStatusResponse { - if m == nil { - return nil - } - o := &UpdateVolumeStatusResponse{} - o.CopyFrom(m) - return o -} - -func (m *UpdateVolumeStatusResponse) CopyFrom(src interface{}) {} -func (m *TasksRequest) Copy() *TasksRequest { - if m == nil { - return nil - } - o := &TasksRequest{} - o.CopyFrom(m) - return o -} - -func (m *TasksRequest) CopyFrom(src interface{}) { - - o := src.(*TasksRequest) - *m = *o -} - -func (m *TasksMessage) Copy() *TasksMessage { - if m == nil { - return nil - } - o := &TasksMessage{} - o.CopyFrom(m) - return o -} - -func (m *TasksMessage) CopyFrom(src interface{}) { - - o := src.(*TasksMessage) - *m = *o - if o.Tasks != nil { - m.Tasks = make([]*Task, len(o.Tasks)) - for i := range m.Tasks { - m.Tasks[i] = &Task{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Tasks[i], o.Tasks[i]) - } - } - -} - -func (m *AssignmentsRequest) Copy() *AssignmentsRequest { - if m == nil { - return nil - } - o := &AssignmentsRequest{} - o.CopyFrom(m) - return o -} - -func (m *AssignmentsRequest) CopyFrom(src interface{}) { - - o := src.(*AssignmentsRequest) - *m = *o -} - -func (m *Assignment) Copy() *Assignment { - if m == nil { - return nil - } - o := &Assignment{} - o.CopyFrom(m) - return o -} - -func (m *Assignment) CopyFrom(src interface{}) { - - o := src.(*Assignment) - *m = *o - if o.Item != nil { - switch o.Item.(type) { - case *Assignment_Task: - v := Assignment_Task{ - Task: &Task{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Task, o.GetTask()) - m.Item = &v - case *Assignment_Secret: - v := Assignment_Secret{ - Secret: &Secret{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Secret, o.GetSecret()) - m.Item = &v - case *Assignment_Config: - v := Assignment_Config{ - Config: &Config{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Config, o.GetConfig()) - m.Item = &v - case *Assignment_Volume: - v := Assignment_Volume{ - Volume: &VolumeAssignment{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Volume, o.GetVolume()) - m.Item = &v - } - } - -} - -func (m *AssignmentChange) Copy() *AssignmentChange { - if m == nil { - return nil - } - o := &AssignmentChange{} - o.CopyFrom(m) - return o -} - -func (m *AssignmentChange) CopyFrom(src interface{}) { - - o := src.(*AssignmentChange) - *m = *o - if o.Assignment != nil { - m.Assignment = &Assignment{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Assignment, o.Assignment) - } -} - -func (m *AssignmentsMessage) Copy() *AssignmentsMessage { - if m == nil { - return nil - } - o := &AssignmentsMessage{} - o.CopyFrom(m) - return o -} - -func (m *AssignmentsMessage) CopyFrom(src interface{}) { - - o := src.(*AssignmentsMessage) - *m = *o - if o.Changes != nil { - m.Changes = make([]*AssignmentChange, len(o.Changes)) - for i := range m.Changes { - m.Changes[i] = &AssignmentChange{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Changes[i], o.Changes[i]) - } - } - -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// DispatcherClient is the client API for Dispatcher service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type DispatcherClient interface { - // Session starts an agent session with the dispatcher. The session is - // started after the first SessionMessage is received. - // - // Once started, the agent is controlled with a stream of SessionMessage. - // Agents should list on the stream at all times for instructions. - Session(ctx context.Context, in *SessionRequest, opts ...grpc.CallOption) (Dispatcher_SessionClient, error) - // Heartbeat is heartbeat method for nodes. It returns new TTL in response. - // Node should send new heartbeat earlier than now + TTL, otherwise it will - // be deregistered from dispatcher and its status will be updated to NodeStatus_DOWN - Heartbeat(ctx context.Context, in *HeartbeatRequest, opts ...grpc.CallOption) (*HeartbeatResponse, error) - // UpdateTaskStatus updates status of task. Node should send such updates - // on every status change of its tasks. - // - // Whether receiving batch updates or single status updates, this method - // should be accepting. Errors should only be returned if the entire update - // should be retried, due to data loss or other problems. - // - // If a task is unknown the dispatcher, the status update should be - // accepted regardless. - UpdateTaskStatus(ctx context.Context, in *UpdateTaskStatusRequest, opts ...grpc.CallOption) (*UpdateTaskStatusResponse, error) - // UpdateVolumeStatus updates the status of a Volume. Like - // UpdateTaskStatus, the node should send such updates on every status - // change of its volumes. - UpdateVolumeStatus(ctx context.Context, in *UpdateVolumeStatusRequest, opts ...grpc.CallOption) (*UpdateVolumeStatusResponse, error) - // Tasks is a stream of tasks state for node. Each message contains full list - // of tasks which should be run on node, if task is not present in that list, - // it should be terminated. - Tasks(ctx context.Context, in *TasksRequest, opts ...grpc.CallOption) (Dispatcher_TasksClient, error) - // Assignments is a stream of assignments such as tasks and secrets for node. - // The first message in the stream contains all of the tasks and secrets - // that are relevant to the node. Future messages in the stream are updates to - // the set of assignments. - Assignments(ctx context.Context, in *AssignmentsRequest, opts ...grpc.CallOption) (Dispatcher_AssignmentsClient, error) -} - -type dispatcherClient struct { - cc *grpc.ClientConn -} - -func NewDispatcherClient(cc *grpc.ClientConn) DispatcherClient { - return &dispatcherClient{cc} -} - -func (c *dispatcherClient) Session(ctx context.Context, in *SessionRequest, opts ...grpc.CallOption) (Dispatcher_SessionClient, error) { - stream, err := c.cc.NewStream(ctx, &_Dispatcher_serviceDesc.Streams[0], "/docker.swarmkit.v1.Dispatcher/Session", opts...) - if err != nil { - return nil, err - } - x := &dispatcherSessionClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Dispatcher_SessionClient interface { - Recv() (*SessionMessage, error) - grpc.ClientStream -} - -type dispatcherSessionClient struct { - grpc.ClientStream -} - -func (x *dispatcherSessionClient) Recv() (*SessionMessage, error) { - m := new(SessionMessage) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *dispatcherClient) Heartbeat(ctx context.Context, in *HeartbeatRequest, opts ...grpc.CallOption) (*HeartbeatResponse, error) { - out := new(HeartbeatResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Dispatcher/Heartbeat", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dispatcherClient) UpdateTaskStatus(ctx context.Context, in *UpdateTaskStatusRequest, opts ...grpc.CallOption) (*UpdateTaskStatusResponse, error) { - out := new(UpdateTaskStatusResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Dispatcher/UpdateTaskStatus", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dispatcherClient) UpdateVolumeStatus(ctx context.Context, in *UpdateVolumeStatusRequest, opts ...grpc.CallOption) (*UpdateVolumeStatusResponse, error) { - out := new(UpdateVolumeStatusResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Dispatcher/UpdateVolumeStatus", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Deprecated: Do not use. -func (c *dispatcherClient) Tasks(ctx context.Context, in *TasksRequest, opts ...grpc.CallOption) (Dispatcher_TasksClient, error) { - stream, err := c.cc.NewStream(ctx, &_Dispatcher_serviceDesc.Streams[1], "/docker.swarmkit.v1.Dispatcher/Tasks", opts...) - if err != nil { - return nil, err - } - x := &dispatcherTasksClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Dispatcher_TasksClient interface { - Recv() (*TasksMessage, error) - grpc.ClientStream -} - -type dispatcherTasksClient struct { - grpc.ClientStream -} - -func (x *dispatcherTasksClient) Recv() (*TasksMessage, error) { - m := new(TasksMessage) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *dispatcherClient) Assignments(ctx context.Context, in *AssignmentsRequest, opts ...grpc.CallOption) (Dispatcher_AssignmentsClient, error) { - stream, err := c.cc.NewStream(ctx, &_Dispatcher_serviceDesc.Streams[2], "/docker.swarmkit.v1.Dispatcher/Assignments", opts...) - if err != nil { - return nil, err - } - x := &dispatcherAssignmentsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Dispatcher_AssignmentsClient interface { - Recv() (*AssignmentsMessage, error) - grpc.ClientStream -} - -type dispatcherAssignmentsClient struct { - grpc.ClientStream -} - -func (x *dispatcherAssignmentsClient) Recv() (*AssignmentsMessage, error) { - m := new(AssignmentsMessage) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// DispatcherServer is the server API for Dispatcher service. -type DispatcherServer interface { - // Session starts an agent session with the dispatcher. The session is - // started after the first SessionMessage is received. - // - // Once started, the agent is controlled with a stream of SessionMessage. - // Agents should list on the stream at all times for instructions. - Session(*SessionRequest, Dispatcher_SessionServer) error - // Heartbeat is heartbeat method for nodes. It returns new TTL in response. - // Node should send new heartbeat earlier than now + TTL, otherwise it will - // be deregistered from dispatcher and its status will be updated to NodeStatus_DOWN - Heartbeat(context.Context, *HeartbeatRequest) (*HeartbeatResponse, error) - // UpdateTaskStatus updates status of task. Node should send such updates - // on every status change of its tasks. - // - // Whether receiving batch updates or single status updates, this method - // should be accepting. Errors should only be returned if the entire update - // should be retried, due to data loss or other problems. - // - // If a task is unknown the dispatcher, the status update should be - // accepted regardless. - UpdateTaskStatus(context.Context, *UpdateTaskStatusRequest) (*UpdateTaskStatusResponse, error) - // UpdateVolumeStatus updates the status of a Volume. Like - // UpdateTaskStatus, the node should send such updates on every status - // change of its volumes. - UpdateVolumeStatus(context.Context, *UpdateVolumeStatusRequest) (*UpdateVolumeStatusResponse, error) - // Tasks is a stream of tasks state for node. Each message contains full list - // of tasks which should be run on node, if task is not present in that list, - // it should be terminated. - Tasks(*TasksRequest, Dispatcher_TasksServer) error - // Assignments is a stream of assignments such as tasks and secrets for node. - // The first message in the stream contains all of the tasks and secrets - // that are relevant to the node. Future messages in the stream are updates to - // the set of assignments. - Assignments(*AssignmentsRequest, Dispatcher_AssignmentsServer) error -} - -// UnimplementedDispatcherServer can be embedded to have forward compatible implementations. -type UnimplementedDispatcherServer struct { -} - -func (*UnimplementedDispatcherServer) Session(req *SessionRequest, srv Dispatcher_SessionServer) error { - return status.Errorf(codes.Unimplemented, "method Session not implemented") -} -func (*UnimplementedDispatcherServer) Heartbeat(ctx context.Context, req *HeartbeatRequest) (*HeartbeatResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Heartbeat not implemented") -} -func (*UnimplementedDispatcherServer) UpdateTaskStatus(ctx context.Context, req *UpdateTaskStatusRequest) (*UpdateTaskStatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateTaskStatus not implemented") -} -func (*UnimplementedDispatcherServer) UpdateVolumeStatus(ctx context.Context, req *UpdateVolumeStatusRequest) (*UpdateVolumeStatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateVolumeStatus not implemented") -} -func (*UnimplementedDispatcherServer) Tasks(req *TasksRequest, srv Dispatcher_TasksServer) error { - return status.Errorf(codes.Unimplemented, "method Tasks not implemented") -} -func (*UnimplementedDispatcherServer) Assignments(req *AssignmentsRequest, srv Dispatcher_AssignmentsServer) error { - return status.Errorf(codes.Unimplemented, "method Assignments not implemented") -} - -func RegisterDispatcherServer(s *grpc.Server, srv DispatcherServer) { - s.RegisterService(&_Dispatcher_serviceDesc, srv) -} - -func _Dispatcher_Session_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SessionRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(DispatcherServer).Session(m, &dispatcherSessionServer{stream}) -} - -type Dispatcher_SessionServer interface { - Send(*SessionMessage) error - grpc.ServerStream -} - -type dispatcherSessionServer struct { - grpc.ServerStream -} - -func (x *dispatcherSessionServer) Send(m *SessionMessage) error { - return x.ServerStream.SendMsg(m) -} - -func _Dispatcher_Heartbeat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HeartbeatRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DispatcherServer).Heartbeat(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Dispatcher/Heartbeat", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DispatcherServer).Heartbeat(ctx, req.(*HeartbeatRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Dispatcher_UpdateTaskStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateTaskStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DispatcherServer).UpdateTaskStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Dispatcher/UpdateTaskStatus", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DispatcherServer).UpdateTaskStatus(ctx, req.(*UpdateTaskStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Dispatcher_UpdateVolumeStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateVolumeStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DispatcherServer).UpdateVolumeStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Dispatcher/UpdateVolumeStatus", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DispatcherServer).UpdateVolumeStatus(ctx, req.(*UpdateVolumeStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Dispatcher_Tasks_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(TasksRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(DispatcherServer).Tasks(m, &dispatcherTasksServer{stream}) -} - -type Dispatcher_TasksServer interface { - Send(*TasksMessage) error - grpc.ServerStream -} - -type dispatcherTasksServer struct { - grpc.ServerStream -} - -func (x *dispatcherTasksServer) Send(m *TasksMessage) error { - return x.ServerStream.SendMsg(m) -} - -func _Dispatcher_Assignments_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(AssignmentsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(DispatcherServer).Assignments(m, &dispatcherAssignmentsServer{stream}) -} - -type Dispatcher_AssignmentsServer interface { - Send(*AssignmentsMessage) error - grpc.ServerStream -} - -type dispatcherAssignmentsServer struct { - grpc.ServerStream -} - -func (x *dispatcherAssignmentsServer) Send(m *AssignmentsMessage) error { - return x.ServerStream.SendMsg(m) -} - -var _Dispatcher_serviceDesc = grpc.ServiceDesc{ - ServiceName: "docker.swarmkit.v1.Dispatcher", - HandlerType: (*DispatcherServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Heartbeat", - Handler: _Dispatcher_Heartbeat_Handler, - }, - { - MethodName: "UpdateTaskStatus", - Handler: _Dispatcher_UpdateTaskStatus_Handler, - }, - { - MethodName: "UpdateVolumeStatus", - Handler: _Dispatcher_UpdateVolumeStatus_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Session", - Handler: _Dispatcher_Session_Handler, - ServerStreams: true, - }, - { - StreamName: "Tasks", - Handler: _Dispatcher_Tasks_Handler, - ServerStreams: true, - }, - { - StreamName: "Assignments", - Handler: _Dispatcher_Assignments_Handler, - ServerStreams: true, - }, - }, - Metadata: "github.com/docker/swarmkit/api/dispatcher.proto", -} - -func (m *SessionRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SessionRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SessionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SessionID) > 0 { - i -= len(m.SessionID) - copy(dAtA[i:], m.SessionID) - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i-- - dAtA[i] = 0x12 - } - if m.Description != nil { - { - size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDispatcher(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SessionMessage) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SessionMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SessionMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.RootCA) > 0 { - i -= len(m.RootCA) - copy(dAtA[i:], m.RootCA) - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.RootCA))) - i-- - dAtA[i] = 0x2a - } - if len(m.NetworkBootstrapKeys) > 0 { - for iNdEx := len(m.NetworkBootstrapKeys) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.NetworkBootstrapKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDispatcher(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Managers) > 0 { - for iNdEx := len(m.Managers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Managers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDispatcher(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.Node != nil { - { - size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDispatcher(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.SessionID) > 0 { - i -= len(m.SessionID) - copy(dAtA[i:], m.SessionID) - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *HeartbeatRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HeartbeatRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HeartbeatRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SessionID) > 0 { - i -= len(m.SessionID) - copy(dAtA[i:], m.SessionID) - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *HeartbeatResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HeartbeatResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HeartbeatResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n3, err3 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Period, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Period):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintDispatcher(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *UpdateTaskStatusRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateTaskStatusRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateTaskStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Updates) > 0 { - for iNdEx := len(m.Updates) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Updates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDispatcher(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.SessionID) > 0 { - i -= len(m.SessionID) - copy(dAtA[i:], m.SessionID) - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateTaskStatusRequest_TaskStatusUpdate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateTaskStatusRequest_TaskStatusUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Status != nil { - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDispatcher(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.TaskID) > 0 { - i -= len(m.TaskID) - copy(dAtA[i:], m.TaskID) - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.TaskID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateTaskStatusResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateTaskStatusResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateTaskStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *UpdateVolumeStatusRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateVolumeStatusRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateVolumeStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Updates) > 0 { - for iNdEx := len(m.Updates) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Updates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDispatcher(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.SessionID) > 0 { - i -= len(m.SessionID) - copy(dAtA[i:], m.SessionID) - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateVolumeStatusRequest_VolumeStatusUpdate) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateVolumeStatusRequest_VolumeStatusUpdate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateVolumeStatusRequest_VolumeStatusUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Unpublished { - i-- - if m.Unpublished { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateVolumeStatusResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateVolumeStatusResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateVolumeStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *TasksRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TasksRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TasksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SessionID) > 0 { - i -= len(m.SessionID) - copy(dAtA[i:], m.SessionID) - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TasksMessage) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TasksMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TasksMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Tasks) > 0 { - for iNdEx := len(m.Tasks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Tasks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDispatcher(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *AssignmentsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AssignmentsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AssignmentsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SessionID) > 0 { - i -= len(m.SessionID) - copy(dAtA[i:], m.SessionID) - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Assignment) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Assignment) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Assignment) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Item != nil { - { - size := m.Item.Size() - i -= size - if _, err := m.Item.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Assignment_Task) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Assignment_Task) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Task != nil { - { - size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDispatcher(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *Assignment_Secret) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Assignment_Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Secret != nil { - { - size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDispatcher(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *Assignment_Config) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Assignment_Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Config != nil { - { - size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDispatcher(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *Assignment_Volume) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Assignment_Volume) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Volume != nil { - { - size, err := m.Volume.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDispatcher(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *AssignmentChange) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AssignmentChange) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AssignmentChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Action != 0 { - i = encodeVarintDispatcher(dAtA, i, uint64(m.Action)) - i-- - dAtA[i] = 0x10 - } - if m.Assignment != nil { - { - size, err := m.Assignment.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDispatcher(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AssignmentsMessage) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AssignmentsMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AssignmentsMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Changes) > 0 { - for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Changes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDispatcher(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.ResultsIn) > 0 { - i -= len(m.ResultsIn) - copy(dAtA[i:], m.ResultsIn) - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.ResultsIn))) - i-- - dAtA[i] = 0x1a - } - if len(m.AppliesTo) > 0 { - i -= len(m.AppliesTo) - copy(dAtA[i:], m.AppliesTo) - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.AppliesTo))) - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintDispatcher(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintDispatcher(dAtA []byte, offset int, v uint64) int { - offset -= sovDispatcher(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -type raftProxyDispatcherServer struct { - local DispatcherServer - connSelector raftselector.ConnProvider - localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error) -} - -func NewRaftProxyDispatcherServer(local DispatcherServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) DispatcherServer { - redirectChecker := func(ctx context.Context) (context.Context, error) { - p, ok := peer.FromContext(ctx) - if !ok { - return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context") - } - addr := p.Addr.String() - md, ok := metadata.FromIncomingContext(ctx) - if ok && len(md["redirect"]) != 0 { - return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"]) - } - if !ok { - md = metadata.New(map[string]string{}) - } - md["redirect"] = append(md["redirect"], addr) - return metadata.NewOutgoingContext(ctx, md), nil - } - remoteMods := []func(context.Context) (context.Context, error){redirectChecker} - remoteMods = append(remoteMods, remoteCtxMod) - - var localMods []func(context.Context) (context.Context, error) - if localCtxMod != nil { - localMods = []func(context.Context) (context.Context, error){localCtxMod} - } - - return &raftProxyDispatcherServer{ - local: local, - connSelector: connSelector, - localCtxMods: localMods, - remoteCtxMods: remoteMods, - } -} -func (p *raftProxyDispatcherServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) { - var err error - for _, mod := range ctxMods { - ctx, err = mod(ctx) - if err != nil { - return ctx, err - } - } - return ctx, nil -} -func (p *raftProxyDispatcherServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) { - ticker := rafttime.NewTicker(500 * rafttime.Millisecond) - defer ticker.Stop() - for { - select { - case <-ticker.C: - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - return nil, err - } - - client := NewHealthClient(conn) - - resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"}) - if err != nil || resp.Status != HealthCheckResponse_SERVING { - continue - } - return conn, nil - case <-ctx.Done(): - return nil, ctx.Err() - } - } -} - -type Dispatcher_SessionServerWrapper struct { - Dispatcher_SessionServer - ctx context.Context -} - -func (s Dispatcher_SessionServerWrapper) Context() context.Context { - return s.ctx -} - -func (p *raftProxyDispatcherServer) Session(r *SessionRequest, stream Dispatcher_SessionServer) error { - ctx := stream.Context() - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return err - } - streamWrapper := Dispatcher_SessionServerWrapper{ - Dispatcher_SessionServer: stream, - ctx: ctx, - } - return p.local.Session(r, streamWrapper) - } - return err - } - ctx, err = p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return err - } - clientStream, err := NewDispatcherClient(conn).Session(ctx, r) - - if err != nil { - return err - } - - for { - msg, err := clientStream.Recv() - if err == io.EOF { - break - } - if err != nil { - return err - } - if err := stream.Send(msg); err != nil { - return err - } - } - return nil -} - -func (p *raftProxyDispatcherServer) Heartbeat(ctx context.Context, r *HeartbeatRequest) (*HeartbeatResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.Heartbeat(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewDispatcherClient(conn).Heartbeat(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.Heartbeat(ctx, r) - } - return nil, err - } - return NewDispatcherClient(conn).Heartbeat(modCtx, r) - } - return resp, err -} - -func (p *raftProxyDispatcherServer) UpdateTaskStatus(ctx context.Context, r *UpdateTaskStatusRequest) (*UpdateTaskStatusResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.UpdateTaskStatus(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewDispatcherClient(conn).UpdateTaskStatus(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.UpdateTaskStatus(ctx, r) - } - return nil, err - } - return NewDispatcherClient(conn).UpdateTaskStatus(modCtx, r) - } - return resp, err -} - -func (p *raftProxyDispatcherServer) UpdateVolumeStatus(ctx context.Context, r *UpdateVolumeStatusRequest) (*UpdateVolumeStatusResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.UpdateVolumeStatus(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewDispatcherClient(conn).UpdateVolumeStatus(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.UpdateVolumeStatus(ctx, r) - } - return nil, err - } - return NewDispatcherClient(conn).UpdateVolumeStatus(modCtx, r) - } - return resp, err -} - -type Dispatcher_TasksServerWrapper struct { - Dispatcher_TasksServer - ctx context.Context -} - -func (s Dispatcher_TasksServerWrapper) Context() context.Context { - return s.ctx -} - -func (p *raftProxyDispatcherServer) Tasks(r *TasksRequest, stream Dispatcher_TasksServer) error { - ctx := stream.Context() - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return err - } - streamWrapper := Dispatcher_TasksServerWrapper{ - Dispatcher_TasksServer: stream, - ctx: ctx, - } - return p.local.Tasks(r, streamWrapper) - } - return err - } - ctx, err = p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return err - } - clientStream, err := NewDispatcherClient(conn).Tasks(ctx, r) - - if err != nil { - return err - } - - for { - msg, err := clientStream.Recv() - if err == io.EOF { - break - } - if err != nil { - return err - } - if err := stream.Send(msg); err != nil { - return err - } - } - return nil -} - -type Dispatcher_AssignmentsServerWrapper struct { - Dispatcher_AssignmentsServer - ctx context.Context -} - -func (s Dispatcher_AssignmentsServerWrapper) Context() context.Context { - return s.ctx -} - -func (p *raftProxyDispatcherServer) Assignments(r *AssignmentsRequest, stream Dispatcher_AssignmentsServer) error { - ctx := stream.Context() - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return err - } - streamWrapper := Dispatcher_AssignmentsServerWrapper{ - Dispatcher_AssignmentsServer: stream, - ctx: ctx, - } - return p.local.Assignments(r, streamWrapper) - } - return err - } - ctx, err = p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return err - } - clientStream, err := NewDispatcherClient(conn).Assignments(ctx, r) - - if err != nil { - return err - } - - for { - msg, err := clientStream.Recv() - if err == io.EOF { - break - } - if err != nil { - return err - } - if err := stream.Send(msg); err != nil { - return err - } - } - return nil -} - -func (m *SessionRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Description != nil { - l = m.Description.Size() - n += 1 + l + sovDispatcher(uint64(l)) - } - l = len(m.SessionID) - if l > 0 { - n += 1 + l + sovDispatcher(uint64(l)) - } - return n -} - -func (m *SessionMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SessionID) - if l > 0 { - n += 1 + l + sovDispatcher(uint64(l)) - } - if m.Node != nil { - l = m.Node.Size() - n += 1 + l + sovDispatcher(uint64(l)) - } - if len(m.Managers) > 0 { - for _, e := range m.Managers { - l = e.Size() - n += 1 + l + sovDispatcher(uint64(l)) - } - } - if len(m.NetworkBootstrapKeys) > 0 { - for _, e := range m.NetworkBootstrapKeys { - l = e.Size() - n += 1 + l + sovDispatcher(uint64(l)) - } - } - l = len(m.RootCA) - if l > 0 { - n += 1 + l + sovDispatcher(uint64(l)) - } - return n -} - -func (m *HeartbeatRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SessionID) - if l > 0 { - n += 1 + l + sovDispatcher(uint64(l)) - } - return n -} - -func (m *HeartbeatResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Period) - n += 1 + l + sovDispatcher(uint64(l)) - return n -} - -func (m *UpdateTaskStatusRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SessionID) - if l > 0 { - n += 1 + l + sovDispatcher(uint64(l)) - } - if len(m.Updates) > 0 { - for _, e := range m.Updates { - l = e.Size() - n += 1 + l + sovDispatcher(uint64(l)) - } - } - return n -} - -func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TaskID) - if l > 0 { - n += 1 + l + sovDispatcher(uint64(l)) - } - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovDispatcher(uint64(l)) - } - return n -} - -func (m *UpdateTaskStatusResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *UpdateVolumeStatusRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SessionID) - if l > 0 { - n += 1 + l + sovDispatcher(uint64(l)) - } - if len(m.Updates) > 0 { - for _, e := range m.Updates { - l = e.Size() - n += 1 + l + sovDispatcher(uint64(l)) - } - } - return n -} - -func (m *UpdateVolumeStatusRequest_VolumeStatusUpdate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovDispatcher(uint64(l)) - } - if m.Unpublished { - n += 2 - } - return n -} - -func (m *UpdateVolumeStatusResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *TasksRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SessionID) - if l > 0 { - n += 1 + l + sovDispatcher(uint64(l)) - } - return n -} - -func (m *TasksMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Tasks) > 0 { - for _, e := range m.Tasks { - l = e.Size() - n += 1 + l + sovDispatcher(uint64(l)) - } - } - return n -} - -func (m *AssignmentsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SessionID) - if l > 0 { - n += 1 + l + sovDispatcher(uint64(l)) - } - return n -} - -func (m *Assignment) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Item != nil { - n += m.Item.Size() - } - return n -} - -func (m *Assignment_Task) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Task != nil { - l = m.Task.Size() - n += 1 + l + sovDispatcher(uint64(l)) - } - return n -} -func (m *Assignment_Secret) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Secret != nil { - l = m.Secret.Size() - n += 1 + l + sovDispatcher(uint64(l)) - } - return n -} -func (m *Assignment_Config) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Config != nil { - l = m.Config.Size() - n += 1 + l + sovDispatcher(uint64(l)) - } - return n -} -func (m *Assignment_Volume) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Volume != nil { - l = m.Volume.Size() - n += 1 + l + sovDispatcher(uint64(l)) - } - return n -} -func (m *AssignmentChange) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Assignment != nil { - l = m.Assignment.Size() - n += 1 + l + sovDispatcher(uint64(l)) - } - if m.Action != 0 { - n += 1 + sovDispatcher(uint64(m.Action)) - } - return n -} - -func (m *AssignmentsMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovDispatcher(uint64(m.Type)) - } - l = len(m.AppliesTo) - if l > 0 { - n += 1 + l + sovDispatcher(uint64(l)) - } - l = len(m.ResultsIn) - if l > 0 { - n += 1 + l + sovDispatcher(uint64(l)) - } - if len(m.Changes) > 0 { - for _, e := range m.Changes { - l = e.Size() - n += 1 + l + sovDispatcher(uint64(l)) - } - } - return n -} - -func sovDispatcher(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozDispatcher(x uint64) (n int) { - return sovDispatcher(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *SessionRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SessionRequest{`, - `Description:` + strings.Replace(fmt.Sprintf("%v", this.Description), "NodeDescription", "NodeDescription", 1) + `,`, - `SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`, - `}`, - }, "") - return s -} -func (this *SessionMessage) String() string { - if this == nil { - return "nil" - } - repeatedStringForManagers := "[]*WeightedPeer{" - for _, f := range this.Managers { - repeatedStringForManagers += strings.Replace(fmt.Sprintf("%v", f), "WeightedPeer", "WeightedPeer", 1) + "," - } - repeatedStringForManagers += "}" - repeatedStringForNetworkBootstrapKeys := "[]*EncryptionKey{" - for _, f := range this.NetworkBootstrapKeys { - repeatedStringForNetworkBootstrapKeys += strings.Replace(fmt.Sprintf("%v", f), "EncryptionKey", "EncryptionKey", 1) + "," - } - repeatedStringForNetworkBootstrapKeys += "}" - s := strings.Join([]string{`&SessionMessage{`, - `SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`, - `Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "Node", "Node", 1) + `,`, - `Managers:` + repeatedStringForManagers + `,`, - `NetworkBootstrapKeys:` + repeatedStringForNetworkBootstrapKeys + `,`, - `RootCA:` + fmt.Sprintf("%v", this.RootCA) + `,`, - `}`, - }, "") - return s -} -func (this *HeartbeatRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&HeartbeatRequest{`, - `SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`, - `}`, - }, "") - return s -} -func (this *HeartbeatResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&HeartbeatResponse{`, - `Period:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Period), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateTaskStatusRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForUpdates := "[]*UpdateTaskStatusRequest_TaskStatusUpdate{" - for _, f := range this.Updates { - repeatedStringForUpdates += strings.Replace(fmt.Sprintf("%v", f), "UpdateTaskStatusRequest_TaskStatusUpdate", "UpdateTaskStatusRequest_TaskStatusUpdate", 1) + "," - } - repeatedStringForUpdates += "}" - s := strings.Join([]string{`&UpdateTaskStatusRequest{`, - `SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`, - `Updates:` + repeatedStringForUpdates + `,`, - `}`, - }, "") - return s -} -func (this *UpdateTaskStatusRequest_TaskStatusUpdate) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateTaskStatusRequest_TaskStatusUpdate{`, - `TaskID:` + fmt.Sprintf("%v", this.TaskID) + `,`, - `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "TaskStatus", "TaskStatus", 1) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateTaskStatusResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateTaskStatusResponse{`, - `}`, - }, "") - return s -} -func (this *UpdateVolumeStatusRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForUpdates := "[]*UpdateVolumeStatusRequest_VolumeStatusUpdate{" - for _, f := range this.Updates { - repeatedStringForUpdates += strings.Replace(fmt.Sprintf("%v", f), "UpdateVolumeStatusRequest_VolumeStatusUpdate", "UpdateVolumeStatusRequest_VolumeStatusUpdate", 1) + "," - } - repeatedStringForUpdates += "}" - s := strings.Join([]string{`&UpdateVolumeStatusRequest{`, - `SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`, - `Updates:` + repeatedStringForUpdates + `,`, - `}`, - }, "") - return s -} -func (this *UpdateVolumeStatusRequest_VolumeStatusUpdate) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateVolumeStatusRequest_VolumeStatusUpdate{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Unpublished:` + fmt.Sprintf("%v", this.Unpublished) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateVolumeStatusResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateVolumeStatusResponse{`, - `}`, - }, "") - return s -} -func (this *TasksRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TasksRequest{`, - `SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`, - `}`, - }, "") - return s -} -func (this *TasksMessage) String() string { - if this == nil { - return "nil" - } - repeatedStringForTasks := "[]*Task{" - for _, f := range this.Tasks { - repeatedStringForTasks += strings.Replace(fmt.Sprintf("%v", f), "Task", "Task", 1) + "," - } - repeatedStringForTasks += "}" - s := strings.Join([]string{`&TasksMessage{`, - `Tasks:` + repeatedStringForTasks + `,`, - `}`, - }, "") - return s -} -func (this *AssignmentsRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AssignmentsRequest{`, - `SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`, - `}`, - }, "") - return s -} -func (this *Assignment) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Assignment{`, - `Item:` + fmt.Sprintf("%v", this.Item) + `,`, - `}`, - }, "") - return s -} -func (this *Assignment_Task) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Assignment_Task{`, - `Task:` + strings.Replace(fmt.Sprintf("%v", this.Task), "Task", "Task", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Assignment_Secret) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Assignment_Secret{`, - `Secret:` + strings.Replace(fmt.Sprintf("%v", this.Secret), "Secret", "Secret", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Assignment_Config) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Assignment_Config{`, - `Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "Config", "Config", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Assignment_Volume) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Assignment_Volume{`, - `Volume:` + strings.Replace(fmt.Sprintf("%v", this.Volume), "VolumeAssignment", "VolumeAssignment", 1) + `,`, - `}`, - }, "") - return s -} -func (this *AssignmentChange) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AssignmentChange{`, - `Assignment:` + strings.Replace(this.Assignment.String(), "Assignment", "Assignment", 1) + `,`, - `Action:` + fmt.Sprintf("%v", this.Action) + `,`, - `}`, - }, "") - return s -} -func (this *AssignmentsMessage) String() string { - if this == nil { - return "nil" - } - repeatedStringForChanges := "[]*AssignmentChange{" - for _, f := range this.Changes { - repeatedStringForChanges += strings.Replace(f.String(), "AssignmentChange", "AssignmentChange", 1) + "," - } - repeatedStringForChanges += "}" - s := strings.Join([]string{`&AssignmentsMessage{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `AppliesTo:` + fmt.Sprintf("%v", this.AppliesTo) + `,`, - `ResultsIn:` + fmt.Sprintf("%v", this.ResultsIn) + `,`, - `Changes:` + repeatedStringForChanges + `,`, - `}`, - }, "") - return s -} -func valueToStringDispatcher(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *SessionRequest) Unmarshal(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 ErrIntOverflowDispatcher - } - 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: SessionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SessionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Description == nil { - m.Description = &NodeDescription{} - } - if err := m.Description.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SessionID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDispatcher(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SessionMessage) Unmarshal(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 ErrIntOverflowDispatcher - } - 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: SessionMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SessionMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SessionID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Node == nil { - m.Node = &Node{} - } - if err := m.Node.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Managers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Managers = append(m.Managers, &WeightedPeer{}) - if err := m.Managers[len(m.Managers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NetworkBootstrapKeys", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NetworkBootstrapKeys = append(m.NetworkBootstrapKeys, &EncryptionKey{}) - if err := m.NetworkBootstrapKeys[len(m.NetworkBootstrapKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RootCA", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RootCA = append(m.RootCA[:0], dAtA[iNdEx:postIndex]...) - if m.RootCA == nil { - m.RootCA = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDispatcher(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HeartbeatRequest) Unmarshal(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 ErrIntOverflowDispatcher - } - 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: HeartbeatRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HeartbeatRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SessionID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDispatcher(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HeartbeatResponse) Unmarshal(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 ErrIntOverflowDispatcher - } - 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: HeartbeatResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HeartbeatResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Period, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDispatcher(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateTaskStatusRequest) Unmarshal(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 ErrIntOverflowDispatcher - } - 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: UpdateTaskStatusRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateTaskStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SessionID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Updates", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Updates = append(m.Updates, &UpdateTaskStatusRequest_TaskStatusUpdate{}) - if err := m.Updates[len(m.Updates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDispatcher(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Unmarshal(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 ErrIntOverflowDispatcher - } - 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: TaskStatusUpdate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TaskStatusUpdate: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TaskID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Status == nil { - m.Status = &TaskStatus{} - } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDispatcher(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateTaskStatusResponse) Unmarshal(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 ErrIntOverflowDispatcher - } - 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: UpdateTaskStatusResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateTaskStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipDispatcher(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateVolumeStatusRequest) Unmarshal(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 ErrIntOverflowDispatcher - } - 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: UpdateVolumeStatusRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateVolumeStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SessionID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Updates", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Updates = append(m.Updates, &UpdateVolumeStatusRequest_VolumeStatusUpdate{}) - if err := m.Updates[len(m.Updates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDispatcher(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateVolumeStatusRequest_VolumeStatusUpdate) Unmarshal(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 ErrIntOverflowDispatcher - } - 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: VolumeStatusUpdate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VolumeStatusUpdate: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Unpublished", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Unpublished = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipDispatcher(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateVolumeStatusResponse) Unmarshal(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 ErrIntOverflowDispatcher - } - 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: UpdateVolumeStatusResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateVolumeStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipDispatcher(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TasksRequest) Unmarshal(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 ErrIntOverflowDispatcher - } - 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: TasksRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TasksRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SessionID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDispatcher(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TasksMessage) Unmarshal(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 ErrIntOverflowDispatcher - } - 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: TasksMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TasksMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tasks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tasks = append(m.Tasks, &Task{}) - if err := m.Tasks[len(m.Tasks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDispatcher(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AssignmentsRequest) Unmarshal(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 ErrIntOverflowDispatcher - } - 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: AssignmentsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AssignmentsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SessionID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SessionID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDispatcher(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Assignment) Unmarshal(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 ErrIntOverflowDispatcher - } - 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: Assignment: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Assignment: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Task", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Task{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Item = &Assignment_Task{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Secret{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Item = &Assignment_Secret{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Config{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Item = &Assignment_Config{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volume", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &VolumeAssignment{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Item = &Assignment_Volume{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDispatcher(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AssignmentChange) Unmarshal(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 ErrIntOverflowDispatcher - } - 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: AssignmentChange: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AssignmentChange: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Assignment", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Assignment == nil { - m.Assignment = &Assignment{} - } - if err := m.Assignment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - m.Action = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Action |= AssignmentChange_AssignmentAction(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipDispatcher(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AssignmentsMessage) Unmarshal(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 ErrIntOverflowDispatcher - } - 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: AssignmentsMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AssignmentsMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= AssignmentsMessage_Type(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppliesTo", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppliesTo = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResultsIn", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResultsIn = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Changes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDispatcher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDispatcher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDispatcher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Changes = append(m.Changes, &AssignmentChange{}) - if err := m.Changes[len(m.Changes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDispatcher(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipDispatcher(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDispatcher - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDispatcher - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDispatcher - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthDispatcher - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupDispatcher - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthDispatcher - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthDispatcher = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDispatcher = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupDispatcher = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/moby/swarmkit/v2/api/dispatcher.proto b/vendor/github.com/moby/swarmkit/v2/api/dispatcher.proto deleted file mode 100644 index fa2d5c32b0..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/dispatcher.proto +++ /dev/null @@ -1,251 +0,0 @@ -syntax = "proto3"; - -package docker.swarmkit.v1; - -import "github.com/docker/swarmkit/api/types.proto"; -import "github.com/docker/swarmkit/api/objects.proto"; -import "gogoproto/gogo.proto"; -import "github.com/docker/swarmkit/protobuf/plugin/plugin.proto"; -import "google/protobuf/duration.proto"; - -// Dispatcher is the API provided by a manager group for agents to connect to. Agents -// connect to this service to receive task assignments and report status. -// -// API methods on this service are used only by agent nodes. -service Dispatcher { // maybe dispatch, al likes this - // Session starts an agent session with the dispatcher. The session is - // started after the first SessionMessage is received. - // - // Once started, the agent is controlled with a stream of SessionMessage. - // Agents should list on the stream at all times for instructions. - rpc Session(SessionRequest) returns (stream SessionMessage) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-worker" roles: "swarm-manager" }; - }; - - // Heartbeat is heartbeat method for nodes. It returns new TTL in response. - // Node should send new heartbeat earlier than now + TTL, otherwise it will - // be deregistered from dispatcher and its status will be updated to NodeStatus_DOWN - rpc Heartbeat(HeartbeatRequest) returns (HeartbeatResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-worker" roles: "swarm-manager" }; - }; - - // UpdateTaskStatus updates status of task. Node should send such updates - // on every status change of its tasks. - // - // Whether receiving batch updates or single status updates, this method - // should be accepting. Errors should only be returned if the entire update - // should be retried, due to data loss or other problems. - // - // If a task is unknown the dispatcher, the status update should be - // accepted regardless. - rpc UpdateTaskStatus(UpdateTaskStatusRequest) returns (UpdateTaskStatusResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-worker" roles: "swarm-manager" }; - }; - - // UpdateVolumeStatus updates the status of a Volume. Like - // UpdateTaskStatus, the node should send such updates on every status - // change of its volumes. - rpc UpdateVolumeStatus(UpdateVolumeStatusRequest) returns (UpdateVolumeStatusResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-worker" roles: "swarm-manager" }; - }; - - // Tasks is a stream of tasks state for node. Each message contains full list - // of tasks which should be run on node, if task is not present in that list, - // it should be terminated. - rpc Tasks(TasksRequest) returns (stream TasksMessage) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-worker" roles: "swarm-manager" }; - option deprecated = true; - }; - - // Assignments is a stream of assignments such as tasks and secrets for node. - // The first message in the stream contains all of the tasks and secrets - // that are relevant to the node. Future messages in the stream are updates to - // the set of assignments. - rpc Assignments(AssignmentsRequest) returns (stream AssignmentsMessage) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-worker" roles: "swarm-manager" }; - }; -} - -// SessionRequest starts a session. -message SessionRequest { - NodeDescription description = 1; - // SessionID can be provided to attempt resuming an existing session. If the - // SessionID is empty or invalid, a new SessionID will be assigned. - // - // See SessionMessage.SessionID for details. - string session_id = 2; -} - -// SessionMessage instructs an agent on various actions as part of the current -// session. An agent should act immediately on the contents. -message SessionMessage { - // SessionID is allocated after a successful registration. It should be - // used on all RPC calls after registration. A dispatcher may choose to - // change the SessionID, at which time an agent must re-register and obtain - // a new one. - // - // All Dispatcher calls after register should include the SessionID. If the - // Dispatcher so chooses, it may reject the call with an InvalidArgument - // error code, at which time the agent should call Register to start a new - // session. - // - // As a rule, once an agent has a SessionID, it should never save it to - // disk or try to otherwise reuse. If the agent loses its SessionID, it - // must start a new session through a call to Register. A Dispatcher may - // choose to reuse the SessionID, if it sees fit, but it is not advised. - // - // The actual implementation of the SessionID is Dispatcher specific and - // should be treated as opaque by agents. - // - // From a Dispatcher perspective, there are many ways to use the SessionID - // to ensure uniqueness of a set of client RPC calls. One method is to keep - // the SessionID unique to every call to Register in a single Dispatcher - // instance. This ensures that the SessionID represents the unique - // session from a single Agent to Manager. If the Agent restarts, we - // allocate a new session, since the restarted Agent is not aware of the - // new SessionID. - // - // The most compelling use case is to support duplicate node detection. If - // one clones a virtual machine, including certificate material, two nodes - // may end up with the same identity. This can also happen if two identical - // agent processes are coming from the same node. If the SessionID is - // replicated through the cluster, we can immediately detect the condition - // and address it. - // - // Extending from the case above, we can actually detect a compromised - // identity. Coupled with provisions to rebuild node identity, we can ban - // the compromised node identity and have the nodes re-authenticate and - // build a new identity. At this time, an administrator can then - // re-authorize the compromised nodes, if it was a mistake or ensure that a - // misbehaved node can no longer connect to the cluster. - // - // We considered placing this field in a GRPC header. Because this is a - // critical feature of the protocol, we thought it should be represented - // directly in the RPC message set. - string session_id = 1; - - // Node identifies the registering node. - Node node = 2; - - // Managers provides a weight list of alternative dispatchers - repeated WeightedPeer managers = 3; - - // Symmetric encryption key distributed by the lead manager. Used by agents - // for securing network bootstrapping and communication. - repeated EncryptionKey network_bootstrap_keys = 4; - - // Which root certificates to trust - bytes RootCA = 5; -} - -// HeartbeatRequest provides identifying properties for a single heartbeat. -message HeartbeatRequest { - string session_id = 1; -} - -message HeartbeatResponse { - // Period is the duration to wait before sending the next heartbeat. - // Well-behaved agents should update this on every heartbeat round trip. - google.protobuf.Duration period = 1 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; -} - -message UpdateTaskStatusRequest { - // Tasks should contain all statuses for running tasks. Only the status - // field must be set. The spec is not required. - string session_id = 1; - - message TaskStatusUpdate { - string task_id = 1; - TaskStatus status = 2; - } - - repeated TaskStatusUpdate updates = 3; -} - -message UpdateTaskStatusResponse{ - // void -} - -message UpdateVolumeStatusRequest { - string session_id = 1; - - message VolumeStatusUpdate { - // ID is the ID of the volume being updated. This is the Swarmkit ID, - // not the CSI VolumeID. - string id = 1; - // Unpublished is set to true when the volume is affirmatively - // unpublished on the Node side. We don't need to report that a Volume - // is published on the the node; as soon as the Volume is assigned to - // the Node, we must assume that it has been published until informed - // otherwise. - // - // Further, the Node must not send unpublished = true unless it will - // definitely no longer attempt to call NodePublishVolume. - bool unpublished = 2; - } - - repeated VolumeStatusUpdate updates = 2; -} - -message UpdateVolumeStatusResponse { - // empty on purpose -} - -message TasksRequest { - string session_id = 1; -} - -message TasksMessage { - // Tasks is the set of tasks that should be running on the node. - // Tasks outside of this set running on the node should be terminated. - repeated Task tasks = 1; -} - -message AssignmentsRequest { - string session_id = 1; -} - -message Assignment { - oneof item { - Task task = 1; - Secret secret = 2; - Config config = 3; - VolumeAssignment volume = 4; - } -} - -message AssignmentChange { - enum AssignmentAction { - UPDATE = 0 [(gogoproto.enumvalue_customname) = "AssignmentActionUpdate"]; - REMOVE = 1 [(gogoproto.enumvalue_customname) = "AssignmentActionRemove"]; - } - - Assignment assignment = 1; - AssignmentAction action = 2; -} - -message AssignmentsMessage { - // AssignmentType specifies whether this assignment message carries - // the full state, or is an update to an existing state. - enum Type { - COMPLETE = 0; - INCREMENTAL = 1; - } - - Type type = 1; - - // AppliesTo references the previous ResultsIn value, to chain - // incremental updates together. For the first update in a stream, - // AppliesTo is empty. If AppliesTo does not match the previously - // received ResultsIn, the consumer of the stream should start a new - // Assignments stream to re-sync. - string applies_to = 2; - - // ResultsIn identifies the result of this assignments message, to - // match against the next message's AppliesTo value and protect - // against missed messages. - string results_in = 3; - - // AssignmentChange is a set of changes to apply on this node. - repeated AssignmentChange changes = 4; -} diff --git a/vendor/github.com/moby/swarmkit/v2/api/equality/equality.go b/vendor/github.com/moby/swarmkit/v2/api/equality/equality.go deleted file mode 100644 index 97eea64252..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/equality/equality.go +++ /dev/null @@ -1,67 +0,0 @@ -package equality - -import ( - "crypto/subtle" - "reflect" - - "github.com/moby/swarmkit/v2/api" -) - -// TasksEqualStable returns true if the tasks are functionally equal, ignoring status, -// version and other superfluous fields. -// -// This used to decide whether or not to propagate a task update to a controller. -func TasksEqualStable(a, b *api.Task) bool { - // shallow copy - copyA, copyB := *a, *b - - copyA.Status, copyB.Status = api.TaskStatus{}, api.TaskStatus{} - copyA.Meta, copyB.Meta = api.Meta{}, api.Meta{} - - return reflect.DeepEqual(©A, ©B) -} - -// TaskStatusesEqualStable compares the task status excluding timestamp fields. -func TaskStatusesEqualStable(a, b *api.TaskStatus) bool { - copyA, copyB := *a, *b - - copyA.Timestamp, copyB.Timestamp = nil, nil - return reflect.DeepEqual(©A, ©B) -} - -// RootCAEqualStable compares RootCAs, excluding join tokens, which are randomly generated -func RootCAEqualStable(a, b *api.RootCA) bool { - if a == nil && b == nil { - return true - } - if a == nil || b == nil { - return false - } - - var aRotationKey, bRotationKey []byte - if a.RootRotation != nil { - aRotationKey = a.RootRotation.CAKey - } - if b.RootRotation != nil { - bRotationKey = b.RootRotation.CAKey - } - if subtle.ConstantTimeCompare(a.CAKey, b.CAKey) != 1 || subtle.ConstantTimeCompare(aRotationKey, bRotationKey) != 1 { - return false - } - - copyA, copyB := *a, *b - copyA.JoinTokens, copyB.JoinTokens = api.JoinTokens{}, api.JoinTokens{} - return reflect.DeepEqual(copyA, copyB) -} - -// ExternalCAsEqualStable compares lists of external CAs and determines whether they are equal. -func ExternalCAsEqualStable(a, b []*api.ExternalCA) bool { - // because DeepEqual will treat an empty list and a nil list differently, we want to manually check this first - if len(a) == 0 && len(b) == 0 { - return true - } - // The assumption is that each individual api.ExternalCA within both lists are created from deserializing from a - // protobuf, so no special affordances are made to treat a nil map and empty map in the Options field of an - // api.ExternalCA as equivalent. - return reflect.DeepEqual(a, b) -} diff --git a/vendor/github.com/moby/swarmkit/v2/api/health.pb.go b/vendor/github.com/moby/swarmkit/v2/api/health.pb.go deleted file mode 100644 index b5795d4da0..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/health.pb.go +++ /dev/null @@ -1,772 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/docker/swarmkit/api/health.proto - -package api - -import ( - context "context" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - raftselector "github.com/moby/swarmkit/v2/manager/raftselector" - _ "github.com/moby/swarmkit/v2/protobuf/plugin" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - metadata "google.golang.org/grpc/metadata" - peer "google.golang.org/grpc/peer" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" - rafttime "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type HealthCheckResponse_ServingStatus int32 - -const ( - HealthCheckResponse_UNKNOWN HealthCheckResponse_ServingStatus = 0 - HealthCheckResponse_SERVING HealthCheckResponse_ServingStatus = 1 - HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2 -) - -var HealthCheckResponse_ServingStatus_name = map[int32]string{ - 0: "UNKNOWN", - 1: "SERVING", - 2: "NOT_SERVING", -} - -var HealthCheckResponse_ServingStatus_value = map[string]int32{ - "UNKNOWN": 0, - "SERVING": 1, - "NOT_SERVING": 2, -} - -func (x HealthCheckResponse_ServingStatus) String() string { - return proto.EnumName(HealthCheckResponse_ServingStatus_name, int32(x)) -} - -func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_288522a148aed5ad, []int{1, 0} -} - -type HealthCheckRequest struct { - Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` -} - -func (m *HealthCheckRequest) Reset() { *m = HealthCheckRequest{} } -func (*HealthCheckRequest) ProtoMessage() {} -func (*HealthCheckRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_288522a148aed5ad, []int{0} -} -func (m *HealthCheckRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HealthCheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HealthCheckRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HealthCheckRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HealthCheckRequest.Merge(m, src) -} -func (m *HealthCheckRequest) XXX_Size() int { - return m.Size() -} -func (m *HealthCheckRequest) XXX_DiscardUnknown() { - xxx_messageInfo_HealthCheckRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_HealthCheckRequest proto.InternalMessageInfo - -type HealthCheckResponse struct { - Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=docker.swarmkit.v1.HealthCheckResponse_ServingStatus" json:"status,omitempty"` -} - -func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} } -func (*HealthCheckResponse) ProtoMessage() {} -func (*HealthCheckResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_288522a148aed5ad, []int{1} -} -func (m *HealthCheckResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HealthCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HealthCheckResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HealthCheckResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_HealthCheckResponse.Merge(m, src) -} -func (m *HealthCheckResponse) XXX_Size() int { - return m.Size() -} -func (m *HealthCheckResponse) XXX_DiscardUnknown() { - xxx_messageInfo_HealthCheckResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_HealthCheckResponse proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("docker.swarmkit.v1.HealthCheckResponse_ServingStatus", HealthCheckResponse_ServingStatus_name, HealthCheckResponse_ServingStatus_value) - proto.RegisterType((*HealthCheckRequest)(nil), "docker.swarmkit.v1.HealthCheckRequest") - proto.RegisterType((*HealthCheckResponse)(nil), "docker.swarmkit.v1.HealthCheckResponse") -} - -func init() { - proto.RegisterFile("github.com/docker/swarmkit/api/health.proto", fileDescriptor_288522a148aed5ad) -} - -var fileDescriptor_288522a148aed5ad = []byte{ - // 328 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4e, 0xcf, 0x2c, 0xc9, - 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xc9, 0x4f, 0xce, 0x4e, 0x2d, 0xd2, 0x2f, 0x2e, - 0x4f, 0x2c, 0xca, 0xcd, 0xce, 0x2c, 0xd1, 0x4f, 0x2c, 0xc8, 0xd4, 0xcf, 0x48, 0x4d, 0xcc, 0x29, - 0xc9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0xa8, 0xd0, 0x83, 0xa9, 0xd0, 0x2b, - 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x4b, 0xeb, 0x83, 0x58, 0x10, 0x95, 0x52, 0xe6, - 0x78, 0x8c, 0x05, 0xab, 0x48, 0x2a, 0x4d, 0xd3, 0x2f, 0xc8, 0x29, 0x4d, 0xcf, 0xcc, 0x83, 0x52, - 0x10, 0x8d, 0x4a, 0x7a, 0x5c, 0x42, 0x1e, 0x60, 0x2b, 0x9d, 0x33, 0x52, 0x93, 0xb3, 0x83, 0x52, - 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0x24, 0xb8, 0xd8, 0x8b, 0x53, 0x8b, 0xca, 0x32, 0x93, 0x53, - 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x60, 0x5c, 0xa5, 0x05, 0x8c, 0x5c, 0xc2, 0x28, 0x1a, - 0x8a, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0x7c, 0xb9, 0xd8, 0x8a, 0x4b, 0x12, 0x4b, 0x4a, 0x8b, - 0xc1, 0x1a, 0xf8, 0x8c, 0x4c, 0xf5, 0x30, 0xdd, 0xae, 0x87, 0x45, 0xa3, 0x5e, 0x30, 0xc8, 0xe0, - 0xbc, 0xf4, 0x60, 0xb0, 0xe6, 0x20, 0xa8, 0x21, 0x4a, 0x56, 0x5c, 0xbc, 0x28, 0x12, 0x42, 0xdc, - 0x5c, 0xec, 0xa1, 0x7e, 0xde, 0x7e, 0xfe, 0xe1, 0x7e, 0x02, 0x0c, 0x20, 0x4e, 0xb0, 0x6b, 0x50, - 0x98, 0xa7, 0x9f, 0xbb, 0x00, 0xa3, 0x10, 0x3f, 0x17, 0xb7, 0x9f, 0x7f, 0x48, 0x3c, 0x4c, 0x80, - 0xc9, 0xa8, 0x92, 0x8b, 0x0d, 0x62, 0x91, 0x50, 0x3e, 0x17, 0x2b, 0xd8, 0x32, 0x21, 0x35, 0x82, - 0xae, 0x01, 0xfb, 0x5b, 0x4a, 0x9d, 0x48, 0x57, 0x2b, 0x89, 0x9e, 0x5a, 0xf7, 0x6e, 0x06, 0x13, - 0x3f, 0x17, 0x2f, 0x58, 0xa1, 0x6e, 0x6e, 0x62, 0x5e, 0x62, 0x7a, 0x6a, 0x91, 0x93, 0xca, 0x89, - 0x87, 0x72, 0x0c, 0x37, 0x1e, 0xca, 0x31, 0x34, 0x3c, 0x92, 0x63, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, - 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, - 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x24, 0x36, 0x70, 0xd0, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, - 0xc9, 0xe8, 0xd3, 0x02, 0x0c, 0x02, 0x00, 0x00, -} - -type authenticatedWrapperHealthServer struct { - local HealthServer - authorize func(context.Context, []string) error -} - -func NewAuthenticatedWrapperHealthServer(local HealthServer, authorize func(context.Context, []string) error) HealthServer { - return &authenticatedWrapperHealthServer{ - local: local, - authorize: authorize, - } -} - -func (p *authenticatedWrapperHealthServer) Check(ctx context.Context, r *HealthCheckRequest) (*HealthCheckResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.Check(ctx, r) -} - -func (m *HealthCheckRequest) Copy() *HealthCheckRequest { - if m == nil { - return nil - } - o := &HealthCheckRequest{} - o.CopyFrom(m) - return o -} - -func (m *HealthCheckRequest) CopyFrom(src interface{}) { - - o := src.(*HealthCheckRequest) - *m = *o -} - -func (m *HealthCheckResponse) Copy() *HealthCheckResponse { - if m == nil { - return nil - } - o := &HealthCheckResponse{} - o.CopyFrom(m) - return o -} - -func (m *HealthCheckResponse) CopyFrom(src interface{}) { - - o := src.(*HealthCheckResponse) - *m = *o -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// HealthClient is the client API for Health service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type HealthClient interface { - Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) -} - -type healthClient struct { - cc *grpc.ClientConn -} - -func NewHealthClient(cc *grpc.ClientConn) HealthClient { - return &healthClient{cc} -} - -func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { - out := new(HealthCheckResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Health/Check", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// HealthServer is the server API for Health service. -type HealthServer interface { - Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) -} - -// UnimplementedHealthServer can be embedded to have forward compatible implementations. -type UnimplementedHealthServer struct { -} - -func (*UnimplementedHealthServer) Check(ctx context.Context, req *HealthCheckRequest) (*HealthCheckResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") -} - -func RegisterHealthServer(s *grpc.Server, srv HealthServer) { - s.RegisterService(&_Health_serviceDesc, srv) -} - -func _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HealthCheckRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(HealthServer).Check(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Health/Check", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HealthServer).Check(ctx, req.(*HealthCheckRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Health_serviceDesc = grpc.ServiceDesc{ - ServiceName: "docker.swarmkit.v1.Health", - HandlerType: (*HealthServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Check", - Handler: _Health_Check_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/docker/swarmkit/api/health.proto", -} - -func (m *HealthCheckRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HealthCheckRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HealthCheckRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Service) > 0 { - i -= len(m.Service) - copy(dAtA[i:], m.Service) - i = encodeVarintHealth(dAtA, i, uint64(len(m.Service))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *HealthCheckResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HealthCheckResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HealthCheckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Status != 0 { - i = encodeVarintHealth(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintHealth(dAtA []byte, offset int, v uint64) int { - offset -= sovHealth(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -type raftProxyHealthServer struct { - local HealthServer - connSelector raftselector.ConnProvider - localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error) -} - -func NewRaftProxyHealthServer(local HealthServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) HealthServer { - redirectChecker := func(ctx context.Context) (context.Context, error) { - p, ok := peer.FromContext(ctx) - if !ok { - return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context") - } - addr := p.Addr.String() - md, ok := metadata.FromIncomingContext(ctx) - if ok && len(md["redirect"]) != 0 { - return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"]) - } - if !ok { - md = metadata.New(map[string]string{}) - } - md["redirect"] = append(md["redirect"], addr) - return metadata.NewOutgoingContext(ctx, md), nil - } - remoteMods := []func(context.Context) (context.Context, error){redirectChecker} - remoteMods = append(remoteMods, remoteCtxMod) - - var localMods []func(context.Context) (context.Context, error) - if localCtxMod != nil { - localMods = []func(context.Context) (context.Context, error){localCtxMod} - } - - return &raftProxyHealthServer{ - local: local, - connSelector: connSelector, - localCtxMods: localMods, - remoteCtxMods: remoteMods, - } -} -func (p *raftProxyHealthServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) { - var err error - for _, mod := range ctxMods { - ctx, err = mod(ctx) - if err != nil { - return ctx, err - } - } - return ctx, nil -} -func (p *raftProxyHealthServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) { - ticker := rafttime.NewTicker(500 * rafttime.Millisecond) - defer ticker.Stop() - for { - select { - case <-ticker.C: - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - return nil, err - } - - client := NewHealthClient(conn) - - resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"}) - if err != nil || resp.Status != HealthCheckResponse_SERVING { - continue - } - return conn, nil - case <-ctx.Done(): - return nil, ctx.Err() - } - } -} - -func (p *raftProxyHealthServer) Check(ctx context.Context, r *HealthCheckRequest) (*HealthCheckResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.Check(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewHealthClient(conn).Check(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.Check(ctx, r) - } - return nil, err - } - return NewHealthClient(conn).Check(modCtx, r) - } - return resp, err -} - -func (m *HealthCheckRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Service) - if l > 0 { - n += 1 + l + sovHealth(uint64(l)) - } - return n -} - -func (m *HealthCheckResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Status != 0 { - n += 1 + sovHealth(uint64(m.Status)) - } - return n -} - -func sovHealth(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozHealth(x uint64) (n int) { - return sovHealth(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *HealthCheckRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&HealthCheckRequest{`, - `Service:` + fmt.Sprintf("%v", this.Service) + `,`, - `}`, - }, "") - return s -} -func (this *HealthCheckResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&HealthCheckResponse{`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `}`, - }, "") - return s -} -func valueToStringHealth(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *HealthCheckRequest) Unmarshal(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 ErrIntOverflowHealth - } - 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: HealthCheckRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HealthCheckRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHealth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthHealth - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthHealth - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Service = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipHealth(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHealth - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HealthCheckResponse) Unmarshal(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 ErrIntOverflowHealth - } - 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: HealthCheckResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HealthCheckResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHealth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= HealthCheckResponse_ServingStatus(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipHealth(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHealth - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipHealth(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowHealth - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowHealth - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowHealth - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthHealth - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupHealth - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthHealth - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthHealth = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowHealth = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupHealth = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/moby/swarmkit/v2/api/health.proto b/vendor/github.com/moby/swarmkit/v2/api/health.proto deleted file mode 100644 index 8e066c0f85..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/health.proto +++ /dev/null @@ -1,34 +0,0 @@ -syntax = "proto3"; - -// See: https://github.com/grpc/grpc-go/blob/master/health/grpc_health_v1/health.proto -// -// We use the same health check service proto description defined in the gRPC documentation, -// including the authorization check. This requires our own implementation of the health -// package located in `manager/health`. -// -// For more infos, refer to: -// https://github.com/grpc/grpc/blob/master/doc/health-checking.md - -package docker.swarmkit.v1; - -import "gogoproto/gogo.proto"; -import "github.com/docker/swarmkit/protobuf/plugin/plugin.proto"; - -service Health { - rpc Check(HealthCheckRequest) returns (HealthCheckResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; -} - -message HealthCheckRequest { - string service = 1; -} - -message HealthCheckResponse { - enum ServingStatus { - UNKNOWN = 0; - SERVING = 1; - NOT_SERVING = 2; - } - ServingStatus status = 1; -} diff --git a/vendor/github.com/moby/swarmkit/v2/api/logbroker.pb.go b/vendor/github.com/moby/swarmkit/v2/api/logbroker.pb.go deleted file mode 100644 index 05cacafd78..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/logbroker.pb.go +++ /dev/null @@ -1,3892 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/docker/swarmkit/api/logbroker.proto - -package api - -import ( - context "context" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - types "github.com/gogo/protobuf/types" - github_com_moby_swarmkit_v2_api_deepcopy "github.com/moby/swarmkit/v2/api/deepcopy" - raftselector "github.com/moby/swarmkit/v2/manager/raftselector" - _ "github.com/moby/swarmkit/v2/protobuf/plugin" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - metadata "google.golang.org/grpc/metadata" - peer "google.golang.org/grpc/peer" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" - rafttime "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// LogStream defines the stream from which the log message came. -type LogStream int32 - -const ( - LogStreamUnknown LogStream = 0 - LogStreamStdout LogStream = 1 - LogStreamStderr LogStream = 2 -) - -var LogStream_name = map[int32]string{ - 0: "LOG_STREAM_UNKNOWN", - 1: "LOG_STREAM_STDOUT", - 2: "LOG_STREAM_STDERR", -} - -var LogStream_value = map[string]int32{ - "LOG_STREAM_UNKNOWN": 0, - "LOG_STREAM_STDOUT": 1, - "LOG_STREAM_STDERR": 2, -} - -func (x LogStream) String() string { - return proto.EnumName(LogStream_name, int32(x)) -} - -func (LogStream) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d5aa8d24ac30376c, []int{0} -} - -type LogSubscriptionOptions struct { - // Streams defines which log streams should be sent from the task source. - // Empty means send all the messages. - Streams []LogStream `protobuf:"varint,1,rep,name=streams,proto3,enum=docker.swarmkit.v1.LogStream" json:"streams,omitempty"` - // Follow instructs the publisher to continue sending log messages as they - // are produced, after satisfying the initial query. - Follow bool `protobuf:"varint,2,opt,name=follow,proto3" json:"follow,omitempty"` - // Tail defines how many messages relative to the log stream to send when - // starting the stream. - // - // Positive values will skip that number of messages from the start of the - // stream before publishing. - // - // Negative values will specify messages relative to the end of the stream, - // offset by one. We can say that the last (-n-1) lines are returned when n - // < 0. As reference, -1 would mean send no log lines (typically used with - // follow), -2 would return the last log line, -11 would return the last 10 - // and so on. - // - // The default value of zero will return all logs. - // - // Note that this is very different from the Docker API. - Tail int64 `protobuf:"varint,3,opt,name=tail,proto3" json:"tail,omitempty"` - // Since indicates that only log messages produced after this timestamp - // should be sent. - // Note: can't use stdtime because this field is nullable. - Since *types.Timestamp `protobuf:"bytes,4,opt,name=since,proto3" json:"since,omitempty"` -} - -func (m *LogSubscriptionOptions) Reset() { *m = LogSubscriptionOptions{} } -func (*LogSubscriptionOptions) ProtoMessage() {} -func (*LogSubscriptionOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_d5aa8d24ac30376c, []int{0} -} -func (m *LogSubscriptionOptions) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LogSubscriptionOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LogSubscriptionOptions.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LogSubscriptionOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_LogSubscriptionOptions.Merge(m, src) -} -func (m *LogSubscriptionOptions) XXX_Size() int { - return m.Size() -} -func (m *LogSubscriptionOptions) XXX_DiscardUnknown() { - xxx_messageInfo_LogSubscriptionOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_LogSubscriptionOptions proto.InternalMessageInfo - -// LogSelector will match logs from ANY of the defined parameters. -// -// For the best effect, the client should use the least specific parameter -// possible. For example, if they want to listen to all the tasks of a service, -// they should use the service id, rather than specifying the individual tasks. -type LogSelector struct { - ServiceIDs []string `protobuf:"bytes,1,rep,name=service_ids,json=serviceIds,proto3" json:"service_ids,omitempty"` - NodeIDs []string `protobuf:"bytes,2,rep,name=node_ids,json=nodeIds,proto3" json:"node_ids,omitempty"` - TaskIDs []string `protobuf:"bytes,3,rep,name=task_ids,json=taskIds,proto3" json:"task_ids,omitempty"` -} - -func (m *LogSelector) Reset() { *m = LogSelector{} } -func (*LogSelector) ProtoMessage() {} -func (*LogSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_d5aa8d24ac30376c, []int{1} -} -func (m *LogSelector) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LogSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LogSelector.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LogSelector) XXX_Merge(src proto.Message) { - xxx_messageInfo_LogSelector.Merge(m, src) -} -func (m *LogSelector) XXX_Size() int { - return m.Size() -} -func (m *LogSelector) XXX_DiscardUnknown() { - xxx_messageInfo_LogSelector.DiscardUnknown(m) -} - -var xxx_messageInfo_LogSelector proto.InternalMessageInfo - -// LogContext marks the context from which a log message was generated. -type LogContext struct { - ServiceID string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - NodeID string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - TaskID string `protobuf:"bytes,3,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` -} - -func (m *LogContext) Reset() { *m = LogContext{} } -func (*LogContext) ProtoMessage() {} -func (*LogContext) Descriptor() ([]byte, []int) { - return fileDescriptor_d5aa8d24ac30376c, []int{2} -} -func (m *LogContext) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LogContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LogContext.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LogContext) XXX_Merge(src proto.Message) { - xxx_messageInfo_LogContext.Merge(m, src) -} -func (m *LogContext) XXX_Size() int { - return m.Size() -} -func (m *LogContext) XXX_DiscardUnknown() { - xxx_messageInfo_LogContext.DiscardUnknown(m) -} - -var xxx_messageInfo_LogContext proto.InternalMessageInfo - -// LogAttr is an extra key/value pair that may be have been set by users -type LogAttr struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *LogAttr) Reset() { *m = LogAttr{} } -func (*LogAttr) ProtoMessage() {} -func (*LogAttr) Descriptor() ([]byte, []int) { - return fileDescriptor_d5aa8d24ac30376c, []int{3} -} -func (m *LogAttr) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LogAttr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LogAttr.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LogAttr) XXX_Merge(src proto.Message) { - xxx_messageInfo_LogAttr.Merge(m, src) -} -func (m *LogAttr) XXX_Size() int { - return m.Size() -} -func (m *LogAttr) XXX_DiscardUnknown() { - xxx_messageInfo_LogAttr.DiscardUnknown(m) -} - -var xxx_messageInfo_LogAttr proto.InternalMessageInfo - -// LogMessage -type LogMessage struct { - // Context identifies the source of the log message. - Context LogContext `protobuf:"bytes,1,opt,name=context,proto3" json:"context"` - // Timestamp is the time at which the message was generated. - // Note: can't use stdtime because this field is nullable. - Timestamp *types.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // Stream identifies the stream of the log message, stdout or stderr. - Stream LogStream `protobuf:"varint,3,opt,name=stream,proto3,enum=docker.swarmkit.v1.LogStream" json:"stream,omitempty"` - // Data is the raw log message, as generated by the application. - Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` - // Attrs is a list of key value pairs representing additional log details - // that may have been returned from the logger - Attrs []LogAttr `protobuf:"bytes,5,rep,name=attrs,proto3" json:"attrs"` -} - -func (m *LogMessage) Reset() { *m = LogMessage{} } -func (*LogMessage) ProtoMessage() {} -func (*LogMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_d5aa8d24ac30376c, []int{4} -} -func (m *LogMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LogMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LogMessage.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LogMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_LogMessage.Merge(m, src) -} -func (m *LogMessage) XXX_Size() int { - return m.Size() -} -func (m *LogMessage) XXX_DiscardUnknown() { - xxx_messageInfo_LogMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_LogMessage proto.InternalMessageInfo - -type SubscribeLogsRequest struct { - // LogSelector describes the logs to which the subscriber is - Selector *LogSelector `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"` - Options *LogSubscriptionOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` -} - -func (m *SubscribeLogsRequest) Reset() { *m = SubscribeLogsRequest{} } -func (*SubscribeLogsRequest) ProtoMessage() {} -func (*SubscribeLogsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d5aa8d24ac30376c, []int{5} -} -func (m *SubscribeLogsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SubscribeLogsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SubscribeLogsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SubscribeLogsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubscribeLogsRequest.Merge(m, src) -} -func (m *SubscribeLogsRequest) XXX_Size() int { - return m.Size() -} -func (m *SubscribeLogsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SubscribeLogsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SubscribeLogsRequest proto.InternalMessageInfo - -type SubscribeLogsMessage struct { - Messages []LogMessage `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages"` -} - -func (m *SubscribeLogsMessage) Reset() { *m = SubscribeLogsMessage{} } -func (*SubscribeLogsMessage) ProtoMessage() {} -func (*SubscribeLogsMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_d5aa8d24ac30376c, []int{6} -} -func (m *SubscribeLogsMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SubscribeLogsMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SubscribeLogsMessage.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SubscribeLogsMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubscribeLogsMessage.Merge(m, src) -} -func (m *SubscribeLogsMessage) XXX_Size() int { - return m.Size() -} -func (m *SubscribeLogsMessage) XXX_DiscardUnknown() { - xxx_messageInfo_SubscribeLogsMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_SubscribeLogsMessage proto.InternalMessageInfo - -// ListenSubscriptionsRequest is a placeholder to begin listening for -// subscriptions. -type ListenSubscriptionsRequest struct { -} - -func (m *ListenSubscriptionsRequest) Reset() { *m = ListenSubscriptionsRequest{} } -func (*ListenSubscriptionsRequest) ProtoMessage() {} -func (*ListenSubscriptionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d5aa8d24ac30376c, []int{7} -} -func (m *ListenSubscriptionsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListenSubscriptionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListenSubscriptionsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListenSubscriptionsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListenSubscriptionsRequest.Merge(m, src) -} -func (m *ListenSubscriptionsRequest) XXX_Size() int { - return m.Size() -} -func (m *ListenSubscriptionsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListenSubscriptionsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListenSubscriptionsRequest proto.InternalMessageInfo - -// SubscriptionMessage instructs the listener to start publishing messages for -// the stream or end a subscription. -// -// If Options.Follow == false, the worker should end the subscription on its own. -type SubscriptionMessage struct { - // ID identifies the subscription. - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Selector defines which sources should be sent for the subscription. - Selector *LogSelector `protobuf:"bytes,2,opt,name=selector,proto3" json:"selector,omitempty"` - // Options specify how the subscription should be satisfied. - Options *LogSubscriptionOptions `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"` - // Close will be true if the node should shutdown the subscription with the - // provided identifier. - Close bool `protobuf:"varint,4,opt,name=close,proto3" json:"close,omitempty"` -} - -func (m *SubscriptionMessage) Reset() { *m = SubscriptionMessage{} } -func (*SubscriptionMessage) ProtoMessage() {} -func (*SubscriptionMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_d5aa8d24ac30376c, []int{8} -} -func (m *SubscriptionMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SubscriptionMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SubscriptionMessage.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SubscriptionMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubscriptionMessage.Merge(m, src) -} -func (m *SubscriptionMessage) XXX_Size() int { - return m.Size() -} -func (m *SubscriptionMessage) XXX_DiscardUnknown() { - xxx_messageInfo_SubscriptionMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_SubscriptionMessage proto.InternalMessageInfo - -type PublishLogsMessage struct { - // SubscriptionID identifies which subscription the set of messages should - // be sent to. We can think of this as a "mail box" for the subscription. - SubscriptionID string `protobuf:"bytes,1,opt,name=subscription_id,json=subscriptionId,proto3" json:"subscription_id,omitempty"` - // Messages is the log message for publishing. - Messages []LogMessage `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages"` - // Close is a boolean for whether or not the client has completed its log - // stream. When close is called, the manager can hang up the subscription. - // Any further logs from this subscription are an error condition. Any - // messages included when close is set can be discarded - Close bool `protobuf:"varint,3,opt,name=close,proto3" json:"close,omitempty"` -} - -func (m *PublishLogsMessage) Reset() { *m = PublishLogsMessage{} } -func (*PublishLogsMessage) ProtoMessage() {} -func (*PublishLogsMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_d5aa8d24ac30376c, []int{9} -} -func (m *PublishLogsMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PublishLogsMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PublishLogsMessage.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PublishLogsMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_PublishLogsMessage.Merge(m, src) -} -func (m *PublishLogsMessage) XXX_Size() int { - return m.Size() -} -func (m *PublishLogsMessage) XXX_DiscardUnknown() { - xxx_messageInfo_PublishLogsMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_PublishLogsMessage proto.InternalMessageInfo - -type PublishLogsResponse struct { -} - -func (m *PublishLogsResponse) Reset() { *m = PublishLogsResponse{} } -func (*PublishLogsResponse) ProtoMessage() {} -func (*PublishLogsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d5aa8d24ac30376c, []int{10} -} -func (m *PublishLogsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PublishLogsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PublishLogsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PublishLogsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PublishLogsResponse.Merge(m, src) -} -func (m *PublishLogsResponse) XXX_Size() int { - return m.Size() -} -func (m *PublishLogsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PublishLogsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PublishLogsResponse proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("docker.swarmkit.v1.LogStream", LogStream_name, LogStream_value) - proto.RegisterType((*LogSubscriptionOptions)(nil), "docker.swarmkit.v1.LogSubscriptionOptions") - proto.RegisterType((*LogSelector)(nil), "docker.swarmkit.v1.LogSelector") - proto.RegisterType((*LogContext)(nil), "docker.swarmkit.v1.LogContext") - proto.RegisterType((*LogAttr)(nil), "docker.swarmkit.v1.LogAttr") - proto.RegisterType((*LogMessage)(nil), "docker.swarmkit.v1.LogMessage") - proto.RegisterType((*SubscribeLogsRequest)(nil), "docker.swarmkit.v1.SubscribeLogsRequest") - proto.RegisterType((*SubscribeLogsMessage)(nil), "docker.swarmkit.v1.SubscribeLogsMessage") - proto.RegisterType((*ListenSubscriptionsRequest)(nil), "docker.swarmkit.v1.ListenSubscriptionsRequest") - proto.RegisterType((*SubscriptionMessage)(nil), "docker.swarmkit.v1.SubscriptionMessage") - proto.RegisterType((*PublishLogsMessage)(nil), "docker.swarmkit.v1.PublishLogsMessage") - proto.RegisterType((*PublishLogsResponse)(nil), "docker.swarmkit.v1.PublishLogsResponse") -} - -func init() { - proto.RegisterFile("github.com/docker/swarmkit/api/logbroker.proto", fileDescriptor_d5aa8d24ac30376c) -} - -var fileDescriptor_d5aa8d24ac30376c = []byte{ - // 979 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x95, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xc7, 0x3d, 0xeb, 0xc4, 0x8e, 0x9f, 0x9b, 0xc4, 0x9d, 0xa4, 0x91, 0x65, 0xe8, 0xda, 0xda, - 0xa2, 0x62, 0x45, 0x65, 0xdd, 0x1a, 0xa1, 0x22, 0x45, 0x42, 0xd4, 0xa4, 0x42, 0x16, 0x6e, 0x82, - 0x26, 0x8e, 0xe0, 0x16, 0xad, 0xed, 0xe9, 0x76, 0xe5, 0xf5, 0x8e, 0xd9, 0x19, 0x27, 0x20, 0x71, - 0xe0, 0x50, 0x24, 0x94, 0x03, 0xe2, 0x82, 0x04, 0x87, 0x9e, 0xe8, 0x05, 0x21, 0x71, 0xe1, 0xc6, - 0x07, 0x40, 0x11, 0xa7, 0x1e, 0x7b, 0xb2, 0xe8, 0xe6, 0xce, 0x67, 0x40, 0x3b, 0xb3, 0x5e, 0x6f, - 0xb0, 0x9d, 0xa2, 0x72, 0xb1, 0x67, 0x3c, 0xbf, 0xb7, 0xef, 0xff, 0xfe, 0xf3, 0xde, 0x1a, 0x4c, - 0xdb, 0x11, 0x8f, 0x46, 0x1d, 0xb3, 0xcb, 0x06, 0xb5, 0x1e, 0xeb, 0xf6, 0xa9, 0x5f, 0xe3, 0x27, - 0x96, 0x3f, 0xe8, 0x3b, 0xa2, 0x66, 0x0d, 0x9d, 0x9a, 0xcb, 0xec, 0x8e, 0xcf, 0xfa, 0xd4, 0x37, - 0x87, 0x3e, 0x13, 0x0c, 0x63, 0x05, 0x99, 0x13, 0xc8, 0x3c, 0xbe, 0x53, 0xda, 0xb4, 0x99, 0xcd, - 0xe4, 0x71, 0x2d, 0x5c, 0x29, 0xb2, 0x54, 0xb6, 0x19, 0xb3, 0x5d, 0x5a, 0x93, 0xbb, 0xce, 0xe8, - 0x61, 0x4d, 0x38, 0x03, 0xca, 0x85, 0x35, 0x18, 0x46, 0xc0, 0xdd, 0x4b, 0x52, 0xc7, 0x41, 0x43, - 0x77, 0x64, 0x3b, 0x5e, 0xf4, 0xa5, 0x02, 0x8d, 0xdf, 0x10, 0x6c, 0xb5, 0x98, 0x7d, 0x30, 0xea, - 0xf0, 0xae, 0xef, 0x0c, 0x85, 0xc3, 0xbc, 0x7d, 0xf9, 0xc9, 0xf1, 0x0e, 0x64, 0xb9, 0xf0, 0xa9, - 0x35, 0xe0, 0x45, 0x54, 0x49, 0x57, 0xd7, 0xea, 0xd7, 0xcd, 0x59, 0xc1, 0x66, 0x18, 0x2c, 0xa9, - 0x86, 0x56, 0x48, 0x91, 0x49, 0x04, 0xde, 0x82, 0xcc, 0x43, 0xe6, 0xba, 0xec, 0xa4, 0xa8, 0x55, - 0x50, 0x75, 0x85, 0x44, 0x3b, 0x8c, 0x61, 0x49, 0x58, 0x8e, 0x5b, 0x4c, 0x57, 0x50, 0x35, 0x4d, - 0xe4, 0x1a, 0xdf, 0x86, 0x65, 0xee, 0x78, 0x5d, 0x5a, 0x5c, 0xaa, 0xa0, 0x6a, 0xbe, 0x5e, 0x32, - 0x55, 0xb5, 0xe6, 0x44, 0xb8, 0xd9, 0x9e, 0x54, 0x4b, 0x14, 0x68, 0x7c, 0x8b, 0x20, 0x1f, 0x26, - 0xa6, 0x2e, 0xed, 0x0a, 0xe6, 0xe3, 0x1a, 0xe4, 0x39, 0xf5, 0x8f, 0x9d, 0x2e, 0x3d, 0x72, 0x7a, - 0x4a, 0x6e, 0xae, 0xb1, 0x16, 0x8c, 0xcb, 0x70, 0xa0, 0x7e, 0x6e, 0xee, 0x72, 0x02, 0x11, 0xd2, - 0xec, 0x71, 0x7c, 0x13, 0x56, 0x3c, 0xd6, 0x53, 0xb4, 0x26, 0xe9, 0x7c, 0x30, 0x2e, 0x67, 0xf7, - 0x58, 0x4f, 0xa2, 0xd9, 0xf0, 0x30, 0xe2, 0x84, 0xc5, 0xfb, 0x92, 0x4b, 0x4f, 0xb9, 0xb6, 0xc5, - 0xfb, 0x92, 0x0b, 0x0f, 0x9b, 0x3d, 0x6e, 0x3c, 0x46, 0x00, 0x2d, 0x66, 0x7f, 0xc0, 0x3c, 0x41, - 0x3f, 0x17, 0xf8, 0x16, 0xc0, 0x54, 0x4f, 0x11, 0x55, 0x50, 0x35, 0xd7, 0x58, 0x0d, 0xc6, 0xe5, - 0x5c, 0x2c, 0x87, 0xe4, 0x62, 0x35, 0xf8, 0x06, 0x64, 0x23, 0x31, 0xd2, 0xac, 0x5c, 0x03, 0x82, - 0x71, 0x39, 0xa3, 0xb4, 0x90, 0x8c, 0x92, 0x12, 0x42, 0x91, 0x12, 0xe9, 0x5d, 0x04, 0x29, 0x21, - 0x24, 0xa3, 0x74, 0x18, 0x77, 0x20, 0xdb, 0x62, 0xf6, 0x3d, 0x21, 0x7c, 0x5c, 0x80, 0x74, 0x9f, - 0x7e, 0xa1, 0x72, 0x93, 0x70, 0x89, 0x37, 0x61, 0xf9, 0xd8, 0x72, 0x47, 0x54, 0x25, 0x21, 0x6a, - 0x63, 0x9c, 0x6a, 0x52, 0xf9, 0x03, 0xca, 0xb9, 0x65, 0x53, 0xfc, 0x1e, 0x64, 0xbb, 0xaa, 0x08, - 0x19, 0x9a, 0xaf, 0xeb, 0x0b, 0x2e, 0x3d, 0x2a, 0xb5, 0xb1, 0x74, 0x36, 0x2e, 0xa7, 0xc8, 0x24, - 0x08, 0xbf, 0x0b, 0xb9, 0xb8, 0x37, 0x65, 0xa2, 0xcb, 0xef, 0x73, 0x0a, 0xe3, 0x77, 0x20, 0xa3, - 0x9a, 0x47, 0xd6, 0xf7, 0xb2, 0x6e, 0x23, 0x11, 0x1c, 0x36, 0x54, 0xcf, 0x12, 0x96, 0xec, 0x9d, - 0x2b, 0x44, 0xae, 0xf1, 0x5d, 0x58, 0xb6, 0x84, 0xf0, 0x79, 0x71, 0xb9, 0x92, 0xae, 0xe6, 0xeb, - 0xaf, 0x2d, 0x78, 0x52, 0xe8, 0x53, 0xa4, 0x5f, 0xf1, 0xc6, 0x8f, 0x08, 0x36, 0xa3, 0x51, 0xe8, - 0xd0, 0x16, 0xb3, 0x39, 0xa1, 0x9f, 0x8d, 0x28, 0x17, 0x78, 0x07, 0x56, 0x78, 0xd4, 0x6c, 0x91, - 0x2f, 0xe5, 0x45, 0xf2, 0x22, 0x8c, 0xc4, 0x01, 0x78, 0x17, 0xb2, 0x4c, 0xcd, 0x54, 0xe4, 0xc8, - 0xf6, 0xa2, 0xd8, 0xd9, 0x29, 0x24, 0x93, 0x50, 0xe3, 0xd3, 0x7f, 0x49, 0x9b, 0xdc, 0xd8, 0xfb, - 0xb0, 0x32, 0x50, 0x4b, 0xd5, 0xf8, 0x8b, 0xaf, 0x2c, 0x8a, 0x88, 0x4a, 0x8e, 0xa3, 0x8c, 0xd7, - 0xa1, 0xd4, 0x72, 0xb8, 0xa0, 0x5e, 0x32, 0xff, 0xa4, 0x74, 0xe3, 0x0f, 0x04, 0x1b, 0xc9, 0x83, - 0x49, 0xde, 0x2d, 0xd0, 0xe2, 0xde, 0xce, 0x04, 0xe3, 0xb2, 0xd6, 0xdc, 0x25, 0x9a, 0xd3, 0xbb, - 0x60, 0x95, 0xf6, 0x3f, 0xac, 0x4a, 0xbf, 0xb2, 0x55, 0x61, 0xa7, 0x77, 0x5d, 0xc6, 0xd5, 0x0b, - 0x65, 0x85, 0xa8, 0x8d, 0xf1, 0x33, 0x02, 0xfc, 0xf1, 0xa8, 0xe3, 0x3a, 0xfc, 0x51, 0xd2, 0xbf, - 0x1d, 0x58, 0xe7, 0x89, 0x87, 0x4d, 0x07, 0x16, 0x07, 0xe3, 0xf2, 0x5a, 0x32, 0x4f, 0x73, 0x97, - 0xac, 0x25, 0xd1, 0x66, 0xef, 0x82, 0xf9, 0xda, 0xab, 0x98, 0x3f, 0xd5, 0x9a, 0x4e, 0x6a, 0xbd, - 0x06, 0x1b, 0x09, 0xa9, 0x84, 0xf2, 0x21, 0xf3, 0x38, 0xdd, 0x7e, 0x8a, 0x20, 0x17, 0x8f, 0x00, - 0xbe, 0x05, 0xb8, 0xb5, 0xff, 0xe1, 0xd1, 0x41, 0x9b, 0xdc, 0xbf, 0xf7, 0xe0, 0xe8, 0x70, 0xef, - 0xa3, 0xbd, 0xfd, 0x4f, 0xf6, 0x0a, 0xa9, 0xd2, 0xe6, 0xe9, 0x93, 0x4a, 0x21, 0xc6, 0x0e, 0xbd, - 0xbe, 0xc7, 0x4e, 0x3c, 0xbc, 0x0d, 0x57, 0x13, 0xf4, 0x41, 0x7b, 0x77, 0xff, 0xb0, 0x5d, 0x40, - 0xa5, 0x8d, 0xd3, 0x27, 0x95, 0xf5, 0x18, 0x3e, 0x10, 0x3d, 0x36, 0x12, 0xb3, 0xec, 0x7d, 0x42, - 0x0a, 0xda, 0x2c, 0x4b, 0x7d, 0xbf, 0x74, 0xf5, 0x9b, 0x9f, 0xf4, 0xd4, 0xef, 0x4f, 0xf5, 0xa9, - 0xb0, 0xfa, 0x63, 0x04, 0x4b, 0xa1, 0x6e, 0xfc, 0x25, 0xac, 0x5e, 0xe8, 0x59, 0x5c, 0x9d, 0xe7, - 0xce, 0xbc, 0x89, 0x2b, 0xbd, 0x9c, 0x8c, 0x1c, 0x35, 0xae, 0xfd, 0xf9, 0xeb, 0xdf, 0x3f, 0x68, - 0xeb, 0xb0, 0x2a, 0xc9, 0xb7, 0x06, 0x96, 0x67, 0xd9, 0xd4, 0xbf, 0x8d, 0xea, 0xbf, 0x68, 0xd2, - 0xad, 0x86, 0xfc, 0xcf, 0xc5, 0xdf, 0x23, 0xd8, 0x98, 0xd3, 0xe6, 0xd8, 0x9c, 0x7b, 0x61, 0x0b, - 0xe7, 0xa1, 0xf4, 0xe6, 0x25, 0xc2, 0x92, 0x03, 0x62, 0xdc, 0x90, 0xba, 0xae, 0xc3, 0x15, 0xa5, - 0xeb, 0x84, 0xf9, 0x7d, 0xea, 0xcf, 0xa8, 0xc4, 0x5f, 0x23, 0xc8, 0x27, 0xee, 0x1a, 0xdf, 0x9c, - 0xf7, 0xfc, 0xd9, 0xbe, 0x9d, 0xaf, 0x63, 0x4e, 0xd3, 0xfc, 0x27, 0x1d, 0x55, 0xd4, 0x78, 0xe3, - 0xec, 0x85, 0x9e, 0x7a, 0xfe, 0x42, 0x4f, 0x7d, 0x15, 0xe8, 0xe8, 0x2c, 0xd0, 0xd1, 0xb3, 0x40, - 0x47, 0x7f, 0x05, 0x3a, 0xfa, 0xee, 0x5c, 0x4f, 0x3d, 0x3b, 0xd7, 0x53, 0xcf, 0xcf, 0xf5, 0x54, - 0x27, 0x23, 0x5f, 0xe2, 0x6f, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0x00, 0xba, 0x6b, 0x91, 0xec, - 0x08, 0x00, 0x00, -} - -type authenticatedWrapperLogsServer struct { - local LogsServer - authorize func(context.Context, []string) error -} - -func NewAuthenticatedWrapperLogsServer(local LogsServer, authorize func(context.Context, []string) error) LogsServer { - return &authenticatedWrapperLogsServer{ - local: local, - authorize: authorize, - } -} - -func (p *authenticatedWrapperLogsServer) SubscribeLogs(r *SubscribeLogsRequest, stream Logs_SubscribeLogsServer) error { - - if err := p.authorize(stream.Context(), []string{"swarm-manager"}); err != nil { - return err - } - return p.local.SubscribeLogs(r, stream) -} - -type authenticatedWrapperLogBrokerServer struct { - local LogBrokerServer - authorize func(context.Context, []string) error -} - -func NewAuthenticatedWrapperLogBrokerServer(local LogBrokerServer, authorize func(context.Context, []string) error) LogBrokerServer { - return &authenticatedWrapperLogBrokerServer{ - local: local, - authorize: authorize, - } -} - -func (p *authenticatedWrapperLogBrokerServer) ListenSubscriptions(r *ListenSubscriptionsRequest, stream LogBroker_ListenSubscriptionsServer) error { - - if err := p.authorize(stream.Context(), []string{"swarm-worker", "swarm-manager"}); err != nil { - return err - } - return p.local.ListenSubscriptions(r, stream) -} - -func (p *authenticatedWrapperLogBrokerServer) PublishLogs(stream LogBroker_PublishLogsServer) error { - - if err := p.authorize(stream.Context(), []string{"swarm-worker", "swarm-manager"}); err != nil { - return err - } - return p.local.PublishLogs(stream) -} - -func (m *LogSubscriptionOptions) Copy() *LogSubscriptionOptions { - if m == nil { - return nil - } - o := &LogSubscriptionOptions{} - o.CopyFrom(m) - return o -} - -func (m *LogSubscriptionOptions) CopyFrom(src interface{}) { - - o := src.(*LogSubscriptionOptions) - *m = *o - if o.Streams != nil { - m.Streams = make([]LogStream, len(o.Streams)) - copy(m.Streams, o.Streams) - } - - if o.Since != nil { - m.Since = &types.Timestamp{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Since, o.Since) - } -} - -func (m *LogSelector) Copy() *LogSelector { - if m == nil { - return nil - } - o := &LogSelector{} - o.CopyFrom(m) - return o -} - -func (m *LogSelector) CopyFrom(src interface{}) { - - o := src.(*LogSelector) - *m = *o - if o.ServiceIDs != nil { - m.ServiceIDs = make([]string, len(o.ServiceIDs)) - copy(m.ServiceIDs, o.ServiceIDs) - } - - if o.NodeIDs != nil { - m.NodeIDs = make([]string, len(o.NodeIDs)) - copy(m.NodeIDs, o.NodeIDs) - } - - if o.TaskIDs != nil { - m.TaskIDs = make([]string, len(o.TaskIDs)) - copy(m.TaskIDs, o.TaskIDs) - } - -} - -func (m *LogContext) Copy() *LogContext { - if m == nil { - return nil - } - o := &LogContext{} - o.CopyFrom(m) - return o -} - -func (m *LogContext) CopyFrom(src interface{}) { - - o := src.(*LogContext) - *m = *o -} - -func (m *LogAttr) Copy() *LogAttr { - if m == nil { - return nil - } - o := &LogAttr{} - o.CopyFrom(m) - return o -} - -func (m *LogAttr) CopyFrom(src interface{}) { - - o := src.(*LogAttr) - *m = *o -} - -func (m *LogMessage) Copy() *LogMessage { - if m == nil { - return nil - } - o := &LogMessage{} - o.CopyFrom(m) - return o -} - -func (m *LogMessage) CopyFrom(src interface{}) { - - o := src.(*LogMessage) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Context, &o.Context) - if o.Timestamp != nil { - m.Timestamp = &types.Timestamp{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Timestamp, o.Timestamp) - } - if o.Data != nil { - m.Data = make([]byte, len(o.Data)) - copy(m.Data, o.Data) - } - if o.Attrs != nil { - m.Attrs = make([]LogAttr, len(o.Attrs)) - for i := range m.Attrs { - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Attrs[i], &o.Attrs[i]) - } - } - -} - -func (m *SubscribeLogsRequest) Copy() *SubscribeLogsRequest { - if m == nil { - return nil - } - o := &SubscribeLogsRequest{} - o.CopyFrom(m) - return o -} - -func (m *SubscribeLogsRequest) CopyFrom(src interface{}) { - - o := src.(*SubscribeLogsRequest) - *m = *o - if o.Selector != nil { - m.Selector = &LogSelector{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Selector, o.Selector) - } - if o.Options != nil { - m.Options = &LogSubscriptionOptions{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Options, o.Options) - } -} - -func (m *SubscribeLogsMessage) Copy() *SubscribeLogsMessage { - if m == nil { - return nil - } - o := &SubscribeLogsMessage{} - o.CopyFrom(m) - return o -} - -func (m *SubscribeLogsMessage) CopyFrom(src interface{}) { - - o := src.(*SubscribeLogsMessage) - *m = *o - if o.Messages != nil { - m.Messages = make([]LogMessage, len(o.Messages)) - for i := range m.Messages { - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Messages[i], &o.Messages[i]) - } - } - -} - -func (m *ListenSubscriptionsRequest) Copy() *ListenSubscriptionsRequest { - if m == nil { - return nil - } - o := &ListenSubscriptionsRequest{} - o.CopyFrom(m) - return o -} - -func (m *ListenSubscriptionsRequest) CopyFrom(src interface{}) {} -func (m *SubscriptionMessage) Copy() *SubscriptionMessage { - if m == nil { - return nil - } - o := &SubscriptionMessage{} - o.CopyFrom(m) - return o -} - -func (m *SubscriptionMessage) CopyFrom(src interface{}) { - - o := src.(*SubscriptionMessage) - *m = *o - if o.Selector != nil { - m.Selector = &LogSelector{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Selector, o.Selector) - } - if o.Options != nil { - m.Options = &LogSubscriptionOptions{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Options, o.Options) - } -} - -func (m *PublishLogsMessage) Copy() *PublishLogsMessage { - if m == nil { - return nil - } - o := &PublishLogsMessage{} - o.CopyFrom(m) - return o -} - -func (m *PublishLogsMessage) CopyFrom(src interface{}) { - - o := src.(*PublishLogsMessage) - *m = *o - if o.Messages != nil { - m.Messages = make([]LogMessage, len(o.Messages)) - for i := range m.Messages { - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Messages[i], &o.Messages[i]) - } - } - -} - -func (m *PublishLogsResponse) Copy() *PublishLogsResponse { - if m == nil { - return nil - } - o := &PublishLogsResponse{} - o.CopyFrom(m) - return o -} - -func (m *PublishLogsResponse) CopyFrom(src interface{}) {} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// LogsClient is the client API for Logs service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type LogsClient interface { - // SubscribeLogs starts a subscription with the specified selector and options. - // - // The subscription will be distributed to relevant nodes and messages will - // be collected and sent via the returned stream. - // - // The subscription will end with an EOF. - SubscribeLogs(ctx context.Context, in *SubscribeLogsRequest, opts ...grpc.CallOption) (Logs_SubscribeLogsClient, error) -} - -type logsClient struct { - cc *grpc.ClientConn -} - -func NewLogsClient(cc *grpc.ClientConn) LogsClient { - return &logsClient{cc} -} - -func (c *logsClient) SubscribeLogs(ctx context.Context, in *SubscribeLogsRequest, opts ...grpc.CallOption) (Logs_SubscribeLogsClient, error) { - stream, err := c.cc.NewStream(ctx, &_Logs_serviceDesc.Streams[0], "/docker.swarmkit.v1.Logs/SubscribeLogs", opts...) - if err != nil { - return nil, err - } - x := &logsSubscribeLogsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Logs_SubscribeLogsClient interface { - Recv() (*SubscribeLogsMessage, error) - grpc.ClientStream -} - -type logsSubscribeLogsClient struct { - grpc.ClientStream -} - -func (x *logsSubscribeLogsClient) Recv() (*SubscribeLogsMessage, error) { - m := new(SubscribeLogsMessage) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// LogsServer is the server API for Logs service. -type LogsServer interface { - // SubscribeLogs starts a subscription with the specified selector and options. - // - // The subscription will be distributed to relevant nodes and messages will - // be collected and sent via the returned stream. - // - // The subscription will end with an EOF. - SubscribeLogs(*SubscribeLogsRequest, Logs_SubscribeLogsServer) error -} - -// UnimplementedLogsServer can be embedded to have forward compatible implementations. -type UnimplementedLogsServer struct { -} - -func (*UnimplementedLogsServer) SubscribeLogs(req *SubscribeLogsRequest, srv Logs_SubscribeLogsServer) error { - return status.Errorf(codes.Unimplemented, "method SubscribeLogs not implemented") -} - -func RegisterLogsServer(s *grpc.Server, srv LogsServer) { - s.RegisterService(&_Logs_serviceDesc, srv) -} - -func _Logs_SubscribeLogs_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SubscribeLogsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(LogsServer).SubscribeLogs(m, &logsSubscribeLogsServer{stream}) -} - -type Logs_SubscribeLogsServer interface { - Send(*SubscribeLogsMessage) error - grpc.ServerStream -} - -type logsSubscribeLogsServer struct { - grpc.ServerStream -} - -func (x *logsSubscribeLogsServer) Send(m *SubscribeLogsMessage) error { - return x.ServerStream.SendMsg(m) -} - -var _Logs_serviceDesc = grpc.ServiceDesc{ - ServiceName: "docker.swarmkit.v1.Logs", - HandlerType: (*LogsServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "SubscribeLogs", - Handler: _Logs_SubscribeLogs_Handler, - ServerStreams: true, - }, - }, - Metadata: "github.com/docker/swarmkit/api/logbroker.proto", -} - -// LogBrokerClient is the client API for LogBroker service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type LogBrokerClient interface { - // ListenSubscriptions starts a subscription stream for the node. For each - // message received, the node should attempt to satisfy the subscription. - // - // Log messages that match the provided subscription should be sent via - // PublishLogs. - ListenSubscriptions(ctx context.Context, in *ListenSubscriptionsRequest, opts ...grpc.CallOption) (LogBroker_ListenSubscriptionsClient, error) - // PublishLogs receives sets of log messages destined for a single - // subscription identifier. - PublishLogs(ctx context.Context, opts ...grpc.CallOption) (LogBroker_PublishLogsClient, error) -} - -type logBrokerClient struct { - cc *grpc.ClientConn -} - -func NewLogBrokerClient(cc *grpc.ClientConn) LogBrokerClient { - return &logBrokerClient{cc} -} - -func (c *logBrokerClient) ListenSubscriptions(ctx context.Context, in *ListenSubscriptionsRequest, opts ...grpc.CallOption) (LogBroker_ListenSubscriptionsClient, error) { - stream, err := c.cc.NewStream(ctx, &_LogBroker_serviceDesc.Streams[0], "/docker.swarmkit.v1.LogBroker/ListenSubscriptions", opts...) - if err != nil { - return nil, err - } - x := &logBrokerListenSubscriptionsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type LogBroker_ListenSubscriptionsClient interface { - Recv() (*SubscriptionMessage, error) - grpc.ClientStream -} - -type logBrokerListenSubscriptionsClient struct { - grpc.ClientStream -} - -func (x *logBrokerListenSubscriptionsClient) Recv() (*SubscriptionMessage, error) { - m := new(SubscriptionMessage) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *logBrokerClient) PublishLogs(ctx context.Context, opts ...grpc.CallOption) (LogBroker_PublishLogsClient, error) { - stream, err := c.cc.NewStream(ctx, &_LogBroker_serviceDesc.Streams[1], "/docker.swarmkit.v1.LogBroker/PublishLogs", opts...) - if err != nil { - return nil, err - } - x := &logBrokerPublishLogsClient{stream} - return x, nil -} - -type LogBroker_PublishLogsClient interface { - Send(*PublishLogsMessage) error - CloseAndRecv() (*PublishLogsResponse, error) - grpc.ClientStream -} - -type logBrokerPublishLogsClient struct { - grpc.ClientStream -} - -func (x *logBrokerPublishLogsClient) Send(m *PublishLogsMessage) error { - return x.ClientStream.SendMsg(m) -} - -func (x *logBrokerPublishLogsClient) CloseAndRecv() (*PublishLogsResponse, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(PublishLogsResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// LogBrokerServer is the server API for LogBroker service. -type LogBrokerServer interface { - // ListenSubscriptions starts a subscription stream for the node. For each - // message received, the node should attempt to satisfy the subscription. - // - // Log messages that match the provided subscription should be sent via - // PublishLogs. - ListenSubscriptions(*ListenSubscriptionsRequest, LogBroker_ListenSubscriptionsServer) error - // PublishLogs receives sets of log messages destined for a single - // subscription identifier. - PublishLogs(LogBroker_PublishLogsServer) error -} - -// UnimplementedLogBrokerServer can be embedded to have forward compatible implementations. -type UnimplementedLogBrokerServer struct { -} - -func (*UnimplementedLogBrokerServer) ListenSubscriptions(req *ListenSubscriptionsRequest, srv LogBroker_ListenSubscriptionsServer) error { - return status.Errorf(codes.Unimplemented, "method ListenSubscriptions not implemented") -} -func (*UnimplementedLogBrokerServer) PublishLogs(srv LogBroker_PublishLogsServer) error { - return status.Errorf(codes.Unimplemented, "method PublishLogs not implemented") -} - -func RegisterLogBrokerServer(s *grpc.Server, srv LogBrokerServer) { - s.RegisterService(&_LogBroker_serviceDesc, srv) -} - -func _LogBroker_ListenSubscriptions_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ListenSubscriptionsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(LogBrokerServer).ListenSubscriptions(m, &logBrokerListenSubscriptionsServer{stream}) -} - -type LogBroker_ListenSubscriptionsServer interface { - Send(*SubscriptionMessage) error - grpc.ServerStream -} - -type logBrokerListenSubscriptionsServer struct { - grpc.ServerStream -} - -func (x *logBrokerListenSubscriptionsServer) Send(m *SubscriptionMessage) error { - return x.ServerStream.SendMsg(m) -} - -func _LogBroker_PublishLogs_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(LogBrokerServer).PublishLogs(&logBrokerPublishLogsServer{stream}) -} - -type LogBroker_PublishLogsServer interface { - SendAndClose(*PublishLogsResponse) error - Recv() (*PublishLogsMessage, error) - grpc.ServerStream -} - -type logBrokerPublishLogsServer struct { - grpc.ServerStream -} - -func (x *logBrokerPublishLogsServer) SendAndClose(m *PublishLogsResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *logBrokerPublishLogsServer) Recv() (*PublishLogsMessage, error) { - m := new(PublishLogsMessage) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _LogBroker_serviceDesc = grpc.ServiceDesc{ - ServiceName: "docker.swarmkit.v1.LogBroker", - HandlerType: (*LogBrokerServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "ListenSubscriptions", - Handler: _LogBroker_ListenSubscriptions_Handler, - ServerStreams: true, - }, - { - StreamName: "PublishLogs", - Handler: _LogBroker_PublishLogs_Handler, - ClientStreams: true, - }, - }, - Metadata: "github.com/docker/swarmkit/api/logbroker.proto", -} - -func (m *LogSubscriptionOptions) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LogSubscriptionOptions) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LogSubscriptionOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Since != nil { - { - size, err := m.Since.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLogbroker(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Tail != 0 { - i = encodeVarintLogbroker(dAtA, i, uint64(m.Tail)) - i-- - dAtA[i] = 0x18 - } - if m.Follow { - i-- - if m.Follow { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.Streams) > 0 { - for iNdEx := len(m.Streams) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarintLogbroker(dAtA, i, uint64(m.Streams[iNdEx])) - i-- - dAtA[i] = 0x8 - } - } - return len(dAtA) - i, nil -} - -func (m *LogSelector) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LogSelector) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LogSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TaskIDs) > 0 { - for iNdEx := len(m.TaskIDs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.TaskIDs[iNdEx]) - copy(dAtA[i:], m.TaskIDs[iNdEx]) - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.TaskIDs[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.NodeIDs) > 0 { - for iNdEx := len(m.NodeIDs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.NodeIDs[iNdEx]) - copy(dAtA[i:], m.NodeIDs[iNdEx]) - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.NodeIDs[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.ServiceIDs) > 0 { - for iNdEx := len(m.ServiceIDs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ServiceIDs[iNdEx]) - copy(dAtA[i:], m.ServiceIDs[iNdEx]) - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.ServiceIDs[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *LogContext) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LogContext) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LogContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TaskID) > 0 { - i -= len(m.TaskID) - copy(dAtA[i:], m.TaskID) - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.TaskID))) - i-- - dAtA[i] = 0x1a - } - if len(m.NodeID) > 0 { - i -= len(m.NodeID) - copy(dAtA[i:], m.NodeID) - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.NodeID))) - i-- - dAtA[i] = 0x12 - } - if len(m.ServiceID) > 0 { - i -= len(m.ServiceID) - copy(dAtA[i:], m.ServiceID) - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.ServiceID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LogAttr) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LogAttr) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LogAttr) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LogMessage) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LogMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LogMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Attrs) > 0 { - for iNdEx := len(m.Attrs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Attrs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLogbroker(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x22 - } - if m.Stream != 0 { - i = encodeVarintLogbroker(dAtA, i, uint64(m.Stream)) - i-- - dAtA[i] = 0x18 - } - if m.Timestamp != nil { - { - size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLogbroker(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Context.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLogbroker(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *SubscribeLogsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SubscribeLogsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SubscribeLogsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Options != nil { - { - size, err := m.Options.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLogbroker(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Selector != nil { - { - size, err := m.Selector.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLogbroker(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SubscribeLogsMessage) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SubscribeLogsMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SubscribeLogsMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Messages) > 0 { - for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLogbroker(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ListenSubscriptionsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListenSubscriptionsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListenSubscriptionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *SubscriptionMessage) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SubscriptionMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SubscriptionMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Close { - i-- - if m.Close { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.Options != nil { - { - size, err := m.Options.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLogbroker(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Selector != nil { - { - size, err := m.Selector.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLogbroker(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PublishLogsMessage) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PublishLogsMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PublishLogsMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Close { - i-- - if m.Close { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.Messages) > 0 { - for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLogbroker(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.SubscriptionID) > 0 { - i -= len(m.SubscriptionID) - copy(dAtA[i:], m.SubscriptionID) - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.SubscriptionID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PublishLogsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PublishLogsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PublishLogsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintLogbroker(dAtA []byte, offset int, v uint64) int { - offset -= sovLogbroker(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -type raftProxyLogsServer struct { - local LogsServer - connSelector raftselector.ConnProvider - localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error) -} - -func NewRaftProxyLogsServer(local LogsServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) LogsServer { - redirectChecker := func(ctx context.Context) (context.Context, error) { - p, ok := peer.FromContext(ctx) - if !ok { - return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context") - } - addr := p.Addr.String() - md, ok := metadata.FromIncomingContext(ctx) - if ok && len(md["redirect"]) != 0 { - return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"]) - } - if !ok { - md = metadata.New(map[string]string{}) - } - md["redirect"] = append(md["redirect"], addr) - return metadata.NewOutgoingContext(ctx, md), nil - } - remoteMods := []func(context.Context) (context.Context, error){redirectChecker} - remoteMods = append(remoteMods, remoteCtxMod) - - var localMods []func(context.Context) (context.Context, error) - if localCtxMod != nil { - localMods = []func(context.Context) (context.Context, error){localCtxMod} - } - - return &raftProxyLogsServer{ - local: local, - connSelector: connSelector, - localCtxMods: localMods, - remoteCtxMods: remoteMods, - } -} -func (p *raftProxyLogsServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) { - var err error - for _, mod := range ctxMods { - ctx, err = mod(ctx) - if err != nil { - return ctx, err - } - } - return ctx, nil -} -func (p *raftProxyLogsServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) { - ticker := rafttime.NewTicker(500 * rafttime.Millisecond) - defer ticker.Stop() - for { - select { - case <-ticker.C: - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - return nil, err - } - - client := NewHealthClient(conn) - - resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"}) - if err != nil || resp.Status != HealthCheckResponse_SERVING { - continue - } - return conn, nil - case <-ctx.Done(): - return nil, ctx.Err() - } - } -} - -type Logs_SubscribeLogsServerWrapper struct { - Logs_SubscribeLogsServer - ctx context.Context -} - -func (s Logs_SubscribeLogsServerWrapper) Context() context.Context { - return s.ctx -} - -func (p *raftProxyLogsServer) SubscribeLogs(r *SubscribeLogsRequest, stream Logs_SubscribeLogsServer) error { - ctx := stream.Context() - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return err - } - streamWrapper := Logs_SubscribeLogsServerWrapper{ - Logs_SubscribeLogsServer: stream, - ctx: ctx, - } - return p.local.SubscribeLogs(r, streamWrapper) - } - return err - } - ctx, err = p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return err - } - clientStream, err := NewLogsClient(conn).SubscribeLogs(ctx, r) - - if err != nil { - return err - } - - for { - msg, err := clientStream.Recv() - if err == io.EOF { - break - } - if err != nil { - return err - } - if err := stream.Send(msg); err != nil { - return err - } - } - return nil -} - -type raftProxyLogBrokerServer struct { - local LogBrokerServer - connSelector raftselector.ConnProvider - localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error) -} - -func NewRaftProxyLogBrokerServer(local LogBrokerServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) LogBrokerServer { - redirectChecker := func(ctx context.Context) (context.Context, error) { - p, ok := peer.FromContext(ctx) - if !ok { - return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context") - } - addr := p.Addr.String() - md, ok := metadata.FromIncomingContext(ctx) - if ok && len(md["redirect"]) != 0 { - return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"]) - } - if !ok { - md = metadata.New(map[string]string{}) - } - md["redirect"] = append(md["redirect"], addr) - return metadata.NewOutgoingContext(ctx, md), nil - } - remoteMods := []func(context.Context) (context.Context, error){redirectChecker} - remoteMods = append(remoteMods, remoteCtxMod) - - var localMods []func(context.Context) (context.Context, error) - if localCtxMod != nil { - localMods = []func(context.Context) (context.Context, error){localCtxMod} - } - - return &raftProxyLogBrokerServer{ - local: local, - connSelector: connSelector, - localCtxMods: localMods, - remoteCtxMods: remoteMods, - } -} -func (p *raftProxyLogBrokerServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) { - var err error - for _, mod := range ctxMods { - ctx, err = mod(ctx) - if err != nil { - return ctx, err - } - } - return ctx, nil -} -func (p *raftProxyLogBrokerServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) { - ticker := rafttime.NewTicker(500 * rafttime.Millisecond) - defer ticker.Stop() - for { - select { - case <-ticker.C: - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - return nil, err - } - - client := NewHealthClient(conn) - - resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"}) - if err != nil || resp.Status != HealthCheckResponse_SERVING { - continue - } - return conn, nil - case <-ctx.Done(): - return nil, ctx.Err() - } - } -} - -type LogBroker_ListenSubscriptionsServerWrapper struct { - LogBroker_ListenSubscriptionsServer - ctx context.Context -} - -func (s LogBroker_ListenSubscriptionsServerWrapper) Context() context.Context { - return s.ctx -} - -func (p *raftProxyLogBrokerServer) ListenSubscriptions(r *ListenSubscriptionsRequest, stream LogBroker_ListenSubscriptionsServer) error { - ctx := stream.Context() - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return err - } - streamWrapper := LogBroker_ListenSubscriptionsServerWrapper{ - LogBroker_ListenSubscriptionsServer: stream, - ctx: ctx, - } - return p.local.ListenSubscriptions(r, streamWrapper) - } - return err - } - ctx, err = p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return err - } - clientStream, err := NewLogBrokerClient(conn).ListenSubscriptions(ctx, r) - - if err != nil { - return err - } - - for { - msg, err := clientStream.Recv() - if err == io.EOF { - break - } - if err != nil { - return err - } - if err := stream.Send(msg); err != nil { - return err - } - } - return nil -} - -type LogBroker_PublishLogsServerWrapper struct { - LogBroker_PublishLogsServer - ctx context.Context -} - -func (s LogBroker_PublishLogsServerWrapper) Context() context.Context { - return s.ctx -} - -func (p *raftProxyLogBrokerServer) PublishLogs(stream LogBroker_PublishLogsServer) error { - ctx := stream.Context() - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return err - } - streamWrapper := LogBroker_PublishLogsServerWrapper{ - LogBroker_PublishLogsServer: stream, - ctx: ctx, - } - return p.local.PublishLogs(streamWrapper) - } - return err - } - ctx, err = p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return err - } - clientStream, err := NewLogBrokerClient(conn).PublishLogs(ctx) - - if err != nil { - return err - } - - for { - msg, err := stream.Recv() - if err == io.EOF { - break - } - if err != nil { - return err - } - if err := clientStream.Send(msg); err != nil { - return err - } - } - - reply, err := clientStream.CloseAndRecv() - if err != nil { - return err - } - - return stream.SendAndClose(reply) -} - -func (m *LogSubscriptionOptions) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Streams) > 0 { - for _, e := range m.Streams { - n += 1 + sovLogbroker(uint64(e)) - } - } - if m.Follow { - n += 2 - } - if m.Tail != 0 { - n += 1 + sovLogbroker(uint64(m.Tail)) - } - if m.Since != nil { - l = m.Since.Size() - n += 1 + l + sovLogbroker(uint64(l)) - } - return n -} - -func (m *LogSelector) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ServiceIDs) > 0 { - for _, s := range m.ServiceIDs { - l = len(s) - n += 1 + l + sovLogbroker(uint64(l)) - } - } - if len(m.NodeIDs) > 0 { - for _, s := range m.NodeIDs { - l = len(s) - n += 1 + l + sovLogbroker(uint64(l)) - } - } - if len(m.TaskIDs) > 0 { - for _, s := range m.TaskIDs { - l = len(s) - n += 1 + l + sovLogbroker(uint64(l)) - } - } - return n -} - -func (m *LogContext) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ServiceID) - if l > 0 { - n += 1 + l + sovLogbroker(uint64(l)) - } - l = len(m.NodeID) - if l > 0 { - n += 1 + l + sovLogbroker(uint64(l)) - } - l = len(m.TaskID) - if l > 0 { - n += 1 + l + sovLogbroker(uint64(l)) - } - return n -} - -func (m *LogAttr) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovLogbroker(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovLogbroker(uint64(l)) - } - return n -} - -func (m *LogMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Context.Size() - n += 1 + l + sovLogbroker(uint64(l)) - if m.Timestamp != nil { - l = m.Timestamp.Size() - n += 1 + l + sovLogbroker(uint64(l)) - } - if m.Stream != 0 { - n += 1 + sovLogbroker(uint64(m.Stream)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovLogbroker(uint64(l)) - } - if len(m.Attrs) > 0 { - for _, e := range m.Attrs { - l = e.Size() - n += 1 + l + sovLogbroker(uint64(l)) - } - } - return n -} - -func (m *SubscribeLogsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Selector != nil { - l = m.Selector.Size() - n += 1 + l + sovLogbroker(uint64(l)) - } - if m.Options != nil { - l = m.Options.Size() - n += 1 + l + sovLogbroker(uint64(l)) - } - return n -} - -func (m *SubscribeLogsMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Messages) > 0 { - for _, e := range m.Messages { - l = e.Size() - n += 1 + l + sovLogbroker(uint64(l)) - } - } - return n -} - -func (m *ListenSubscriptionsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *SubscriptionMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovLogbroker(uint64(l)) - } - if m.Selector != nil { - l = m.Selector.Size() - n += 1 + l + sovLogbroker(uint64(l)) - } - if m.Options != nil { - l = m.Options.Size() - n += 1 + l + sovLogbroker(uint64(l)) - } - if m.Close { - n += 2 - } - return n -} - -func (m *PublishLogsMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SubscriptionID) - if l > 0 { - n += 1 + l + sovLogbroker(uint64(l)) - } - if len(m.Messages) > 0 { - for _, e := range m.Messages { - l = e.Size() - n += 1 + l + sovLogbroker(uint64(l)) - } - } - if m.Close { - n += 2 - } - return n -} - -func (m *PublishLogsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovLogbroker(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozLogbroker(x uint64) (n int) { - return sovLogbroker(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *LogSubscriptionOptions) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LogSubscriptionOptions{`, - `Streams:` + fmt.Sprintf("%v", this.Streams) + `,`, - `Follow:` + fmt.Sprintf("%v", this.Follow) + `,`, - `Tail:` + fmt.Sprintf("%v", this.Tail) + `,`, - `Since:` + strings.Replace(fmt.Sprintf("%v", this.Since), "Timestamp", "types.Timestamp", 1) + `,`, - `}`, - }, "") - return s -} -func (this *LogSelector) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LogSelector{`, - `ServiceIDs:` + fmt.Sprintf("%v", this.ServiceIDs) + `,`, - `NodeIDs:` + fmt.Sprintf("%v", this.NodeIDs) + `,`, - `TaskIDs:` + fmt.Sprintf("%v", this.TaskIDs) + `,`, - `}`, - }, "") - return s -} -func (this *LogContext) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LogContext{`, - `ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`, - `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, - `TaskID:` + fmt.Sprintf("%v", this.TaskID) + `,`, - `}`, - }, "") - return s -} -func (this *LogAttr) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LogAttr{`, - `Key:` + fmt.Sprintf("%v", this.Key) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `}`, - }, "") - return s -} -func (this *LogMessage) String() string { - if this == nil { - return "nil" - } - repeatedStringForAttrs := "[]LogAttr{" - for _, f := range this.Attrs { - repeatedStringForAttrs += strings.Replace(strings.Replace(f.String(), "LogAttr", "LogAttr", 1), `&`, ``, 1) + "," - } - repeatedStringForAttrs += "}" - s := strings.Join([]string{`&LogMessage{`, - `Context:` + strings.Replace(strings.Replace(this.Context.String(), "LogContext", "LogContext", 1), `&`, ``, 1) + `,`, - `Timestamp:` + strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1) + `,`, - `Stream:` + fmt.Sprintf("%v", this.Stream) + `,`, - `Data:` + fmt.Sprintf("%v", this.Data) + `,`, - `Attrs:` + repeatedStringForAttrs + `,`, - `}`, - }, "") - return s -} -func (this *SubscribeLogsRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SubscribeLogsRequest{`, - `Selector:` + strings.Replace(this.Selector.String(), "LogSelector", "LogSelector", 1) + `,`, - `Options:` + strings.Replace(this.Options.String(), "LogSubscriptionOptions", "LogSubscriptionOptions", 1) + `,`, - `}`, - }, "") - return s -} -func (this *SubscribeLogsMessage) String() string { - if this == nil { - return "nil" - } - repeatedStringForMessages := "[]LogMessage{" - for _, f := range this.Messages { - repeatedStringForMessages += strings.Replace(strings.Replace(f.String(), "LogMessage", "LogMessage", 1), `&`, ``, 1) + "," - } - repeatedStringForMessages += "}" - s := strings.Join([]string{`&SubscribeLogsMessage{`, - `Messages:` + repeatedStringForMessages + `,`, - `}`, - }, "") - return s -} -func (this *ListenSubscriptionsRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ListenSubscriptionsRequest{`, - `}`, - }, "") - return s -} -func (this *SubscriptionMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SubscriptionMessage{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Selector:` + strings.Replace(this.Selector.String(), "LogSelector", "LogSelector", 1) + `,`, - `Options:` + strings.Replace(this.Options.String(), "LogSubscriptionOptions", "LogSubscriptionOptions", 1) + `,`, - `Close:` + fmt.Sprintf("%v", this.Close) + `,`, - `}`, - }, "") - return s -} -func (this *PublishLogsMessage) String() string { - if this == nil { - return "nil" - } - repeatedStringForMessages := "[]LogMessage{" - for _, f := range this.Messages { - repeatedStringForMessages += strings.Replace(strings.Replace(f.String(), "LogMessage", "LogMessage", 1), `&`, ``, 1) + "," - } - repeatedStringForMessages += "}" - s := strings.Join([]string{`&PublishLogsMessage{`, - `SubscriptionID:` + fmt.Sprintf("%v", this.SubscriptionID) + `,`, - `Messages:` + repeatedStringForMessages + `,`, - `Close:` + fmt.Sprintf("%v", this.Close) + `,`, - `}`, - }, "") - return s -} -func (this *PublishLogsResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PublishLogsResponse{`, - `}`, - }, "") - return s -} -func valueToStringLogbroker(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *LogSubscriptionOptions) Unmarshal(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 ErrIntOverflowLogbroker - } - 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: LogSubscriptionOptions: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LogSubscriptionOptions: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 0 { - var v LogStream - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= LogStream(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Streams = append(m.Streams, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.Streams) == 0 { - m.Streams = make([]LogStream, 0, elementCount) - } - for iNdEx < postIndex { - var v LogStream - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= LogStream(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Streams = append(m.Streams, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Streams", wireType) - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Follow", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Follow = bool(v != 0) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Tail", wireType) - } - m.Tail = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Tail |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Since", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Since == nil { - m.Since = &types.Timestamp{} - } - if err := m.Since.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipLogbroker(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LogSelector) Unmarshal(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 ErrIntOverflowLogbroker - } - 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: LogSelector: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LogSelector: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceIDs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceIDs = append(m.ServiceIDs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeIDs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NodeIDs = append(m.NodeIDs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskIDs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TaskIDs = append(m.TaskIDs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipLogbroker(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LogContext) Unmarshal(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 ErrIntOverflowLogbroker - } - 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: LogContext: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LogContext: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NodeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TaskID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipLogbroker(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LogAttr) Unmarshal(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 ErrIntOverflowLogbroker - } - 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: LogAttr: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LogAttr: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipLogbroker(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LogMessage) Unmarshal(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 ErrIntOverflowLogbroker - } - 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: LogMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LogMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Timestamp == nil { - m.Timestamp = &types.Timestamp{} - } - if err := m.Timestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Stream", wireType) - } - m.Stream = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Stream |= LogStream(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attrs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Attrs = append(m.Attrs, LogAttr{}) - if err := m.Attrs[len(m.Attrs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipLogbroker(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SubscribeLogsRequest) Unmarshal(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 ErrIntOverflowLogbroker - } - 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: SubscribeLogsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SubscribeLogsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Selector == nil { - m.Selector = &LogSelector{} - } - if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Options == nil { - m.Options = &LogSubscriptionOptions{} - } - if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipLogbroker(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SubscribeLogsMessage) Unmarshal(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 ErrIntOverflowLogbroker - } - 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: SubscribeLogsMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SubscribeLogsMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Messages = append(m.Messages, LogMessage{}) - if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipLogbroker(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListenSubscriptionsRequest) Unmarshal(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 ErrIntOverflowLogbroker - } - 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: ListenSubscriptionsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListenSubscriptionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipLogbroker(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SubscriptionMessage) Unmarshal(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 ErrIntOverflowLogbroker - } - 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: SubscriptionMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SubscriptionMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Selector == nil { - m.Selector = &LogSelector{} - } - if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Options == nil { - m.Options = &LogSubscriptionOptions{} - } - if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Close", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Close = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipLogbroker(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PublishLogsMessage) Unmarshal(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 ErrIntOverflowLogbroker - } - 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: PublishLogsMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PublishLogsMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubscriptionID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SubscriptionID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLogbroker - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLogbroker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Messages = append(m.Messages, LogMessage{}) - if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Close", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogbroker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Close = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipLogbroker(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PublishLogsResponse) Unmarshal(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 ErrIntOverflowLogbroker - } - 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: PublishLogsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PublishLogsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipLogbroker(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipLogbroker(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowLogbroker - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowLogbroker - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowLogbroker - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthLogbroker - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupLogbroker - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthLogbroker - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthLogbroker = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowLogbroker = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupLogbroker = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/moby/swarmkit/v2/api/logbroker.proto b/vendor/github.com/moby/swarmkit/v2/api/logbroker.proto deleted file mode 100644 index 1549640d4b..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/logbroker.proto +++ /dev/null @@ -1,188 +0,0 @@ -syntax = "proto3"; - -package docker.swarmkit.v1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "github.com/docker/swarmkit/protobuf/plugin/plugin.proto"; - -// LogStream defines the stream from which the log message came. -enum LogStream { - option (gogoproto.goproto_enum_prefix) = false; - option (gogoproto.enum_customname) = "LogStream"; - - LOG_STREAM_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "LogStreamUnknown"]; - LOG_STREAM_STDOUT = 1 [(gogoproto.enumvalue_customname) = "LogStreamStdout"]; - LOG_STREAM_STDERR = 2 [(gogoproto.enumvalue_customname) = "LogStreamStderr"]; -} - -message LogSubscriptionOptions { - // Streams defines which log streams should be sent from the task source. - // Empty means send all the messages. - repeated LogStream streams = 1 [packed=false]; - - // Follow instructs the publisher to continue sending log messages as they - // are produced, after satisfying the initial query. - bool follow = 2; - - // Tail defines how many messages relative to the log stream to send when - // starting the stream. - // - // Positive values will skip that number of messages from the start of the - // stream before publishing. - // - // Negative values will specify messages relative to the end of the stream, - // offset by one. We can say that the last (-n-1) lines are returned when n - // < 0. As reference, -1 would mean send no log lines (typically used with - // follow), -2 would return the last log line, -11 would return the last 10 - // and so on. - // - // The default value of zero will return all logs. - // - // Note that this is very different from the Docker API. - int64 tail = 3; - - // Since indicates that only log messages produced after this timestamp - // should be sent. - // Note: can't use stdtime because this field is nullable. - google.protobuf.Timestamp since = 4; -} - -// LogSelector will match logs from ANY of the defined parameters. -// -// For the best effect, the client should use the least specific parameter -// possible. For example, if they want to listen to all the tasks of a service, -// they should use the service id, rather than specifying the individual tasks. -message LogSelector { - repeated string service_ids = 1; - repeated string node_ids = 2; - repeated string task_ids = 3; -} - -// LogContext marks the context from which a log message was generated. -message LogContext { - string service_id = 1; - string node_id = 2; - string task_id = 3; -} - -// LogAttr is an extra key/value pair that may be have been set by users -message LogAttr { - string key = 1; - string value = 2; -} - -// LogMessage -message LogMessage { - // Context identifies the source of the log message. - LogContext context = 1 [(gogoproto.nullable) = false]; - - // Timestamp is the time at which the message was generated. - // Note: can't use stdtime because this field is nullable. - google.protobuf.Timestamp timestamp = 2; - - // Stream identifies the stream of the log message, stdout or stderr. - LogStream stream = 3; - - // Data is the raw log message, as generated by the application. - bytes data = 4; - - // Attrs is a list of key value pairs representing additional log details - // that may have been returned from the logger - repeated LogAttr attrs = 5 [(gogoproto.nullable) = false]; -} - -// Logs defines the methods for retrieving task logs messages from a cluster. -service Logs { - // SubscribeLogs starts a subscription with the specified selector and options. - // - // The subscription will be distributed to relevant nodes and messages will - // be collected and sent via the returned stream. - // - // The subscription will end with an EOF. - rpc SubscribeLogs(SubscribeLogsRequest) returns (stream SubscribeLogsMessage) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - } -} - -message SubscribeLogsRequest { - // LogSelector describes the logs to which the subscriber is - LogSelector selector = 1; - - LogSubscriptionOptions options = 2; -} - -message SubscribeLogsMessage { - repeated LogMessage messages = 1 [(gogoproto.nullable) = false]; -} - -// LogBroker defines the API used by the worker to send task logs back to a -// manager. A client listens for subscriptions then optimistically retrieves -// logs satisfying said subscriptions, calling PublishLogs for results that are -// relevant. -// -// The structure of ListenSubscriptions is similar to the Dispatcher API but -// decoupled to allow log distribution to work outside of the regular task -// flow. -service LogBroker { - // ListenSubscriptions starts a subscription stream for the node. For each - // message received, the node should attempt to satisfy the subscription. - // - // Log messages that match the provided subscription should be sent via - // PublishLogs. - rpc ListenSubscriptions(ListenSubscriptionsRequest) returns (stream SubscriptionMessage) { - option (docker.protobuf.plugin.tls_authorization) = { - roles: "swarm-worker" - roles: "swarm-manager" - }; - } - - // PublishLogs receives sets of log messages destined for a single - // subscription identifier. - rpc PublishLogs(stream PublishLogsMessage) returns (PublishLogsResponse) { - option (docker.protobuf.plugin.tls_authorization) = { - roles: "swarm-worker" - roles: "swarm-manager" - }; - } -} - -// ListenSubscriptionsRequest is a placeholder to begin listening for -// subscriptions. -message ListenSubscriptionsRequest { } - -// SubscriptionMessage instructs the listener to start publishing messages for -// the stream or end a subscription. -// -// If Options.Follow == false, the worker should end the subscription on its own. -message SubscriptionMessage { - // ID identifies the subscription. - string id = 1; - - // Selector defines which sources should be sent for the subscription. - LogSelector selector = 2; - - // Options specify how the subscription should be satisfied. - LogSubscriptionOptions options = 3; - - // Close will be true if the node should shutdown the subscription with the - // provided identifier. - bool close = 4; -} - -message PublishLogsMessage { - // SubscriptionID identifies which subscription the set of messages should - // be sent to. We can think of this as a "mail box" for the subscription. - string subscription_id = 1; - - // Messages is the log message for publishing. - repeated LogMessage messages = 2 [(gogoproto.nullable) = false]; - - // Close is a boolean for whether or not the client has completed its log - // stream. When close is called, the manager can hang up the subscription. - // Any further logs from this subscription are an error condition. Any - // messages included when close is set can be discarded - bool close = 3; -} - -message PublishLogsResponse { } diff --git a/vendor/github.com/moby/swarmkit/v2/api/objects.pb.go b/vendor/github.com/moby/swarmkit/v2/api/objects.pb.go deleted file mode 100644 index cbd14db42f..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/objects.pb.go +++ /dev/null @@ -1,10132 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/docker/swarmkit/api/objects.proto - -package api - -import ( - fmt "fmt" - github_com_docker_go_events "github.com/docker/go-events" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - types "github.com/gogo/protobuf/types" - github_com_moby_swarmkit_v2_api_deepcopy "github.com/moby/swarmkit/v2/api/deepcopy" - _ "github.com/moby/swarmkit/v2/protobuf/plugin" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Meta contains metadata about objects. Every object contains a meta field. -type Meta struct { - // Version tracks the current version of the object. - Version Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version"` - // Object timestamps. - // Note: can't use stdtime because these fields are nullable. - CreatedAt *types.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *types.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` -} - -func (m *Meta) Reset() { *m = Meta{} } -func (*Meta) ProtoMessage() {} -func (*Meta) Descriptor() ([]byte, []int) { - return fileDescriptor_6218a23329ef342d, []int{0} -} -func (m *Meta) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Meta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Meta.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Meta) XXX_Merge(src proto.Message) { - xxx_messageInfo_Meta.Merge(m, src) -} -func (m *Meta) XXX_Size() int { - return m.Size() -} -func (m *Meta) XXX_DiscardUnknown() { - xxx_messageInfo_Meta.DiscardUnknown(m) -} - -var xxx_messageInfo_Meta proto.InternalMessageInfo - -// Node provides the internal node state as seen by the cluster. -type Node struct { - // ID specifies the identity of the node. - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Meta Meta `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta"` - // Spec defines the desired state of the node as specified by the user. - // The system will honor this and will *never* modify it. - Spec NodeSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec"` - // Description encapsulated the properties of the Node as reported by the - // agent. - Description *NodeDescription `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - // Status provides the current status of the node, as seen by the manager. - Status NodeStatus `protobuf:"bytes,5,opt,name=status,proto3" json:"status"` - // ManagerStatus provides the current status of the node's manager - // component, if the node is a manager. - ManagerStatus *ManagerStatus `protobuf:"bytes,6,opt,name=manager_status,json=managerStatus,proto3" json:"manager_status,omitempty"` - // DEPRECATED: Use Attachments to find the ingress network - // The node attachment to the ingress network. - Attachment *NetworkAttachment `protobuf:"bytes,7,opt,name=attachment,proto3" json:"attachment,omitempty"` // Deprecated: Do not use. - // Certificate is the TLS certificate issued for the node, if any. - Certificate Certificate `protobuf:"bytes,8,opt,name=certificate,proto3" json:"certificate"` - // Role is the *observed* role for this node. It differs from the - // desired role set in Node.Spec.Role because the role here is only - // updated after the Raft member list has been reconciled with the - // desired role from the spec. - // - // This field represents the current reconciled state. If an action is - // to be performed, first verify the role in the cert. This field only - // shows the privilege level that the CA would currently grant when - // issuing or renewing the node's certificate. - Role NodeRole `protobuf:"varint,9,opt,name=role,proto3,enum=docker.swarmkit.v1.NodeRole" json:"role,omitempty"` - // Attachments enumerates the network attachments for the node to set up an - // endpoint on the node to be used for load balancing. Each overlay - // network, including ingress network, will have an NetworkAttachment. - Attachments []*NetworkAttachment `protobuf:"bytes,10,rep,name=attachments,proto3" json:"attachments,omitempty"` - // VXLANUDPPort specifies the UDP port for VXLAN traffic. - // This information is passed from cluster object to individual nodes. - VXLANUDPPort uint32 `protobuf:"varint,11,opt,name=VXLANUDPPort,proto3" json:"VXLANUDPPort,omitempty"` -} - -func (m *Node) Reset() { *m = Node{} } -func (*Node) ProtoMessage() {} -func (*Node) Descriptor() ([]byte, []int) { - return fileDescriptor_6218a23329ef342d, []int{1} -} -func (m *Node) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Node.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Node) XXX_Merge(src proto.Message) { - xxx_messageInfo_Node.Merge(m, src) -} -func (m *Node) XXX_Size() int { - return m.Size() -} -func (m *Node) XXX_DiscardUnknown() { - xxx_messageInfo_Node.DiscardUnknown(m) -} - -var xxx_messageInfo_Node proto.InternalMessageInfo - -type Service struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Meta Meta `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta"` - Spec ServiceSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec"` - // SpecVersion versions Spec, to identify changes in the spec. Note that - // this is not directly comparable to the service's Version. - SpecVersion *Version `protobuf:"bytes,10,opt,name=spec_version,json=specVersion,proto3" json:"spec_version,omitempty"` - // PreviousSpec is the previous service spec that was in place before - // "Spec". - PreviousSpec *ServiceSpec `protobuf:"bytes,6,opt,name=previous_spec,json=previousSpec,proto3" json:"previous_spec,omitempty"` - // PreviousSpecVersion versions PreviousSpec. Note that this is not - // directly comparable to the service's Version. - PreviousSpecVersion *Version `protobuf:"bytes,11,opt,name=previous_spec_version,json=previousSpecVersion,proto3" json:"previous_spec_version,omitempty"` - // Runtime state of service endpoint. This may be different - // from the spec version because the user may not have entered - // the optional fields like node_port or virtual_ip and it - // could be auto allocated by the system. - Endpoint *Endpoint `protobuf:"bytes,4,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - // UpdateStatus contains the status of an update, if one is in - // progress. - UpdateStatus *UpdateStatus `protobuf:"bytes,5,opt,name=update_status,json=updateStatus,proto3" json:"update_status,omitempty"` - // JobStatus contains the status of a Service that is in one of the Job - // modes. It is absent on Replicated and Global services. - JobStatus *JobStatus `protobuf:"bytes,12,opt,name=job_status,json=jobStatus,proto3" json:"job_status,omitempty"` - // PendingDelete indicates that this service's deletion has been requested. - // Services, as well as all service-level resources, can only be deleted - // after all of the service's containers have properly shut down. - // When a user requests a deletion, we just flip this flag - // the deallocator will take it from there - it will start monitoring - // this service's tasks, and proceed to delete the service itself (and - // potentially its associated resources also marked for deletion) when - // all of its tasks are gone - PendingDelete bool `protobuf:"varint,7,opt,name=pending_delete,json=pendingDelete,proto3" json:"pending_delete,omitempty"` -} - -func (m *Service) Reset() { *m = Service{} } -func (*Service) ProtoMessage() {} -func (*Service) Descriptor() ([]byte, []int) { - return fileDescriptor_6218a23329ef342d, []int{2} -} -func (m *Service) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Service.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Service) XXX_Merge(src proto.Message) { - xxx_messageInfo_Service.Merge(m, src) -} -func (m *Service) XXX_Size() int { - return m.Size() -} -func (m *Service) XXX_DiscardUnknown() { - xxx_messageInfo_Service.DiscardUnknown(m) -} - -var xxx_messageInfo_Service proto.InternalMessageInfo - -// Endpoint specified all the network parameters required to -// correctly discover and load balance a service -type Endpoint struct { - Spec *EndpointSpec `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"` - // Runtime state of the exposed ports which may carry - // auto-allocated swarm ports in addition to the user - // configured information. - Ports []*PortConfig `protobuf:"bytes,2,rep,name=ports,proto3" json:"ports,omitempty"` - // VirtualIPs specifies the IP addresses under which this endpoint will be - // made available. - VirtualIPs []*Endpoint_VirtualIP `protobuf:"bytes,3,rep,name=virtual_ips,json=virtualIps,proto3" json:"virtual_ips,omitempty"` -} - -func (m *Endpoint) Reset() { *m = Endpoint{} } -func (*Endpoint) ProtoMessage() {} -func (*Endpoint) Descriptor() ([]byte, []int) { - return fileDescriptor_6218a23329ef342d, []int{3} -} -func (m *Endpoint) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Endpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Endpoint.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Endpoint) XXX_Merge(src proto.Message) { - xxx_messageInfo_Endpoint.Merge(m, src) -} -func (m *Endpoint) XXX_Size() int { - return m.Size() -} -func (m *Endpoint) XXX_DiscardUnknown() { - xxx_messageInfo_Endpoint.DiscardUnknown(m) -} - -var xxx_messageInfo_Endpoint proto.InternalMessageInfo - -// VirtualIP specifies a set of networks this endpoint will be attached to -// and the IP addresses the target service will be made available under. -type Endpoint_VirtualIP struct { - // NetworkID for which this endpoint attachment was created. - NetworkID string `protobuf:"bytes,1,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` - // A virtual IP is used to address this service in IP - // layer that the client can use to send requests to - // this service. A DNS A/AAAA query on the service - // name might return this IP to the client. This is - // strictly a logical IP and there may not be any - // interfaces assigned this IP address or any route - // created for this address. More than one to - // accommodate for both IPv4 and IPv6 - Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` -} - -func (m *Endpoint_VirtualIP) Reset() { *m = Endpoint_VirtualIP{} } -func (*Endpoint_VirtualIP) ProtoMessage() {} -func (*Endpoint_VirtualIP) Descriptor() ([]byte, []int) { - return fileDescriptor_6218a23329ef342d, []int{3, 0} -} -func (m *Endpoint_VirtualIP) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Endpoint_VirtualIP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Endpoint_VirtualIP.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Endpoint_VirtualIP) XXX_Merge(src proto.Message) { - xxx_messageInfo_Endpoint_VirtualIP.Merge(m, src) -} -func (m *Endpoint_VirtualIP) XXX_Size() int { - return m.Size() -} -func (m *Endpoint_VirtualIP) XXX_DiscardUnknown() { - xxx_messageInfo_Endpoint_VirtualIP.DiscardUnknown(m) -} - -var xxx_messageInfo_Endpoint_VirtualIP proto.InternalMessageInfo - -// Task specifies the parameters for implementing a Spec. A task is effectively -// immutable and idempotent. Once it is dispatched to a node, it will not be -// dispatched to another node. -type Task struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Meta Meta `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta"` - // Spec defines the desired state of the task as specified by the user. - // The system will honor this and will *never* modify it. - Spec TaskSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec"` - // SpecVersion is copied from Service, to identify which version of the - // spec this task has. Note that this is not directly comparable to the - // service's Version. - SpecVersion *Version `protobuf:"bytes,14,opt,name=spec_version,json=specVersion,proto3" json:"spec_version,omitempty"` - // ServiceID indicates the service under which this task is orchestrated. This - // should almost always be set. - ServiceID string `protobuf:"bytes,4,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Slot is the service slot number for a task. - // For example, if a replicated service has replicas = 2, there will be a - // task with slot = 1, and another with slot = 2. - Slot uint64 `protobuf:"varint,5,opt,name=slot,proto3" json:"slot,omitempty"` - // NodeID indicates the node to which the task is assigned. If this field - // is empty or not set, the task is unassigned. - NodeID string `protobuf:"bytes,6,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Annotations defines the names and labels for the runtime, as set by - // the cluster manager. - // - // As backup, if this field has an empty name, the runtime will - // allocate a unique name for the actual container. - // - // NOTE(stevvooe): The preserves the ability for us to making naming - // decisions for tasks in orchestrator, albeit, this is left empty for now. - Annotations Annotations `protobuf:"bytes,7,opt,name=annotations,proto3" json:"annotations"` - // ServiceAnnotations is a direct copy of the service name and labels when - // this task is created. - // - // Labels set here will *not* be propagated to the runtime target, such as a - // container. Use labels on the runtime target for that purpose. - ServiceAnnotations Annotations `protobuf:"bytes,8,opt,name=service_annotations,json=serviceAnnotations,proto3" json:"service_annotations"` - Status TaskStatus `protobuf:"bytes,9,opt,name=status,proto3" json:"status"` - // DesiredState is the target state for the task. It is set to - // TaskStateRunning when a task is first created, and changed to - // TaskStateShutdown if the manager wants to terminate the task. This field - // is only written by the manager. - DesiredState TaskState `protobuf:"varint,10,opt,name=desired_state,json=desiredState,proto3,enum=docker.swarmkit.v1.TaskState" json:"desired_state,omitempty"` - // List of network attachments by the task. - Networks []*NetworkAttachment `protobuf:"bytes,11,rep,name=networks,proto3" json:"networks,omitempty"` - // A copy of runtime state of service endpoint from Service - // object to be distributed to agents as part of the task. - Endpoint *Endpoint `protobuf:"bytes,12,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - // LogDriver specifies the selected log driver to use for the task. Agent - // processes should always favor the value in this field. - // - // If present in the TaskSpec, this will be a copy of that value. The - // orchestrator may choose to insert a value here, which should be honored, - // such a cluster default or policy-based value. - // - // If not present, the daemon's default will be used. - LogDriver *Driver `protobuf:"bytes,13,opt,name=log_driver,json=logDriver,proto3" json:"log_driver,omitempty"` - AssignedGenericResources []*GenericResource `protobuf:"bytes,15,rep,name=assigned_generic_resources,json=assignedGenericResources,proto3" json:"assigned_generic_resources,omitempty"` - // JobIteration is the iteration number of the Job-mode Service that this - // task belongs to. - JobIteration *Version `protobuf:"bytes,16,opt,name=job_iteration,json=jobIteration,proto3" json:"job_iteration,omitempty"` - // Volumes is a list of VolumeAttachments for this task. It specifies which - // volumes this task is allocated. - Volumes []*VolumeAttachment `protobuf:"bytes,17,rep,name=volumes,proto3" json:"volumes,omitempty"` -} - -func (m *Task) Reset() { *m = Task{} } -func (*Task) ProtoMessage() {} -func (*Task) Descriptor() ([]byte, []int) { - return fileDescriptor_6218a23329ef342d, []int{4} -} -func (m *Task) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Task) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Task.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Task) XXX_Merge(src proto.Message) { - xxx_messageInfo_Task.Merge(m, src) -} -func (m *Task) XXX_Size() int { - return m.Size() -} -func (m *Task) XXX_DiscardUnknown() { - xxx_messageInfo_Task.DiscardUnknown(m) -} - -var xxx_messageInfo_Task proto.InternalMessageInfo - -// NetworkAttachment specifies the network parameters of attachment to -// a single network by an object such as task or node. -type NetworkAttachment struct { - // Network state as a whole becomes part of the object so that - // it always is available for use in agents so that agents - // don't have any other dependency during execution. - Network *Network `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` - // List of IPv4/IPv6 addresses that are assigned to the object - // as part of getting attached to this network. - Addresses []string `protobuf:"bytes,2,rep,name=addresses,proto3" json:"addresses,omitempty"` - // List of aliases by which a task is resolved in a network - Aliases []string `protobuf:"bytes,3,rep,name=aliases,proto3" json:"aliases,omitempty"` - // Map of all the driver attachment options for this network - DriverAttachmentOpts map[string]string `protobuf:"bytes,4,rep,name=driver_attachment_opts,json=driverAttachmentOpts,proto3" json:"driver_attachment_opts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *NetworkAttachment) Reset() { *m = NetworkAttachment{} } -func (*NetworkAttachment) ProtoMessage() {} -func (*NetworkAttachment) Descriptor() ([]byte, []int) { - return fileDescriptor_6218a23329ef342d, []int{5} -} -func (m *NetworkAttachment) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NetworkAttachment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NetworkAttachment.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NetworkAttachment) XXX_Merge(src proto.Message) { - xxx_messageInfo_NetworkAttachment.Merge(m, src) -} -func (m *NetworkAttachment) XXX_Size() int { - return m.Size() -} -func (m *NetworkAttachment) XXX_DiscardUnknown() { - xxx_messageInfo_NetworkAttachment.DiscardUnknown(m) -} - -var xxx_messageInfo_NetworkAttachment proto.InternalMessageInfo - -type Network struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Meta Meta `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta"` - Spec NetworkSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec"` - // Driver specific operational state provided by the network driver. - DriverState *Driver `protobuf:"bytes,4,opt,name=driver_state,json=driverState,proto3" json:"driver_state,omitempty"` - // Runtime state of IPAM options. This may not reflect the - // ipam options from NetworkSpec. - IPAM *IPAMOptions `protobuf:"bytes,5,opt,name=ipam,proto3" json:"ipam,omitempty"` - // PendingDelete indicates that this network's deletion has been requested. - // Services, as well as all service-level resources, can only be deleted - // after all the service's containers have properly shut down - // when a user requests a deletion, we just flip this flag - // the deallocator will take it from there - // PendingDelete indicates that this network's deletion has been requested. - // Services, as well as all service-level resources, can only be deleted - // after all of the service's containers have properly shut down. - // When a user requests a deletion of this network, we just flip this flag - // the deallocator will take it from there - it will start monitoring - // the services that still use this service, and proceed to delete - // this network when all of these services are gone - PendingDelete bool `protobuf:"varint,6,opt,name=pending_delete,json=pendingDelete,proto3" json:"pending_delete,omitempty"` -} - -func (m *Network) Reset() { *m = Network{} } -func (*Network) ProtoMessage() {} -func (*Network) Descriptor() ([]byte, []int) { - return fileDescriptor_6218a23329ef342d, []int{6} -} -func (m *Network) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Network) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Network.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Network) XXX_Merge(src proto.Message) { - xxx_messageInfo_Network.Merge(m, src) -} -func (m *Network) XXX_Size() int { - return m.Size() -} -func (m *Network) XXX_DiscardUnknown() { - xxx_messageInfo_Network.DiscardUnknown(m) -} - -var xxx_messageInfo_Network proto.InternalMessageInfo - -// Cluster provides global cluster settings. -type Cluster struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Meta Meta `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta"` - Spec ClusterSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec"` - // RootCA contains key material for the root CA. - RootCA RootCA `protobuf:"bytes,4,opt,name=root_ca,json=rootCa,proto3" json:"root_ca"` - // Symmetric encryption key distributed by the lead manager. Used by agents - // for securing network bootstrapping and communication. - NetworkBootstrapKeys []*EncryptionKey `protobuf:"bytes,5,rep,name=network_bootstrap_keys,json=networkBootstrapKeys,proto3" json:"network_bootstrap_keys,omitempty"` - // Logical clock used to timestamp every key. It allows other managers - // and agents to unambiguously identify the older key to be deleted when - // a new key is allocated on key rotation. - EncryptionKeyLamportClock uint64 `protobuf:"varint,6,opt,name=encryption_key_lamport_clock,json=encryptionKeyLamportClock,proto3" json:"encryption_key_lamport_clock,omitempty"` - // BlacklistedCertificates tracks certificates that should no longer - // be honored. It's a mapping from CN -> BlacklistedCertificate. - // swarm. Their certificates should effectively be blacklisted. - BlacklistedCertificates map[string]*BlacklistedCertificate `protobuf:"bytes,8,rep,name=blacklisted_certificates,json=blacklistedCertificates,proto3" json:"blacklisted_certificates,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // UnlockKeys defines the keys that lock node data at rest. For example, - // this would contain the key encrypting key (KEK) that will encrypt the - // manager TLS keys at rest and the raft encryption keys at rest. - // If the key is empty, the node will be unlocked (will not require a key - // to start up from a shut down state). - UnlockKeys []*EncryptionKey `protobuf:"bytes,9,rep,name=unlock_keys,json=unlockKeys,proto3" json:"unlock_keys,omitempty"` - // FIPS specifies whether this cluster should be in FIPS mode. This changes - // the format of the join tokens, and nodes that are not FIPS-enabled should - // reject joining the cluster. Nodes that report themselves to be non-FIPS - // should be rejected from the cluster. - FIPS bool `protobuf:"varint,10,opt,name=fips,proto3" json:"fips,omitempty"` - // This field specifies default subnet pools for global scope networks. If - // unspecified, Docker will use the predefined subnets as it works on older releases. - // Format Example : {"20.20.0.0/16",""20.20.0.0/16"} - DefaultAddressPool []string `protobuf:"bytes,11,rep,name=defaultAddressPool,proto3" json:"defaultAddressPool,omitempty"` - // This flag specifies the default subnet size of global scope networks by giving - // the length of the subnet masks for every such network - SubnetSize uint32 `protobuf:"varint,12,opt,name=subnetSize,proto3" json:"subnetSize,omitempty"` - // VXLANUDPPort specifies the UDP port for VXLAN traffic. - VXLANUDPPort uint32 `protobuf:"varint,13,opt,name=VXLANUDPPort,proto3" json:"VXLANUDPPort,omitempty"` -} - -func (m *Cluster) Reset() { *m = Cluster{} } -func (*Cluster) ProtoMessage() {} -func (*Cluster) Descriptor() ([]byte, []int) { - return fileDescriptor_6218a23329ef342d, []int{7} -} -func (m *Cluster) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Cluster) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Cluster.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Cluster) XXX_Merge(src proto.Message) { - xxx_messageInfo_Cluster.Merge(m, src) -} -func (m *Cluster) XXX_Size() int { - return m.Size() -} -func (m *Cluster) XXX_DiscardUnknown() { - xxx_messageInfo_Cluster.DiscardUnknown(m) -} - -var xxx_messageInfo_Cluster proto.InternalMessageInfo - -// Secret represents a secret that should be passed to a container or a node, -// and is immutable. -type Secret struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Meta Meta `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta"` - // Spec contains the actual secret data, as well as any context around the - // secret data that the user provides. - Spec SecretSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec"` - // Whether the secret is an internal secret (not set by a user) or not. - Internal bool `protobuf:"varint,4,opt,name=internal,proto3" json:"internal,omitempty"` -} - -func (m *Secret) Reset() { *m = Secret{} } -func (*Secret) ProtoMessage() {} -func (*Secret) Descriptor() ([]byte, []int) { - return fileDescriptor_6218a23329ef342d, []int{8} -} -func (m *Secret) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Secret) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Secret.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Secret) XXX_Merge(src proto.Message) { - xxx_messageInfo_Secret.Merge(m, src) -} -func (m *Secret) XXX_Size() int { - return m.Size() -} -func (m *Secret) XXX_DiscardUnknown() { - xxx_messageInfo_Secret.DiscardUnknown(m) -} - -var xxx_messageInfo_Secret proto.InternalMessageInfo - -// Config represents a set of configuration files that should be passed to a -// container. -type Config struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Meta Meta `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta"` - // Spec contains the actual config data, as well as any context around the - // config data that the user provides. - Spec ConfigSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec"` -} - -func (m *Config) Reset() { *m = Config{} } -func (*Config) ProtoMessage() {} -func (*Config) Descriptor() ([]byte, []int) { - return fileDescriptor_6218a23329ef342d, []int{9} -} -func (m *Config) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Config.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Config) XXX_Merge(src proto.Message) { - xxx_messageInfo_Config.Merge(m, src) -} -func (m *Config) XXX_Size() int { - return m.Size() -} -func (m *Config) XXX_DiscardUnknown() { - xxx_messageInfo_Config.DiscardUnknown(m) -} - -var xxx_messageInfo_Config proto.InternalMessageInfo - -// Resource is a top-level object with externally defined content and indexing. -// SwarmKit can serve as a store for these objects without understanding their -// meanings. -type Resource struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Meta Meta `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta"` - Annotations Annotations `protobuf:"bytes,3,opt,name=annotations,proto3" json:"annotations"` - // Kind identifies this class of object. It is essentially a namespace - // to keep IDs or indices from colliding between unrelated Resource - // objects. This must correspond to the name of an Extension. - Kind string `protobuf:"bytes,4,opt,name=kind,proto3" json:"kind,omitempty"` - // Payload bytes. This data is not interpreted in any way by SwarmKit. - // By convention, it should be a marshalled protocol buffers message. - Payload *types.Any `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (m *Resource) Reset() { *m = Resource{} } -func (*Resource) ProtoMessage() {} -func (*Resource) Descriptor() ([]byte, []int) { - return fileDescriptor_6218a23329ef342d, []int{10} -} -func (m *Resource) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Resource.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Resource) XXX_Merge(src proto.Message) { - xxx_messageInfo_Resource.Merge(m, src) -} -func (m *Resource) XXX_Size() int { - return m.Size() -} -func (m *Resource) XXX_DiscardUnknown() { - xxx_messageInfo_Resource.DiscardUnknown(m) -} - -var xxx_messageInfo_Resource proto.InternalMessageInfo - -// Extension declares a type of "resource" object. This message provides some -// metadata about the objects. -type Extension struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Meta Meta `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta"` - Annotations Annotations `protobuf:"bytes,3,opt,name=annotations,proto3" json:"annotations"` - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` -} - -func (m *Extension) Reset() { *m = Extension{} } -func (*Extension) ProtoMessage() {} -func (*Extension) Descriptor() ([]byte, []int) { - return fileDescriptor_6218a23329ef342d, []int{11} -} -func (m *Extension) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Extension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Extension.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Extension) XXX_Merge(src proto.Message) { - xxx_messageInfo_Extension.Merge(m, src) -} -func (m *Extension) XXX_Size() int { - return m.Size() -} -func (m *Extension) XXX_DiscardUnknown() { - xxx_messageInfo_Extension.DiscardUnknown(m) -} - -var xxx_messageInfo_Extension proto.InternalMessageInfo - -// Volume is the top-level object describing a volume usable by Swarmkit. The -// Volume contains the user's VolumeSpec, the Volume's status, and the Volume -// object that was returned by the CSI Plugin when the volume was created. -type Volume struct { - // ID is the swarmkit-internal ID for this volume object. This has no - // relation to the CSI volume identifier provided by the CSI Plugin. - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Meta Meta `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta"` - // Spec is the desired state of the Volume, as provided by the user. - Spec VolumeSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec"` - // PublishStatus is the status of the volume as it pertains to the various - // nodes it is in use on. - PublishStatus []*VolumePublishStatus `protobuf:"bytes,4,rep,name=publish_status,json=publishStatus,proto3" json:"publish_status,omitempty"` - // VolumeInfo contains information about the volume originating from the - // CSI plugin when the volume is created. - VolumeInfo *VolumeInfo `protobuf:"bytes,5,opt,name=volume_info,json=volumeInfo,proto3" json:"volume_info,omitempty"` - // PendingDelete indicates that this Volume is being removed from Swarm. - // Before a Volume can be removed, we must call the DeleteVolume on the - // Controller. Because of this, we cannot immediately remove the Volume - // when a user wishes to delete it. Instead, we will mark a Volume with - // PendingDelete = true, which instructs Swarm to go through the work of - // removing the volume and then delete it when finished. - PendingDelete bool `protobuf:"varint,6,opt,name=pending_delete,json=pendingDelete,proto3" json:"pending_delete,omitempty"` -} - -func (m *Volume) Reset() { *m = Volume{} } -func (*Volume) ProtoMessage() {} -func (*Volume) Descriptor() ([]byte, []int) { - return fileDescriptor_6218a23329ef342d, []int{12} -} -func (m *Volume) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Volume) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Volume.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Volume) XXX_Merge(src proto.Message) { - xxx_messageInfo_Volume.Merge(m, src) -} -func (m *Volume) XXX_Size() int { - return m.Size() -} -func (m *Volume) XXX_DiscardUnknown() { - xxx_messageInfo_Volume.DiscardUnknown(m) -} - -var xxx_messageInfo_Volume proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Meta)(nil), "docker.swarmkit.v1.Meta") - proto.RegisterType((*Node)(nil), "docker.swarmkit.v1.Node") - proto.RegisterType((*Service)(nil), "docker.swarmkit.v1.Service") - proto.RegisterType((*Endpoint)(nil), "docker.swarmkit.v1.Endpoint") - proto.RegisterType((*Endpoint_VirtualIP)(nil), "docker.swarmkit.v1.Endpoint.VirtualIP") - proto.RegisterType((*Task)(nil), "docker.swarmkit.v1.Task") - proto.RegisterType((*NetworkAttachment)(nil), "docker.swarmkit.v1.NetworkAttachment") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.NetworkAttachment.DriverAttachmentOptsEntry") - proto.RegisterType((*Network)(nil), "docker.swarmkit.v1.Network") - proto.RegisterType((*Cluster)(nil), "docker.swarmkit.v1.Cluster") - proto.RegisterMapType((map[string]*BlacklistedCertificate)(nil), "docker.swarmkit.v1.Cluster.BlacklistedCertificatesEntry") - proto.RegisterType((*Secret)(nil), "docker.swarmkit.v1.Secret") - proto.RegisterType((*Config)(nil), "docker.swarmkit.v1.Config") - proto.RegisterType((*Resource)(nil), "docker.swarmkit.v1.Resource") - proto.RegisterType((*Extension)(nil), "docker.swarmkit.v1.Extension") - proto.RegisterType((*Volume)(nil), "docker.swarmkit.v1.Volume") -} - -func init() { - proto.RegisterFile("github.com/docker/swarmkit/api/objects.proto", fileDescriptor_6218a23329ef342d) -} - -var fileDescriptor_6218a23329ef342d = []byte{ - // 1786 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcb, 0x73, 0x1c, 0x47, - 0x19, 0xd7, 0xac, 0xc6, 0xfb, 0xf8, 0xf6, 0x81, 0xd3, 0x11, 0x62, 0x2c, 0xc4, 0x4a, 0x6c, 0x12, - 0x70, 0xa5, 0x5c, 0xab, 0x60, 0x02, 0xc8, 0x22, 0x89, 0xbd, 0x2b, 0x09, 0x67, 0x49, 0x6c, 0xab, - 0x5a, 0x89, 0x93, 0xdb, 0x30, 0x3b, 0xd3, 0x5a, 0x8f, 0x77, 0x76, 0x7a, 0x6a, 0xba, 0x67, 0xc3, - 0x72, 0xe2, 0xec, 0x2a, 0xaa, 0xb8, 0xf9, 0xc6, 0x81, 0xe2, 0x9f, 0xe0, 0xc2, 0x81, 0x03, 0x65, - 0x6e, 0x39, 0x51, 0x29, 0x0e, 0x2a, 0xbc, 0xfe, 0x2b, 0xb8, 0x51, 0xfd, 0x98, 0xdd, 0x91, 0x77, - 0xf4, 0x30, 0xb8, 0x54, 0x9c, 0xb6, 0x1f, 0xbf, 0xdf, 0xd7, 0xdf, 0xf7, 0x75, 0x7f, 0x8f, 0x59, - 0xb8, 0x31, 0xf0, 0xf9, 0xa3, 0xa4, 0xdf, 0x76, 0xe9, 0x68, 0xcb, 0xa3, 0xee, 0x90, 0xc4, 0x5b, - 0xec, 0x2b, 0x27, 0x1e, 0x0d, 0x7d, 0xbe, 0xe5, 0x44, 0xfe, 0x16, 0xed, 0x3f, 0x26, 0x2e, 0x67, - 0xed, 0x28, 0xa6, 0x9c, 0x22, 0xa4, 0x20, 0xed, 0x14, 0xd2, 0x1e, 0xff, 0x68, 0xed, 0xdd, 0x73, - 0x24, 0xf0, 0x49, 0x44, 0x34, 0xff, 0x5c, 0x2c, 0x8b, 0x88, 0x9b, 0x62, 0x37, 0x06, 0x94, 0x0e, - 0x02, 0xb2, 0x25, 0x67, 0xfd, 0xe4, 0x68, 0x8b, 0xfb, 0x23, 0xc2, 0xb8, 0x33, 0x8a, 0x34, 0x60, - 0x65, 0x40, 0x07, 0x54, 0x0e, 0xb7, 0xc4, 0x48, 0xaf, 0x5e, 0x7b, 0x99, 0xe6, 0x84, 0x13, 0xbd, - 0xf5, 0xb3, 0x33, 0x4e, 0x9f, 0xc1, 0xa3, 0x20, 0x19, 0xf8, 0xa1, 0xfe, 0x51, 0xc4, 0xd6, 0x9f, - 0x0d, 0x30, 0xef, 0x11, 0xee, 0xa0, 0x9f, 0x43, 0x69, 0x4c, 0x62, 0xe6, 0xd3, 0xd0, 0x32, 0x36, - 0x8d, 0xeb, 0xd5, 0x9b, 0xdf, 0x6d, 0x2f, 0x7a, 0xa4, 0xfd, 0x50, 0x41, 0xba, 0xe6, 0xb3, 0xe3, - 0x8d, 0x25, 0x9c, 0x32, 0xd0, 0x2d, 0x00, 0x37, 0x26, 0x0e, 0x27, 0x9e, 0xed, 0x70, 0xab, 0x20, - 0xf9, 0x6b, 0x6d, 0xa5, 0x6e, 0x3b, 0x3d, 0xbf, 0xfd, 0x59, 0x6a, 0x25, 0xae, 0x68, 0x74, 0x87, - 0x0b, 0x6a, 0x12, 0x79, 0x29, 0x75, 0xf9, 0x7c, 0xaa, 0x46, 0x77, 0x78, 0xeb, 0x4f, 0x57, 0xc0, - 0xbc, 0x4f, 0x3d, 0x82, 0x56, 0xa1, 0xe0, 0x7b, 0x52, 0xed, 0x4a, 0xb7, 0x38, 0x3d, 0xde, 0x28, - 0xf4, 0xf6, 0x70, 0xc1, 0xf7, 0xd0, 0x4d, 0x30, 0x47, 0x84, 0x3b, 0x5a, 0x21, 0x2b, 0xcf, 0x20, - 0x61, 0xbb, 0xb6, 0x46, 0x62, 0xd1, 0x4f, 0xc1, 0x14, 0x57, 0xa5, 0x35, 0x59, 0xcf, 0xe3, 0x88, - 0x33, 0x0f, 0x23, 0xe2, 0xa6, 0x3c, 0x81, 0x47, 0xfb, 0x50, 0xf5, 0x08, 0x73, 0x63, 0x3f, 0xe2, - 0xc2, 0x87, 0xa6, 0xa4, 0xbf, 0x75, 0x1a, 0x7d, 0x6f, 0x0e, 0xc5, 0x59, 0x1e, 0xfa, 0x00, 0x8a, - 0x8c, 0x3b, 0x3c, 0x61, 0xd6, 0x15, 0x29, 0xa1, 0x79, 0xaa, 0x02, 0x12, 0xa5, 0x55, 0xd0, 0x1c, - 0xf4, 0x31, 0x34, 0x46, 0x4e, 0xe8, 0x0c, 0x48, 0x6c, 0x6b, 0x29, 0x45, 0x29, 0xe5, 0xfb, 0xb9, - 0xa6, 0x2b, 0xa4, 0x12, 0x84, 0xeb, 0xa3, 0xec, 0x14, 0xf5, 0x00, 0x1c, 0xce, 0x1d, 0xf7, 0xd1, - 0x88, 0x84, 0xdc, 0x2a, 0x49, 0x29, 0xef, 0xe4, 0xea, 0x42, 0xf8, 0x57, 0x34, 0x1e, 0x76, 0x66, - 0xe0, 0x6e, 0xc1, 0x32, 0x70, 0x86, 0x8c, 0xee, 0x42, 0xd5, 0x25, 0x31, 0xf7, 0x8f, 0x7c, 0xd7, - 0xe1, 0xc4, 0x2a, 0x4b, 0x59, 0x1b, 0x79, 0xb2, 0x76, 0xe7, 0x30, 0x6d, 0x58, 0x96, 0x89, 0xde, - 0x03, 0x33, 0xa6, 0x01, 0xb1, 0x2a, 0x9b, 0xc6, 0xf5, 0xc6, 0xe9, 0x57, 0x83, 0x69, 0x40, 0xb0, - 0x44, 0x8a, 0xa3, 0xe7, 0x8a, 0x30, 0x0b, 0x36, 0x97, 0x2f, 0x6c, 0x06, 0xce, 0x32, 0x51, 0x0b, - 0x6a, 0x0f, 0xbf, 0xfc, 0xb4, 0x73, 0xff, 0xf3, 0xbd, 0x83, 0x03, 0x1a, 0x73, 0xab, 0xba, 0x69, - 0x5c, 0xaf, 0xe3, 0x13, 0x6b, 0x3b, 0xab, 0x4f, 0x9e, 0xb6, 0x10, 0x5c, 0x2d, 0x1b, 0x57, 0x0d, - 0xf9, 0x16, 0x8d, 0xf7, 0x8c, 0x2f, 0x8d, 0x5f, 0x19, 0xad, 0xe7, 0x26, 0x94, 0x0e, 0x49, 0x3c, - 0xf6, 0xdd, 0xd7, 0xfb, 0x52, 0x6f, 0x9d, 0x78, 0xa9, 0xb9, 0x0e, 0xd5, 0xc7, 0x2e, 0x3c, 0xd6, - 0x8f, 0xa0, 0x26, 0x7e, 0xed, 0x34, 0xe2, 0xe1, 0xdc, 0x88, 0xc7, 0x55, 0x41, 0xd0, 0x13, 0xb4, - 0x07, 0xf5, 0x28, 0x26, 0x63, 0x9f, 0x26, 0xcc, 0x96, 0x3a, 0x14, 0x2f, 0xa4, 0x03, 0xae, 0xa5, - 0x2c, 0x31, 0x43, 0x0f, 0xe0, 0xdb, 0x27, 0xa4, 0xcc, 0xd4, 0xa9, 0x9e, 0xaf, 0xce, 0x9b, 0x59, - 0x49, 0xa9, 0x5a, 0xdb, 0x50, 0x26, 0xa1, 0x17, 0x51, 0x3f, 0xe4, 0x3a, 0x00, 0x73, 0x1f, 0xc9, - 0xbe, 0xc6, 0xe0, 0x19, 0x1a, 0xed, 0x43, 0x5d, 0xe5, 0x15, 0xfb, 0x44, 0xf4, 0x6d, 0xe6, 0xd1, - 0x3f, 0x97, 0x40, 0x1d, 0x36, 0xb5, 0x24, 0x33, 0x43, 0x1f, 0x00, 0x3c, 0xa6, 0xfd, 0x54, 0x46, - 0x4d, 0xca, 0xf8, 0x5e, 0x9e, 0x8c, 0x5f, 0xd2, 0xbe, 0x16, 0x50, 0x79, 0x9c, 0x0e, 0xd1, 0x3b, - 0xd0, 0x88, 0x48, 0xe8, 0xf9, 0xe1, 0xc0, 0xf6, 0x48, 0x40, 0x38, 0x91, 0x71, 0x57, 0xc6, 0x75, - 0xbd, 0xba, 0x27, 0x17, 0x77, 0xd0, 0x93, 0xa7, 0xad, 0x06, 0xd4, 0xb2, 0xef, 0xac, 0xf5, 0x87, - 0x02, 0x94, 0x53, 0xb3, 0xd0, 0xfb, 0xfa, 0x61, 0x18, 0xa7, 0xdb, 0x90, 0x62, 0xe5, 0xad, 0xa8, - 0x37, 0xf1, 0x3e, 0x5c, 0x89, 0x68, 0xcc, 0x99, 0x55, 0x90, 0x51, 0x92, 0x9b, 0x78, 0xc4, 0x3b, - 0xdf, 0xa5, 0xe1, 0x91, 0x3f, 0xc0, 0x0a, 0x8c, 0xbe, 0x80, 0xea, 0xd8, 0x8f, 0x79, 0xe2, 0x04, - 0xb6, 0x1f, 0x31, 0x6b, 0x59, 0x72, 0x7f, 0x70, 0xd6, 0x91, 0xed, 0x87, 0x0a, 0xdf, 0x3b, 0xe8, - 0x36, 0xa6, 0xc7, 0x1b, 0x30, 0x9b, 0x32, 0x0c, 0x5a, 0x54, 0x2f, 0x62, 0x6b, 0xf7, 0xa0, 0x32, - 0xdb, 0x41, 0x37, 0x00, 0x42, 0x15, 0xa0, 0xf6, 0x2c, 0x7c, 0xea, 0xd3, 0xe3, 0x8d, 0x8a, 0x0e, - 0xdb, 0xde, 0x1e, 0xae, 0x68, 0x40, 0xcf, 0x43, 0x08, 0x4c, 0xc7, 0xf3, 0x62, 0x19, 0x4c, 0x15, - 0x2c, 0xc7, 0xad, 0xdf, 0x95, 0xc1, 0xfc, 0xcc, 0x61, 0xc3, 0xcb, 0xae, 0x15, 0xe2, 0xcc, 0x73, - 0xc3, 0xaf, 0xf1, 0x8a, 0xe1, 0x77, 0x03, 0x80, 0xa9, 0xa8, 0x12, 0xee, 0x30, 0xe7, 0xee, 0xd0, - 0xb1, 0x26, 0xdc, 0xa1, 0x01, 0xca, 0x1d, 0x2c, 0xa0, 0x5c, 0x3e, 0x69, 0x13, 0xcb, 0x31, 0x7a, - 0x0b, 0x4a, 0x21, 0xf5, 0x24, 0xbd, 0x28, 0xe9, 0x30, 0x3d, 0xde, 0x28, 0x8a, 0xec, 0xd9, 0xdb, - 0xc3, 0x45, 0xb1, 0xd5, 0xf3, 0x64, 0xf6, 0x0c, 0x43, 0xca, 0x1d, 0x51, 0x99, 0x98, 0x2e, 0x02, - 0xb9, 0x31, 0xde, 0x99, 0xc3, 0xd2, 0xc4, 0x9d, 0x61, 0xa2, 0x87, 0xf0, 0x66, 0xaa, 0x6f, 0x56, - 0x60, 0xf9, 0x55, 0x04, 0x22, 0x2d, 0x21, 0xb3, 0x93, 0x29, 0x96, 0x95, 0xd3, 0x8b, 0xa5, 0xbc, - 0x81, 0xbc, 0x62, 0xd9, 0x85, 0xba, 0x47, 0x98, 0x1f, 0x13, 0x4f, 0x06, 0x2c, 0x91, 0x59, 0xb0, - 0x91, 0x1f, 0xaf, 0xa9, 0x10, 0x82, 0x6b, 0x9a, 0x23, 0x67, 0xa8, 0x03, 0x65, 0xfd, 0xee, 0x98, - 0x55, 0x7d, 0x95, 0xea, 0x32, 0xa3, 0x9d, 0x48, 0x5a, 0xb5, 0x57, 0x4a, 0x5a, 0xb7, 0x00, 0x02, - 0x3a, 0xb0, 0xbd, 0xd8, 0x1f, 0x93, 0xd8, 0xaa, 0xeb, 0xd6, 0x29, 0x87, 0xbb, 0x27, 0x11, 0xb8, - 0x12, 0xd0, 0x81, 0x1a, 0x22, 0x07, 0xd6, 0x1c, 0xc6, 0xfc, 0x41, 0x48, 0x3c, 0x7b, 0x40, 0x42, - 0x12, 0xfb, 0xae, 0x1d, 0x13, 0x46, 0x93, 0xd8, 0x25, 0xcc, 0xfa, 0x96, 0xb4, 0x24, 0xb7, 0x79, - 0xb9, 0xab, 0xc0, 0x58, 0x63, 0xb1, 0x95, 0x8a, 0x79, 0x69, 0x83, 0xa1, 0x3b, 0x50, 0x17, 0xb9, - 0xd0, 0xe7, 0x24, 0x96, 0xd7, 0x65, 0x5d, 0x3d, 0xff, 0x95, 0xd7, 0x1e, 0xd3, 0x7e, 0x2f, 0x25, - 0xa0, 0x8f, 0xa0, 0x34, 0xa6, 0x41, 0x32, 0x22, 0xcc, 0x7a, 0x43, 0x6a, 0xf4, 0x76, 0x2e, 0x57, - 0x42, 0x32, 0xae, 0x4d, 0x49, 0x3b, 0x6b, 0x4f, 0x9e, 0xb6, 0x56, 0x61, 0x25, 0x9b, 0x28, 0xb7, - 0x8d, 0x3b, 0xc6, 0xc7, 0xc6, 0x81, 0xd1, 0xfa, 0x6b, 0x01, 0xde, 0x58, 0xb8, 0x15, 0xf4, 0x13, - 0x28, 0xe9, 0x7b, 0x39, 0xab, 0x09, 0xd6, 0x3c, 0x9c, 0x62, 0xd1, 0x3a, 0x54, 0x44, 0x92, 0x21, - 0x8c, 0x11, 0x95, 0x3e, 0x2b, 0x78, 0xbe, 0x80, 0x2c, 0x28, 0x39, 0x81, 0xef, 0x88, 0xbd, 0x65, - 0xb9, 0x97, 0x4e, 0x51, 0x02, 0xab, 0xea, 0xf2, 0xec, 0x79, 0xaf, 0x61, 0xd3, 0x88, 0x33, 0xcb, - 0x94, 0xf6, 0xde, 0xbe, 0xd0, 0x5b, 0xd2, 0xd7, 0x3b, 0x5f, 0x78, 0x10, 0x71, 0xb6, 0x1f, 0xf2, - 0x78, 0x82, 0x57, 0xbc, 0x9c, 0xad, 0xb5, 0xbb, 0x70, 0xed, 0x54, 0x0a, 0xba, 0x0a, 0xcb, 0x43, - 0x32, 0x51, 0x09, 0x12, 0x8b, 0x21, 0x5a, 0x81, 0x2b, 0x63, 0x27, 0x48, 0x88, 0xce, 0xa7, 0x6a, - 0xb2, 0x53, 0xd8, 0x36, 0x5a, 0x7f, 0x2f, 0x40, 0x49, 0xab, 0x73, 0xd9, 0x9d, 0x8d, 0x3e, 0x76, - 0x21, 0xb5, 0x7e, 0x08, 0x35, 0xed, 0x52, 0x15, 0xd3, 0xe6, 0xb9, 0x51, 0x51, 0x55, 0x78, 0x15, - 0xcf, 0x1f, 0x82, 0xe9, 0x47, 0xce, 0x48, 0x97, 0xff, 0xdc, 0x93, 0x7b, 0x07, 0x9d, 0x7b, 0x0f, - 0x22, 0x95, 0x9a, 0xca, 0xd3, 0xe3, 0x0d, 0x53, 0x2c, 0x60, 0x49, 0xcb, 0xa9, 0xe0, 0xc5, 0x8b, - 0x56, 0xf0, 0xbf, 0x15, 0xa1, 0xb4, 0x1b, 0x24, 0x8c, 0x93, 0xf8, 0xb2, 0x7d, 0xa9, 0x8f, 0x5d, - 0xf0, 0xe5, 0x2e, 0x94, 0x62, 0x4a, 0xb9, 0xed, 0x3a, 0x67, 0xb9, 0x11, 0x53, 0xca, 0x77, 0x3b, - 0xdd, 0x86, 0x20, 0x8a, 0x22, 0xa2, 0xe6, 0xb8, 0x28, 0xa8, 0xbb, 0x0e, 0xfa, 0x02, 0x56, 0xd3, - 0xd2, 0xdd, 0xa7, 0x94, 0x33, 0x1e, 0x3b, 0x91, 0x3d, 0x24, 0x13, 0xd1, 0x62, 0x2d, 0x9f, 0xf6, - 0x69, 0xb2, 0x1f, 0xba, 0xf1, 0x44, 0xfa, 0xf8, 0x13, 0x32, 0xc1, 0x2b, 0x5a, 0x40, 0x37, 0xe5, - 0x7f, 0x42, 0x26, 0x0c, 0xdd, 0x86, 0x75, 0x32, 0x83, 0x09, 0x89, 0x76, 0xe0, 0x8c, 0x44, 0x53, - 0x62, 0xbb, 0x01, 0x75, 0x87, 0xd2, 0xf3, 0x26, 0xbe, 0x46, 0xb2, 0xa2, 0x3e, 0x55, 0x88, 0x5d, - 0x01, 0x40, 0x0c, 0xac, 0x7e, 0xe0, 0xb8, 0xc3, 0xc0, 0x67, 0xe2, 0xeb, 0x33, 0xf3, 0xa5, 0x21, - 0x4a, 0x93, 0xd0, 0x6d, 0xfb, 0x0c, 0x6f, 0xb5, 0xbb, 0x73, 0x6e, 0xe6, 0xbb, 0x45, 0x07, 0xde, - 0x77, 0xfa, 0xf9, 0xbb, 0xa8, 0x0b, 0xd5, 0x24, 0x14, 0xc7, 0x2b, 0x1f, 0x54, 0x2e, 0xea, 0x03, - 0x50, 0x2c, 0x69, 0xf9, 0x3a, 0x98, 0x47, 0xa2, 0xd9, 0x12, 0xf5, 0xaa, 0xac, 0xde, 0xe0, 0x2f, - 0x7a, 0x07, 0x87, 0x58, 0xae, 0xa2, 0x36, 0x20, 0x8f, 0x1c, 0x39, 0x49, 0xc0, 0x3b, 0x2a, 0x05, - 0x1d, 0x50, 0x1a, 0xc8, 0xe2, 0x54, 0xc1, 0x39, 0x3b, 0xa8, 0x09, 0xc0, 0x92, 0x7e, 0x48, 0xf8, - 0xa1, 0xff, 0x1b, 0x22, 0x2b, 0x50, 0x1d, 0x67, 0x56, 0x16, 0x3e, 0x7d, 0xea, 0x8b, 0x9f, 0x3e, - 0x6b, 0x63, 0x58, 0x3f, 0xcb, 0x1d, 0x39, 0x49, 0xe5, 0x4e, 0x36, 0xa9, 0x54, 0x6f, 0xbe, 0x9b, - 0xe7, 0x81, 0x7c, 0x91, 0x99, 0x04, 0x94, 0x1b, 0x48, 0x7f, 0x31, 0xa0, 0x78, 0x48, 0xdc, 0x98, - 0xf0, 0xd7, 0x1a, 0x47, 0xdb, 0x27, 0xe2, 0xa8, 0x99, 0xff, 0xa5, 0x23, 0x4e, 0x5d, 0x08, 0xa3, - 0x35, 0x28, 0xfb, 0x21, 0x27, 0x71, 0xe8, 0x04, 0x32, 0x8e, 0xca, 0x78, 0x36, 0xcf, 0x35, 0xe0, - 0x8f, 0x06, 0x14, 0x55, 0x93, 0x7d, 0xd9, 0x06, 0xa8, 0x53, 0x5f, 0x36, 0x20, 0x57, 0xc9, 0x7f, - 0x1b, 0x50, 0x4e, 0x6b, 0xfd, 0x6b, 0x55, 0xf3, 0xa5, 0xa6, 0x73, 0xf9, 0xbf, 0x6e, 0x3a, 0x11, - 0x98, 0x43, 0x3f, 0xd4, 0xed, 0x31, 0x96, 0x63, 0xd4, 0x86, 0x52, 0xe4, 0x4c, 0x02, 0xea, 0x78, - 0x3a, 0xc3, 0xaf, 0x2c, 0xfc, 0xd3, 0xd4, 0x09, 0x27, 0x38, 0x05, 0xed, 0xac, 0x3c, 0x79, 0xda, - 0xba, 0x0a, 0x8d, 0xac, 0xe5, 0x8f, 0x8c, 0xd6, 0x3f, 0x0c, 0xa8, 0xec, 0xff, 0x9a, 0x93, 0x50, - 0x36, 0xe3, 0xff, 0x97, 0xc6, 0x6f, 0x2e, 0xfe, 0x1b, 0x55, 0x39, 0xf1, 0x47, 0x53, 0xee, 0xa5, - 0xfe, 0xb3, 0x00, 0x45, 0xd5, 0x4e, 0x5d, 0xf6, 0xcb, 0x53, 0xa7, 0x2e, 0x84, 0xce, 0x7d, 0x68, - 0x44, 0x49, 0x3f, 0xf0, 0xd9, 0xa3, 0xf4, 0x9b, 0x5a, 0x35, 0x46, 0x3f, 0x3c, 0x5d, 0xc6, 0x81, - 0xc2, 0xa7, 0xff, 0x6a, 0x45, 0xd9, 0x29, 0xba, 0x0d, 0x55, 0xd5, 0x1c, 0xda, 0x7e, 0x78, 0x44, - 0xcf, 0xfa, 0x8b, 0x4d, 0x09, 0xeb, 0x85, 0x47, 0x14, 0xc3, 0x78, 0x36, 0xfe, 0x1f, 0x0a, 0x7c, - 0xf7, 0xed, 0x67, 0xcf, 0x9b, 0x4b, 0xdf, 0x3c, 0x6f, 0x2e, 0xfd, 0x76, 0xda, 0x34, 0x9e, 0x4d, - 0x9b, 0xc6, 0xd7, 0xd3, 0xa6, 0xf1, 0xaf, 0x69, 0xd3, 0xf8, 0xfd, 0x8b, 0xe6, 0xd2, 0xd7, 0x2f, - 0x9a, 0x4b, 0xdf, 0xbc, 0x68, 0x2e, 0xf5, 0x8b, 0xf2, 0x21, 0xfe, 0xf8, 0x3f, 0x01, 0x00, 0x00, - 0xff, 0xff, 0xb2, 0x67, 0x0d, 0x00, 0xbd, 0x16, 0x00, 0x00, -} - -func (m *Meta) Copy() *Meta { - if m == nil { - return nil - } - o := &Meta{} - o.CopyFrom(m) - return o -} - -func (m *Meta) CopyFrom(src interface{}) { - - o := src.(*Meta) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Version, &o.Version) - if o.CreatedAt != nil { - m.CreatedAt = &types.Timestamp{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.CreatedAt, o.CreatedAt) - } - if o.UpdatedAt != nil { - m.UpdatedAt = &types.Timestamp{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.UpdatedAt, o.UpdatedAt) - } -} - -func (m *Node) Copy() *Node { - if m == nil { - return nil - } - o := &Node{} - o.CopyFrom(m) - return o -} - -func (m *Node) CopyFrom(src interface{}) { - - o := src.(*Node) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Meta, &o.Meta) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Spec, &o.Spec) - if o.Description != nil { - m.Description = &NodeDescription{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Description, o.Description) - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Status, &o.Status) - if o.ManagerStatus != nil { - m.ManagerStatus = &ManagerStatus{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.ManagerStatus, o.ManagerStatus) - } - if o.Attachment != nil { - m.Attachment = &NetworkAttachment{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Attachment, o.Attachment) - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Certificate, &o.Certificate) - if o.Attachments != nil { - m.Attachments = make([]*NetworkAttachment, len(o.Attachments)) - for i := range m.Attachments { - m.Attachments[i] = &NetworkAttachment{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Attachments[i], o.Attachments[i]) - } - } - -} - -func (m *Service) Copy() *Service { - if m == nil { - return nil - } - o := &Service{} - o.CopyFrom(m) - return o -} - -func (m *Service) CopyFrom(src interface{}) { - - o := src.(*Service) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Meta, &o.Meta) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Spec, &o.Spec) - if o.SpecVersion != nil { - m.SpecVersion = &Version{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.SpecVersion, o.SpecVersion) - } - if o.PreviousSpec != nil { - m.PreviousSpec = &ServiceSpec{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.PreviousSpec, o.PreviousSpec) - } - if o.PreviousSpecVersion != nil { - m.PreviousSpecVersion = &Version{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.PreviousSpecVersion, o.PreviousSpecVersion) - } - if o.Endpoint != nil { - m.Endpoint = &Endpoint{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Endpoint, o.Endpoint) - } - if o.UpdateStatus != nil { - m.UpdateStatus = &UpdateStatus{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.UpdateStatus, o.UpdateStatus) - } - if o.JobStatus != nil { - m.JobStatus = &JobStatus{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.JobStatus, o.JobStatus) - } -} - -func (m *Endpoint) Copy() *Endpoint { - if m == nil { - return nil - } - o := &Endpoint{} - o.CopyFrom(m) - return o -} - -func (m *Endpoint) CopyFrom(src interface{}) { - - o := src.(*Endpoint) - *m = *o - if o.Spec != nil { - m.Spec = &EndpointSpec{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Spec, o.Spec) - } - if o.Ports != nil { - m.Ports = make([]*PortConfig, len(o.Ports)) - for i := range m.Ports { - m.Ports[i] = &PortConfig{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Ports[i], o.Ports[i]) - } - } - - if o.VirtualIPs != nil { - m.VirtualIPs = make([]*Endpoint_VirtualIP, len(o.VirtualIPs)) - for i := range m.VirtualIPs { - m.VirtualIPs[i] = &Endpoint_VirtualIP{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.VirtualIPs[i], o.VirtualIPs[i]) - } - } - -} - -func (m *Endpoint_VirtualIP) Copy() *Endpoint_VirtualIP { - if m == nil { - return nil - } - o := &Endpoint_VirtualIP{} - o.CopyFrom(m) - return o -} - -func (m *Endpoint_VirtualIP) CopyFrom(src interface{}) { - - o := src.(*Endpoint_VirtualIP) - *m = *o -} - -func (m *Task) Copy() *Task { - if m == nil { - return nil - } - o := &Task{} - o.CopyFrom(m) - return o -} - -func (m *Task) CopyFrom(src interface{}) { - - o := src.(*Task) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Meta, &o.Meta) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Spec, &o.Spec) - if o.SpecVersion != nil { - m.SpecVersion = &Version{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.SpecVersion, o.SpecVersion) - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Annotations, &o.Annotations) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.ServiceAnnotations, &o.ServiceAnnotations) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Status, &o.Status) - if o.Networks != nil { - m.Networks = make([]*NetworkAttachment, len(o.Networks)) - for i := range m.Networks { - m.Networks[i] = &NetworkAttachment{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Networks[i], o.Networks[i]) - } - } - - if o.Endpoint != nil { - m.Endpoint = &Endpoint{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Endpoint, o.Endpoint) - } - if o.LogDriver != nil { - m.LogDriver = &Driver{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.LogDriver, o.LogDriver) - } - if o.AssignedGenericResources != nil { - m.AssignedGenericResources = make([]*GenericResource, len(o.AssignedGenericResources)) - for i := range m.AssignedGenericResources { - m.AssignedGenericResources[i] = &GenericResource{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.AssignedGenericResources[i], o.AssignedGenericResources[i]) - } - } - - if o.JobIteration != nil { - m.JobIteration = &Version{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.JobIteration, o.JobIteration) - } - if o.Volumes != nil { - m.Volumes = make([]*VolumeAttachment, len(o.Volumes)) - for i := range m.Volumes { - m.Volumes[i] = &VolumeAttachment{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Volumes[i], o.Volumes[i]) - } - } - -} - -func (m *NetworkAttachment) Copy() *NetworkAttachment { - if m == nil { - return nil - } - o := &NetworkAttachment{} - o.CopyFrom(m) - return o -} - -func (m *NetworkAttachment) CopyFrom(src interface{}) { - - o := src.(*NetworkAttachment) - *m = *o - if o.Network != nil { - m.Network = &Network{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Network, o.Network) - } - if o.Addresses != nil { - m.Addresses = make([]string, len(o.Addresses)) - copy(m.Addresses, o.Addresses) - } - - if o.Aliases != nil { - m.Aliases = make([]string, len(o.Aliases)) - copy(m.Aliases, o.Aliases) - } - - if o.DriverAttachmentOpts != nil { - m.DriverAttachmentOpts = make(map[string]string, len(o.DriverAttachmentOpts)) - for k, v := range o.DriverAttachmentOpts { - m.DriverAttachmentOpts[k] = v - } - } - -} - -func (m *Network) Copy() *Network { - if m == nil { - return nil - } - o := &Network{} - o.CopyFrom(m) - return o -} - -func (m *Network) CopyFrom(src interface{}) { - - o := src.(*Network) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Meta, &o.Meta) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Spec, &o.Spec) - if o.DriverState != nil { - m.DriverState = &Driver{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.DriverState, o.DriverState) - } - if o.IPAM != nil { - m.IPAM = &IPAMOptions{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.IPAM, o.IPAM) - } -} - -func (m *Cluster) Copy() *Cluster { - if m == nil { - return nil - } - o := &Cluster{} - o.CopyFrom(m) - return o -} - -func (m *Cluster) CopyFrom(src interface{}) { - - o := src.(*Cluster) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Meta, &o.Meta) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Spec, &o.Spec) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.RootCA, &o.RootCA) - if o.NetworkBootstrapKeys != nil { - m.NetworkBootstrapKeys = make([]*EncryptionKey, len(o.NetworkBootstrapKeys)) - for i := range m.NetworkBootstrapKeys { - m.NetworkBootstrapKeys[i] = &EncryptionKey{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.NetworkBootstrapKeys[i], o.NetworkBootstrapKeys[i]) - } - } - - if o.BlacklistedCertificates != nil { - m.BlacklistedCertificates = make(map[string]*BlacklistedCertificate, len(o.BlacklistedCertificates)) - for k, v := range o.BlacklistedCertificates { - m.BlacklistedCertificates[k] = &BlacklistedCertificate{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.BlacklistedCertificates[k], v) - } - } - - if o.UnlockKeys != nil { - m.UnlockKeys = make([]*EncryptionKey, len(o.UnlockKeys)) - for i := range m.UnlockKeys { - m.UnlockKeys[i] = &EncryptionKey{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.UnlockKeys[i], o.UnlockKeys[i]) - } - } - - if o.DefaultAddressPool != nil { - m.DefaultAddressPool = make([]string, len(o.DefaultAddressPool)) - copy(m.DefaultAddressPool, o.DefaultAddressPool) - } - -} - -func (m *Secret) Copy() *Secret { - if m == nil { - return nil - } - o := &Secret{} - o.CopyFrom(m) - return o -} - -func (m *Secret) CopyFrom(src interface{}) { - - o := src.(*Secret) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Meta, &o.Meta) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Spec, &o.Spec) -} - -func (m *Config) Copy() *Config { - if m == nil { - return nil - } - o := &Config{} - o.CopyFrom(m) - return o -} - -func (m *Config) CopyFrom(src interface{}) { - - o := src.(*Config) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Meta, &o.Meta) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Spec, &o.Spec) -} - -func (m *Resource) Copy() *Resource { - if m == nil { - return nil - } - o := &Resource{} - o.CopyFrom(m) - return o -} - -func (m *Resource) CopyFrom(src interface{}) { - - o := src.(*Resource) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Meta, &o.Meta) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Annotations, &o.Annotations) - if o.Payload != nil { - m.Payload = &types.Any{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Payload, o.Payload) - } -} - -func (m *Extension) Copy() *Extension { - if m == nil { - return nil - } - o := &Extension{} - o.CopyFrom(m) - return o -} - -func (m *Extension) CopyFrom(src interface{}) { - - o := src.(*Extension) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Meta, &o.Meta) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Annotations, &o.Annotations) -} - -func (m *Volume) Copy() *Volume { - if m == nil { - return nil - } - o := &Volume{} - o.CopyFrom(m) - return o -} - -func (m *Volume) CopyFrom(src interface{}) { - - o := src.(*Volume) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Meta, &o.Meta) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Spec, &o.Spec) - if o.PublishStatus != nil { - m.PublishStatus = make([]*VolumePublishStatus, len(o.PublishStatus)) - for i := range m.PublishStatus { - m.PublishStatus[i] = &VolumePublishStatus{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.PublishStatus[i], o.PublishStatus[i]) - } - } - - if o.VolumeInfo != nil { - m.VolumeInfo = &VolumeInfo{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.VolumeInfo, o.VolumeInfo) - } -} - -func (m *Meta) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Meta) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Meta) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.UpdatedAt != nil { - { - size, err := m.UpdatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.CreatedAt != nil { - { - size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Node) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Node) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.VXLANUDPPort != 0 { - i = encodeVarintObjects(dAtA, i, uint64(m.VXLANUDPPort)) - i-- - dAtA[i] = 0x58 - } - if len(m.Attachments) > 0 { - for iNdEx := len(m.Attachments) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Attachments[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - } - if m.Role != 0 { - i = encodeVarintObjects(dAtA, i, uint64(m.Role)) - i-- - dAtA[i] = 0x48 - } - { - size, err := m.Certificate.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - if m.Attachment != nil { - { - size, err := m.Attachment.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if m.ManagerStatus != nil { - { - size, err := m.ManagerStatus.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if m.Description != nil { - { - size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Service) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Service) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.JobStatus != nil { - { - size, err := m.JobStatus.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - } - if m.PreviousSpecVersion != nil { - { - size, err := m.PreviousSpecVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - } - if m.SpecVersion != nil { - { - size, err := m.SpecVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - if m.PendingDelete { - i-- - if m.PendingDelete { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - if m.PreviousSpec != nil { - { - size, err := m.PreviousSpec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.UpdateStatus != nil { - { - size, err := m.UpdateStatus.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.Endpoint != nil { - { - size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Endpoint) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Endpoint) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Endpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.VirtualIPs) > 0 { - for iNdEx := len(m.VirtualIPs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.VirtualIPs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Ports) > 0 { - for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Spec != nil { - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Endpoint_VirtualIP) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Endpoint_VirtualIP) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Endpoint_VirtualIP) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Addr) > 0 { - i -= len(m.Addr) - copy(dAtA[i:], m.Addr) - i = encodeVarintObjects(dAtA, i, uint64(len(m.Addr))) - i-- - dAtA[i] = 0x12 - } - if len(m.NetworkID) > 0 { - i -= len(m.NetworkID) - copy(dAtA[i:], m.NetworkID) - i = encodeVarintObjects(dAtA, i, uint64(len(m.NetworkID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Task) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Task) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Task) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Volumes) > 0 { - for iNdEx := len(m.Volumes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Volumes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } - } - if m.JobIteration != nil { - { - size, err := m.JobIteration.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - if len(m.AssignedGenericResources) > 0 { - for iNdEx := len(m.AssignedGenericResources) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.AssignedGenericResources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x7a - } - } - if m.SpecVersion != nil { - { - size, err := m.SpecVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 - } - if m.LogDriver != nil { - { - size, err := m.LogDriver.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - } - if m.Endpoint != nil { - { - size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - } - if len(m.Networks) > 0 { - for iNdEx := len(m.Networks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Networks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - } - } - if m.DesiredState != 0 { - i = encodeVarintObjects(dAtA, i, uint64(m.DesiredState)) - i-- - dAtA[i] = 0x50 - } - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - { - size, err := m.ServiceAnnotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - if len(m.NodeID) > 0 { - i -= len(m.NodeID) - copy(dAtA[i:], m.NodeID) - i = encodeVarintObjects(dAtA, i, uint64(len(m.NodeID))) - i-- - dAtA[i] = 0x32 - } - if m.Slot != 0 { - i = encodeVarintObjects(dAtA, i, uint64(m.Slot)) - i-- - dAtA[i] = 0x28 - } - if len(m.ServiceID) > 0 { - i -= len(m.ServiceID) - copy(dAtA[i:], m.ServiceID) - i = encodeVarintObjects(dAtA, i, uint64(len(m.ServiceID))) - i-- - dAtA[i] = 0x22 - } - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *NetworkAttachment) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NetworkAttachment) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NetworkAttachment) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.DriverAttachmentOpts) > 0 { - for k := range m.DriverAttachmentOpts { - v := m.DriverAttachmentOpts[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintObjects(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintObjects(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintObjects(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Aliases) > 0 { - for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Aliases[iNdEx]) - copy(dAtA[i:], m.Aliases[iNdEx]) - i = encodeVarintObjects(dAtA, i, uint64(len(m.Aliases[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.Addresses) > 0 { - for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Addresses[iNdEx]) - copy(dAtA[i:], m.Addresses[iNdEx]) - i = encodeVarintObjects(dAtA, i, uint64(len(m.Addresses[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if m.Network != nil { - { - size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Network) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Network) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Network) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PendingDelete { - i-- - if m.PendingDelete { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if m.IPAM != nil { - { - size, err := m.IPAM.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.DriverState != nil { - { - size, err := m.DriverState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Cluster) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Cluster) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Cluster) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.VXLANUDPPort != 0 { - i = encodeVarintObjects(dAtA, i, uint64(m.VXLANUDPPort)) - i-- - dAtA[i] = 0x68 - } - if m.SubnetSize != 0 { - i = encodeVarintObjects(dAtA, i, uint64(m.SubnetSize)) - i-- - dAtA[i] = 0x60 - } - if len(m.DefaultAddressPool) > 0 { - for iNdEx := len(m.DefaultAddressPool) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.DefaultAddressPool[iNdEx]) - copy(dAtA[i:], m.DefaultAddressPool[iNdEx]) - i = encodeVarintObjects(dAtA, i, uint64(len(m.DefaultAddressPool[iNdEx]))) - i-- - dAtA[i] = 0x5a - } - } - if m.FIPS { - i-- - if m.FIPS { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x50 - } - if len(m.UnlockKeys) > 0 { - for iNdEx := len(m.UnlockKeys) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.UnlockKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - if len(m.BlacklistedCertificates) > 0 { - for k := range m.BlacklistedCertificates { - v := m.BlacklistedCertificates[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintObjects(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintObjects(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x42 - } - } - if m.EncryptionKeyLamportClock != 0 { - i = encodeVarintObjects(dAtA, i, uint64(m.EncryptionKeyLamportClock)) - i-- - dAtA[i] = 0x30 - } - if len(m.NetworkBootstrapKeys) > 0 { - for iNdEx := len(m.NetworkBootstrapKeys) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.NetworkBootstrapKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - { - size, err := m.RootCA.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Secret) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Secret) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Internal { - i-- - if m.Internal { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Config) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Config) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Resource) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Resource) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Resource) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Payload != nil { - { - size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.Kind) > 0 { - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintObjects(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0x22 - } - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Extension) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Extension) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Extension) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintObjects(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x22 - } - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Volume) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Volume) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Volume) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PendingDelete { - i-- - if m.PendingDelete { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if m.VolumeInfo != nil { - { - size, err := m.VolumeInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.PublishStatus) > 0 { - for iNdEx := len(m.PublishStatus) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PublishStatus[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintObjects(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintObjects(dAtA []byte, offset int, v uint64) int { - offset -= sovObjects(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Meta) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Version.Size() - n += 1 + l + sovObjects(uint64(l)) - if m.CreatedAt != nil { - l = m.CreatedAt.Size() - n += 1 + l + sovObjects(uint64(l)) - } - if m.UpdatedAt != nil { - l = m.UpdatedAt.Size() - n += 1 + l + sovObjects(uint64(l)) - } - return n -} - -func (m *Node) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovObjects(uint64(l)) - } - l = m.Meta.Size() - n += 1 + l + sovObjects(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovObjects(uint64(l)) - if m.Description != nil { - l = m.Description.Size() - n += 1 + l + sovObjects(uint64(l)) - } - l = m.Status.Size() - n += 1 + l + sovObjects(uint64(l)) - if m.ManagerStatus != nil { - l = m.ManagerStatus.Size() - n += 1 + l + sovObjects(uint64(l)) - } - if m.Attachment != nil { - l = m.Attachment.Size() - n += 1 + l + sovObjects(uint64(l)) - } - l = m.Certificate.Size() - n += 1 + l + sovObjects(uint64(l)) - if m.Role != 0 { - n += 1 + sovObjects(uint64(m.Role)) - } - if len(m.Attachments) > 0 { - for _, e := range m.Attachments { - l = e.Size() - n += 1 + l + sovObjects(uint64(l)) - } - } - if m.VXLANUDPPort != 0 { - n += 1 + sovObjects(uint64(m.VXLANUDPPort)) - } - return n -} - -func (m *Service) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovObjects(uint64(l)) - } - l = m.Meta.Size() - n += 1 + l + sovObjects(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovObjects(uint64(l)) - if m.Endpoint != nil { - l = m.Endpoint.Size() - n += 1 + l + sovObjects(uint64(l)) - } - if m.UpdateStatus != nil { - l = m.UpdateStatus.Size() - n += 1 + l + sovObjects(uint64(l)) - } - if m.PreviousSpec != nil { - l = m.PreviousSpec.Size() - n += 1 + l + sovObjects(uint64(l)) - } - if m.PendingDelete { - n += 2 - } - if m.SpecVersion != nil { - l = m.SpecVersion.Size() - n += 1 + l + sovObjects(uint64(l)) - } - if m.PreviousSpecVersion != nil { - l = m.PreviousSpecVersion.Size() - n += 1 + l + sovObjects(uint64(l)) - } - if m.JobStatus != nil { - l = m.JobStatus.Size() - n += 1 + l + sovObjects(uint64(l)) - } - return n -} - -func (m *Endpoint) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Spec != nil { - l = m.Spec.Size() - n += 1 + l + sovObjects(uint64(l)) - } - if len(m.Ports) > 0 { - for _, e := range m.Ports { - l = e.Size() - n += 1 + l + sovObjects(uint64(l)) - } - } - if len(m.VirtualIPs) > 0 { - for _, e := range m.VirtualIPs { - l = e.Size() - n += 1 + l + sovObjects(uint64(l)) - } - } - return n -} - -func (m *Endpoint_VirtualIP) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.NetworkID) - if l > 0 { - n += 1 + l + sovObjects(uint64(l)) - } - l = len(m.Addr) - if l > 0 { - n += 1 + l + sovObjects(uint64(l)) - } - return n -} - -func (m *Task) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovObjects(uint64(l)) - } - l = m.Meta.Size() - n += 1 + l + sovObjects(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovObjects(uint64(l)) - l = len(m.ServiceID) - if l > 0 { - n += 1 + l + sovObjects(uint64(l)) - } - if m.Slot != 0 { - n += 1 + sovObjects(uint64(m.Slot)) - } - l = len(m.NodeID) - if l > 0 { - n += 1 + l + sovObjects(uint64(l)) - } - l = m.Annotations.Size() - n += 1 + l + sovObjects(uint64(l)) - l = m.ServiceAnnotations.Size() - n += 1 + l + sovObjects(uint64(l)) - l = m.Status.Size() - n += 1 + l + sovObjects(uint64(l)) - if m.DesiredState != 0 { - n += 1 + sovObjects(uint64(m.DesiredState)) - } - if len(m.Networks) > 0 { - for _, e := range m.Networks { - l = e.Size() - n += 1 + l + sovObjects(uint64(l)) - } - } - if m.Endpoint != nil { - l = m.Endpoint.Size() - n += 1 + l + sovObjects(uint64(l)) - } - if m.LogDriver != nil { - l = m.LogDriver.Size() - n += 1 + l + sovObjects(uint64(l)) - } - if m.SpecVersion != nil { - l = m.SpecVersion.Size() - n += 1 + l + sovObjects(uint64(l)) - } - if len(m.AssignedGenericResources) > 0 { - for _, e := range m.AssignedGenericResources { - l = e.Size() - n += 1 + l + sovObjects(uint64(l)) - } - } - if m.JobIteration != nil { - l = m.JobIteration.Size() - n += 2 + l + sovObjects(uint64(l)) - } - if len(m.Volumes) > 0 { - for _, e := range m.Volumes { - l = e.Size() - n += 2 + l + sovObjects(uint64(l)) - } - } - return n -} - -func (m *NetworkAttachment) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Network != nil { - l = m.Network.Size() - n += 1 + l + sovObjects(uint64(l)) - } - if len(m.Addresses) > 0 { - for _, s := range m.Addresses { - l = len(s) - n += 1 + l + sovObjects(uint64(l)) - } - } - if len(m.Aliases) > 0 { - for _, s := range m.Aliases { - l = len(s) - n += 1 + l + sovObjects(uint64(l)) - } - } - if len(m.DriverAttachmentOpts) > 0 { - for k, v := range m.DriverAttachmentOpts { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovObjects(uint64(len(k))) + 1 + len(v) + sovObjects(uint64(len(v))) - n += mapEntrySize + 1 + sovObjects(uint64(mapEntrySize)) - } - } - return n -} - -func (m *Network) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovObjects(uint64(l)) - } - l = m.Meta.Size() - n += 1 + l + sovObjects(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovObjects(uint64(l)) - if m.DriverState != nil { - l = m.DriverState.Size() - n += 1 + l + sovObjects(uint64(l)) - } - if m.IPAM != nil { - l = m.IPAM.Size() - n += 1 + l + sovObjects(uint64(l)) - } - if m.PendingDelete { - n += 2 - } - return n -} - -func (m *Cluster) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovObjects(uint64(l)) - } - l = m.Meta.Size() - n += 1 + l + sovObjects(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovObjects(uint64(l)) - l = m.RootCA.Size() - n += 1 + l + sovObjects(uint64(l)) - if len(m.NetworkBootstrapKeys) > 0 { - for _, e := range m.NetworkBootstrapKeys { - l = e.Size() - n += 1 + l + sovObjects(uint64(l)) - } - } - if m.EncryptionKeyLamportClock != 0 { - n += 1 + sovObjects(uint64(m.EncryptionKeyLamportClock)) - } - if len(m.BlacklistedCertificates) > 0 { - for k, v := range m.BlacklistedCertificates { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovObjects(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovObjects(uint64(len(k))) + l - n += mapEntrySize + 1 + sovObjects(uint64(mapEntrySize)) - } - } - if len(m.UnlockKeys) > 0 { - for _, e := range m.UnlockKeys { - l = e.Size() - n += 1 + l + sovObjects(uint64(l)) - } - } - if m.FIPS { - n += 2 - } - if len(m.DefaultAddressPool) > 0 { - for _, s := range m.DefaultAddressPool { - l = len(s) - n += 1 + l + sovObjects(uint64(l)) - } - } - if m.SubnetSize != 0 { - n += 1 + sovObjects(uint64(m.SubnetSize)) - } - if m.VXLANUDPPort != 0 { - n += 1 + sovObjects(uint64(m.VXLANUDPPort)) - } - return n -} - -func (m *Secret) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovObjects(uint64(l)) - } - l = m.Meta.Size() - n += 1 + l + sovObjects(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovObjects(uint64(l)) - if m.Internal { - n += 2 - } - return n -} - -func (m *Config) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovObjects(uint64(l)) - } - l = m.Meta.Size() - n += 1 + l + sovObjects(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovObjects(uint64(l)) - return n -} - -func (m *Resource) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovObjects(uint64(l)) - } - l = m.Meta.Size() - n += 1 + l + sovObjects(uint64(l)) - l = m.Annotations.Size() - n += 1 + l + sovObjects(uint64(l)) - l = len(m.Kind) - if l > 0 { - n += 1 + l + sovObjects(uint64(l)) - } - if m.Payload != nil { - l = m.Payload.Size() - n += 1 + l + sovObjects(uint64(l)) - } - return n -} - -func (m *Extension) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovObjects(uint64(l)) - } - l = m.Meta.Size() - n += 1 + l + sovObjects(uint64(l)) - l = m.Annotations.Size() - n += 1 + l + sovObjects(uint64(l)) - l = len(m.Description) - if l > 0 { - n += 1 + l + sovObjects(uint64(l)) - } - return n -} - -func (m *Volume) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovObjects(uint64(l)) - } - l = m.Meta.Size() - n += 1 + l + sovObjects(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovObjects(uint64(l)) - if len(m.PublishStatus) > 0 { - for _, e := range m.PublishStatus { - l = e.Size() - n += 1 + l + sovObjects(uint64(l)) - } - } - if m.VolumeInfo != nil { - l = m.VolumeInfo.Size() - n += 1 + l + sovObjects(uint64(l)) - } - if m.PendingDelete { - n += 2 - } - return n -} - -func sovObjects(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozObjects(x uint64) (n int) { - return sovObjects(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} - -type NodeCheckFunc func(t1, t2 *Node) bool - -type EventNode interface { - IsEventNode() bool -} - -type EventCreateNode struct { - Node *Node - Checks []NodeCheckFunc -} - -func (e EventCreateNode) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventCreateNode) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Node, typedEvent.Node) { - return false - } - } - return true -} - -func (e EventCreateNode) IsEventCreate() bool { - return true -} - -func (e EventCreateNode) IsEventNode() bool { - return true -} - -type EventUpdateNode struct { - Node *Node - OldNode *Node - Checks []NodeCheckFunc -} - -func (e EventUpdateNode) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventUpdateNode) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Node, typedEvent.Node) { - return false - } - } - return true -} - -func (e EventUpdateNode) IsEventUpdate() bool { - return true -} - -func (e EventUpdateNode) IsEventNode() bool { - return true -} - -type EventDeleteNode struct { - Node *Node - Checks []NodeCheckFunc -} - -func (e EventDeleteNode) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventDeleteNode) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Node, typedEvent.Node) { - return false - } - } - return true -} - -func (e EventDeleteNode) IsEventDelete() bool { - return true -} - -func (e EventDeleteNode) IsEventNode() bool { - return true -} - -func (m *Node) CopyStoreObject() StoreObject { - return m.Copy() -} - -func (m *Node) GetMeta() Meta { - return m.Meta -} - -func (m *Node) SetMeta(meta Meta) { - m.Meta = meta -} - -func (m *Node) GetID() string { - return m.ID -} - -func (m *Node) EventCreate() Event { - return EventCreateNode{Node: m} -} - -func (m *Node) EventUpdate(oldObject StoreObject) Event { - if oldObject != nil { - return EventUpdateNode{Node: m, OldNode: oldObject.(*Node)} - } else { - return EventUpdateNode{Node: m} - } -} - -func (m *Node) EventDelete() Event { - return EventDeleteNode{Node: m} -} - -func NodeCheckID(v1, v2 *Node) bool { - return v1.ID == v2.ID -} - -func NodeCheckIDPrefix(v1, v2 *Node) bool { - return strings.HasPrefix(v2.ID, v1.ID) -} - -func NodeCheckName(v1, v2 *Node) bool { - if v1.Description == nil || v2.Description == nil { - return false - } - return v1.Description.Hostname == v2.Description.Hostname -} - -func NodeCheckNamePrefix(v1, v2 *Node) bool { - if v1.Description == nil || v2.Description == nil { - return false - } - return strings.HasPrefix(v2.Description.Hostname, v1.Description.Hostname) -} - -func NodeCheckCustom(v1, v2 *Node) bool { - return checkCustom(v1.Spec.Annotations, v2.Spec.Annotations) -} - -func NodeCheckCustomPrefix(v1, v2 *Node) bool { - return checkCustomPrefix(v1.Spec.Annotations, v2.Spec.Annotations) -} - -func NodeCheckRole(v1, v2 *Node) bool { - return v1.Role == v2.Role -} - -func NodeCheckMembership(v1, v2 *Node) bool { - return v1.Spec.Membership == v2.Spec.Membership -} - -func ConvertNodeWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) { - var ( - m Node - checkFuncs []NodeCheckFunc - hasRole bool - hasMembership bool - ) - - for _, filter := range filters { - switch v := filter.By.(type) { - case *SelectBy_ID: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.ID - checkFuncs = append(checkFuncs, NodeCheckID) - case *SelectBy_IDPrefix: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.IDPrefix - checkFuncs = append(checkFuncs, NodeCheckIDPrefix) - case *SelectBy_Name: - if m.Description != nil { - return nil, errConflictingFilters - } - m.Description = &NodeDescription{Hostname: v.Name} - checkFuncs = append(checkFuncs, NodeCheckName) - case *SelectBy_NamePrefix: - if m.Description != nil { - return nil, errConflictingFilters - } - m.Description = &NodeDescription{Hostname: v.NamePrefix} - checkFuncs = append(checkFuncs, NodeCheckNamePrefix) - case *SelectBy_Custom: - if len(m.Spec.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Spec.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}} - checkFuncs = append(checkFuncs, NodeCheckCustom) - case *SelectBy_CustomPrefix: - if len(m.Spec.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Spec.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}} - checkFuncs = append(checkFuncs, NodeCheckCustomPrefix) - case *SelectBy_Role: - if hasRole { - return nil, errConflictingFilters - } - hasRole = true - m.Role = v.Role - checkFuncs = append(checkFuncs, NodeCheckRole) - case *SelectBy_Membership: - if hasMembership { - return nil, errConflictingFilters - } - hasMembership = true - m.Spec.Membership = v.Membership - checkFuncs = append(checkFuncs, NodeCheckMembership) - } - } - var events []Event - if (action & WatchActionKindCreate) != 0 { - events = append(events, EventCreateNode{Node: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindUpdate) != 0 { - events = append(events, EventUpdateNode{Node: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindRemove) != 0 { - events = append(events, EventDeleteNode{Node: &m, Checks: checkFuncs}) - } - if len(events) == 0 { - return nil, errUnrecognizedAction - } - return events, nil -} - -type NodeIndexerByID struct{} - -func (indexer NodeIndexerByID) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer NodeIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer NodeIndexerByID) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Node) - return true, []byte(m.ID + "\x00"), nil -} - -type NodeIndexerByName struct{} - -func (indexer NodeIndexerByName) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer NodeIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer NodeIndexerByName) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Node) - val := m.Spec.Annotations.Name - return true, []byte(strings.ToLower(val) + "\x00"), nil -} - -type NodeCustomIndexer struct{} - -func (indexer NodeCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer NodeCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer NodeCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) { - m := obj.(*Node) - return customIndexer("", &m.Spec.Annotations) -} - -type ServiceCheckFunc func(t1, t2 *Service) bool - -type EventService interface { - IsEventService() bool -} - -type EventCreateService struct { - Service *Service - Checks []ServiceCheckFunc -} - -func (e EventCreateService) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventCreateService) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Service, typedEvent.Service) { - return false - } - } - return true -} - -func (e EventCreateService) IsEventCreate() bool { - return true -} - -func (e EventCreateService) IsEventService() bool { - return true -} - -type EventUpdateService struct { - Service *Service - OldService *Service - Checks []ServiceCheckFunc -} - -func (e EventUpdateService) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventUpdateService) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Service, typedEvent.Service) { - return false - } - } - return true -} - -func (e EventUpdateService) IsEventUpdate() bool { - return true -} - -func (e EventUpdateService) IsEventService() bool { - return true -} - -type EventDeleteService struct { - Service *Service - Checks []ServiceCheckFunc -} - -func (e EventDeleteService) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventDeleteService) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Service, typedEvent.Service) { - return false - } - } - return true -} - -func (e EventDeleteService) IsEventDelete() bool { - return true -} - -func (e EventDeleteService) IsEventService() bool { - return true -} - -func (m *Service) CopyStoreObject() StoreObject { - return m.Copy() -} - -func (m *Service) GetMeta() Meta { - return m.Meta -} - -func (m *Service) SetMeta(meta Meta) { - m.Meta = meta -} - -func (m *Service) GetID() string { - return m.ID -} - -func (m *Service) EventCreate() Event { - return EventCreateService{Service: m} -} - -func (m *Service) EventUpdate(oldObject StoreObject) Event { - if oldObject != nil { - return EventUpdateService{Service: m, OldService: oldObject.(*Service)} - } else { - return EventUpdateService{Service: m} - } -} - -func (m *Service) EventDelete() Event { - return EventDeleteService{Service: m} -} - -func ServiceCheckID(v1, v2 *Service) bool { - return v1.ID == v2.ID -} - -func ServiceCheckIDPrefix(v1, v2 *Service) bool { - return strings.HasPrefix(v2.ID, v1.ID) -} - -func ServiceCheckName(v1, v2 *Service) bool { - return v1.Spec.Annotations.Name == v2.Spec.Annotations.Name -} - -func ServiceCheckNamePrefix(v1, v2 *Service) bool { - return strings.HasPrefix(v2.Spec.Annotations.Name, v1.Spec.Annotations.Name) -} - -func ServiceCheckCustom(v1, v2 *Service) bool { - return checkCustom(v1.Spec.Annotations, v2.Spec.Annotations) -} - -func ServiceCheckCustomPrefix(v1, v2 *Service) bool { - return checkCustomPrefix(v1.Spec.Annotations, v2.Spec.Annotations) -} - -func ConvertServiceWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) { - var ( - m Service - checkFuncs []ServiceCheckFunc - ) - - for _, filter := range filters { - switch v := filter.By.(type) { - case *SelectBy_ID: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.ID - checkFuncs = append(checkFuncs, ServiceCheckID) - case *SelectBy_IDPrefix: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.IDPrefix - checkFuncs = append(checkFuncs, ServiceCheckIDPrefix) - case *SelectBy_Name: - if m.Spec.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Spec.Annotations.Name = v.Name - checkFuncs = append(checkFuncs, ServiceCheckName) - case *SelectBy_NamePrefix: - if m.Spec.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Spec.Annotations.Name = v.NamePrefix - checkFuncs = append(checkFuncs, ServiceCheckNamePrefix) - case *SelectBy_Custom: - if len(m.Spec.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Spec.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}} - checkFuncs = append(checkFuncs, ServiceCheckCustom) - case *SelectBy_CustomPrefix: - if len(m.Spec.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Spec.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}} - checkFuncs = append(checkFuncs, ServiceCheckCustomPrefix) - } - } - var events []Event - if (action & WatchActionKindCreate) != 0 { - events = append(events, EventCreateService{Service: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindUpdate) != 0 { - events = append(events, EventUpdateService{Service: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindRemove) != 0 { - events = append(events, EventDeleteService{Service: &m, Checks: checkFuncs}) - } - if len(events) == 0 { - return nil, errUnrecognizedAction - } - return events, nil -} - -type ServiceIndexerByID struct{} - -func (indexer ServiceIndexerByID) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer ServiceIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer ServiceIndexerByID) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Service) - return true, []byte(m.ID + "\x00"), nil -} - -type ServiceIndexerByName struct{} - -func (indexer ServiceIndexerByName) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer ServiceIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer ServiceIndexerByName) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Service) - val := m.Spec.Annotations.Name - return true, []byte(strings.ToLower(val) + "\x00"), nil -} - -type ServiceCustomIndexer struct{} - -func (indexer ServiceCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer ServiceCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer ServiceCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) { - m := obj.(*Service) - return customIndexer("", &m.Spec.Annotations) -} - -type TaskCheckFunc func(t1, t2 *Task) bool - -type EventTask interface { - IsEventTask() bool -} - -type EventCreateTask struct { - Task *Task - Checks []TaskCheckFunc -} - -func (e EventCreateTask) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventCreateTask) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Task, typedEvent.Task) { - return false - } - } - return true -} - -func (e EventCreateTask) IsEventCreate() bool { - return true -} - -func (e EventCreateTask) IsEventTask() bool { - return true -} - -type EventUpdateTask struct { - Task *Task - OldTask *Task - Checks []TaskCheckFunc -} - -func (e EventUpdateTask) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventUpdateTask) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Task, typedEvent.Task) { - return false - } - } - return true -} - -func (e EventUpdateTask) IsEventUpdate() bool { - return true -} - -func (e EventUpdateTask) IsEventTask() bool { - return true -} - -type EventDeleteTask struct { - Task *Task - Checks []TaskCheckFunc -} - -func (e EventDeleteTask) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventDeleteTask) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Task, typedEvent.Task) { - return false - } - } - return true -} - -func (e EventDeleteTask) IsEventDelete() bool { - return true -} - -func (e EventDeleteTask) IsEventTask() bool { - return true -} - -func (m *Task) CopyStoreObject() StoreObject { - return m.Copy() -} - -func (m *Task) GetMeta() Meta { - return m.Meta -} - -func (m *Task) SetMeta(meta Meta) { - m.Meta = meta -} - -func (m *Task) GetID() string { - return m.ID -} - -func (m *Task) EventCreate() Event { - return EventCreateTask{Task: m} -} - -func (m *Task) EventUpdate(oldObject StoreObject) Event { - if oldObject != nil { - return EventUpdateTask{Task: m, OldTask: oldObject.(*Task)} - } else { - return EventUpdateTask{Task: m} - } -} - -func (m *Task) EventDelete() Event { - return EventDeleteTask{Task: m} -} - -func TaskCheckID(v1, v2 *Task) bool { - return v1.ID == v2.ID -} - -func TaskCheckIDPrefix(v1, v2 *Task) bool { - return strings.HasPrefix(v2.ID, v1.ID) -} - -func TaskCheckName(v1, v2 *Task) bool { - return v1.Annotations.Name == v2.Annotations.Name -} - -func TaskCheckNamePrefix(v1, v2 *Task) bool { - return strings.HasPrefix(v2.Annotations.Name, v1.Annotations.Name) -} - -func TaskCheckCustom(v1, v2 *Task) bool { - return checkCustom(v1.Annotations, v2.Annotations) -} - -func TaskCheckCustomPrefix(v1, v2 *Task) bool { - return checkCustomPrefix(v1.Annotations, v2.Annotations) -} - -func TaskCheckNodeID(v1, v2 *Task) bool { - return v1.NodeID == v2.NodeID -} - -func TaskCheckServiceID(v1, v2 *Task) bool { - return v1.ServiceID == v2.ServiceID -} - -func TaskCheckSlot(v1, v2 *Task) bool { - return v1.Slot == v2.Slot -} - -func TaskCheckDesiredState(v1, v2 *Task) bool { - return v1.DesiredState == v2.DesiredState -} - -func ConvertTaskWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) { - var ( - m Task - checkFuncs []TaskCheckFunc - hasDesiredState bool - ) - - for _, filter := range filters { - switch v := filter.By.(type) { - case *SelectBy_ID: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.ID - checkFuncs = append(checkFuncs, TaskCheckID) - case *SelectBy_IDPrefix: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.IDPrefix - checkFuncs = append(checkFuncs, TaskCheckIDPrefix) - case *SelectBy_Name: - if m.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Annotations.Name = v.Name - checkFuncs = append(checkFuncs, TaskCheckName) - case *SelectBy_NamePrefix: - if m.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Annotations.Name = v.NamePrefix - checkFuncs = append(checkFuncs, TaskCheckNamePrefix) - case *SelectBy_Custom: - if len(m.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}} - checkFuncs = append(checkFuncs, TaskCheckCustom) - case *SelectBy_CustomPrefix: - if len(m.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}} - checkFuncs = append(checkFuncs, TaskCheckCustomPrefix) - case *SelectBy_ServiceID: - if m.ServiceID != "" { - return nil, errConflictingFilters - } - m.ServiceID = v.ServiceID - checkFuncs = append(checkFuncs, TaskCheckServiceID) - case *SelectBy_NodeID: - if m.NodeID != "" { - return nil, errConflictingFilters - } - m.NodeID = v.NodeID - checkFuncs = append(checkFuncs, TaskCheckNodeID) - case *SelectBy_Slot: - if m.Slot != 0 || m.ServiceID != "" { - return nil, errConflictingFilters - } - m.ServiceID = v.Slot.ServiceID - m.Slot = v.Slot.Slot - checkFuncs = append(checkFuncs, TaskCheckNodeID, TaskCheckSlot) - case *SelectBy_DesiredState: - if hasDesiredState { - return nil, errConflictingFilters - } - hasDesiredState = true - m.DesiredState = v.DesiredState - checkFuncs = append(checkFuncs, TaskCheckDesiredState) - } - } - var events []Event - if (action & WatchActionKindCreate) != 0 { - events = append(events, EventCreateTask{Task: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindUpdate) != 0 { - events = append(events, EventUpdateTask{Task: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindRemove) != 0 { - events = append(events, EventDeleteTask{Task: &m, Checks: checkFuncs}) - } - if len(events) == 0 { - return nil, errUnrecognizedAction - } - return events, nil -} - -type TaskIndexerByID struct{} - -func (indexer TaskIndexerByID) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer TaskIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer TaskIndexerByID) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Task) - return true, []byte(m.ID + "\x00"), nil -} - -type TaskIndexerByName struct{} - -func (indexer TaskIndexerByName) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer TaskIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer TaskIndexerByName) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Task) - val := m.Annotations.Name - return true, []byte(strings.ToLower(val) + "\x00"), nil -} - -type TaskCustomIndexer struct{} - -func (indexer TaskCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer TaskCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer TaskCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) { - m := obj.(*Task) - return customIndexer("", &m.Annotations) -} - -type NetworkCheckFunc func(t1, t2 *Network) bool - -type EventNetwork interface { - IsEventNetwork() bool -} - -type EventCreateNetwork struct { - Network *Network - Checks []NetworkCheckFunc -} - -func (e EventCreateNetwork) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventCreateNetwork) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Network, typedEvent.Network) { - return false - } - } - return true -} - -func (e EventCreateNetwork) IsEventCreate() bool { - return true -} - -func (e EventCreateNetwork) IsEventNetwork() bool { - return true -} - -type EventUpdateNetwork struct { - Network *Network - OldNetwork *Network - Checks []NetworkCheckFunc -} - -func (e EventUpdateNetwork) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventUpdateNetwork) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Network, typedEvent.Network) { - return false - } - } - return true -} - -func (e EventUpdateNetwork) IsEventUpdate() bool { - return true -} - -func (e EventUpdateNetwork) IsEventNetwork() bool { - return true -} - -type EventDeleteNetwork struct { - Network *Network - Checks []NetworkCheckFunc -} - -func (e EventDeleteNetwork) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventDeleteNetwork) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Network, typedEvent.Network) { - return false - } - } - return true -} - -func (e EventDeleteNetwork) IsEventDelete() bool { - return true -} - -func (e EventDeleteNetwork) IsEventNetwork() bool { - return true -} - -func (m *Network) CopyStoreObject() StoreObject { - return m.Copy() -} - -func (m *Network) GetMeta() Meta { - return m.Meta -} - -func (m *Network) SetMeta(meta Meta) { - m.Meta = meta -} - -func (m *Network) GetID() string { - return m.ID -} - -func (m *Network) EventCreate() Event { - return EventCreateNetwork{Network: m} -} - -func (m *Network) EventUpdate(oldObject StoreObject) Event { - if oldObject != nil { - return EventUpdateNetwork{Network: m, OldNetwork: oldObject.(*Network)} - } else { - return EventUpdateNetwork{Network: m} - } -} - -func (m *Network) EventDelete() Event { - return EventDeleteNetwork{Network: m} -} - -func NetworkCheckID(v1, v2 *Network) bool { - return v1.ID == v2.ID -} - -func NetworkCheckIDPrefix(v1, v2 *Network) bool { - return strings.HasPrefix(v2.ID, v1.ID) -} - -func NetworkCheckName(v1, v2 *Network) bool { - return v1.Spec.Annotations.Name == v2.Spec.Annotations.Name -} - -func NetworkCheckNamePrefix(v1, v2 *Network) bool { - return strings.HasPrefix(v2.Spec.Annotations.Name, v1.Spec.Annotations.Name) -} - -func NetworkCheckCustom(v1, v2 *Network) bool { - return checkCustom(v1.Spec.Annotations, v2.Spec.Annotations) -} - -func NetworkCheckCustomPrefix(v1, v2 *Network) bool { - return checkCustomPrefix(v1.Spec.Annotations, v2.Spec.Annotations) -} - -func ConvertNetworkWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) { - var ( - m Network - checkFuncs []NetworkCheckFunc - ) - - for _, filter := range filters { - switch v := filter.By.(type) { - case *SelectBy_ID: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.ID - checkFuncs = append(checkFuncs, NetworkCheckID) - case *SelectBy_IDPrefix: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.IDPrefix - checkFuncs = append(checkFuncs, NetworkCheckIDPrefix) - case *SelectBy_Name: - if m.Spec.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Spec.Annotations.Name = v.Name - checkFuncs = append(checkFuncs, NetworkCheckName) - case *SelectBy_NamePrefix: - if m.Spec.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Spec.Annotations.Name = v.NamePrefix - checkFuncs = append(checkFuncs, NetworkCheckNamePrefix) - case *SelectBy_Custom: - if len(m.Spec.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Spec.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}} - checkFuncs = append(checkFuncs, NetworkCheckCustom) - case *SelectBy_CustomPrefix: - if len(m.Spec.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Spec.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}} - checkFuncs = append(checkFuncs, NetworkCheckCustomPrefix) - } - } - var events []Event - if (action & WatchActionKindCreate) != 0 { - events = append(events, EventCreateNetwork{Network: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindUpdate) != 0 { - events = append(events, EventUpdateNetwork{Network: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindRemove) != 0 { - events = append(events, EventDeleteNetwork{Network: &m, Checks: checkFuncs}) - } - if len(events) == 0 { - return nil, errUnrecognizedAction - } - return events, nil -} - -type NetworkIndexerByID struct{} - -func (indexer NetworkIndexerByID) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer NetworkIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer NetworkIndexerByID) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Network) - return true, []byte(m.ID + "\x00"), nil -} - -type NetworkIndexerByName struct{} - -func (indexer NetworkIndexerByName) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer NetworkIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer NetworkIndexerByName) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Network) - val := m.Spec.Annotations.Name - return true, []byte(strings.ToLower(val) + "\x00"), nil -} - -type NetworkCustomIndexer struct{} - -func (indexer NetworkCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer NetworkCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer NetworkCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) { - m := obj.(*Network) - return customIndexer("", &m.Spec.Annotations) -} - -type ClusterCheckFunc func(t1, t2 *Cluster) bool - -type EventCluster interface { - IsEventCluster() bool -} - -type EventCreateCluster struct { - Cluster *Cluster - Checks []ClusterCheckFunc -} - -func (e EventCreateCluster) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventCreateCluster) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Cluster, typedEvent.Cluster) { - return false - } - } - return true -} - -func (e EventCreateCluster) IsEventCreate() bool { - return true -} - -func (e EventCreateCluster) IsEventCluster() bool { - return true -} - -type EventUpdateCluster struct { - Cluster *Cluster - OldCluster *Cluster - Checks []ClusterCheckFunc -} - -func (e EventUpdateCluster) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventUpdateCluster) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Cluster, typedEvent.Cluster) { - return false - } - } - return true -} - -func (e EventUpdateCluster) IsEventUpdate() bool { - return true -} - -func (e EventUpdateCluster) IsEventCluster() bool { - return true -} - -type EventDeleteCluster struct { - Cluster *Cluster - Checks []ClusterCheckFunc -} - -func (e EventDeleteCluster) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventDeleteCluster) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Cluster, typedEvent.Cluster) { - return false - } - } - return true -} - -func (e EventDeleteCluster) IsEventDelete() bool { - return true -} - -func (e EventDeleteCluster) IsEventCluster() bool { - return true -} - -func (m *Cluster) CopyStoreObject() StoreObject { - return m.Copy() -} - -func (m *Cluster) GetMeta() Meta { - return m.Meta -} - -func (m *Cluster) SetMeta(meta Meta) { - m.Meta = meta -} - -func (m *Cluster) GetID() string { - return m.ID -} - -func (m *Cluster) EventCreate() Event { - return EventCreateCluster{Cluster: m} -} - -func (m *Cluster) EventUpdate(oldObject StoreObject) Event { - if oldObject != nil { - return EventUpdateCluster{Cluster: m, OldCluster: oldObject.(*Cluster)} - } else { - return EventUpdateCluster{Cluster: m} - } -} - -func (m *Cluster) EventDelete() Event { - return EventDeleteCluster{Cluster: m} -} - -func ClusterCheckID(v1, v2 *Cluster) bool { - return v1.ID == v2.ID -} - -func ClusterCheckIDPrefix(v1, v2 *Cluster) bool { - return strings.HasPrefix(v2.ID, v1.ID) -} - -func ClusterCheckName(v1, v2 *Cluster) bool { - return v1.Spec.Annotations.Name == v2.Spec.Annotations.Name -} - -func ClusterCheckNamePrefix(v1, v2 *Cluster) bool { - return strings.HasPrefix(v2.Spec.Annotations.Name, v1.Spec.Annotations.Name) -} - -func ClusterCheckCustom(v1, v2 *Cluster) bool { - return checkCustom(v1.Spec.Annotations, v2.Spec.Annotations) -} - -func ClusterCheckCustomPrefix(v1, v2 *Cluster) bool { - return checkCustomPrefix(v1.Spec.Annotations, v2.Spec.Annotations) -} - -func ConvertClusterWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) { - var ( - m Cluster - checkFuncs []ClusterCheckFunc - ) - - for _, filter := range filters { - switch v := filter.By.(type) { - case *SelectBy_ID: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.ID - checkFuncs = append(checkFuncs, ClusterCheckID) - case *SelectBy_IDPrefix: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.IDPrefix - checkFuncs = append(checkFuncs, ClusterCheckIDPrefix) - case *SelectBy_Name: - if m.Spec.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Spec.Annotations.Name = v.Name - checkFuncs = append(checkFuncs, ClusterCheckName) - case *SelectBy_NamePrefix: - if m.Spec.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Spec.Annotations.Name = v.NamePrefix - checkFuncs = append(checkFuncs, ClusterCheckNamePrefix) - case *SelectBy_Custom: - if len(m.Spec.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Spec.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}} - checkFuncs = append(checkFuncs, ClusterCheckCustom) - case *SelectBy_CustomPrefix: - if len(m.Spec.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Spec.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}} - checkFuncs = append(checkFuncs, ClusterCheckCustomPrefix) - } - } - var events []Event - if (action & WatchActionKindCreate) != 0 { - events = append(events, EventCreateCluster{Cluster: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindUpdate) != 0 { - events = append(events, EventUpdateCluster{Cluster: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindRemove) != 0 { - events = append(events, EventDeleteCluster{Cluster: &m, Checks: checkFuncs}) - } - if len(events) == 0 { - return nil, errUnrecognizedAction - } - return events, nil -} - -type ClusterIndexerByID struct{} - -func (indexer ClusterIndexerByID) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer ClusterIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer ClusterIndexerByID) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Cluster) - return true, []byte(m.ID + "\x00"), nil -} - -type ClusterIndexerByName struct{} - -func (indexer ClusterIndexerByName) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer ClusterIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer ClusterIndexerByName) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Cluster) - val := m.Spec.Annotations.Name - return true, []byte(strings.ToLower(val) + "\x00"), nil -} - -type ClusterCustomIndexer struct{} - -func (indexer ClusterCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer ClusterCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer ClusterCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) { - m := obj.(*Cluster) - return customIndexer("", &m.Spec.Annotations) -} - -type SecretCheckFunc func(t1, t2 *Secret) bool - -type EventSecret interface { - IsEventSecret() bool -} - -type EventCreateSecret struct { - Secret *Secret - Checks []SecretCheckFunc -} - -func (e EventCreateSecret) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventCreateSecret) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Secret, typedEvent.Secret) { - return false - } - } - return true -} - -func (e EventCreateSecret) IsEventCreate() bool { - return true -} - -func (e EventCreateSecret) IsEventSecret() bool { - return true -} - -type EventUpdateSecret struct { - Secret *Secret - OldSecret *Secret - Checks []SecretCheckFunc -} - -func (e EventUpdateSecret) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventUpdateSecret) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Secret, typedEvent.Secret) { - return false - } - } - return true -} - -func (e EventUpdateSecret) IsEventUpdate() bool { - return true -} - -func (e EventUpdateSecret) IsEventSecret() bool { - return true -} - -type EventDeleteSecret struct { - Secret *Secret - Checks []SecretCheckFunc -} - -func (e EventDeleteSecret) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventDeleteSecret) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Secret, typedEvent.Secret) { - return false - } - } - return true -} - -func (e EventDeleteSecret) IsEventDelete() bool { - return true -} - -func (e EventDeleteSecret) IsEventSecret() bool { - return true -} - -func (m *Secret) CopyStoreObject() StoreObject { - return m.Copy() -} - -func (m *Secret) GetMeta() Meta { - return m.Meta -} - -func (m *Secret) SetMeta(meta Meta) { - m.Meta = meta -} - -func (m *Secret) GetID() string { - return m.ID -} - -func (m *Secret) EventCreate() Event { - return EventCreateSecret{Secret: m} -} - -func (m *Secret) EventUpdate(oldObject StoreObject) Event { - if oldObject != nil { - return EventUpdateSecret{Secret: m, OldSecret: oldObject.(*Secret)} - } else { - return EventUpdateSecret{Secret: m} - } -} - -func (m *Secret) EventDelete() Event { - return EventDeleteSecret{Secret: m} -} - -func SecretCheckID(v1, v2 *Secret) bool { - return v1.ID == v2.ID -} - -func SecretCheckIDPrefix(v1, v2 *Secret) bool { - return strings.HasPrefix(v2.ID, v1.ID) -} - -func SecretCheckName(v1, v2 *Secret) bool { - return v1.Spec.Annotations.Name == v2.Spec.Annotations.Name -} - -func SecretCheckNamePrefix(v1, v2 *Secret) bool { - return strings.HasPrefix(v2.Spec.Annotations.Name, v1.Spec.Annotations.Name) -} - -func SecretCheckCustom(v1, v2 *Secret) bool { - return checkCustom(v1.Spec.Annotations, v2.Spec.Annotations) -} - -func SecretCheckCustomPrefix(v1, v2 *Secret) bool { - return checkCustomPrefix(v1.Spec.Annotations, v2.Spec.Annotations) -} - -func ConvertSecretWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) { - var ( - m Secret - checkFuncs []SecretCheckFunc - ) - - for _, filter := range filters { - switch v := filter.By.(type) { - case *SelectBy_ID: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.ID - checkFuncs = append(checkFuncs, SecretCheckID) - case *SelectBy_IDPrefix: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.IDPrefix - checkFuncs = append(checkFuncs, SecretCheckIDPrefix) - case *SelectBy_Name: - if m.Spec.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Spec.Annotations.Name = v.Name - checkFuncs = append(checkFuncs, SecretCheckName) - case *SelectBy_NamePrefix: - if m.Spec.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Spec.Annotations.Name = v.NamePrefix - checkFuncs = append(checkFuncs, SecretCheckNamePrefix) - case *SelectBy_Custom: - if len(m.Spec.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Spec.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}} - checkFuncs = append(checkFuncs, SecretCheckCustom) - case *SelectBy_CustomPrefix: - if len(m.Spec.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Spec.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}} - checkFuncs = append(checkFuncs, SecretCheckCustomPrefix) - } - } - var events []Event - if (action & WatchActionKindCreate) != 0 { - events = append(events, EventCreateSecret{Secret: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindUpdate) != 0 { - events = append(events, EventUpdateSecret{Secret: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindRemove) != 0 { - events = append(events, EventDeleteSecret{Secret: &m, Checks: checkFuncs}) - } - if len(events) == 0 { - return nil, errUnrecognizedAction - } - return events, nil -} - -type SecretIndexerByID struct{} - -func (indexer SecretIndexerByID) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer SecretIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer SecretIndexerByID) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Secret) - return true, []byte(m.ID + "\x00"), nil -} - -type SecretIndexerByName struct{} - -func (indexer SecretIndexerByName) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer SecretIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer SecretIndexerByName) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Secret) - val := m.Spec.Annotations.Name - return true, []byte(strings.ToLower(val) + "\x00"), nil -} - -type SecretCustomIndexer struct{} - -func (indexer SecretCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer SecretCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer SecretCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) { - m := obj.(*Secret) - return customIndexer("", &m.Spec.Annotations) -} - -type ConfigCheckFunc func(t1, t2 *Config) bool - -type EventConfig interface { - IsEventConfig() bool -} - -type EventCreateConfig struct { - Config *Config - Checks []ConfigCheckFunc -} - -func (e EventCreateConfig) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventCreateConfig) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Config, typedEvent.Config) { - return false - } - } - return true -} - -func (e EventCreateConfig) IsEventCreate() bool { - return true -} - -func (e EventCreateConfig) IsEventConfig() bool { - return true -} - -type EventUpdateConfig struct { - Config *Config - OldConfig *Config - Checks []ConfigCheckFunc -} - -func (e EventUpdateConfig) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventUpdateConfig) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Config, typedEvent.Config) { - return false - } - } - return true -} - -func (e EventUpdateConfig) IsEventUpdate() bool { - return true -} - -func (e EventUpdateConfig) IsEventConfig() bool { - return true -} - -type EventDeleteConfig struct { - Config *Config - Checks []ConfigCheckFunc -} - -func (e EventDeleteConfig) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventDeleteConfig) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Config, typedEvent.Config) { - return false - } - } - return true -} - -func (e EventDeleteConfig) IsEventDelete() bool { - return true -} - -func (e EventDeleteConfig) IsEventConfig() bool { - return true -} - -func (m *Config) CopyStoreObject() StoreObject { - return m.Copy() -} - -func (m *Config) GetMeta() Meta { - return m.Meta -} - -func (m *Config) SetMeta(meta Meta) { - m.Meta = meta -} - -func (m *Config) GetID() string { - return m.ID -} - -func (m *Config) EventCreate() Event { - return EventCreateConfig{Config: m} -} - -func (m *Config) EventUpdate(oldObject StoreObject) Event { - if oldObject != nil { - return EventUpdateConfig{Config: m, OldConfig: oldObject.(*Config)} - } else { - return EventUpdateConfig{Config: m} - } -} - -func (m *Config) EventDelete() Event { - return EventDeleteConfig{Config: m} -} - -func ConfigCheckID(v1, v2 *Config) bool { - return v1.ID == v2.ID -} - -func ConfigCheckIDPrefix(v1, v2 *Config) bool { - return strings.HasPrefix(v2.ID, v1.ID) -} - -func ConfigCheckName(v1, v2 *Config) bool { - return v1.Spec.Annotations.Name == v2.Spec.Annotations.Name -} - -func ConfigCheckNamePrefix(v1, v2 *Config) bool { - return strings.HasPrefix(v2.Spec.Annotations.Name, v1.Spec.Annotations.Name) -} - -func ConfigCheckCustom(v1, v2 *Config) bool { - return checkCustom(v1.Spec.Annotations, v2.Spec.Annotations) -} - -func ConfigCheckCustomPrefix(v1, v2 *Config) bool { - return checkCustomPrefix(v1.Spec.Annotations, v2.Spec.Annotations) -} - -func ConvertConfigWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) { - var ( - m Config - checkFuncs []ConfigCheckFunc - ) - - for _, filter := range filters { - switch v := filter.By.(type) { - case *SelectBy_ID: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.ID - checkFuncs = append(checkFuncs, ConfigCheckID) - case *SelectBy_IDPrefix: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.IDPrefix - checkFuncs = append(checkFuncs, ConfigCheckIDPrefix) - case *SelectBy_Name: - if m.Spec.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Spec.Annotations.Name = v.Name - checkFuncs = append(checkFuncs, ConfigCheckName) - case *SelectBy_NamePrefix: - if m.Spec.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Spec.Annotations.Name = v.NamePrefix - checkFuncs = append(checkFuncs, ConfigCheckNamePrefix) - case *SelectBy_Custom: - if len(m.Spec.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Spec.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}} - checkFuncs = append(checkFuncs, ConfigCheckCustom) - case *SelectBy_CustomPrefix: - if len(m.Spec.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Spec.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}} - checkFuncs = append(checkFuncs, ConfigCheckCustomPrefix) - } - } - var events []Event - if (action & WatchActionKindCreate) != 0 { - events = append(events, EventCreateConfig{Config: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindUpdate) != 0 { - events = append(events, EventUpdateConfig{Config: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindRemove) != 0 { - events = append(events, EventDeleteConfig{Config: &m, Checks: checkFuncs}) - } - if len(events) == 0 { - return nil, errUnrecognizedAction - } - return events, nil -} - -type ConfigIndexerByID struct{} - -func (indexer ConfigIndexerByID) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer ConfigIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer ConfigIndexerByID) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Config) - return true, []byte(m.ID + "\x00"), nil -} - -type ConfigIndexerByName struct{} - -func (indexer ConfigIndexerByName) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer ConfigIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer ConfigIndexerByName) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Config) - val := m.Spec.Annotations.Name - return true, []byte(strings.ToLower(val) + "\x00"), nil -} - -type ConfigCustomIndexer struct{} - -func (indexer ConfigCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer ConfigCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer ConfigCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) { - m := obj.(*Config) - return customIndexer("", &m.Spec.Annotations) -} - -type ResourceCheckFunc func(t1, t2 *Resource) bool - -type EventResource interface { - IsEventResource() bool -} - -type EventCreateResource struct { - Resource *Resource - Checks []ResourceCheckFunc -} - -func (e EventCreateResource) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventCreateResource) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Resource, typedEvent.Resource) { - return false - } - } - return true -} - -func (e EventCreateResource) IsEventCreate() bool { - return true -} - -func (e EventCreateResource) IsEventResource() bool { - return true -} - -type EventUpdateResource struct { - Resource *Resource - OldResource *Resource - Checks []ResourceCheckFunc -} - -func (e EventUpdateResource) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventUpdateResource) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Resource, typedEvent.Resource) { - return false - } - } - return true -} - -func (e EventUpdateResource) IsEventUpdate() bool { - return true -} - -func (e EventUpdateResource) IsEventResource() bool { - return true -} - -type EventDeleteResource struct { - Resource *Resource - Checks []ResourceCheckFunc -} - -func (e EventDeleteResource) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventDeleteResource) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Resource, typedEvent.Resource) { - return false - } - } - return true -} - -func (e EventDeleteResource) IsEventDelete() bool { - return true -} - -func (e EventDeleteResource) IsEventResource() bool { - return true -} - -func (m *Resource) CopyStoreObject() StoreObject { - return m.Copy() -} - -func (m *Resource) GetMeta() Meta { - return m.Meta -} - -func (m *Resource) SetMeta(meta Meta) { - m.Meta = meta -} - -func (m *Resource) GetID() string { - return m.ID -} - -func (m *Resource) EventCreate() Event { - return EventCreateResource{Resource: m} -} - -func (m *Resource) EventUpdate(oldObject StoreObject) Event { - if oldObject != nil { - return EventUpdateResource{Resource: m, OldResource: oldObject.(*Resource)} - } else { - return EventUpdateResource{Resource: m} - } -} - -func (m *Resource) EventDelete() Event { - return EventDeleteResource{Resource: m} -} - -func ResourceCheckID(v1, v2 *Resource) bool { - return v1.ID == v2.ID -} - -func ResourceCheckIDPrefix(v1, v2 *Resource) bool { - return strings.HasPrefix(v2.ID, v1.ID) -} - -func ResourceCheckName(v1, v2 *Resource) bool { - return v1.Annotations.Name == v2.Annotations.Name -} - -func ResourceCheckNamePrefix(v1, v2 *Resource) bool { - return strings.HasPrefix(v2.Annotations.Name, v1.Annotations.Name) -} - -func ResourceCheckCustom(v1, v2 *Resource) bool { - return checkCustom(v1.Annotations, v2.Annotations) -} - -func ResourceCheckCustomPrefix(v1, v2 *Resource) bool { - return checkCustomPrefix(v1.Annotations, v2.Annotations) -} - -func ResourceCheckKind(v1, v2 *Resource) bool { - return v1.Kind == v2.Kind -} - -func ConvertResourceWatch(action WatchActionKind, filters []*SelectBy, kind string) ([]Event, error) { - var ( - m Resource - checkFuncs []ResourceCheckFunc - ) - m.Kind = kind - checkFuncs = append(checkFuncs, ResourceCheckKind) - - for _, filter := range filters { - switch v := filter.By.(type) { - case *SelectBy_ID: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.ID - checkFuncs = append(checkFuncs, ResourceCheckID) - case *SelectBy_IDPrefix: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.IDPrefix - checkFuncs = append(checkFuncs, ResourceCheckIDPrefix) - case *SelectBy_Name: - if m.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Annotations.Name = v.Name - checkFuncs = append(checkFuncs, ResourceCheckName) - case *SelectBy_NamePrefix: - if m.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Annotations.Name = v.NamePrefix - checkFuncs = append(checkFuncs, ResourceCheckNamePrefix) - case *SelectBy_Custom: - if len(m.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}} - checkFuncs = append(checkFuncs, ResourceCheckCustom) - case *SelectBy_CustomPrefix: - if len(m.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}} - checkFuncs = append(checkFuncs, ResourceCheckCustomPrefix) - } - } - var events []Event - if (action & WatchActionKindCreate) != 0 { - events = append(events, EventCreateResource{Resource: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindUpdate) != 0 { - events = append(events, EventUpdateResource{Resource: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindRemove) != 0 { - events = append(events, EventDeleteResource{Resource: &m, Checks: checkFuncs}) - } - if len(events) == 0 { - return nil, errUnrecognizedAction - } - return events, nil -} - -type ResourceIndexerByID struct{} - -func (indexer ResourceIndexerByID) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer ResourceIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer ResourceIndexerByID) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Resource) - return true, []byte(m.ID + "\x00"), nil -} - -type ResourceIndexerByName struct{} - -func (indexer ResourceIndexerByName) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer ResourceIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer ResourceIndexerByName) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Resource) - val := m.Annotations.Name - return true, []byte(strings.ToLower(val) + "\x00"), nil -} - -type ResourceCustomIndexer struct{} - -func (indexer ResourceCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer ResourceCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer ResourceCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) { - m := obj.(*Resource) - return customIndexer("", &m.Annotations) -} - -type ExtensionCheckFunc func(t1, t2 *Extension) bool - -type EventExtension interface { - IsEventExtension() bool -} - -type EventCreateExtension struct { - Extension *Extension - Checks []ExtensionCheckFunc -} - -func (e EventCreateExtension) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventCreateExtension) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Extension, typedEvent.Extension) { - return false - } - } - return true -} - -func (e EventCreateExtension) IsEventCreate() bool { - return true -} - -func (e EventCreateExtension) IsEventExtension() bool { - return true -} - -type EventUpdateExtension struct { - Extension *Extension - OldExtension *Extension - Checks []ExtensionCheckFunc -} - -func (e EventUpdateExtension) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventUpdateExtension) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Extension, typedEvent.Extension) { - return false - } - } - return true -} - -func (e EventUpdateExtension) IsEventUpdate() bool { - return true -} - -func (e EventUpdateExtension) IsEventExtension() bool { - return true -} - -type EventDeleteExtension struct { - Extension *Extension - Checks []ExtensionCheckFunc -} - -func (e EventDeleteExtension) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventDeleteExtension) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Extension, typedEvent.Extension) { - return false - } - } - return true -} - -func (e EventDeleteExtension) IsEventDelete() bool { - return true -} - -func (e EventDeleteExtension) IsEventExtension() bool { - return true -} - -func (m *Extension) CopyStoreObject() StoreObject { - return m.Copy() -} - -func (m *Extension) GetMeta() Meta { - return m.Meta -} - -func (m *Extension) SetMeta(meta Meta) { - m.Meta = meta -} - -func (m *Extension) GetID() string { - return m.ID -} - -func (m *Extension) EventCreate() Event { - return EventCreateExtension{Extension: m} -} - -func (m *Extension) EventUpdate(oldObject StoreObject) Event { - if oldObject != nil { - return EventUpdateExtension{Extension: m, OldExtension: oldObject.(*Extension)} - } else { - return EventUpdateExtension{Extension: m} - } -} - -func (m *Extension) EventDelete() Event { - return EventDeleteExtension{Extension: m} -} - -func ExtensionCheckID(v1, v2 *Extension) bool { - return v1.ID == v2.ID -} - -func ExtensionCheckIDPrefix(v1, v2 *Extension) bool { - return strings.HasPrefix(v2.ID, v1.ID) -} - -func ExtensionCheckName(v1, v2 *Extension) bool { - return v1.Annotations.Name == v2.Annotations.Name -} - -func ExtensionCheckNamePrefix(v1, v2 *Extension) bool { - return strings.HasPrefix(v2.Annotations.Name, v1.Annotations.Name) -} - -func ExtensionCheckCustom(v1, v2 *Extension) bool { - return checkCustom(v1.Annotations, v2.Annotations) -} - -func ExtensionCheckCustomPrefix(v1, v2 *Extension) bool { - return checkCustomPrefix(v1.Annotations, v2.Annotations) -} - -func ConvertExtensionWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) { - var ( - m Extension - checkFuncs []ExtensionCheckFunc - ) - - for _, filter := range filters { - switch v := filter.By.(type) { - case *SelectBy_ID: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.ID - checkFuncs = append(checkFuncs, ExtensionCheckID) - case *SelectBy_IDPrefix: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.IDPrefix - checkFuncs = append(checkFuncs, ExtensionCheckIDPrefix) - case *SelectBy_Name: - if m.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Annotations.Name = v.Name - checkFuncs = append(checkFuncs, ExtensionCheckName) - case *SelectBy_NamePrefix: - if m.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Annotations.Name = v.NamePrefix - checkFuncs = append(checkFuncs, ExtensionCheckNamePrefix) - case *SelectBy_Custom: - if len(m.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}} - checkFuncs = append(checkFuncs, ExtensionCheckCustom) - case *SelectBy_CustomPrefix: - if len(m.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}} - checkFuncs = append(checkFuncs, ExtensionCheckCustomPrefix) - } - } - var events []Event - if (action & WatchActionKindCreate) != 0 { - events = append(events, EventCreateExtension{Extension: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindUpdate) != 0 { - events = append(events, EventUpdateExtension{Extension: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindRemove) != 0 { - events = append(events, EventDeleteExtension{Extension: &m, Checks: checkFuncs}) - } - if len(events) == 0 { - return nil, errUnrecognizedAction - } - return events, nil -} - -type ExtensionIndexerByID struct{} - -func (indexer ExtensionIndexerByID) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer ExtensionIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer ExtensionIndexerByID) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Extension) - return true, []byte(m.ID + "\x00"), nil -} - -type ExtensionIndexerByName struct{} - -func (indexer ExtensionIndexerByName) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer ExtensionIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer ExtensionIndexerByName) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Extension) - val := m.Annotations.Name - return true, []byte(strings.ToLower(val) + "\x00"), nil -} - -type ExtensionCustomIndexer struct{} - -func (indexer ExtensionCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer ExtensionCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer ExtensionCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) { - m := obj.(*Extension) - return customIndexer("", &m.Annotations) -} - -type VolumeCheckFunc func(t1, t2 *Volume) bool - -type EventVolume interface { - IsEventVolume() bool -} - -type EventCreateVolume struct { - Volume *Volume - Checks []VolumeCheckFunc -} - -func (e EventCreateVolume) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventCreateVolume) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Volume, typedEvent.Volume) { - return false - } - } - return true -} - -func (e EventCreateVolume) IsEventCreate() bool { - return true -} - -func (e EventCreateVolume) IsEventVolume() bool { - return true -} - -type EventUpdateVolume struct { - Volume *Volume - OldVolume *Volume - Checks []VolumeCheckFunc -} - -func (e EventUpdateVolume) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventUpdateVolume) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Volume, typedEvent.Volume) { - return false - } - } - return true -} - -func (e EventUpdateVolume) IsEventUpdate() bool { - return true -} - -func (e EventUpdateVolume) IsEventVolume() bool { - return true -} - -type EventDeleteVolume struct { - Volume *Volume - Checks []VolumeCheckFunc -} - -func (e EventDeleteVolume) Matches(apiEvent github_com_docker_go_events.Event) bool { - typedEvent, ok := apiEvent.(EventDeleteVolume) - if !ok { - return false - } - - for _, check := range e.Checks { - if !check(e.Volume, typedEvent.Volume) { - return false - } - } - return true -} - -func (e EventDeleteVolume) IsEventDelete() bool { - return true -} - -func (e EventDeleteVolume) IsEventVolume() bool { - return true -} - -func (m *Volume) CopyStoreObject() StoreObject { - return m.Copy() -} - -func (m *Volume) GetMeta() Meta { - return m.Meta -} - -func (m *Volume) SetMeta(meta Meta) { - m.Meta = meta -} - -func (m *Volume) GetID() string { - return m.ID -} - -func (m *Volume) EventCreate() Event { - return EventCreateVolume{Volume: m} -} - -func (m *Volume) EventUpdate(oldObject StoreObject) Event { - if oldObject != nil { - return EventUpdateVolume{Volume: m, OldVolume: oldObject.(*Volume)} - } else { - return EventUpdateVolume{Volume: m} - } -} - -func (m *Volume) EventDelete() Event { - return EventDeleteVolume{Volume: m} -} - -func VolumeCheckID(v1, v2 *Volume) bool { - return v1.ID == v2.ID -} - -func VolumeCheckIDPrefix(v1, v2 *Volume) bool { - return strings.HasPrefix(v2.ID, v1.ID) -} - -func VolumeCheckName(v1, v2 *Volume) bool { - return v1.Spec.Annotations.Name == v2.Spec.Annotations.Name -} - -func VolumeCheckNamePrefix(v1, v2 *Volume) bool { - return strings.HasPrefix(v2.Spec.Annotations.Name, v1.Spec.Annotations.Name) -} - -func VolumeCheckCustom(v1, v2 *Volume) bool { - return checkCustom(v1.Spec.Annotations, v2.Spec.Annotations) -} - -func VolumeCheckCustomPrefix(v1, v2 *Volume) bool { - return checkCustomPrefix(v1.Spec.Annotations, v2.Spec.Annotations) -} - -func ConvertVolumeWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) { - var ( - m Volume - checkFuncs []VolumeCheckFunc - ) - - for _, filter := range filters { - switch v := filter.By.(type) { - case *SelectBy_ID: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.ID - checkFuncs = append(checkFuncs, VolumeCheckID) - case *SelectBy_IDPrefix: - if m.ID != "" { - return nil, errConflictingFilters - } - m.ID = v.IDPrefix - checkFuncs = append(checkFuncs, VolumeCheckIDPrefix) - case *SelectBy_Name: - if m.Spec.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Spec.Annotations.Name = v.Name - checkFuncs = append(checkFuncs, VolumeCheckName) - case *SelectBy_NamePrefix: - if m.Spec.Annotations.Name != "" { - return nil, errConflictingFilters - } - m.Spec.Annotations.Name = v.NamePrefix - checkFuncs = append(checkFuncs, VolumeCheckNamePrefix) - case *SelectBy_Custom: - if len(m.Spec.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Spec.Annotations.Indices = []IndexEntry{{Key: v.Custom.Index, Val: v.Custom.Value}} - checkFuncs = append(checkFuncs, VolumeCheckCustom) - case *SelectBy_CustomPrefix: - if len(m.Spec.Annotations.Indices) != 0 { - return nil, errConflictingFilters - } - m.Spec.Annotations.Indices = []IndexEntry{{Key: v.CustomPrefix.Index, Val: v.CustomPrefix.Value}} - checkFuncs = append(checkFuncs, VolumeCheckCustomPrefix) - } - } - var events []Event - if (action & WatchActionKindCreate) != 0 { - events = append(events, EventCreateVolume{Volume: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindUpdate) != 0 { - events = append(events, EventUpdateVolume{Volume: &m, Checks: checkFuncs}) - } - if (action & WatchActionKindRemove) != 0 { - events = append(events, EventDeleteVolume{Volume: &m, Checks: checkFuncs}) - } - if len(events) == 0 { - return nil, errUnrecognizedAction - } - return events, nil -} - -type VolumeIndexerByID struct{} - -func (indexer VolumeIndexerByID) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer VolumeIndexerByID) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer VolumeIndexerByID) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Volume) - return true, []byte(m.ID + "\x00"), nil -} - -type VolumeIndexerByName struct{} - -func (indexer VolumeIndexerByName) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer VolumeIndexerByName) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer VolumeIndexerByName) FromObject(obj interface{}) (bool, []byte, error) { - m := obj.(*Volume) - val := m.Spec.Annotations.Name - return true, []byte(strings.ToLower(val) + "\x00"), nil -} - -type VolumeCustomIndexer struct{} - -func (indexer VolumeCustomIndexer) FromArgs(args ...interface{}) ([]byte, error) { - return fromArgs(args...) -} -func (indexer VolumeCustomIndexer) PrefixFromArgs(args ...interface{}) ([]byte, error) { - return prefixFromArgs(args...) -} -func (indexer VolumeCustomIndexer) FromObject(obj interface{}) (bool, [][]byte, error) { - m := obj.(*Volume) - return customIndexer("", &m.Spec.Annotations) -} -func NewStoreAction(c Event) (StoreAction, error) { - var sa StoreAction - switch v := c.(type) { - case EventCreateNode: - sa.Action = StoreActionKindCreate - sa.Target = &StoreAction_Node{Node: v.Node} - case EventUpdateNode: - sa.Action = StoreActionKindUpdate - sa.Target = &StoreAction_Node{Node: v.Node} - case EventDeleteNode: - sa.Action = StoreActionKindRemove - sa.Target = &StoreAction_Node{Node: v.Node} - case EventCreateService: - sa.Action = StoreActionKindCreate - sa.Target = &StoreAction_Service{Service: v.Service} - case EventUpdateService: - sa.Action = StoreActionKindUpdate - sa.Target = &StoreAction_Service{Service: v.Service} - case EventDeleteService: - sa.Action = StoreActionKindRemove - sa.Target = &StoreAction_Service{Service: v.Service} - case EventCreateTask: - sa.Action = StoreActionKindCreate - sa.Target = &StoreAction_Task{Task: v.Task} - case EventUpdateTask: - sa.Action = StoreActionKindUpdate - sa.Target = &StoreAction_Task{Task: v.Task} - case EventDeleteTask: - sa.Action = StoreActionKindRemove - sa.Target = &StoreAction_Task{Task: v.Task} - case EventCreateNetwork: - sa.Action = StoreActionKindCreate - sa.Target = &StoreAction_Network{Network: v.Network} - case EventUpdateNetwork: - sa.Action = StoreActionKindUpdate - sa.Target = &StoreAction_Network{Network: v.Network} - case EventDeleteNetwork: - sa.Action = StoreActionKindRemove - sa.Target = &StoreAction_Network{Network: v.Network} - case EventCreateCluster: - sa.Action = StoreActionKindCreate - sa.Target = &StoreAction_Cluster{Cluster: v.Cluster} - case EventUpdateCluster: - sa.Action = StoreActionKindUpdate - sa.Target = &StoreAction_Cluster{Cluster: v.Cluster} - case EventDeleteCluster: - sa.Action = StoreActionKindRemove - sa.Target = &StoreAction_Cluster{Cluster: v.Cluster} - case EventCreateSecret: - sa.Action = StoreActionKindCreate - sa.Target = &StoreAction_Secret{Secret: v.Secret} - case EventUpdateSecret: - sa.Action = StoreActionKindUpdate - sa.Target = &StoreAction_Secret{Secret: v.Secret} - case EventDeleteSecret: - sa.Action = StoreActionKindRemove - sa.Target = &StoreAction_Secret{Secret: v.Secret} - case EventCreateConfig: - sa.Action = StoreActionKindCreate - sa.Target = &StoreAction_Config{Config: v.Config} - case EventUpdateConfig: - sa.Action = StoreActionKindUpdate - sa.Target = &StoreAction_Config{Config: v.Config} - case EventDeleteConfig: - sa.Action = StoreActionKindRemove - sa.Target = &StoreAction_Config{Config: v.Config} - case EventCreateResource: - sa.Action = StoreActionKindCreate - sa.Target = &StoreAction_Resource{Resource: v.Resource} - case EventUpdateResource: - sa.Action = StoreActionKindUpdate - sa.Target = &StoreAction_Resource{Resource: v.Resource} - case EventDeleteResource: - sa.Action = StoreActionKindRemove - sa.Target = &StoreAction_Resource{Resource: v.Resource} - case EventCreateExtension: - sa.Action = StoreActionKindCreate - sa.Target = &StoreAction_Extension{Extension: v.Extension} - case EventUpdateExtension: - sa.Action = StoreActionKindUpdate - sa.Target = &StoreAction_Extension{Extension: v.Extension} - case EventDeleteExtension: - sa.Action = StoreActionKindRemove - sa.Target = &StoreAction_Extension{Extension: v.Extension} - case EventCreateVolume: - sa.Action = StoreActionKindCreate - sa.Target = &StoreAction_Volume{Volume: v.Volume} - case EventUpdateVolume: - sa.Action = StoreActionKindUpdate - sa.Target = &StoreAction_Volume{Volume: v.Volume} - case EventDeleteVolume: - sa.Action = StoreActionKindRemove - sa.Target = &StoreAction_Volume{Volume: v.Volume} - default: - return StoreAction{}, errUnknownStoreAction - } - return sa, nil -} - -func EventFromStoreAction(sa StoreAction, oldObject StoreObject) (Event, error) { - switch v := sa.Target.(type) { - case *StoreAction_Node: - switch sa.Action { - case StoreActionKindCreate: - return EventCreateNode{Node: v.Node}, nil - case StoreActionKindUpdate: - if oldObject != nil { - return EventUpdateNode{Node: v.Node, OldNode: oldObject.(*Node)}, nil - } else { - return EventUpdateNode{Node: v.Node}, nil - } - case StoreActionKindRemove: - return EventDeleteNode{Node: v.Node}, nil - } - case *StoreAction_Service: - switch sa.Action { - case StoreActionKindCreate: - return EventCreateService{Service: v.Service}, nil - case StoreActionKindUpdate: - if oldObject != nil { - return EventUpdateService{Service: v.Service, OldService: oldObject.(*Service)}, nil - } else { - return EventUpdateService{Service: v.Service}, nil - } - case StoreActionKindRemove: - return EventDeleteService{Service: v.Service}, nil - } - case *StoreAction_Task: - switch sa.Action { - case StoreActionKindCreate: - return EventCreateTask{Task: v.Task}, nil - case StoreActionKindUpdate: - if oldObject != nil { - return EventUpdateTask{Task: v.Task, OldTask: oldObject.(*Task)}, nil - } else { - return EventUpdateTask{Task: v.Task}, nil - } - case StoreActionKindRemove: - return EventDeleteTask{Task: v.Task}, nil - } - case *StoreAction_Network: - switch sa.Action { - case StoreActionKindCreate: - return EventCreateNetwork{Network: v.Network}, nil - case StoreActionKindUpdate: - if oldObject != nil { - return EventUpdateNetwork{Network: v.Network, OldNetwork: oldObject.(*Network)}, nil - } else { - return EventUpdateNetwork{Network: v.Network}, nil - } - case StoreActionKindRemove: - return EventDeleteNetwork{Network: v.Network}, nil - } - case *StoreAction_Cluster: - switch sa.Action { - case StoreActionKindCreate: - return EventCreateCluster{Cluster: v.Cluster}, nil - case StoreActionKindUpdate: - if oldObject != nil { - return EventUpdateCluster{Cluster: v.Cluster, OldCluster: oldObject.(*Cluster)}, nil - } else { - return EventUpdateCluster{Cluster: v.Cluster}, nil - } - case StoreActionKindRemove: - return EventDeleteCluster{Cluster: v.Cluster}, nil - } - case *StoreAction_Secret: - switch sa.Action { - case StoreActionKindCreate: - return EventCreateSecret{Secret: v.Secret}, nil - case StoreActionKindUpdate: - if oldObject != nil { - return EventUpdateSecret{Secret: v.Secret, OldSecret: oldObject.(*Secret)}, nil - } else { - return EventUpdateSecret{Secret: v.Secret}, nil - } - case StoreActionKindRemove: - return EventDeleteSecret{Secret: v.Secret}, nil - } - case *StoreAction_Config: - switch sa.Action { - case StoreActionKindCreate: - return EventCreateConfig{Config: v.Config}, nil - case StoreActionKindUpdate: - if oldObject != nil { - return EventUpdateConfig{Config: v.Config, OldConfig: oldObject.(*Config)}, nil - } else { - return EventUpdateConfig{Config: v.Config}, nil - } - case StoreActionKindRemove: - return EventDeleteConfig{Config: v.Config}, nil - } - case *StoreAction_Resource: - switch sa.Action { - case StoreActionKindCreate: - return EventCreateResource{Resource: v.Resource}, nil - case StoreActionKindUpdate: - if oldObject != nil { - return EventUpdateResource{Resource: v.Resource, OldResource: oldObject.(*Resource)}, nil - } else { - return EventUpdateResource{Resource: v.Resource}, nil - } - case StoreActionKindRemove: - return EventDeleteResource{Resource: v.Resource}, nil - } - case *StoreAction_Extension: - switch sa.Action { - case StoreActionKindCreate: - return EventCreateExtension{Extension: v.Extension}, nil - case StoreActionKindUpdate: - if oldObject != nil { - return EventUpdateExtension{Extension: v.Extension, OldExtension: oldObject.(*Extension)}, nil - } else { - return EventUpdateExtension{Extension: v.Extension}, nil - } - case StoreActionKindRemove: - return EventDeleteExtension{Extension: v.Extension}, nil - } - case *StoreAction_Volume: - switch sa.Action { - case StoreActionKindCreate: - return EventCreateVolume{Volume: v.Volume}, nil - case StoreActionKindUpdate: - if oldObject != nil { - return EventUpdateVolume{Volume: v.Volume, OldVolume: oldObject.(*Volume)}, nil - } else { - return EventUpdateVolume{Volume: v.Volume}, nil - } - case StoreActionKindRemove: - return EventDeleteVolume{Volume: v.Volume}, nil - } - } - return nil, errUnknownStoreAction -} - -func WatchMessageEvent(c Event) *WatchMessage_Event { - switch v := c.(type) { - case EventCreateNode: - return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Node{Node: v.Node}}} - case EventUpdateNode: - if v.OldNode != nil { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Node{Node: v.Node}}, OldObject: &Object{Object: &Object_Node{Node: v.OldNode}}} - } else { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Node{Node: v.Node}}} - } - case EventDeleteNode: - return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Node{Node: v.Node}}} - case EventCreateService: - return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Service{Service: v.Service}}} - case EventUpdateService: - if v.OldService != nil { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Service{Service: v.Service}}, OldObject: &Object{Object: &Object_Service{Service: v.OldService}}} - } else { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Service{Service: v.Service}}} - } - case EventDeleteService: - return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Service{Service: v.Service}}} - case EventCreateTask: - return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Task{Task: v.Task}}} - case EventUpdateTask: - if v.OldTask != nil { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Task{Task: v.Task}}, OldObject: &Object{Object: &Object_Task{Task: v.OldTask}}} - } else { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Task{Task: v.Task}}} - } - case EventDeleteTask: - return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Task{Task: v.Task}}} - case EventCreateNetwork: - return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Network{Network: v.Network}}} - case EventUpdateNetwork: - if v.OldNetwork != nil { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Network{Network: v.Network}}, OldObject: &Object{Object: &Object_Network{Network: v.OldNetwork}}} - } else { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Network{Network: v.Network}}} - } - case EventDeleteNetwork: - return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Network{Network: v.Network}}} - case EventCreateCluster: - return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Cluster{Cluster: v.Cluster}}} - case EventUpdateCluster: - if v.OldCluster != nil { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Cluster{Cluster: v.Cluster}}, OldObject: &Object{Object: &Object_Cluster{Cluster: v.OldCluster}}} - } else { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Cluster{Cluster: v.Cluster}}} - } - case EventDeleteCluster: - return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Cluster{Cluster: v.Cluster}}} - case EventCreateSecret: - return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Secret{Secret: v.Secret}}} - case EventUpdateSecret: - if v.OldSecret != nil { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Secret{Secret: v.Secret}}, OldObject: &Object{Object: &Object_Secret{Secret: v.OldSecret}}} - } else { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Secret{Secret: v.Secret}}} - } - case EventDeleteSecret: - return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Secret{Secret: v.Secret}}} - case EventCreateConfig: - return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Config{Config: v.Config}}} - case EventUpdateConfig: - if v.OldConfig != nil { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Config{Config: v.Config}}, OldObject: &Object{Object: &Object_Config{Config: v.OldConfig}}} - } else { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Config{Config: v.Config}}} - } - case EventDeleteConfig: - return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Config{Config: v.Config}}} - case EventCreateResource: - return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Resource{Resource: v.Resource}}} - case EventUpdateResource: - if v.OldResource != nil { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Resource{Resource: v.Resource}}, OldObject: &Object{Object: &Object_Resource{Resource: v.OldResource}}} - } else { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Resource{Resource: v.Resource}}} - } - case EventDeleteResource: - return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Resource{Resource: v.Resource}}} - case EventCreateExtension: - return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Extension{Extension: v.Extension}}} - case EventUpdateExtension: - if v.OldExtension != nil { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Extension{Extension: v.Extension}}, OldObject: &Object{Object: &Object_Extension{Extension: v.OldExtension}}} - } else { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Extension{Extension: v.Extension}}} - } - case EventDeleteExtension: - return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Extension{Extension: v.Extension}}} - case EventCreateVolume: - return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Volume{Volume: v.Volume}}} - case EventUpdateVolume: - if v.OldVolume != nil { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Volume{Volume: v.Volume}}, OldObject: &Object{Object: &Object_Volume{Volume: v.OldVolume}}} - } else { - return &WatchMessage_Event{Action: WatchActionKindUpdate, Object: &Object{Object: &Object_Volume{Volume: v.Volume}}} - } - case EventDeleteVolume: - return &WatchMessage_Event{Action: WatchActionKindRemove, Object: &Object{Object: &Object_Volume{Volume: v.Volume}}} - } - return nil -} - -func ConvertWatchArgs(entries []*WatchRequest_WatchEntry) ([]Event, error) { - var events []Event - for _, entry := range entries { - var newEvents []Event - var err error - switch entry.Kind { - case "": - return nil, errNoKindSpecified - case "node": - newEvents, err = ConvertNodeWatch(entry.Action, entry.Filters) - case "service": - newEvents, err = ConvertServiceWatch(entry.Action, entry.Filters) - case "task": - newEvents, err = ConvertTaskWatch(entry.Action, entry.Filters) - case "network": - newEvents, err = ConvertNetworkWatch(entry.Action, entry.Filters) - case "cluster": - newEvents, err = ConvertClusterWatch(entry.Action, entry.Filters) - case "secret": - newEvents, err = ConvertSecretWatch(entry.Action, entry.Filters) - case "config": - newEvents, err = ConvertConfigWatch(entry.Action, entry.Filters) - default: - newEvents, err = ConvertResourceWatch(entry.Action, entry.Filters, entry.Kind) - case "extension": - newEvents, err = ConvertExtensionWatch(entry.Action, entry.Filters) - case "volume": - newEvents, err = ConvertVolumeWatch(entry.Action, entry.Filters) - } - if err != nil { - return nil, err - } - events = append(events, newEvents...) - } - return events, nil -} - -func (this *Meta) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Meta{`, - `Version:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Version), "Version", "Version", 1), `&`, ``, 1) + `,`, - `CreatedAt:` + strings.Replace(fmt.Sprintf("%v", this.CreatedAt), "Timestamp", "types.Timestamp", 1) + `,`, - `UpdatedAt:` + strings.Replace(fmt.Sprintf("%v", this.UpdatedAt), "Timestamp", "types.Timestamp", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Node) String() string { - if this == nil { - return "nil" - } - repeatedStringForAttachments := "[]*NetworkAttachment{" - for _, f := range this.Attachments { - repeatedStringForAttachments += strings.Replace(f.String(), "NetworkAttachment", "NetworkAttachment", 1) + "," - } - repeatedStringForAttachments += "}" - s := strings.Join([]string{`&Node{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "NodeSpec", "NodeSpec", 1), `&`, ``, 1) + `,`, - `Description:` + strings.Replace(fmt.Sprintf("%v", this.Description), "NodeDescription", "NodeDescription", 1) + `,`, - `Status:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Status), "NodeStatus", "NodeStatus", 1), `&`, ``, 1) + `,`, - `ManagerStatus:` + strings.Replace(fmt.Sprintf("%v", this.ManagerStatus), "ManagerStatus", "ManagerStatus", 1) + `,`, - `Attachment:` + strings.Replace(this.Attachment.String(), "NetworkAttachment", "NetworkAttachment", 1) + `,`, - `Certificate:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Certificate), "Certificate", "Certificate", 1), `&`, ``, 1) + `,`, - `Role:` + fmt.Sprintf("%v", this.Role) + `,`, - `Attachments:` + repeatedStringForAttachments + `,`, - `VXLANUDPPort:` + fmt.Sprintf("%v", this.VXLANUDPPort) + `,`, - `}`, - }, "") - return s -} -func (this *Service) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Service{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "ServiceSpec", "ServiceSpec", 1), `&`, ``, 1) + `,`, - `Endpoint:` + strings.Replace(this.Endpoint.String(), "Endpoint", "Endpoint", 1) + `,`, - `UpdateStatus:` + strings.Replace(fmt.Sprintf("%v", this.UpdateStatus), "UpdateStatus", "UpdateStatus", 1) + `,`, - `PreviousSpec:` + strings.Replace(fmt.Sprintf("%v", this.PreviousSpec), "ServiceSpec", "ServiceSpec", 1) + `,`, - `PendingDelete:` + fmt.Sprintf("%v", this.PendingDelete) + `,`, - `SpecVersion:` + strings.Replace(fmt.Sprintf("%v", this.SpecVersion), "Version", "Version", 1) + `,`, - `PreviousSpecVersion:` + strings.Replace(fmt.Sprintf("%v", this.PreviousSpecVersion), "Version", "Version", 1) + `,`, - `JobStatus:` + strings.Replace(fmt.Sprintf("%v", this.JobStatus), "JobStatus", "JobStatus", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Endpoint) String() string { - if this == nil { - return "nil" - } - repeatedStringForPorts := "[]*PortConfig{" - for _, f := range this.Ports { - repeatedStringForPorts += strings.Replace(fmt.Sprintf("%v", f), "PortConfig", "PortConfig", 1) + "," - } - repeatedStringForPorts += "}" - repeatedStringForVirtualIPs := "[]*Endpoint_VirtualIP{" - for _, f := range this.VirtualIPs { - repeatedStringForVirtualIPs += strings.Replace(fmt.Sprintf("%v", f), "Endpoint_VirtualIP", "Endpoint_VirtualIP", 1) + "," - } - repeatedStringForVirtualIPs += "}" - s := strings.Join([]string{`&Endpoint{`, - `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "EndpointSpec", "EndpointSpec", 1) + `,`, - `Ports:` + repeatedStringForPorts + `,`, - `VirtualIPs:` + repeatedStringForVirtualIPs + `,`, - `}`, - }, "") - return s -} -func (this *Endpoint_VirtualIP) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Endpoint_VirtualIP{`, - `NetworkID:` + fmt.Sprintf("%v", this.NetworkID) + `,`, - `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`, - `}`, - }, "") - return s -} -func (this *Task) String() string { - if this == nil { - return "nil" - } - repeatedStringForNetworks := "[]*NetworkAttachment{" - for _, f := range this.Networks { - repeatedStringForNetworks += strings.Replace(f.String(), "NetworkAttachment", "NetworkAttachment", 1) + "," - } - repeatedStringForNetworks += "}" - repeatedStringForAssignedGenericResources := "[]*GenericResource{" - for _, f := range this.AssignedGenericResources { - repeatedStringForAssignedGenericResources += strings.Replace(fmt.Sprintf("%v", f), "GenericResource", "GenericResource", 1) + "," - } - repeatedStringForAssignedGenericResources += "}" - repeatedStringForVolumes := "[]*VolumeAttachment{" - for _, f := range this.Volumes { - repeatedStringForVolumes += strings.Replace(fmt.Sprintf("%v", f), "VolumeAttachment", "VolumeAttachment", 1) + "," - } - repeatedStringForVolumes += "}" - s := strings.Join([]string{`&Task{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "TaskSpec", "TaskSpec", 1), `&`, ``, 1) + `,`, - `ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`, - `Slot:` + fmt.Sprintf("%v", this.Slot) + `,`, - `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, - `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `ServiceAnnotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ServiceAnnotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Status), "TaskStatus", "TaskStatus", 1), `&`, ``, 1) + `,`, - `DesiredState:` + fmt.Sprintf("%v", this.DesiredState) + `,`, - `Networks:` + repeatedStringForNetworks + `,`, - `Endpoint:` + strings.Replace(this.Endpoint.String(), "Endpoint", "Endpoint", 1) + `,`, - `LogDriver:` + strings.Replace(fmt.Sprintf("%v", this.LogDriver), "Driver", "Driver", 1) + `,`, - `SpecVersion:` + strings.Replace(fmt.Sprintf("%v", this.SpecVersion), "Version", "Version", 1) + `,`, - `AssignedGenericResources:` + repeatedStringForAssignedGenericResources + `,`, - `JobIteration:` + strings.Replace(fmt.Sprintf("%v", this.JobIteration), "Version", "Version", 1) + `,`, - `Volumes:` + repeatedStringForVolumes + `,`, - `}`, - }, "") - return s -} -func (this *NetworkAttachment) String() string { - if this == nil { - return "nil" - } - keysForDriverAttachmentOpts := make([]string, 0, len(this.DriverAttachmentOpts)) - for k, _ := range this.DriverAttachmentOpts { - keysForDriverAttachmentOpts = append(keysForDriverAttachmentOpts, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForDriverAttachmentOpts) - mapStringForDriverAttachmentOpts := "map[string]string{" - for _, k := range keysForDriverAttachmentOpts { - mapStringForDriverAttachmentOpts += fmt.Sprintf("%v: %v,", k, this.DriverAttachmentOpts[k]) - } - mapStringForDriverAttachmentOpts += "}" - s := strings.Join([]string{`&NetworkAttachment{`, - `Network:` + strings.Replace(this.Network.String(), "Network", "Network", 1) + `,`, - `Addresses:` + fmt.Sprintf("%v", this.Addresses) + `,`, - `Aliases:` + fmt.Sprintf("%v", this.Aliases) + `,`, - `DriverAttachmentOpts:` + mapStringForDriverAttachmentOpts + `,`, - `}`, - }, "") - return s -} -func (this *Network) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Network{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "NetworkSpec", "NetworkSpec", 1), `&`, ``, 1) + `,`, - `DriverState:` + strings.Replace(fmt.Sprintf("%v", this.DriverState), "Driver", "Driver", 1) + `,`, - `IPAM:` + strings.Replace(fmt.Sprintf("%v", this.IPAM), "IPAMOptions", "IPAMOptions", 1) + `,`, - `PendingDelete:` + fmt.Sprintf("%v", this.PendingDelete) + `,`, - `}`, - }, "") - return s -} -func (this *Cluster) String() string { - if this == nil { - return "nil" - } - repeatedStringForNetworkBootstrapKeys := "[]*EncryptionKey{" - for _, f := range this.NetworkBootstrapKeys { - repeatedStringForNetworkBootstrapKeys += strings.Replace(fmt.Sprintf("%v", f), "EncryptionKey", "EncryptionKey", 1) + "," - } - repeatedStringForNetworkBootstrapKeys += "}" - repeatedStringForUnlockKeys := "[]*EncryptionKey{" - for _, f := range this.UnlockKeys { - repeatedStringForUnlockKeys += strings.Replace(fmt.Sprintf("%v", f), "EncryptionKey", "EncryptionKey", 1) + "," - } - repeatedStringForUnlockKeys += "}" - keysForBlacklistedCertificates := make([]string, 0, len(this.BlacklistedCertificates)) - for k, _ := range this.BlacklistedCertificates { - keysForBlacklistedCertificates = append(keysForBlacklistedCertificates, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForBlacklistedCertificates) - mapStringForBlacklistedCertificates := "map[string]*BlacklistedCertificate{" - for _, k := range keysForBlacklistedCertificates { - mapStringForBlacklistedCertificates += fmt.Sprintf("%v: %v,", k, this.BlacklistedCertificates[k]) - } - mapStringForBlacklistedCertificates += "}" - s := strings.Join([]string{`&Cluster{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "ClusterSpec", "ClusterSpec", 1), `&`, ``, 1) + `,`, - `RootCA:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.RootCA), "RootCA", "RootCA", 1), `&`, ``, 1) + `,`, - `NetworkBootstrapKeys:` + repeatedStringForNetworkBootstrapKeys + `,`, - `EncryptionKeyLamportClock:` + fmt.Sprintf("%v", this.EncryptionKeyLamportClock) + `,`, - `BlacklistedCertificates:` + mapStringForBlacklistedCertificates + `,`, - `UnlockKeys:` + repeatedStringForUnlockKeys + `,`, - `FIPS:` + fmt.Sprintf("%v", this.FIPS) + `,`, - `DefaultAddressPool:` + fmt.Sprintf("%v", this.DefaultAddressPool) + `,`, - `SubnetSize:` + fmt.Sprintf("%v", this.SubnetSize) + `,`, - `VXLANUDPPort:` + fmt.Sprintf("%v", this.VXLANUDPPort) + `,`, - `}`, - }, "") - return s -} -func (this *Secret) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Secret{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "SecretSpec", "SecretSpec", 1), `&`, ``, 1) + `,`, - `Internal:` + fmt.Sprintf("%v", this.Internal) + `,`, - `}`, - }, "") - return s -} -func (this *Config) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Config{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "ConfigSpec", "ConfigSpec", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *Resource) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Resource{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `Payload:` + strings.Replace(fmt.Sprintf("%v", this.Payload), "Any", "types.Any", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Extension) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Extension{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `Description:` + fmt.Sprintf("%v", this.Description) + `,`, - `}`, - }, "") - return s -} -func (this *Volume) String() string { - if this == nil { - return "nil" - } - repeatedStringForPublishStatus := "[]*VolumePublishStatus{" - for _, f := range this.PublishStatus { - repeatedStringForPublishStatus += strings.Replace(fmt.Sprintf("%v", f), "VolumePublishStatus", "VolumePublishStatus", 1) + "," - } - repeatedStringForPublishStatus += "}" - s := strings.Join([]string{`&Volume{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "VolumeSpec", "VolumeSpec", 1), `&`, ``, 1) + `,`, - `PublishStatus:` + repeatedStringForPublishStatus + `,`, - `VolumeInfo:` + strings.Replace(fmt.Sprintf("%v", this.VolumeInfo), "VolumeInfo", "VolumeInfo", 1) + `,`, - `PendingDelete:` + fmt.Sprintf("%v", this.PendingDelete) + `,`, - `}`, - }, "") - return s -} -func valueToStringObjects(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Meta) Unmarshal(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 ErrIntOverflowObjects - } - 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: Meta: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Meta: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CreatedAt == nil { - m.CreatedAt = &types.Timestamp{} - } - if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.UpdatedAt == nil { - m.UpdatedAt = &types.Timestamp{} - } - if err := m.UpdatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipObjects(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Node) Unmarshal(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 ErrIntOverflowObjects - } - 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: Node: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Node: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Description == nil { - m.Description = &NodeDescription{} - } - if err := m.Description.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ManagerStatus", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ManagerStatus == nil { - m.ManagerStatus = &ManagerStatus{} - } - if err := m.ManagerStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attachment", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Attachment == nil { - m.Attachment = &NetworkAttachment{} - } - if err := m.Attachment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Certificate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Certificate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - m.Role = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Role |= NodeRole(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attachments", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Attachments = append(m.Attachments, &NetworkAttachment{}) - if err := m.Attachments[len(m.Attachments)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field VXLANUDPPort", wireType) - } - m.VXLANUDPPort = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.VXLANUDPPort |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipObjects(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Service) Unmarshal(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 ErrIntOverflowObjects - } - 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: Service: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Service: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Endpoint == nil { - m.Endpoint = &Endpoint{} - } - if err := m.Endpoint.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdateStatus", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.UpdateStatus == nil { - m.UpdateStatus = &UpdateStatus{} - } - if err := m.UpdateStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PreviousSpec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PreviousSpec == nil { - m.PreviousSpec = &ServiceSpec{} - } - if err := m.PreviousSpec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PendingDelete", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.PendingDelete = bool(v != 0) - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpecVersion", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SpecVersion == nil { - m.SpecVersion = &Version{} - } - if err := m.SpecVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PreviousSpecVersion", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PreviousSpecVersion == nil { - m.PreviousSpecVersion = &Version{} - } - if err := m.PreviousSpecVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field JobStatus", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.JobStatus == nil { - m.JobStatus = &JobStatus{} - } - if err := m.JobStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipObjects(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Endpoint) Unmarshal(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 ErrIntOverflowObjects - } - 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: Endpoint: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Endpoint: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Spec == nil { - m.Spec = &EndpointSpec{} - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Ports = append(m.Ports, &PortConfig{}) - if err := m.Ports[len(m.Ports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VirtualIPs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VirtualIPs = append(m.VirtualIPs, &Endpoint_VirtualIP{}) - if err := m.VirtualIPs[len(m.VirtualIPs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipObjects(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Endpoint_VirtualIP) Unmarshal(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 ErrIntOverflowObjects - } - 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: VirtualIP: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VirtualIP: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NetworkID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NetworkID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Addr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipObjects(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Task) Unmarshal(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 ErrIntOverflowObjects - } - 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: Task: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Task: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) - } - m.Slot = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Slot |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NodeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceAnnotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ServiceAnnotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredState", wireType) - } - m.DesiredState = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DesiredState |= TaskState(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Networks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Networks = append(m.Networks, &NetworkAttachment{}) - if err := m.Networks[len(m.Networks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Endpoint == nil { - m.Endpoint = &Endpoint{} - } - if err := m.Endpoint.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogDriver", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LogDriver == nil { - m.LogDriver = &Driver{} - } - if err := m.LogDriver.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpecVersion", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SpecVersion == nil { - m.SpecVersion = &Version{} - } - if err := m.SpecVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssignedGenericResources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssignedGenericResources = append(m.AssignedGenericResources, &GenericResource{}) - if err := m.AssignedGenericResources[len(m.AssignedGenericResources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field JobIteration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.JobIteration == nil { - m.JobIteration = &Version{} - } - if err := m.JobIteration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Volumes = append(m.Volumes, &VolumeAttachment{}) - if err := m.Volumes[len(m.Volumes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipObjects(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NetworkAttachment) Unmarshal(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 ErrIntOverflowObjects - } - 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: NetworkAttachment: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NetworkAttachment: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Network == nil { - m.Network = &Network{} - } - if err := m.Network.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Aliases = append(m.Aliases, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DriverAttachmentOpts", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DriverAttachmentOpts == nil { - m.DriverAttachmentOpts = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - 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 ErrIntOverflowObjects - } - 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 ErrInvalidLengthObjects - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthObjects - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthObjects - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthObjects - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipObjects(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.DriverAttachmentOpts[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipObjects(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Network) Unmarshal(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 ErrIntOverflowObjects - } - 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: Network: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Network: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DriverState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DriverState == nil { - m.DriverState = &Driver{} - } - if err := m.DriverState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IPAM", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.IPAM == nil { - m.IPAM = &IPAMOptions{} - } - if err := m.IPAM.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PendingDelete", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.PendingDelete = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipObjects(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Cluster) Unmarshal(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 ErrIntOverflowObjects - } - 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: Cluster: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Cluster: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RootCA", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.RootCA.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NetworkBootstrapKeys", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NetworkBootstrapKeys = append(m.NetworkBootstrapKeys, &EncryptionKey{}) - if err := m.NetworkBootstrapKeys[len(m.NetworkBootstrapKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EncryptionKeyLamportClock", wireType) - } - m.EncryptionKeyLamportClock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EncryptionKeyLamportClock |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlacklistedCertificates", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BlacklistedCertificates == nil { - m.BlacklistedCertificates = make(map[string]*BlacklistedCertificate) - } - var mapkey string - var mapvalue *BlacklistedCertificate - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - 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 ErrIntOverflowObjects - } - 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 ErrInvalidLengthObjects - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthObjects - } - 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 ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthObjects - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthObjects - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &BlacklistedCertificate{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipObjects(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.BlacklistedCertificates[mapkey] = mapvalue - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UnlockKeys", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.UnlockKeys = append(m.UnlockKeys, &EncryptionKey{}) - if err := m.UnlockKeys[len(m.UnlockKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FIPS", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.FIPS = bool(v != 0) - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultAddressPool", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DefaultAddressPool = append(m.DefaultAddressPool, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SubnetSize", wireType) - } - m.SubnetSize = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SubnetSize |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field VXLANUDPPort", wireType) - } - m.VXLANUDPPort = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.VXLANUDPPort |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipObjects(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Secret) Unmarshal(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 ErrIntOverflowObjects - } - 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: Secret: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Secret: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Internal", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Internal = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipObjects(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Config) Unmarshal(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 ErrIntOverflowObjects - } - 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: Config: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Config: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipObjects(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Resource) Unmarshal(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 ErrIntOverflowObjects - } - 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: Resource: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Resource: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Payload == nil { - m.Payload = &types.Any{} - } - if err := m.Payload.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipObjects(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Extension) Unmarshal(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 ErrIntOverflowObjects - } - 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: Extension: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Extension: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipObjects(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Volume) Unmarshal(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 ErrIntOverflowObjects - } - 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: Volume: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Volume: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Meta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublishStatus", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PublishStatus = append(m.PublishStatus, &VolumePublishStatus{}) - if err := m.PublishStatus[len(m.PublishStatus)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthObjects - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthObjects - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VolumeInfo == nil { - m.VolumeInfo = &VolumeInfo{} - } - if err := m.VolumeInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PendingDelete", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowObjects - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.PendingDelete = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipObjects(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipObjects(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowObjects - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowObjects - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowObjects - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthObjects - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupObjects - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthObjects - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthObjects = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowObjects = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupObjects = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/moby/swarmkit/v2/api/objects.proto b/vendor/github.com/moby/swarmkit/v2/api/objects.proto deleted file mode 100644 index f1a677d848..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/objects.proto +++ /dev/null @@ -1,556 +0,0 @@ -syntax = "proto3"; - -package docker.swarmkit.v1; - -import "github.com/docker/swarmkit/api/types.proto"; -import "github.com/docker/swarmkit/api/specs.proto"; -import "google/protobuf/timestamp.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "github.com/docker/swarmkit/protobuf/plugin/plugin.proto"; - -// This file contains definitions for all first-class objects in the cluster -// API. Such types typically have a corresponding specification, with the -// naming XXXSpec, but not all. - -// Meta contains metadata about objects. Every object contains a meta field. -message Meta { - // Version tracks the current version of the object. - Version version = 1 [(gogoproto.nullable) = false]; - - // Object timestamps. - // Note: can't use stdtime because these fields are nullable. - google.protobuf.Timestamp created_at = 2; - google.protobuf.Timestamp updated_at = 3; -} - -// Node provides the internal node state as seen by the cluster. -message Node { - option (docker.protobuf.plugin.store_object) = { - watch_selectors: { - id: true - id_prefix: true - name: true - name_prefix: true - custom: true - custom_prefix: true - role: true - membership: true - } - }; - - // ID specifies the identity of the node. - string id = 1; - - Meta meta = 2 [(gogoproto.nullable) = false]; - - // Spec defines the desired state of the node as specified by the user. - // The system will honor this and will *never* modify it. - NodeSpec spec = 3 [(gogoproto.nullable) = false]; - - // Description encapsulated the properties of the Node as reported by the - // agent. - NodeDescription description = 4; - - // Status provides the current status of the node, as seen by the manager. - NodeStatus status = 5 [(gogoproto.nullable) = false]; - - // ManagerStatus provides the current status of the node's manager - // component, if the node is a manager. - ManagerStatus manager_status = 6; - - // DEPRECATED: Use Attachments to find the ingress network - // The node attachment to the ingress network. - NetworkAttachment attachment = 7 [deprecated=true]; - - // Certificate is the TLS certificate issued for the node, if any. - Certificate certificate = 8 [(gogoproto.nullable) = false]; - - // Role is the *observed* role for this node. It differs from the - // desired role set in Node.Spec.Role because the role here is only - // updated after the Raft member list has been reconciled with the - // desired role from the spec. - // - // This field represents the current reconciled state. If an action is - // to be performed, first verify the role in the cert. This field only - // shows the privilege level that the CA would currently grant when - // issuing or renewing the node's certificate. - NodeRole role = 9; - - // Attachments enumerates the network attachments for the node to set up an - // endpoint on the node to be used for load balancing. Each overlay - // network, including ingress network, will have an NetworkAttachment. - repeated NetworkAttachment attachments = 10; - - // VXLANUDPPort specifies the UDP port for VXLAN traffic. - // This information is passed from cluster object to individual nodes. - uint32 VXLANUDPPort = 11; -} - -message Service { - option (docker.protobuf.plugin.store_object) = { - watch_selectors: { - id: true - id_prefix: true - name: true - name_prefix: true - custom: true - custom_prefix: true - } - }; - - string id = 1; - - Meta meta = 2 [(gogoproto.nullable) = false]; - - ServiceSpec spec = 3 [(gogoproto.nullable) = false]; - - // SpecVersion versions Spec, to identify changes in the spec. Note that - // this is not directly comparable to the service's Version. - Version spec_version = 10; - - // PreviousSpec is the previous service spec that was in place before - // "Spec". - ServiceSpec previous_spec = 6; - - // PreviousSpecVersion versions PreviousSpec. Note that this is not - // directly comparable to the service's Version. - Version previous_spec_version = 11; - - // Runtime state of service endpoint. This may be different - // from the spec version because the user may not have entered - // the optional fields like node_port or virtual_ip and it - // could be auto allocated by the system. - Endpoint endpoint = 4; - - // UpdateStatus contains the status of an update, if one is in - // progress. - UpdateStatus update_status = 5; - - // JobStatus contains the status of a Service that is in one of the Job - // modes. It is absent on Replicated and Global services. - JobStatus job_status = 12; - - // PendingDelete indicates that this service's deletion has been requested. - // Services, as well as all service-level resources, can only be deleted - // after all of the service's containers have properly shut down. - // When a user requests a deletion, we just flip this flag - // the deallocator will take it from there - it will start monitoring - // this service's tasks, and proceed to delete the service itself (and - // potentially its associated resources also marked for deletion) when - // all of its tasks are gone - bool pending_delete = 7; -} - -// Endpoint specified all the network parameters required to -// correctly discover and load balance a service -message Endpoint { - EndpointSpec spec = 1; - - // Runtime state of the exposed ports which may carry - // auto-allocated swarm ports in addition to the user - // configured information. - repeated PortConfig ports = 2; - - // An endpoint attachment specifies the data that the process - // of attaching an endpoint to a network creates. - - // VirtualIP specifies a set of networks this endpoint will be attached to - // and the IP addresses the target service will be made available under. - message VirtualIP { - // NetworkID for which this endpoint attachment was created. - string network_id = 1; - - // A virtual IP is used to address this service in IP - // layer that the client can use to send requests to - // this service. A DNS A/AAAA query on the service - // name might return this IP to the client. This is - // strictly a logical IP and there may not be any - // interfaces assigned this IP address or any route - // created for this address. More than one to - // accommodate for both IPv4 and IPv6 - string addr = 2; - } - - // VirtualIPs specifies the IP addresses under which this endpoint will be - // made available. - repeated VirtualIP virtual_ips = 3 [(gogoproto.customname) = "VirtualIPs"]; -} - -// Task specifies the parameters for implementing a Spec. A task is effectively -// immutable and idempotent. Once it is dispatched to a node, it will not be -// dispatched to another node. -message Task { - option (docker.protobuf.plugin.store_object) = { - watch_selectors: { - id: true - id_prefix: true - name: true - name_prefix: true - custom: true - custom_prefix: true - service_id: true - node_id: true - slot: true - desired_state: true - } - }; - - string id = 1; - - Meta meta = 2 [(gogoproto.nullable) = false]; - - // Spec defines the desired state of the task as specified by the user. - // The system will honor this and will *never* modify it. - TaskSpec spec = 3 [(gogoproto.nullable) = false]; - - // SpecVersion is copied from Service, to identify which version of the - // spec this task has. Note that this is not directly comparable to the - // service's Version. - Version spec_version = 14; - - // ServiceID indicates the service under which this task is orchestrated. This - // should almost always be set. - string service_id = 4; - - // Slot is the service slot number for a task. - // For example, if a replicated service has replicas = 2, there will be a - // task with slot = 1, and another with slot = 2. - uint64 slot = 5; - - // NodeID indicates the node to which the task is assigned. If this field - // is empty or not set, the task is unassigned. - string node_id = 6; - - // Annotations defines the names and labels for the runtime, as set by - // the cluster manager. - // - // As backup, if this field has an empty name, the runtime will - // allocate a unique name for the actual container. - // - // NOTE(stevvooe): The preserves the ability for us to making naming - // decisions for tasks in orchestrator, albeit, this is left empty for now. - Annotations annotations = 7 [(gogoproto.nullable) = false]; - - // ServiceAnnotations is a direct copy of the service name and labels when - // this task is created. - // - // Labels set here will *not* be propagated to the runtime target, such as a - // container. Use labels on the runtime target for that purpose. - Annotations service_annotations = 8 [(gogoproto.nullable) = false]; - - TaskStatus status = 9 [(gogoproto.nullable) = false]; - - // DesiredState is the target state for the task. It is set to - // TaskStateRunning when a task is first created, and changed to - // TaskStateShutdown if the manager wants to terminate the task. This field - // is only written by the manager. - TaskState desired_state = 10; - - // List of network attachments by the task. - repeated NetworkAttachment networks = 11; - - // A copy of runtime state of service endpoint from Service - // object to be distributed to agents as part of the task. - Endpoint endpoint = 12; - - // LogDriver specifies the selected log driver to use for the task. Agent - // processes should always favor the value in this field. - // - // If present in the TaskSpec, this will be a copy of that value. The - // orchestrator may choose to insert a value here, which should be honored, - // such a cluster default or policy-based value. - // - // If not present, the daemon's default will be used. - Driver log_driver = 13; - - repeated GenericResource assigned_generic_resources = 15; - - // JobIteration is the iteration number of the Job-mode Service that this - // task belongs to. - Version job_iteration = 16; - - // Volumes is a list of VolumeAttachments for this task. It specifies which - // volumes this task is allocated. - repeated VolumeAttachment volumes = 17; -} - -// NetworkAttachment specifies the network parameters of attachment to -// a single network by an object such as task or node. -message NetworkAttachment { - // Network state as a whole becomes part of the object so that - // it always is available for use in agents so that agents - // don't have any other dependency during execution. - Network network = 1; - - // List of IPv4/IPv6 addresses that are assigned to the object - // as part of getting attached to this network. - repeated string addresses = 2; - - // List of aliases by which a task is resolved in a network - repeated string aliases = 3; - - // Map of all the driver attachment options for this network - map driver_attachment_opts = 4; -} - -message Network { - option (docker.protobuf.plugin.store_object) = { - watch_selectors: { - id: true - id_prefix: true - name: true - name_prefix: true - custom: true - custom_prefix: true - } - }; - - string id = 1; - - Meta meta = 2 [(gogoproto.nullable) = false]; - - NetworkSpec spec = 3 [(gogoproto.nullable) = false]; - - // Driver specific operational state provided by the network driver. - Driver driver_state = 4; - - // Runtime state of IPAM options. This may not reflect the - // ipam options from NetworkSpec. - IPAMOptions ipam = 5 [(gogoproto.customname) = "IPAM"]; - - // PendingDelete indicates that this network's deletion has been requested. - // Services, as well as all service-level resources, can only be deleted - // after all the service's containers have properly shut down - // when a user requests a deletion, we just flip this flag - // the deallocator will take it from there - // PendingDelete indicates that this network's deletion has been requested. - // Services, as well as all service-level resources, can only be deleted - // after all of the service's containers have properly shut down. - // When a user requests a deletion of this network, we just flip this flag - // the deallocator will take it from there - it will start monitoring - // the services that still use this service, and proceed to delete - // this network when all of these services are gone - bool pending_delete = 6; -} - -// Cluster provides global cluster settings. -message Cluster { - option (docker.protobuf.plugin.store_object) = { - watch_selectors: { - id: true - id_prefix: true - name: true - name_prefix: true - custom: true - custom_prefix: true - } - }; - - string id = 1; - - Meta meta = 2 [(gogoproto.nullable) = false]; - - ClusterSpec spec = 3 [(gogoproto.nullable) = false]; - - // RootCA contains key material for the root CA. - RootCA root_ca = 4 [(gogoproto.nullable)=false, (gogoproto.customname) = "RootCA"]; - - // Symmetric encryption key distributed by the lead manager. Used by agents - // for securing network bootstrapping and communication. - repeated EncryptionKey network_bootstrap_keys = 5; - - // Logical clock used to timestamp every key. It allows other managers - // and agents to unambiguously identify the older key to be deleted when - // a new key is allocated on key rotation. - uint64 encryption_key_lamport_clock = 6; - - // BlacklistedCertificates tracks certificates that should no longer - // be honored. It's a mapping from CN -> BlacklistedCertificate. - // swarm. Their certificates should effectively be blacklisted. - map blacklisted_certificates = 8; - - // UnlockKeys defines the keys that lock node data at rest. For example, - // this would contain the key encrypting key (KEK) that will encrypt the - // manager TLS keys at rest and the raft encryption keys at rest. - // If the key is empty, the node will be unlocked (will not require a key - // to start up from a shut down state). - repeated EncryptionKey unlock_keys = 9; - - // FIPS specifies whether this cluster should be in FIPS mode. This changes - // the format of the join tokens, and nodes that are not FIPS-enabled should - // reject joining the cluster. Nodes that report themselves to be non-FIPS - // should be rejected from the cluster. - bool fips = 10 [(gogoproto.customname) = "FIPS"]; - - // This field specifies default subnet pools for global scope networks. If - // unspecified, Docker will use the predefined subnets as it works on older releases. - // Format Example : {"20.20.0.0/16",""20.20.0.0/16"} - repeated string defaultAddressPool = 11; - - // This flag specifies the default subnet size of global scope networks by giving - // the length of the subnet masks for every such network - uint32 subnetSize = 12; - - // VXLANUDPPort specifies the UDP port for VXLAN traffic. - uint32 VXLANUDPPort = 13; -} - -// Secret represents a secret that should be passed to a container or a node, -// and is immutable. -message Secret { - option (docker.protobuf.plugin.store_object) = { - watch_selectors: { - id: true - id_prefix: true - name: true - name_prefix: true - custom: true - custom_prefix: true - } - }; - - string id = 1; - - Meta meta = 2 [(gogoproto.nullable) = false]; - - // Spec contains the actual secret data, as well as any context around the - // secret data that the user provides. - SecretSpec spec = 3 [(gogoproto.nullable) = false]; - - // Whether the secret is an internal secret (not set by a user) or not. - bool internal = 4; -} - -// Config represents a set of configuration files that should be passed to a -// container. -message Config { - option (docker.protobuf.plugin.store_object) = { - watch_selectors: { - id: true - id_prefix: true - name: true - name_prefix: true - custom: true - custom_prefix: true - } - }; - - string id = 1; - - Meta meta = 2 [(gogoproto.nullable) = false]; - - // Spec contains the actual config data, as well as any context around the - // config data that the user provides. - ConfigSpec spec = 3 [(gogoproto.nullable) = false]; -} - -// Resource is a top-level object with externally defined content and indexing. -// SwarmKit can serve as a store for these objects without understanding their -// meanings. -message Resource { - option (docker.protobuf.plugin.store_object) = { - watch_selectors: { - id: true - id_prefix: true - name: true - name_prefix: true - custom: true - custom_prefix: true - kind: true - } - }; - - string id = 1 [(gogoproto.customname) = "ID"]; - - Meta meta = 2 [(gogoproto.nullable) = false]; - - Annotations annotations = 3 [(gogoproto.nullable) = false]; - - // Kind identifies this class of object. It is essentially a namespace - // to keep IDs or indices from colliding between unrelated Resource - // objects. This must correspond to the name of an Extension. - string kind = 4; - - // Payload bytes. This data is not interpreted in any way by SwarmKit. - // By convention, it should be a marshalled protocol buffers message. - google.protobuf.Any payload = 5; -} - -// Extension declares a type of "resource" object. This message provides some -// metadata about the objects. -message Extension { - option (docker.protobuf.plugin.store_object) = { - watch_selectors: { - id: true - id_prefix: true - name: true - name_prefix: true - custom: true - custom_prefix: true - } - }; - - string id = 1 [(gogoproto.customname) = "ID"]; - - Meta meta = 2 [(gogoproto.nullable) = false]; - - Annotations annotations = 3 [(gogoproto.nullable) = false]; - - string description = 4; - - // TODO(aaronl): Add optional indexing capabilities. It would be - // extremely useful be able to automatically introspect protobuf, json, - // etc. objects and automatically index them based on a schema and field - // paths defined here. - // - //oneof Schema { - // google.protobuf.Descriptor protobuf = 1; - // bytes json = 2; - //} - // - //Schema schema = 5; - // - // // Indices, with values expressed as Go templates. - //repeated IndexEntry index_templates = 6; -} - -// Volume is the top-level object describing a volume usable by Swarmkit. The -// Volume contains the user's VolumeSpec, the Volume's status, and the Volume -// object that was returned by the CSI Plugin when the volume was created. -message Volume { - option (docker.protobuf.plugin.store_object) = { - watch_selectors: { - id: true - id_prefix: true - name: true - name_prefix: true - custom: true - custom_prefix: true - } - }; - - // ID is the swarmkit-internal ID for this volume object. This has no - // relation to the CSI volume identifier provided by the CSI Plugin. - string id = 1; - Meta meta = 2 [(gogoproto.nullable) = false]; - - // Spec is the desired state of the Volume, as provided by the user. - VolumeSpec spec = 3 [(gogoproto.nullable) = false]; - - // PublishStatus is the status of the volume as it pertains to the various - // nodes it is in use on. - repeated VolumePublishStatus publish_status = 4; - - // VolumeInfo contains information about the volume originating from the - // CSI plugin when the volume is created. - VolumeInfo volume_info = 5; - - // PendingDelete indicates that this Volume is being removed from Swarm. - // Before a Volume can be removed, we must call the DeleteVolume on the - // Controller. Because of this, we cannot immediately remove the Volume - // when a user wishes to delete it. Instead, we will mark a Volume with - // PendingDelete = true, which instructs Swarm to go through the work of - // removing the volume and then delete it when finished. - bool pending_delete = 6; -} diff --git a/vendor/github.com/moby/swarmkit/v2/api/raft.pb.go b/vendor/github.com/moby/swarmkit/v2/api/raft.pb.go deleted file mode 100644 index 96fa855077..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/raft.pb.go +++ /dev/null @@ -1,4579 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/docker/swarmkit/api/raft.proto - -package api - -import ( - context "context" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - github_com_moby_swarmkit_v2_api_deepcopy "github.com/moby/swarmkit/v2/api/deepcopy" - raftselector "github.com/moby/swarmkit/v2/manager/raftselector" - raftpb "go.etcd.io/etcd/raft/v3/raftpb" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - metadata "google.golang.org/grpc/metadata" - peer "google.golang.org/grpc/peer" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" - rafttime "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// StoreActionKind defines the operation to take on the store for the target of -// a storage action. -type StoreActionKind int32 - -const ( - StoreActionKindUnknown StoreActionKind = 0 - StoreActionKindCreate StoreActionKind = 1 - StoreActionKindUpdate StoreActionKind = 2 - StoreActionKindRemove StoreActionKind = 3 -) - -var StoreActionKind_name = map[int32]string{ - 0: "UNKNOWN", - 1: "STORE_ACTION_CREATE", - 2: "STORE_ACTION_UPDATE", - 3: "STORE_ACTION_REMOVE", -} - -var StoreActionKind_value = map[string]int32{ - "UNKNOWN": 0, - "STORE_ACTION_CREATE": 1, - "STORE_ACTION_UPDATE": 2, - "STORE_ACTION_REMOVE": 3, -} - -func (x StoreActionKind) String() string { - return proto.EnumName(StoreActionKind_name, int32(x)) -} - -func (StoreActionKind) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d2c32e1e3c930c15, []int{0} -} - -type RaftMember struct { - // RaftID specifies the internal ID used by the manager in a raft context, it can never be modified - // and is used only for information purposes - RaftID uint64 `protobuf:"varint,1,opt,name=raft_id,json=raftId,proto3" json:"raft_id,omitempty"` - // NodeID is the node's ID. - NodeID string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // Addr specifies the address of the member - Addr string `protobuf:"bytes,3,opt,name=addr,proto3" json:"addr,omitempty"` - // Status provides the current status of the manager from the perspective of another manager. - Status RaftMemberStatus `protobuf:"bytes,4,opt,name=status,proto3" json:"status"` -} - -func (m *RaftMember) Reset() { *m = RaftMember{} } -func (*RaftMember) ProtoMessage() {} -func (*RaftMember) Descriptor() ([]byte, []int) { - return fileDescriptor_d2c32e1e3c930c15, []int{0} -} -func (m *RaftMember) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RaftMember) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RaftMember.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RaftMember) XXX_Merge(src proto.Message) { - xxx_messageInfo_RaftMember.Merge(m, src) -} -func (m *RaftMember) XXX_Size() int { - return m.Size() -} -func (m *RaftMember) XXX_DiscardUnknown() { - xxx_messageInfo_RaftMember.DiscardUnknown(m) -} - -var xxx_messageInfo_RaftMember proto.InternalMessageInfo - -type JoinRequest struct { - // Addr specifies the address of the member - Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` -} - -func (m *JoinRequest) Reset() { *m = JoinRequest{} } -func (*JoinRequest) ProtoMessage() {} -func (*JoinRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d2c32e1e3c930c15, []int{1} -} -func (m *JoinRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *JoinRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_JoinRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *JoinRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_JoinRequest.Merge(m, src) -} -func (m *JoinRequest) XXX_Size() int { - return m.Size() -} -func (m *JoinRequest) XXX_DiscardUnknown() { - xxx_messageInfo_JoinRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_JoinRequest proto.InternalMessageInfo - -type JoinResponse struct { - // RaftID is the ID assigned to the new member. - RaftID uint64 `protobuf:"varint,1,opt,name=raft_id,json=raftId,proto3" json:"raft_id,omitempty"` - // Members is the membership set of the cluster. - Members []*RaftMember `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` - // RemovedMembers is a list of members that have been removed from - // the cluster, so the new node can avoid communicating with them. - RemovedMembers []uint64 `protobuf:"varint,3,rep,name=removed_members,json=removedMembers,proto3" json:"removed_members,omitempty"` -} - -func (m *JoinResponse) Reset() { *m = JoinResponse{} } -func (*JoinResponse) ProtoMessage() {} -func (*JoinResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d2c32e1e3c930c15, []int{2} -} -func (m *JoinResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *JoinResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_JoinResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *JoinResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_JoinResponse.Merge(m, src) -} -func (m *JoinResponse) XXX_Size() int { - return m.Size() -} -func (m *JoinResponse) XXX_DiscardUnknown() { - xxx_messageInfo_JoinResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_JoinResponse proto.InternalMessageInfo - -type LeaveRequest struct { - Node *RaftMember `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` -} - -func (m *LeaveRequest) Reset() { *m = LeaveRequest{} } -func (*LeaveRequest) ProtoMessage() {} -func (*LeaveRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d2c32e1e3c930c15, []int{3} -} -func (m *LeaveRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LeaveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LeaveRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LeaveRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaveRequest.Merge(m, src) -} -func (m *LeaveRequest) XXX_Size() int { - return m.Size() -} -func (m *LeaveRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LeaveRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaveRequest proto.InternalMessageInfo - -type LeaveResponse struct { -} - -func (m *LeaveResponse) Reset() { *m = LeaveResponse{} } -func (*LeaveResponse) ProtoMessage() {} -func (*LeaveResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d2c32e1e3c930c15, []int{4} -} -func (m *LeaveResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LeaveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LeaveResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LeaveResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaveResponse.Merge(m, src) -} -func (m *LeaveResponse) XXX_Size() int { - return m.Size() -} -func (m *LeaveResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LeaveResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaveResponse proto.InternalMessageInfo - -type ProcessRaftMessageRequest struct { - Message *raftpb.Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` -} - -func (m *ProcessRaftMessageRequest) Reset() { *m = ProcessRaftMessageRequest{} } -func (*ProcessRaftMessageRequest) ProtoMessage() {} -func (*ProcessRaftMessageRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d2c32e1e3c930c15, []int{5} -} -func (m *ProcessRaftMessageRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProcessRaftMessageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProcessRaftMessageRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ProcessRaftMessageRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProcessRaftMessageRequest.Merge(m, src) -} -func (m *ProcessRaftMessageRequest) XXX_Size() int { - return m.Size() -} -func (m *ProcessRaftMessageRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ProcessRaftMessageRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ProcessRaftMessageRequest proto.InternalMessageInfo - -type ProcessRaftMessageResponse struct { -} - -func (m *ProcessRaftMessageResponse) Reset() { *m = ProcessRaftMessageResponse{} } -func (*ProcessRaftMessageResponse) ProtoMessage() {} -func (*ProcessRaftMessageResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d2c32e1e3c930c15, []int{6} -} -func (m *ProcessRaftMessageResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProcessRaftMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProcessRaftMessageResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ProcessRaftMessageResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProcessRaftMessageResponse.Merge(m, src) -} -func (m *ProcessRaftMessageResponse) XXX_Size() int { - return m.Size() -} -func (m *ProcessRaftMessageResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ProcessRaftMessageResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ProcessRaftMessageResponse proto.InternalMessageInfo - -// Raft message streaming request. -type StreamRaftMessageRequest struct { - Message *raftpb.Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` -} - -func (m *StreamRaftMessageRequest) Reset() { *m = StreamRaftMessageRequest{} } -func (*StreamRaftMessageRequest) ProtoMessage() {} -func (*StreamRaftMessageRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d2c32e1e3c930c15, []int{7} -} -func (m *StreamRaftMessageRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StreamRaftMessageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StreamRaftMessageRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StreamRaftMessageRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StreamRaftMessageRequest.Merge(m, src) -} -func (m *StreamRaftMessageRequest) XXX_Size() int { - return m.Size() -} -func (m *StreamRaftMessageRequest) XXX_DiscardUnknown() { - xxx_messageInfo_StreamRaftMessageRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_StreamRaftMessageRequest proto.InternalMessageInfo - -// Raft message streaming response. -type StreamRaftMessageResponse struct { -} - -func (m *StreamRaftMessageResponse) Reset() { *m = StreamRaftMessageResponse{} } -func (*StreamRaftMessageResponse) ProtoMessage() {} -func (*StreamRaftMessageResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d2c32e1e3c930c15, []int{8} -} -func (m *StreamRaftMessageResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StreamRaftMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StreamRaftMessageResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StreamRaftMessageResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StreamRaftMessageResponse.Merge(m, src) -} -func (m *StreamRaftMessageResponse) XXX_Size() int { - return m.Size() -} -func (m *StreamRaftMessageResponse) XXX_DiscardUnknown() { - xxx_messageInfo_StreamRaftMessageResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_StreamRaftMessageResponse proto.InternalMessageInfo - -type ResolveAddressRequest struct { - // raft_id is the ID to resolve to an address. - RaftID uint64 `protobuf:"varint,1,opt,name=raft_id,json=raftId,proto3" json:"raft_id,omitempty"` -} - -func (m *ResolveAddressRequest) Reset() { *m = ResolveAddressRequest{} } -func (*ResolveAddressRequest) ProtoMessage() {} -func (*ResolveAddressRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d2c32e1e3c930c15, []int{9} -} -func (m *ResolveAddressRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResolveAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResolveAddressRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ResolveAddressRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResolveAddressRequest.Merge(m, src) -} -func (m *ResolveAddressRequest) XXX_Size() int { - return m.Size() -} -func (m *ResolveAddressRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ResolveAddressRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ResolveAddressRequest proto.InternalMessageInfo - -type ResolveAddressResponse struct { - // Addr specifies the address of the member - Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` -} - -func (m *ResolveAddressResponse) Reset() { *m = ResolveAddressResponse{} } -func (*ResolveAddressResponse) ProtoMessage() {} -func (*ResolveAddressResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d2c32e1e3c930c15, []int{10} -} -func (m *ResolveAddressResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResolveAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResolveAddressResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ResolveAddressResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResolveAddressResponse.Merge(m, src) -} -func (m *ResolveAddressResponse) XXX_Size() int { - return m.Size() -} -func (m *ResolveAddressResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ResolveAddressResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ResolveAddressResponse proto.InternalMessageInfo - -// Contains one of many protobuf encoded objects to replicate -// over the raft backend with a request ID to track when the -// action is effectively applied -type InternalRaftRequest struct { - ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Action []StoreAction `protobuf:"bytes,2,rep,name=action,proto3" json:"action"` -} - -func (m *InternalRaftRequest) Reset() { *m = InternalRaftRequest{} } -func (*InternalRaftRequest) ProtoMessage() {} -func (*InternalRaftRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d2c32e1e3c930c15, []int{11} -} -func (m *InternalRaftRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InternalRaftRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InternalRaftRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *InternalRaftRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_InternalRaftRequest.Merge(m, src) -} -func (m *InternalRaftRequest) XXX_Size() int { - return m.Size() -} -func (m *InternalRaftRequest) XXX_DiscardUnknown() { - xxx_messageInfo_InternalRaftRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_InternalRaftRequest proto.InternalMessageInfo - -// StoreAction defines a target and operation to apply on the storage system. -type StoreAction struct { - Action StoreActionKind `protobuf:"varint,1,opt,name=action,proto3,enum=docker.swarmkit.v1.StoreActionKind" json:"action,omitempty"` - // Types that are valid to be assigned to Target: - // *StoreAction_Node - // *StoreAction_Service - // *StoreAction_Task - // *StoreAction_Network - // *StoreAction_Cluster - // *StoreAction_Secret - // *StoreAction_Resource - // *StoreAction_Extension - // *StoreAction_Config - // *StoreAction_Volume - Target isStoreAction_Target `protobuf_oneof:"target"` -} - -func (m *StoreAction) Reset() { *m = StoreAction{} } -func (*StoreAction) ProtoMessage() {} -func (*StoreAction) Descriptor() ([]byte, []int) { - return fileDescriptor_d2c32e1e3c930c15, []int{12} -} -func (m *StoreAction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StoreAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StoreAction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StoreAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_StoreAction.Merge(m, src) -} -func (m *StoreAction) XXX_Size() int { - return m.Size() -} -func (m *StoreAction) XXX_DiscardUnknown() { - xxx_messageInfo_StoreAction.DiscardUnknown(m) -} - -var xxx_messageInfo_StoreAction proto.InternalMessageInfo - -type isStoreAction_Target interface { - isStoreAction_Target() - MarshalTo([]byte) (int, error) - Size() int -} - -type StoreAction_Node struct { - Node *Node `protobuf:"bytes,2,opt,name=node,proto3,oneof" json:"node,omitempty"` -} -type StoreAction_Service struct { - Service *Service `protobuf:"bytes,3,opt,name=service,proto3,oneof" json:"service,omitempty"` -} -type StoreAction_Task struct { - Task *Task `protobuf:"bytes,4,opt,name=task,proto3,oneof" json:"task,omitempty"` -} -type StoreAction_Network struct { - Network *Network `protobuf:"bytes,5,opt,name=network,proto3,oneof" json:"network,omitempty"` -} -type StoreAction_Cluster struct { - Cluster *Cluster `protobuf:"bytes,6,opt,name=cluster,proto3,oneof" json:"cluster,omitempty"` -} -type StoreAction_Secret struct { - Secret *Secret `protobuf:"bytes,7,opt,name=secret,proto3,oneof" json:"secret,omitempty"` -} -type StoreAction_Resource struct { - Resource *Resource `protobuf:"bytes,8,opt,name=resource,proto3,oneof" json:"resource,omitempty"` -} -type StoreAction_Extension struct { - Extension *Extension `protobuf:"bytes,9,opt,name=extension,proto3,oneof" json:"extension,omitempty"` -} -type StoreAction_Config struct { - Config *Config `protobuf:"bytes,10,opt,name=config,proto3,oneof" json:"config,omitempty"` -} -type StoreAction_Volume struct { - Volume *Volume `protobuf:"bytes,11,opt,name=volume,proto3,oneof" json:"volume,omitempty"` -} - -func (*StoreAction_Node) isStoreAction_Target() {} -func (*StoreAction_Service) isStoreAction_Target() {} -func (*StoreAction_Task) isStoreAction_Target() {} -func (*StoreAction_Network) isStoreAction_Target() {} -func (*StoreAction_Cluster) isStoreAction_Target() {} -func (*StoreAction_Secret) isStoreAction_Target() {} -func (*StoreAction_Resource) isStoreAction_Target() {} -func (*StoreAction_Extension) isStoreAction_Target() {} -func (*StoreAction_Config) isStoreAction_Target() {} -func (*StoreAction_Volume) isStoreAction_Target() {} - -func (m *StoreAction) GetTarget() isStoreAction_Target { - if m != nil { - return m.Target - } - return nil -} - -func (m *StoreAction) GetNode() *Node { - if x, ok := m.GetTarget().(*StoreAction_Node); ok { - return x.Node - } - return nil -} - -func (m *StoreAction) GetService() *Service { - if x, ok := m.GetTarget().(*StoreAction_Service); ok { - return x.Service - } - return nil -} - -func (m *StoreAction) GetTask() *Task { - if x, ok := m.GetTarget().(*StoreAction_Task); ok { - return x.Task - } - return nil -} - -func (m *StoreAction) GetNetwork() *Network { - if x, ok := m.GetTarget().(*StoreAction_Network); ok { - return x.Network - } - return nil -} - -func (m *StoreAction) GetCluster() *Cluster { - if x, ok := m.GetTarget().(*StoreAction_Cluster); ok { - return x.Cluster - } - return nil -} - -func (m *StoreAction) GetSecret() *Secret { - if x, ok := m.GetTarget().(*StoreAction_Secret); ok { - return x.Secret - } - return nil -} - -func (m *StoreAction) GetResource() *Resource { - if x, ok := m.GetTarget().(*StoreAction_Resource); ok { - return x.Resource - } - return nil -} - -func (m *StoreAction) GetExtension() *Extension { - if x, ok := m.GetTarget().(*StoreAction_Extension); ok { - return x.Extension - } - return nil -} - -func (m *StoreAction) GetConfig() *Config { - if x, ok := m.GetTarget().(*StoreAction_Config); ok { - return x.Config - } - return nil -} - -func (m *StoreAction) GetVolume() *Volume { - if x, ok := m.GetTarget().(*StoreAction_Volume); ok { - return x.Volume - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*StoreAction) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*StoreAction_Node)(nil), - (*StoreAction_Service)(nil), - (*StoreAction_Task)(nil), - (*StoreAction_Network)(nil), - (*StoreAction_Cluster)(nil), - (*StoreAction_Secret)(nil), - (*StoreAction_Resource)(nil), - (*StoreAction_Extension)(nil), - (*StoreAction_Config)(nil), - (*StoreAction_Volume)(nil), - } -} - -func init() { - proto.RegisterEnum("docker.swarmkit.v1.StoreActionKind", StoreActionKind_name, StoreActionKind_value) - proto.RegisterType((*RaftMember)(nil), "docker.swarmkit.v1.RaftMember") - proto.RegisterType((*JoinRequest)(nil), "docker.swarmkit.v1.JoinRequest") - proto.RegisterType((*JoinResponse)(nil), "docker.swarmkit.v1.JoinResponse") - proto.RegisterType((*LeaveRequest)(nil), "docker.swarmkit.v1.LeaveRequest") - proto.RegisterType((*LeaveResponse)(nil), "docker.swarmkit.v1.LeaveResponse") - proto.RegisterType((*ProcessRaftMessageRequest)(nil), "docker.swarmkit.v1.ProcessRaftMessageRequest") - proto.RegisterType((*ProcessRaftMessageResponse)(nil), "docker.swarmkit.v1.ProcessRaftMessageResponse") - proto.RegisterType((*StreamRaftMessageRequest)(nil), "docker.swarmkit.v1.StreamRaftMessageRequest") - proto.RegisterType((*StreamRaftMessageResponse)(nil), "docker.swarmkit.v1.StreamRaftMessageResponse") - proto.RegisterType((*ResolveAddressRequest)(nil), "docker.swarmkit.v1.ResolveAddressRequest") - proto.RegisterType((*ResolveAddressResponse)(nil), "docker.swarmkit.v1.ResolveAddressResponse") - proto.RegisterType((*InternalRaftRequest)(nil), "docker.swarmkit.v1.InternalRaftRequest") - proto.RegisterType((*StoreAction)(nil), "docker.swarmkit.v1.StoreAction") -} - -func init() { - proto.RegisterFile("github.com/docker/swarmkit/api/raft.proto", fileDescriptor_d2c32e1e3c930c15) -} - -var fileDescriptor_d2c32e1e3c930c15 = []byte{ - // 1046 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x41, 0x73, 0xdb, 0x44, - 0x14, 0xc7, 0x25, 0x5b, 0x75, 0x92, 0xe7, 0x36, 0x09, 0x5b, 0x12, 0x14, 0xb5, 0x28, 0xae, 0xdb, - 0x19, 0x9c, 0x90, 0xc8, 0x83, 0xcb, 0x4c, 0x99, 0x42, 0x0f, 0x71, 0xe2, 0x99, 0x98, 0xb4, 0x4e, - 0x47, 0x49, 0x4a, 0x6f, 0x41, 0x96, 0x36, 0xae, 0xb0, 0xad, 0x35, 0xbb, 0x6b, 0x07, 0x2e, 0x4c, - 0x8f, 0x90, 0x13, 0x37, 0x18, 0x66, 0x3a, 0x1c, 0xe0, 0xdc, 0x0f, 0xc0, 0x27, 0xc8, 0x70, 0xea, - 0x8d, 0x9e, 0x32, 0xd4, 0xb9, 0xc3, 0x17, 0xe0, 0xc0, 0xec, 0x4a, 0x4a, 0x42, 0x22, 0x3b, 0x3e, - 0x70, 0xd2, 0x8e, 0xf7, 0xf7, 0x7f, 0xff, 0xb7, 0xbb, 0x6f, 0xdf, 0x1a, 0x16, 0x1a, 0x3e, 0x7f, - 0xd6, 0xad, 0x5b, 0x2e, 0x69, 0x17, 0x3d, 0xe2, 0x36, 0x31, 0x2d, 0xb2, 0x7d, 0x87, 0xb6, 0x9b, - 0x3e, 0x2f, 0x3a, 0x1d, 0xbf, 0x48, 0x9d, 0x3d, 0x6e, 0x75, 0x28, 0xe1, 0x04, 0xa1, 0x70, 0xde, - 0x8a, 0xe7, 0xad, 0xde, 0x07, 0xc6, 0xd2, 0x25, 0x72, 0x52, 0xff, 0x02, 0xbb, 0x9c, 0x85, 0x11, - 0x8c, 0xc5, 0x4b, 0x68, 0xfe, 0x75, 0x07, 0xc7, 0xec, 0x42, 0x83, 0x58, 0x98, 0xbb, 0x9e, 0xe5, - 0x93, 0xa2, 0xf8, 0xca, 0x4c, 0x8a, 0xbd, 0xbb, 0xf2, 0xdb, 0xa9, 0x9f, 0x49, 0xcc, 0x78, 0xbb, - 0x41, 0x1a, 0x44, 0x0e, 0x8b, 0x62, 0x14, 0xfd, 0x7a, 0x6f, 0x88, 0x99, 0x24, 0xea, 0xdd, 0xbd, - 0x62, 0xa7, 0xd5, 0x6d, 0xf8, 0x41, 0xf4, 0x09, 0x85, 0xf9, 0x97, 0x2a, 0x80, 0xed, 0xec, 0xf1, - 0x47, 0xb8, 0x5d, 0xc7, 0x14, 0xdd, 0x86, 0x31, 0xe1, 0xb5, 0xeb, 0x7b, 0xba, 0x9a, 0x53, 0x0b, - 0x5a, 0x19, 0xfa, 0x47, 0xf3, 0x19, 0x01, 0x54, 0xd7, 0xec, 0x8c, 0x98, 0xaa, 0x7a, 0x02, 0x0a, - 0x88, 0x87, 0x05, 0x94, 0xca, 0xa9, 0x85, 0x89, 0x10, 0xaa, 0x11, 0x0f, 0x0b, 0x48, 0x4c, 0x55, - 0x3d, 0x84, 0x40, 0x73, 0x3c, 0x8f, 0xea, 0x69, 0x41, 0xd8, 0x72, 0x8c, 0xca, 0x90, 0x61, 0xdc, - 0xe1, 0x5d, 0xa6, 0x6b, 0x39, 0xb5, 0x90, 0x2d, 0xdd, 0xb1, 0x2e, 0xee, 0xb2, 0x75, 0x9a, 0xcd, - 0x96, 0x64, 0xcb, 0xda, 0xe1, 0xd1, 0xbc, 0x62, 0x47, 0xca, 0xfc, 0x2d, 0xc8, 0x7e, 0x4a, 0xfc, - 0xc0, 0xc6, 0x5f, 0x76, 0x31, 0xe3, 0x27, 0x36, 0xea, 0xa9, 0x4d, 0xfe, 0x27, 0x15, 0xae, 0x86, - 0x0c, 0xeb, 0x90, 0x80, 0xe1, 0xd1, 0x56, 0xf5, 0x11, 0x8c, 0xb5, 0xa5, 0x2d, 0xd3, 0x53, 0xb9, - 0x74, 0x21, 0x5b, 0x32, 0x87, 0x67, 0x67, 0xc7, 0x38, 0x7a, 0x1f, 0xa6, 0x28, 0x6e, 0x93, 0x1e, - 0xf6, 0x76, 0xe3, 0x08, 0xe9, 0x5c, 0xba, 0xa0, 0x95, 0x53, 0xd3, 0x8a, 0x3d, 0x19, 0x4d, 0x85, - 0x22, 0x96, 0x2f, 0xc3, 0xd5, 0x87, 0xd8, 0xe9, 0xe1, 0x78, 0x01, 0x25, 0xd0, 0xc4, 0x8e, 0xc9, - 0xc4, 0x2e, 0xf7, 0x94, 0x6c, 0x7e, 0x0a, 0xae, 0x45, 0x31, 0xc2, 0x05, 0xe6, 0x1f, 0xc2, 0xdc, - 0x63, 0x4a, 0x5c, 0xcc, 0x58, 0xc8, 0x32, 0xe6, 0x34, 0x4e, 0x1c, 0x16, 0xc4, 0xc2, 0xe4, 0x2f, - 0x91, 0xc9, 0x94, 0x15, 0x96, 0x95, 0x15, 0x83, 0xf1, 0xfc, 0x7d, 0xed, 0xf9, 0x0f, 0x79, 0x25, - 0x7f, 0x13, 0x8c, 0xa4, 0x68, 0x91, 0xd7, 0x06, 0xe8, 0x5b, 0x9c, 0x62, 0xa7, 0xfd, 0x7f, 0x58, - 0xdd, 0x80, 0xb9, 0x84, 0x60, 0x91, 0xd3, 0x27, 0x30, 0x63, 0x63, 0x46, 0x5a, 0x3d, 0xbc, 0xe2, - 0x79, 0x54, 0xa4, 0x13, 0xd9, 0x8c, 0x72, 0x9e, 0xf9, 0x25, 0x98, 0x3d, 0xaf, 0x8e, 0xca, 0x21, - 0xa9, 0x66, 0x5a, 0x70, 0xbd, 0x1a, 0x70, 0x4c, 0x03, 0xa7, 0x25, 0xe2, 0xc4, 0x4e, 0xb3, 0x90, - 0x3a, 0x31, 0xc9, 0xf4, 0x8f, 0xe6, 0x53, 0xd5, 0x35, 0x3b, 0xe5, 0x7b, 0xe8, 0x01, 0x64, 0x1c, - 0x97, 0xfb, 0x24, 0x88, 0x6a, 0x65, 0x3e, 0xe9, 0xdc, 0xb6, 0x38, 0xa1, 0x78, 0x45, 0x62, 0x71, - 0x11, 0x87, 0xa2, 0xfc, 0x3f, 0x1a, 0x64, 0xcf, 0xcc, 0xa2, 0x8f, 0x4f, 0xc2, 0x09, 0xab, 0xc9, - 0xd2, 0xed, 0x4b, 0xc2, 0x6d, 0xf8, 0x81, 0x17, 0x07, 0x43, 0x56, 0x54, 0x41, 0x29, 0xb9, 0xe3, - 0x7a, 0x92, 0x54, 0xdc, 0xcd, 0x75, 0x25, 0xac, 0x1e, 0x74, 0x0f, 0xc6, 0x18, 0xa6, 0x3d, 0xdf, - 0xc5, 0xf2, 0x72, 0x66, 0x4b, 0x37, 0x12, 0xdd, 0x42, 0x64, 0x5d, 0xb1, 0x63, 0x5a, 0x18, 0x71, - 0x87, 0x35, 0xa3, 0xcb, 0x9b, 0x68, 0xb4, 0xed, 0xb0, 0xa6, 0x30, 0x12, 0x9c, 0x30, 0x0a, 0x30, - 0xdf, 0x27, 0xb4, 0xa9, 0x5f, 0x19, 0x6c, 0x54, 0x0b, 0x11, 0x61, 0x14, 0xd1, 0x42, 0xe8, 0xb6, - 0xba, 0x8c, 0x63, 0xaa, 0x67, 0x06, 0x0b, 0x57, 0x43, 0x44, 0x08, 0x23, 0x1a, 0x7d, 0x08, 0x19, - 0x86, 0x5d, 0x8a, 0xb9, 0x3e, 0x26, 0x75, 0x46, 0xf2, 0xca, 0x04, 0xb1, 0x2e, 0x5a, 0x8a, 0x1c, - 0xa1, 0xfb, 0x30, 0x4e, 0x31, 0x23, 0x5d, 0xea, 0x62, 0x7d, 0x5c, 0xea, 0x6e, 0x26, 0x5e, 0xc3, - 0x88, 0x59, 0x57, 0xec, 0x13, 0x1e, 0x3d, 0x80, 0x09, 0xfc, 0x15, 0xc7, 0x01, 0x13, 0x87, 0x37, - 0x21, 0xc5, 0xef, 0x26, 0x89, 0x2b, 0x31, 0xb4, 0xae, 0xd8, 0xa7, 0x0a, 0x91, 0xb0, 0x4b, 0x82, - 0x3d, 0xbf, 0xa1, 0xc3, 0xe0, 0x84, 0x57, 0x25, 0x21, 0x12, 0x0e, 0x59, 0xa1, 0xea, 0x91, 0x56, - 0xb7, 0x8d, 0xf5, 0xec, 0x60, 0xd5, 0x13, 0x49, 0x08, 0x55, 0xc8, 0x96, 0xc7, 0x21, 0xc3, 0x1d, - 0xda, 0xc0, 0x7c, 0xf1, 0x6f, 0x15, 0xa6, 0xce, 0x55, 0x13, 0x7a, 0x0f, 0xc6, 0x76, 0x6a, 0x1b, - 0xb5, 0xcd, 0xcf, 0x6a, 0xd3, 0x8a, 0x61, 0x1c, 0xbc, 0xc8, 0xcd, 0x9e, 0x23, 0x76, 0x82, 0x66, - 0x40, 0xf6, 0x03, 0x54, 0x82, 0xeb, 0x5b, 0xdb, 0x9b, 0x76, 0x65, 0x77, 0x65, 0x75, 0xbb, 0xba, - 0x59, 0xdb, 0x5d, 0xb5, 0x2b, 0x2b, 0xdb, 0x95, 0x69, 0xd5, 0x98, 0x3b, 0x78, 0x91, 0x9b, 0x39, - 0x27, 0x5a, 0xa5, 0xd8, 0xe1, 0xf8, 0x82, 0x66, 0xe7, 0xf1, 0x9a, 0xd0, 0xa4, 0x12, 0x35, 0x3b, - 0x1d, 0x2f, 0x49, 0x63, 0x57, 0x1e, 0x6d, 0x3e, 0xa9, 0x4c, 0xa7, 0x13, 0x35, 0xb6, 0x6c, 0xb2, - 0xc6, 0x3b, 0xdf, 0xfe, 0x62, 0x2a, 0xbf, 0xfd, 0x6a, 0x9e, 0x5f, 0x5d, 0xe9, 0xe7, 0x34, 0x68, - 0xe2, 0x5e, 0xa3, 0x03, 0x15, 0xd0, 0xc5, 0xe6, 0x86, 0x96, 0x93, 0x76, 0x70, 0x60, 0x4b, 0x35, - 0xac, 0x51, 0xf1, 0xa8, 0x93, 0xcd, 0xfc, 0xfe, 0xf2, 0xaf, 0x1f, 0x53, 0x53, 0x70, 0x4d, 0xf2, - 0xcb, 0x6d, 0x27, 0x70, 0x1a, 0x98, 0xa2, 0xef, 0x54, 0x78, 0xeb, 0x42, 0xfb, 0x43, 0x4b, 0xc9, - 0x97, 0x3f, 0xb9, 0xe5, 0x1a, 0xcb, 0x23, 0xd2, 0x43, 0x33, 0x29, 0xa8, 0xe8, 0x1b, 0x98, 0xfc, - 0x6f, 0xbb, 0x44, 0x0b, 0x83, 0x2e, 0xc1, 0x85, 0x86, 0x6c, 0x2c, 0x8e, 0x82, 0x0e, 0xcd, 0xa0, - 0xf4, 0x87, 0x0a, 0x93, 0xa7, 0x0f, 0x1d, 0x7b, 0xe6, 0x77, 0xd0, 0xe7, 0xa0, 0x89, 0x67, 0x1c, - 0x25, 0x36, 0xd7, 0x33, 0x7f, 0x02, 0x8c, 0xdc, 0x60, 0x60, 0xf8, 0x01, 0xb8, 0x70, 0x45, 0x3e, - 0xa4, 0x28, 0x31, 0xc2, 0xd9, 0x77, 0xda, 0xb8, 0x35, 0x84, 0x18, 0x6a, 0x52, 0xbe, 0x73, 0xf8, - 0xc6, 0x54, 0x5e, 0xbf, 0x31, 0x95, 0xe7, 0x7d, 0x53, 0x3d, 0xec, 0x9b, 0xea, 0xab, 0xbe, 0xa9, - 0xfe, 0xd9, 0x37, 0xd5, 0xef, 0x8f, 0x4d, 0xe5, 0xd5, 0xb1, 0xa9, 0xbc, 0x3e, 0x36, 0x95, 0xa7, - 0xe9, 0xa7, 0x5a, 0x3d, 0x23, 0xff, 0x93, 0xdd, 0xfd, 0x37, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x56, - 0x23, 0xf6, 0xa8, 0x0a, 0x00, 0x00, -} - -type authenticatedWrapperRaftServer struct { - local RaftServer - authorize func(context.Context, []string) error -} - -func NewAuthenticatedWrapperRaftServer(local RaftServer, authorize func(context.Context, []string) error) RaftServer { - return &authenticatedWrapperRaftServer{ - local: local, - authorize: authorize, - } -} - -func (p *authenticatedWrapperRaftServer) ProcessRaftMessage(ctx context.Context, r *ProcessRaftMessageRequest) (*ProcessRaftMessageResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.ProcessRaftMessage(ctx, r) -} - -func (p *authenticatedWrapperRaftServer) StreamRaftMessage(stream Raft_StreamRaftMessageServer) error { - - if err := p.authorize(stream.Context(), []string{"swarm-manager"}); err != nil { - return err - } - return p.local.StreamRaftMessage(stream) -} - -func (p *authenticatedWrapperRaftServer) ResolveAddress(ctx context.Context, r *ResolveAddressRequest) (*ResolveAddressResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.ResolveAddress(ctx, r) -} - -type authenticatedWrapperRaftMembershipServer struct { - local RaftMembershipServer - authorize func(context.Context, []string) error -} - -func NewAuthenticatedWrapperRaftMembershipServer(local RaftMembershipServer, authorize func(context.Context, []string) error) RaftMembershipServer { - return &authenticatedWrapperRaftMembershipServer{ - local: local, - authorize: authorize, - } -} - -func (p *authenticatedWrapperRaftMembershipServer) Join(ctx context.Context, r *JoinRequest) (*JoinResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.Join(ctx, r) -} - -func (p *authenticatedWrapperRaftMembershipServer) Leave(ctx context.Context, r *LeaveRequest) (*LeaveResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { - return nil, err - } - return p.local.Leave(ctx, r) -} - -func (m *RaftMember) Copy() *RaftMember { - if m == nil { - return nil - } - o := &RaftMember{} - o.CopyFrom(m) - return o -} - -func (m *RaftMember) CopyFrom(src interface{}) { - - o := src.(*RaftMember) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Status, &o.Status) -} - -func (m *JoinRequest) Copy() *JoinRequest { - if m == nil { - return nil - } - o := &JoinRequest{} - o.CopyFrom(m) - return o -} - -func (m *JoinRequest) CopyFrom(src interface{}) { - - o := src.(*JoinRequest) - *m = *o -} - -func (m *JoinResponse) Copy() *JoinResponse { - if m == nil { - return nil - } - o := &JoinResponse{} - o.CopyFrom(m) - return o -} - -func (m *JoinResponse) CopyFrom(src interface{}) { - - o := src.(*JoinResponse) - *m = *o - if o.Members != nil { - m.Members = make([]*RaftMember, len(o.Members)) - for i := range m.Members { - m.Members[i] = &RaftMember{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Members[i], o.Members[i]) - } - } - - if o.RemovedMembers != nil { - m.RemovedMembers = make([]uint64, len(o.RemovedMembers)) - copy(m.RemovedMembers, o.RemovedMembers) - } - -} - -func (m *LeaveRequest) Copy() *LeaveRequest { - if m == nil { - return nil - } - o := &LeaveRequest{} - o.CopyFrom(m) - return o -} - -func (m *LeaveRequest) CopyFrom(src interface{}) { - - o := src.(*LeaveRequest) - *m = *o - if o.Node != nil { - m.Node = &RaftMember{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Node, o.Node) - } -} - -func (m *LeaveResponse) Copy() *LeaveResponse { - if m == nil { - return nil - } - o := &LeaveResponse{} - o.CopyFrom(m) - return o -} - -func (m *LeaveResponse) CopyFrom(src interface{}) {} -func (m *ProcessRaftMessageResponse) Copy() *ProcessRaftMessageResponse { - if m == nil { - return nil - } - o := &ProcessRaftMessageResponse{} - o.CopyFrom(m) - return o -} - -func (m *ProcessRaftMessageResponse) CopyFrom(src interface{}) {} -func (m *StreamRaftMessageResponse) Copy() *StreamRaftMessageResponse { - if m == nil { - return nil - } - o := &StreamRaftMessageResponse{} - o.CopyFrom(m) - return o -} - -func (m *StreamRaftMessageResponse) CopyFrom(src interface{}) {} -func (m *ResolveAddressRequest) Copy() *ResolveAddressRequest { - if m == nil { - return nil - } - o := &ResolveAddressRequest{} - o.CopyFrom(m) - return o -} - -func (m *ResolveAddressRequest) CopyFrom(src interface{}) { - - o := src.(*ResolveAddressRequest) - *m = *o -} - -func (m *ResolveAddressResponse) Copy() *ResolveAddressResponse { - if m == nil { - return nil - } - o := &ResolveAddressResponse{} - o.CopyFrom(m) - return o -} - -func (m *ResolveAddressResponse) CopyFrom(src interface{}) { - - o := src.(*ResolveAddressResponse) - *m = *o -} - -func (m *InternalRaftRequest) Copy() *InternalRaftRequest { - if m == nil { - return nil - } - o := &InternalRaftRequest{} - o.CopyFrom(m) - return o -} - -func (m *InternalRaftRequest) CopyFrom(src interface{}) { - - o := src.(*InternalRaftRequest) - *m = *o - if o.Action != nil { - m.Action = make([]StoreAction, len(o.Action)) - for i := range m.Action { - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Action[i], &o.Action[i]) - } - } - -} - -func (m *StoreAction) Copy() *StoreAction { - if m == nil { - return nil - } - o := &StoreAction{} - o.CopyFrom(m) - return o -} - -func (m *StoreAction) CopyFrom(src interface{}) { - - o := src.(*StoreAction) - *m = *o - if o.Target != nil { - switch o.Target.(type) { - case *StoreAction_Node: - v := StoreAction_Node{ - Node: &Node{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Node, o.GetNode()) - m.Target = &v - case *StoreAction_Service: - v := StoreAction_Service{ - Service: &Service{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Service, o.GetService()) - m.Target = &v - case *StoreAction_Task: - v := StoreAction_Task{ - Task: &Task{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Task, o.GetTask()) - m.Target = &v - case *StoreAction_Network: - v := StoreAction_Network{ - Network: &Network{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Network, o.GetNetwork()) - m.Target = &v - case *StoreAction_Cluster: - v := StoreAction_Cluster{ - Cluster: &Cluster{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Cluster, o.GetCluster()) - m.Target = &v - case *StoreAction_Secret: - v := StoreAction_Secret{ - Secret: &Secret{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Secret, o.GetSecret()) - m.Target = &v - case *StoreAction_Resource: - v := StoreAction_Resource{ - Resource: &Resource{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Resource, o.GetResource()) - m.Target = &v - case *StoreAction_Extension: - v := StoreAction_Extension{ - Extension: &Extension{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Extension, o.GetExtension()) - m.Target = &v - case *StoreAction_Config: - v := StoreAction_Config{ - Config: &Config{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Config, o.GetConfig()) - m.Target = &v - case *StoreAction_Volume: - v := StoreAction_Volume{ - Volume: &Volume{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Volume, o.GetVolume()) - m.Target = &v - } - } - -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// RaftClient is the client API for Raft service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type RaftClient interface { - // ProcessRaftMessage sends a raft message to be processed on a raft member, it is - // called from the RaftMember willing to send a message to its destination ('To' field) - ProcessRaftMessage(ctx context.Context, in *ProcessRaftMessageRequest, opts ...grpc.CallOption) (*ProcessRaftMessageResponse, error) - // StreamRaftMessage accepts a stream of raft messages of type StreamRaftMessageRequest - // to be processed on a raft member, returning a StreamRaftMessageResponse - // when processing of the streamed messages is complete. A single stream corresponds - // to a single raft message, which may be disassembled and streamed as individual messages. - // It is called from the Raft leader, which uses it to stream messages to a raft member. - StreamRaftMessage(ctx context.Context, opts ...grpc.CallOption) (Raft_StreamRaftMessageClient, error) - // ResolveAddress returns the address where the node with the given ID can be reached. - ResolveAddress(ctx context.Context, in *ResolveAddressRequest, opts ...grpc.CallOption) (*ResolveAddressResponse, error) -} - -type raftClient struct { - cc *grpc.ClientConn -} - -func NewRaftClient(cc *grpc.ClientConn) RaftClient { - return &raftClient{cc} -} - -func (c *raftClient) ProcessRaftMessage(ctx context.Context, in *ProcessRaftMessageRequest, opts ...grpc.CallOption) (*ProcessRaftMessageResponse, error) { - out := new(ProcessRaftMessageResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Raft/ProcessRaftMessage", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *raftClient) StreamRaftMessage(ctx context.Context, opts ...grpc.CallOption) (Raft_StreamRaftMessageClient, error) { - stream, err := c.cc.NewStream(ctx, &_Raft_serviceDesc.Streams[0], "/docker.swarmkit.v1.Raft/StreamRaftMessage", opts...) - if err != nil { - return nil, err - } - x := &raftStreamRaftMessageClient{stream} - return x, nil -} - -type Raft_StreamRaftMessageClient interface { - Send(*StreamRaftMessageRequest) error - CloseAndRecv() (*StreamRaftMessageResponse, error) - grpc.ClientStream -} - -type raftStreamRaftMessageClient struct { - grpc.ClientStream -} - -func (x *raftStreamRaftMessageClient) Send(m *StreamRaftMessageRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *raftStreamRaftMessageClient) CloseAndRecv() (*StreamRaftMessageResponse, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(StreamRaftMessageResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *raftClient) ResolveAddress(ctx context.Context, in *ResolveAddressRequest, opts ...grpc.CallOption) (*ResolveAddressResponse, error) { - out := new(ResolveAddressResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Raft/ResolveAddress", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RaftServer is the server API for Raft service. -type RaftServer interface { - // ProcessRaftMessage sends a raft message to be processed on a raft member, it is - // called from the RaftMember willing to send a message to its destination ('To' field) - ProcessRaftMessage(context.Context, *ProcessRaftMessageRequest) (*ProcessRaftMessageResponse, error) - // StreamRaftMessage accepts a stream of raft messages of type StreamRaftMessageRequest - // to be processed on a raft member, returning a StreamRaftMessageResponse - // when processing of the streamed messages is complete. A single stream corresponds - // to a single raft message, which may be disassembled and streamed as individual messages. - // It is called from the Raft leader, which uses it to stream messages to a raft member. - StreamRaftMessage(Raft_StreamRaftMessageServer) error - // ResolveAddress returns the address where the node with the given ID can be reached. - ResolveAddress(context.Context, *ResolveAddressRequest) (*ResolveAddressResponse, error) -} - -// UnimplementedRaftServer can be embedded to have forward compatible implementations. -type UnimplementedRaftServer struct { -} - -func (*UnimplementedRaftServer) ProcessRaftMessage(ctx context.Context, req *ProcessRaftMessageRequest) (*ProcessRaftMessageResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessRaftMessage not implemented") -} -func (*UnimplementedRaftServer) StreamRaftMessage(srv Raft_StreamRaftMessageServer) error { - return status.Errorf(codes.Unimplemented, "method StreamRaftMessage not implemented") -} -func (*UnimplementedRaftServer) ResolveAddress(ctx context.Context, req *ResolveAddressRequest) (*ResolveAddressResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ResolveAddress not implemented") -} - -func RegisterRaftServer(s *grpc.Server, srv RaftServer) { - s.RegisterService(&_Raft_serviceDesc, srv) -} - -func _Raft_ProcessRaftMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ProcessRaftMessageRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RaftServer).ProcessRaftMessage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Raft/ProcessRaftMessage", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RaftServer).ProcessRaftMessage(ctx, req.(*ProcessRaftMessageRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Raft_StreamRaftMessage_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(RaftServer).StreamRaftMessage(&raftStreamRaftMessageServer{stream}) -} - -type Raft_StreamRaftMessageServer interface { - SendAndClose(*StreamRaftMessageResponse) error - Recv() (*StreamRaftMessageRequest, error) - grpc.ServerStream -} - -type raftStreamRaftMessageServer struct { - grpc.ServerStream -} - -func (x *raftStreamRaftMessageServer) SendAndClose(m *StreamRaftMessageResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *raftStreamRaftMessageServer) Recv() (*StreamRaftMessageRequest, error) { - m := new(StreamRaftMessageRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Raft_ResolveAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ResolveAddressRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RaftServer).ResolveAddress(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.Raft/ResolveAddress", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RaftServer).ResolveAddress(ctx, req.(*ResolveAddressRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Raft_serviceDesc = grpc.ServiceDesc{ - ServiceName: "docker.swarmkit.v1.Raft", - HandlerType: (*RaftServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ProcessRaftMessage", - Handler: _Raft_ProcessRaftMessage_Handler, - }, - { - MethodName: "ResolveAddress", - Handler: _Raft_ResolveAddress_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamRaftMessage", - Handler: _Raft_StreamRaftMessage_Handler, - ClientStreams: true, - }, - }, - Metadata: "github.com/docker/swarmkit/api/raft.proto", -} - -// RaftMembershipClient is the client API for RaftMembership service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type RaftMembershipClient interface { - // Join adds a RaftMember to the raft cluster. - Join(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*JoinResponse, error) - // Leave removes a RaftMember from the raft cluster. - Leave(ctx context.Context, in *LeaveRequest, opts ...grpc.CallOption) (*LeaveResponse, error) -} - -type raftMembershipClient struct { - cc *grpc.ClientConn -} - -func NewRaftMembershipClient(cc *grpc.ClientConn) RaftMembershipClient { - return &raftMembershipClient{cc} -} - -func (c *raftMembershipClient) Join(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*JoinResponse, error) { - out := new(JoinResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.RaftMembership/Join", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *raftMembershipClient) Leave(ctx context.Context, in *LeaveRequest, opts ...grpc.CallOption) (*LeaveResponse, error) { - out := new(LeaveResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.RaftMembership/Leave", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RaftMembershipServer is the server API for RaftMembership service. -type RaftMembershipServer interface { - // Join adds a RaftMember to the raft cluster. - Join(context.Context, *JoinRequest) (*JoinResponse, error) - // Leave removes a RaftMember from the raft cluster. - Leave(context.Context, *LeaveRequest) (*LeaveResponse, error) -} - -// UnimplementedRaftMembershipServer can be embedded to have forward compatible implementations. -type UnimplementedRaftMembershipServer struct { -} - -func (*UnimplementedRaftMembershipServer) Join(ctx context.Context, req *JoinRequest) (*JoinResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Join not implemented") -} -func (*UnimplementedRaftMembershipServer) Leave(ctx context.Context, req *LeaveRequest) (*LeaveResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Leave not implemented") -} - -func RegisterRaftMembershipServer(s *grpc.Server, srv RaftMembershipServer) { - s.RegisterService(&_RaftMembership_serviceDesc, srv) -} - -func _RaftMembership_Join_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(JoinRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RaftMembershipServer).Join(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.RaftMembership/Join", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RaftMembershipServer).Join(ctx, req.(*JoinRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RaftMembership_Leave_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LeaveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RaftMembershipServer).Leave(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.RaftMembership/Leave", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RaftMembershipServer).Leave(ctx, req.(*LeaveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _RaftMembership_serviceDesc = grpc.ServiceDesc{ - ServiceName: "docker.swarmkit.v1.RaftMembership", - HandlerType: (*RaftMembershipServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Join", - Handler: _RaftMembership_Join_Handler, - }, - { - MethodName: "Leave", - Handler: _RaftMembership_Leave_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/docker/swarmkit/api/raft.proto", -} - -func (m *RaftMember) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RaftMember) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RaftMember) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.Addr) > 0 { - i -= len(m.Addr) - copy(dAtA[i:], m.Addr) - i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr))) - i-- - dAtA[i] = 0x1a - } - if len(m.NodeID) > 0 { - i -= len(m.NodeID) - copy(dAtA[i:], m.NodeID) - i = encodeVarintRaft(dAtA, i, uint64(len(m.NodeID))) - i-- - dAtA[i] = 0x12 - } - if m.RaftID != 0 { - i = encodeVarintRaft(dAtA, i, uint64(m.RaftID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *JoinRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JoinRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JoinRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Addr) > 0 { - i -= len(m.Addr) - copy(dAtA[i:], m.Addr) - i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *JoinResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JoinResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JoinResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.RemovedMembers) > 0 { - for iNdEx := len(m.RemovedMembers) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarintRaft(dAtA, i, uint64(m.RemovedMembers[iNdEx])) - i-- - dAtA[i] = 0x18 - } - } - if len(m.Members) > 0 { - for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Members[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.RaftID != 0 { - i = encodeVarintRaft(dAtA, i, uint64(m.RaftID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *LeaveRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaveRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Node != nil { - { - size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LeaveResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaveResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *ProcessRaftMessageRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProcessRaftMessageRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProcessRaftMessageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Message != nil { - { - size, err := m.Message.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProcessRaftMessageResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProcessRaftMessageResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProcessRaftMessageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *StreamRaftMessageRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StreamRaftMessageRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StreamRaftMessageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Message != nil { - { - size, err := m.Message.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *StreamRaftMessageResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StreamRaftMessageResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StreamRaftMessageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *ResolveAddressRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResolveAddressRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResolveAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.RaftID != 0 { - i = encodeVarintRaft(dAtA, i, uint64(m.RaftID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ResolveAddressResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResolveAddressResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResolveAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Addr) > 0 { - i -= len(m.Addr) - copy(dAtA[i:], m.Addr) - i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *InternalRaftRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InternalRaftRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Action) > 0 { - for iNdEx := len(m.Action) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Action[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.ID != 0 { - i = encodeVarintRaft(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *StoreAction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StoreAction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Target != nil { - { - size := m.Target.Size() - i -= size - if _, err := m.Target.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.Action != 0 { - i = encodeVarintRaft(dAtA, i, uint64(m.Action)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *StoreAction_Node) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreAction_Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Node != nil { - { - size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *StoreAction_Service) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreAction_Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Service != nil { - { - size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *StoreAction_Task) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreAction_Task) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Task != nil { - { - size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *StoreAction_Network) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreAction_Network) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Network != nil { - { - size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func (m *StoreAction_Cluster) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreAction_Cluster) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Cluster != nil { - { - size, err := m.Cluster.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - return len(dAtA) - i, nil -} -func (m *StoreAction_Secret) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreAction_Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Secret != nil { - { - size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *StoreAction_Resource) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreAction_Resource) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Resource != nil { - { - size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - return len(dAtA) - i, nil -} -func (m *StoreAction_Extension) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreAction_Extension) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Extension != nil { - { - size, err := m.Extension.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - return len(dAtA) - i, nil -} -func (m *StoreAction_Config) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreAction_Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Config != nil { - { - size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - return len(dAtA) - i, nil -} -func (m *StoreAction_Volume) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreAction_Volume) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Volume != nil { - { - size, err := m.Volume.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - } - return len(dAtA) - i, nil -} -func encodeVarintRaft(dAtA []byte, offset int, v uint64) int { - offset -= sovRaft(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -type raftProxyRaftServer struct { - local RaftServer - connSelector raftselector.ConnProvider - localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error) -} - -func NewRaftProxyRaftServer(local RaftServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) RaftServer { - redirectChecker := func(ctx context.Context) (context.Context, error) { - p, ok := peer.FromContext(ctx) - if !ok { - return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context") - } - addr := p.Addr.String() - md, ok := metadata.FromIncomingContext(ctx) - if ok && len(md["redirect"]) != 0 { - return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"]) - } - if !ok { - md = metadata.New(map[string]string{}) - } - md["redirect"] = append(md["redirect"], addr) - return metadata.NewOutgoingContext(ctx, md), nil - } - remoteMods := []func(context.Context) (context.Context, error){redirectChecker} - remoteMods = append(remoteMods, remoteCtxMod) - - var localMods []func(context.Context) (context.Context, error) - if localCtxMod != nil { - localMods = []func(context.Context) (context.Context, error){localCtxMod} - } - - return &raftProxyRaftServer{ - local: local, - connSelector: connSelector, - localCtxMods: localMods, - remoteCtxMods: remoteMods, - } -} -func (p *raftProxyRaftServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) { - var err error - for _, mod := range ctxMods { - ctx, err = mod(ctx) - if err != nil { - return ctx, err - } - } - return ctx, nil -} -func (p *raftProxyRaftServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) { - ticker := rafttime.NewTicker(500 * rafttime.Millisecond) - defer ticker.Stop() - for { - select { - case <-ticker.C: - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - return nil, err - } - - client := NewHealthClient(conn) - - resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"}) - if err != nil || resp.Status != HealthCheckResponse_SERVING { - continue - } - return conn, nil - case <-ctx.Done(): - return nil, ctx.Err() - } - } -} - -func (p *raftProxyRaftServer) ProcessRaftMessage(ctx context.Context, r *ProcessRaftMessageRequest) (*ProcessRaftMessageResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.ProcessRaftMessage(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewRaftClient(conn).ProcessRaftMessage(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.ProcessRaftMessage(ctx, r) - } - return nil, err - } - return NewRaftClient(conn).ProcessRaftMessage(modCtx, r) - } - return resp, err -} - -type Raft_StreamRaftMessageServerWrapper struct { - Raft_StreamRaftMessageServer - ctx context.Context -} - -func (s Raft_StreamRaftMessageServerWrapper) Context() context.Context { - return s.ctx -} - -func (p *raftProxyRaftServer) StreamRaftMessage(stream Raft_StreamRaftMessageServer) error { - ctx := stream.Context() - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return err - } - streamWrapper := Raft_StreamRaftMessageServerWrapper{ - Raft_StreamRaftMessageServer: stream, - ctx: ctx, - } - return p.local.StreamRaftMessage(streamWrapper) - } - return err - } - ctx, err = p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return err - } - clientStream, err := NewRaftClient(conn).StreamRaftMessage(ctx) - - if err != nil { - return err - } - - for { - msg, err := stream.Recv() - if err == io.EOF { - break - } - if err != nil { - return err - } - if err := clientStream.Send(msg); err != nil { - return err - } - } - - reply, err := clientStream.CloseAndRecv() - if err != nil { - return err - } - - return stream.SendAndClose(reply) -} - -func (p *raftProxyRaftServer) ResolveAddress(ctx context.Context, r *ResolveAddressRequest) (*ResolveAddressResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.ResolveAddress(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewRaftClient(conn).ResolveAddress(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.ResolveAddress(ctx, r) - } - return nil, err - } - return NewRaftClient(conn).ResolveAddress(modCtx, r) - } - return resp, err -} - -type raftProxyRaftMembershipServer struct { - local RaftMembershipServer - connSelector raftselector.ConnProvider - localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error) -} - -func NewRaftProxyRaftMembershipServer(local RaftMembershipServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) RaftMembershipServer { - redirectChecker := func(ctx context.Context) (context.Context, error) { - p, ok := peer.FromContext(ctx) - if !ok { - return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context") - } - addr := p.Addr.String() - md, ok := metadata.FromIncomingContext(ctx) - if ok && len(md["redirect"]) != 0 { - return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"]) - } - if !ok { - md = metadata.New(map[string]string{}) - } - md["redirect"] = append(md["redirect"], addr) - return metadata.NewOutgoingContext(ctx, md), nil - } - remoteMods := []func(context.Context) (context.Context, error){redirectChecker} - remoteMods = append(remoteMods, remoteCtxMod) - - var localMods []func(context.Context) (context.Context, error) - if localCtxMod != nil { - localMods = []func(context.Context) (context.Context, error){localCtxMod} - } - - return &raftProxyRaftMembershipServer{ - local: local, - connSelector: connSelector, - localCtxMods: localMods, - remoteCtxMods: remoteMods, - } -} -func (p *raftProxyRaftMembershipServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) { - var err error - for _, mod := range ctxMods { - ctx, err = mod(ctx) - if err != nil { - return ctx, err - } - } - return ctx, nil -} -func (p *raftProxyRaftMembershipServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) { - ticker := rafttime.NewTicker(500 * rafttime.Millisecond) - defer ticker.Stop() - for { - select { - case <-ticker.C: - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - return nil, err - } - - client := NewHealthClient(conn) - - resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"}) - if err != nil || resp.Status != HealthCheckResponse_SERVING { - continue - } - return conn, nil - case <-ctx.Done(): - return nil, ctx.Err() - } - } -} - -func (p *raftProxyRaftMembershipServer) Join(ctx context.Context, r *JoinRequest) (*JoinResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.Join(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewRaftMembershipClient(conn).Join(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.Join(ctx, r) - } - return nil, err - } - return NewRaftMembershipClient(conn).Join(modCtx, r) - } - return resp, err -} - -func (p *raftProxyRaftMembershipServer) Leave(ctx context.Context, r *LeaveRequest) (*LeaveResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.Leave(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewRaftMembershipClient(conn).Leave(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.Leave(ctx, r) - } - return nil, err - } - return NewRaftMembershipClient(conn).Leave(modCtx, r) - } - return resp, err -} - -func (m *RaftMember) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RaftID != 0 { - n += 1 + sovRaft(uint64(m.RaftID)) - } - l = len(m.NodeID) - if l > 0 { - n += 1 + l + sovRaft(uint64(l)) - } - l = len(m.Addr) - if l > 0 { - n += 1 + l + sovRaft(uint64(l)) - } - l = m.Status.Size() - n += 1 + l + sovRaft(uint64(l)) - return n -} - -func (m *JoinRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Addr) - if l > 0 { - n += 1 + l + sovRaft(uint64(l)) - } - return n -} - -func (m *JoinResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RaftID != 0 { - n += 1 + sovRaft(uint64(m.RaftID)) - } - if len(m.Members) > 0 { - for _, e := range m.Members { - l = e.Size() - n += 1 + l + sovRaft(uint64(l)) - } - } - if len(m.RemovedMembers) > 0 { - for _, e := range m.RemovedMembers { - n += 1 + sovRaft(uint64(e)) - } - } - return n -} - -func (m *LeaveRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Node != nil { - l = m.Node.Size() - n += 1 + l + sovRaft(uint64(l)) - } - return n -} - -func (m *LeaveResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *ProcessRaftMessageRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Message != nil { - l = m.Message.Size() - n += 1 + l + sovRaft(uint64(l)) - } - return n -} - -func (m *ProcessRaftMessageResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *StreamRaftMessageRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Message != nil { - l = m.Message.Size() - n += 1 + l + sovRaft(uint64(l)) - } - return n -} - -func (m *StreamRaftMessageResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *ResolveAddressRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RaftID != 0 { - n += 1 + sovRaft(uint64(m.RaftID)) - } - return n -} - -func (m *ResolveAddressResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Addr) - if l > 0 { - n += 1 + l + sovRaft(uint64(l)) - } - return n -} - -func (m *InternalRaftRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRaft(uint64(m.ID)) - } - if len(m.Action) > 0 { - for _, e := range m.Action { - l = e.Size() - n += 1 + l + sovRaft(uint64(l)) - } - } - return n -} - -func (m *StoreAction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Action != 0 { - n += 1 + sovRaft(uint64(m.Action)) - } - if m.Target != nil { - n += m.Target.Size() - } - return n -} - -func (m *StoreAction_Node) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Node != nil { - l = m.Node.Size() - n += 1 + l + sovRaft(uint64(l)) - } - return n -} -func (m *StoreAction_Service) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Service != nil { - l = m.Service.Size() - n += 1 + l + sovRaft(uint64(l)) - } - return n -} -func (m *StoreAction_Task) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Task != nil { - l = m.Task.Size() - n += 1 + l + sovRaft(uint64(l)) - } - return n -} -func (m *StoreAction_Network) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Network != nil { - l = m.Network.Size() - n += 1 + l + sovRaft(uint64(l)) - } - return n -} -func (m *StoreAction_Cluster) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Cluster != nil { - l = m.Cluster.Size() - n += 1 + l + sovRaft(uint64(l)) - } - return n -} -func (m *StoreAction_Secret) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Secret != nil { - l = m.Secret.Size() - n += 1 + l + sovRaft(uint64(l)) - } - return n -} -func (m *StoreAction_Resource) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Resource != nil { - l = m.Resource.Size() - n += 1 + l + sovRaft(uint64(l)) - } - return n -} -func (m *StoreAction_Extension) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Extension != nil { - l = m.Extension.Size() - n += 1 + l + sovRaft(uint64(l)) - } - return n -} -func (m *StoreAction_Config) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Config != nil { - l = m.Config.Size() - n += 1 + l + sovRaft(uint64(l)) - } - return n -} -func (m *StoreAction_Volume) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Volume != nil { - l = m.Volume.Size() - n += 1 + l + sovRaft(uint64(l)) - } - return n -} - -func sovRaft(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRaft(x uint64) (n int) { - return sovRaft(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *RaftMember) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RaftMember{`, - `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`, - `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, - `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`, - `Status:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Status), "RaftMemberStatus", "RaftMemberStatus", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *JoinRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&JoinRequest{`, - `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`, - `}`, - }, "") - return s -} -func (this *JoinResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForMembers := "[]*RaftMember{" - for _, f := range this.Members { - repeatedStringForMembers += strings.Replace(f.String(), "RaftMember", "RaftMember", 1) + "," - } - repeatedStringForMembers += "}" - s := strings.Join([]string{`&JoinResponse{`, - `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`, - `Members:` + repeatedStringForMembers + `,`, - `RemovedMembers:` + fmt.Sprintf("%v", this.RemovedMembers) + `,`, - `}`, - }, "") - return s -} -func (this *LeaveRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LeaveRequest{`, - `Node:` + strings.Replace(this.Node.String(), "RaftMember", "RaftMember", 1) + `,`, - `}`, - }, "") - return s -} -func (this *LeaveResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LeaveResponse{`, - `}`, - }, "") - return s -} -func (this *ProcessRaftMessageRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ProcessRaftMessageRequest{`, - `Message:` + strings.Replace(fmt.Sprintf("%v", this.Message), "Message", "raftpb.Message", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ProcessRaftMessageResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ProcessRaftMessageResponse{`, - `}`, - }, "") - return s -} -func (this *StreamRaftMessageRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StreamRaftMessageRequest{`, - `Message:` + strings.Replace(fmt.Sprintf("%v", this.Message), "Message", "raftpb.Message", 1) + `,`, - `}`, - }, "") - return s -} -func (this *StreamRaftMessageResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StreamRaftMessageResponse{`, - `}`, - }, "") - return s -} -func (this *ResolveAddressRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResolveAddressRequest{`, - `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`, - `}`, - }, "") - return s -} -func (this *ResolveAddressResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResolveAddressResponse{`, - `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`, - `}`, - }, "") - return s -} -func (this *InternalRaftRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForAction := "[]StoreAction{" - for _, f := range this.Action { - repeatedStringForAction += strings.Replace(strings.Replace(f.String(), "StoreAction", "StoreAction", 1), `&`, ``, 1) + "," - } - repeatedStringForAction += "}" - s := strings.Join([]string{`&InternalRaftRequest{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Action:` + repeatedStringForAction + `,`, - `}`, - }, "") - return s -} -func (this *StoreAction) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StoreAction{`, - `Action:` + fmt.Sprintf("%v", this.Action) + `,`, - `Target:` + fmt.Sprintf("%v", this.Target) + `,`, - `}`, - }, "") - return s -} -func (this *StoreAction_Node) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StoreAction_Node{`, - `Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "Node", "Node", 1) + `,`, - `}`, - }, "") - return s -} -func (this *StoreAction_Service) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StoreAction_Service{`, - `Service:` + strings.Replace(fmt.Sprintf("%v", this.Service), "Service", "Service", 1) + `,`, - `}`, - }, "") - return s -} -func (this *StoreAction_Task) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StoreAction_Task{`, - `Task:` + strings.Replace(fmt.Sprintf("%v", this.Task), "Task", "Task", 1) + `,`, - `}`, - }, "") - return s -} -func (this *StoreAction_Network) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StoreAction_Network{`, - `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`, - `}`, - }, "") - return s -} -func (this *StoreAction_Cluster) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StoreAction_Cluster{`, - `Cluster:` + strings.Replace(fmt.Sprintf("%v", this.Cluster), "Cluster", "Cluster", 1) + `,`, - `}`, - }, "") - return s -} -func (this *StoreAction_Secret) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StoreAction_Secret{`, - `Secret:` + strings.Replace(fmt.Sprintf("%v", this.Secret), "Secret", "Secret", 1) + `,`, - `}`, - }, "") - return s -} -func (this *StoreAction_Resource) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StoreAction_Resource{`, - `Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "Resource", "Resource", 1) + `,`, - `}`, - }, "") - return s -} -func (this *StoreAction_Extension) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StoreAction_Extension{`, - `Extension:` + strings.Replace(fmt.Sprintf("%v", this.Extension), "Extension", "Extension", 1) + `,`, - `}`, - }, "") - return s -} -func (this *StoreAction_Config) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StoreAction_Config{`, - `Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "Config", "Config", 1) + `,`, - `}`, - }, "") - return s -} -func (this *StoreAction_Volume) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StoreAction_Volume{`, - `Volume:` + strings.Replace(fmt.Sprintf("%v", this.Volume), "Volume", "Volume", 1) + `,`, - `}`, - }, "") - return s -} -func valueToStringRaft(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *RaftMember) Unmarshal(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 ErrIntOverflowRaft - } - 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: RaftMember: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RaftMember: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftID", wireType) - } - m.RaftID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RaftID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NodeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Addr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JoinRequest) Unmarshal(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 ErrIntOverflowRaft - } - 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: JoinRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JoinRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Addr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JoinResponse) Unmarshal(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 ErrIntOverflowRaft - } - 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: JoinResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JoinResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftID", wireType) - } - m.RaftID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RaftID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Members = append(m.Members, &RaftMember{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.RemovedMembers = append(m.RemovedMembers, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.RemovedMembers) == 0 { - m.RemovedMembers = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.RemovedMembers = append(m.RemovedMembers, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field RemovedMembers", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaveRequest) Unmarshal(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 ErrIntOverflowRaft - } - 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: LeaveRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaveRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Node == nil { - m.Node = &RaftMember{} - } - if err := m.Node.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaveResponse) Unmarshal(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 ErrIntOverflowRaft - } - 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: LeaveResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaveResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProcessRaftMessageRequest) Unmarshal(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 ErrIntOverflowRaft - } - 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: ProcessRaftMessageRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProcessRaftMessageRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Message == nil { - m.Message = &raftpb.Message{} - } - if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProcessRaftMessageResponse) Unmarshal(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 ErrIntOverflowRaft - } - 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: ProcessRaftMessageResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProcessRaftMessageResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StreamRaftMessageRequest) Unmarshal(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 ErrIntOverflowRaft - } - 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: StreamRaftMessageRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StreamRaftMessageRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Message == nil { - m.Message = &raftpb.Message{} - } - if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StreamRaftMessageResponse) Unmarshal(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 ErrIntOverflowRaft - } - 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: StreamRaftMessageResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StreamRaftMessageResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResolveAddressRequest) Unmarshal(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 ErrIntOverflowRaft - } - 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: ResolveAddressRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResolveAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftID", wireType) - } - m.RaftID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RaftID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResolveAddressResponse) Unmarshal(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 ErrIntOverflowRaft - } - 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: ResolveAddressResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResolveAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Addr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *InternalRaftRequest) Unmarshal(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 ErrIntOverflowRaft - } - 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: InternalRaftRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InternalRaftRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Action = append(m.Action, StoreAction{}) - if err := m.Action[len(m.Action)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StoreAction) Unmarshal(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 ErrIntOverflowRaft - } - 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: StoreAction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StoreAction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - m.Action = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Action |= StoreActionKind(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Node{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Target = &StoreAction_Node{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Service{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Target = &StoreAction_Service{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Task", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Task{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Target = &StoreAction_Task{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Network{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Target = &StoreAction_Network{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Cluster{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Target = &StoreAction_Cluster{v} - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Secret{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Target = &StoreAction_Secret{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Resource{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Target = &StoreAction_Resource{v} - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extension", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Extension{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Target = &StoreAction_Extension{v} - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Config{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Target = &StoreAction_Config{v} - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volume", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Volume{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Target = &StoreAction_Volume{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRaft(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaft - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaft - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaft - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRaft - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRaft - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRaft - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthRaft = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRaft = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRaft = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/moby/swarmkit/v2/api/raft.proto b/vendor/github.com/moby/swarmkit/v2/api/raft.proto deleted file mode 100644 index 5ab79e9a9d..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/raft.proto +++ /dev/null @@ -1,151 +0,0 @@ -syntax = "proto3"; - -package docker.swarmkit.v1; - -import "github.com/docker/swarmkit/api/objects.proto"; -import "github.com/docker/swarmkit/api/types.proto"; -import "go.etcd.io/etcd/raft/v3/raftpb/raft.proto"; -import weak "gogoproto/gogo.proto"; -import weak "github.com/docker/swarmkit/protobuf/plugin/plugin.proto"; - -// Raft defines the RPC communication between raft nodes. -service Raft { - // ProcessRaftMessage sends a raft message to be processed on a raft member, it is - // called from the RaftMember willing to send a message to its destination ('To' field) - rpc ProcessRaftMessage(ProcessRaftMessageRequest) returns (ProcessRaftMessageResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - - // StreamRaftMessage accepts a stream of raft messages of type StreamRaftMessageRequest - // to be processed on a raft member, returning a StreamRaftMessageResponse - // when processing of the streamed messages is complete. A single stream corresponds - // to a single raft message, which may be disassembled and streamed as individual messages. - // It is called from the Raft leader, which uses it to stream messages to a raft member. - rpc StreamRaftMessage(stream StreamRaftMessageRequest) returns (StreamRaftMessageResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - - // ResolveAddress returns the address where the node with the given ID can be reached. - rpc ResolveAddress(ResolveAddressRequest) returns (ResolveAddressResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; -} - -// RaftMembership defines RPCs for adding and removing members from the -// cluster. These RPCs must always run on the leader, so they are in a separate -// service to support the raft proxy. -service RaftMembership { - // Join adds a RaftMember to the raft cluster. - rpc Join(JoinRequest) returns (JoinResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; - - // Leave removes a RaftMember from the raft cluster. - rpc Leave(LeaveRequest) returns (LeaveResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; -} - -message RaftMember { - // RaftID specifies the internal ID used by the manager in a raft context, it can never be modified - // and is used only for information purposes - uint64 raft_id = 1; - - // NodeID is the node's ID. - string node_id = 2; - - // Addr specifies the address of the member - string addr = 3; - - // Status provides the current status of the manager from the perspective of another manager. - RaftMemberStatus status = 4 [(gogoproto.nullable) = false]; -} - -message JoinRequest { - // Addr specifies the address of the member - string addr = 1; -} - -message JoinResponse { - // RaftID is the ID assigned to the new member. - uint64 raft_id = 1; - - // Members is the membership set of the cluster. - repeated RaftMember members = 2; - - // RemovedMembers is a list of members that have been removed from - // the cluster, so the new node can avoid communicating with them. - repeated uint64 removed_members = 3 [packed=false]; -} - -message LeaveRequest { - RaftMember node = 1; -} - -message LeaveResponse {} - -message ProcessRaftMessageRequest { - option (docker.protobuf.plugin.deepcopy) = false; - raftpb.Message message = 1; -} - -message ProcessRaftMessageResponse {} - -// Raft message streaming request. -message StreamRaftMessageRequest { - option (docker.protobuf.plugin.deepcopy) = false; - raftpb.Message message = 1; -} - -// Raft message streaming response. -message StreamRaftMessageResponse {} - -message ResolveAddressRequest { - // raft_id is the ID to resolve to an address. - uint64 raft_id = 1; -} - -message ResolveAddressResponse { - // Addr specifies the address of the member - string addr = 1; -} - -// Contains one of many protobuf encoded objects to replicate -// over the raft backend with a request ID to track when the -// action is effectively applied -message InternalRaftRequest { - uint64 id = 1; - - repeated StoreAction action = 2 [(gogoproto.nullable) = false]; -} - -// TODO(stevvooe): Storage actions may belong in another protobuf file. They -// aren't necessarily first-class "types" in the cluster schema. - -// StoreActionKind defines the operation to take on the store for the target of -// a storage action. -enum StoreActionKind { - option (gogoproto.goproto_enum_prefix) = false; - option (gogoproto.enum_customname) = "StoreActionKind"; - UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "StoreActionKindUnknown"]; // default value, invalid - STORE_ACTION_CREATE = 1 [(gogoproto.enumvalue_customname) = "StoreActionKindCreate"]; - STORE_ACTION_UPDATE = 2 [(gogoproto.enumvalue_customname) = "StoreActionKindUpdate"]; - STORE_ACTION_REMOVE = 3 [(gogoproto.enumvalue_customname) = "StoreActionKindRemove"]; -} - -// StoreAction defines a target and operation to apply on the storage system. -message StoreAction { - StoreActionKind action = 1; - oneof target { - Node node = 2; - Service service = 3; - Task task = 4; - Network network = 5; - Cluster cluster = 6; - Secret secret = 7; - Resource resource = 8; - Extension extension = 9; - Config config = 10; - Volume volume = 11; - } -} diff --git a/vendor/github.com/moby/swarmkit/v2/api/resource.pb.go b/vendor/github.com/moby/swarmkit/v2/api/resource.pb.go deleted file mode 100644 index 3466e44073..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/resource.pb.go +++ /dev/null @@ -1,1227 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/docker/swarmkit/api/resource.proto - -package api - -import ( - context "context" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_moby_swarmkit_v2_api_deepcopy "github.com/moby/swarmkit/v2/api/deepcopy" - raftselector "github.com/moby/swarmkit/v2/manager/raftselector" - _ "github.com/moby/swarmkit/v2/protobuf/plugin" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - metadata "google.golang.org/grpc/metadata" - peer "google.golang.org/grpc/peer" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" - rafttime "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type AttachNetworkRequest struct { - Config *NetworkAttachmentConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` - ContainerID string `protobuf:"bytes,2,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` -} - -func (m *AttachNetworkRequest) Reset() { *m = AttachNetworkRequest{} } -func (*AttachNetworkRequest) ProtoMessage() {} -func (*AttachNetworkRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_909455b1b868ddb9, []int{0} -} -func (m *AttachNetworkRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AttachNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AttachNetworkRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AttachNetworkRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AttachNetworkRequest.Merge(m, src) -} -func (m *AttachNetworkRequest) XXX_Size() int { - return m.Size() -} -func (m *AttachNetworkRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AttachNetworkRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AttachNetworkRequest proto.InternalMessageInfo - -type AttachNetworkResponse struct { - AttachmentID string `protobuf:"bytes,1,opt,name=attachment_id,json=attachmentId,proto3" json:"attachment_id,omitempty"` -} - -func (m *AttachNetworkResponse) Reset() { *m = AttachNetworkResponse{} } -func (*AttachNetworkResponse) ProtoMessage() {} -func (*AttachNetworkResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_909455b1b868ddb9, []int{1} -} -func (m *AttachNetworkResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AttachNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AttachNetworkResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AttachNetworkResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AttachNetworkResponse.Merge(m, src) -} -func (m *AttachNetworkResponse) XXX_Size() int { - return m.Size() -} -func (m *AttachNetworkResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AttachNetworkResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AttachNetworkResponse proto.InternalMessageInfo - -type DetachNetworkRequest struct { - AttachmentID string `protobuf:"bytes,1,opt,name=attachment_id,json=attachmentId,proto3" json:"attachment_id,omitempty"` -} - -func (m *DetachNetworkRequest) Reset() { *m = DetachNetworkRequest{} } -func (*DetachNetworkRequest) ProtoMessage() {} -func (*DetachNetworkRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_909455b1b868ddb9, []int{2} -} -func (m *DetachNetworkRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DetachNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DetachNetworkRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DetachNetworkRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DetachNetworkRequest.Merge(m, src) -} -func (m *DetachNetworkRequest) XXX_Size() int { - return m.Size() -} -func (m *DetachNetworkRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DetachNetworkRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DetachNetworkRequest proto.InternalMessageInfo - -type DetachNetworkResponse struct { -} - -func (m *DetachNetworkResponse) Reset() { *m = DetachNetworkResponse{} } -func (*DetachNetworkResponse) ProtoMessage() {} -func (*DetachNetworkResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_909455b1b868ddb9, []int{3} -} -func (m *DetachNetworkResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DetachNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DetachNetworkResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DetachNetworkResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DetachNetworkResponse.Merge(m, src) -} -func (m *DetachNetworkResponse) XXX_Size() int { - return m.Size() -} -func (m *DetachNetworkResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DetachNetworkResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DetachNetworkResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*AttachNetworkRequest)(nil), "docker.swarmkit.v1.AttachNetworkRequest") - proto.RegisterType((*AttachNetworkResponse)(nil), "docker.swarmkit.v1.AttachNetworkResponse") - proto.RegisterType((*DetachNetworkRequest)(nil), "docker.swarmkit.v1.DetachNetworkRequest") - proto.RegisterType((*DetachNetworkResponse)(nil), "docker.swarmkit.v1.DetachNetworkResponse") -} - -func init() { - proto.RegisterFile("github.com/docker/swarmkit/api/resource.proto", fileDescriptor_909455b1b868ddb9) -} - -var fileDescriptor_909455b1b868ddb9 = []byte{ - // 411 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x3f, 0x6f, 0xda, 0x40, - 0x18, 0xc6, 0x7d, 0x0c, 0x48, 0x3d, 0x8c, 0xda, 0x5a, 0xa0, 0x22, 0xa4, 0x1e, 0xc8, 0xed, 0x40, - 0x5b, 0x61, 0xab, 0x54, 0x55, 0x67, 0xfe, 0x2c, 0x1e, 0xca, 0xe0, 0x2f, 0x50, 0x1d, 0xf6, 0x61, - 0x2c, 0xb0, 0xcf, 0x3d, 0x9f, 0x83, 0xb2, 0x65, 0xcd, 0x94, 0x8c, 0xf9, 0x0e, 0x91, 0xf2, 0x39, - 0x50, 0x26, 0x46, 0x26, 0x14, 0xcc, 0x9e, 0xcf, 0x10, 0xe1, 0x33, 0x20, 0x88, 0x95, 0xa0, 0x4c, - 0x3e, 0x9f, 0x9f, 0xe7, 0x79, 0x7f, 0xef, 0xfb, 0x1a, 0x36, 0x1d, 0x97, 0x8f, 0xa2, 0x81, 0x66, - 0x51, 0x4f, 0xb7, 0xa9, 0x35, 0x26, 0x4c, 0x0f, 0xa7, 0x98, 0x79, 0x63, 0x97, 0xeb, 0x38, 0x70, - 0x75, 0x46, 0x42, 0x1a, 0x31, 0x8b, 0x68, 0x01, 0xa3, 0x9c, 0x2a, 0x8a, 0xd0, 0x68, 0x5b, 0x8d, - 0x76, 0xf6, 0xb3, 0xfa, 0xfd, 0x95, 0x08, 0x7e, 0x1e, 0x90, 0x50, 0xf8, 0xab, 0x25, 0x87, 0x3a, - 0x34, 0x39, 0xea, 0x9b, 0x53, 0x7a, 0xfb, 0xe7, 0x85, 0x84, 0x44, 0x31, 0x88, 0x86, 0x7a, 0x30, - 0x89, 0x1c, 0xd7, 0x4f, 0x1f, 0xc2, 0xa8, 0x5e, 0x01, 0x58, 0x6a, 0x73, 0x8e, 0xad, 0x51, 0x9f, - 0xf0, 0x29, 0x65, 0x63, 0x93, 0xfc, 0x8f, 0x48, 0xc8, 0x95, 0x2e, 0xcc, 0x5b, 0xd4, 0x1f, 0xba, - 0x4e, 0x05, 0xd4, 0x41, 0xa3, 0xd0, 0xfa, 0xa1, 0x3d, 0x07, 0xd7, 0x52, 0x8f, 0x08, 0xf0, 0x88, - 0xcf, 0xbb, 0x89, 0xc5, 0x4c, 0xad, 0x4a, 0x0b, 0xca, 0x16, 0xf5, 0x39, 0x76, 0x7d, 0xc2, 0xfe, - 0xb9, 0x76, 0x25, 0x57, 0x07, 0x8d, 0x77, 0x9d, 0xf7, 0xf1, 0xb2, 0x56, 0xe8, 0x6e, 0xef, 0x8d, - 0x9e, 0x59, 0xd8, 0x89, 0x0c, 0x5b, 0xed, 0xc3, 0xf2, 0x11, 0x50, 0x18, 0x50, 0x3f, 0x24, 0xca, - 0x6f, 0x58, 0xc4, 0xbb, 0x42, 0x9b, 0x34, 0x90, 0xa4, 0x7d, 0x88, 0x97, 0x35, 0x79, 0x4f, 0x60, - 0xf4, 0x4c, 0x79, 0x2f, 0x33, 0x6c, 0xf5, 0x2f, 0x2c, 0xf5, 0x48, 0x46, 0x83, 0x6f, 0x8c, 0xfb, - 0x04, 0xcb, 0x47, 0x71, 0x02, 0xaf, 0x75, 0x9b, 0x83, 0x1f, 0xcd, 0x74, 0xd7, 0xed, 0xc9, 0x84, - 0x5a, 0x98, 0x53, 0xa6, 0x5c, 0x02, 0x58, 0x3c, 0x68, 0x47, 0x69, 0x64, 0x0d, 0x32, 0x6b, 0x05, - 0xd5, 0x6f, 0x27, 0x28, 0x45, 0x71, 0xf5, 0xcb, 0xfd, 0xdd, 0xe3, 0x4d, 0xee, 0x33, 0x94, 0x13, - 0x69, 0x73, 0xf3, 0x8d, 0x30, 0x58, 0x14, 0x6f, 0x1e, 0xf6, 0xb1, 0x43, 0x04, 0xcb, 0x01, 0x7b, - 0x36, 0x4b, 0xd6, 0xb4, 0xb2, 0x59, 0x32, 0x07, 0x71, 0x12, 0x4b, 0xe7, 0xeb, 0x6c, 0x85, 0xa4, - 0xc5, 0x0a, 0x49, 0x17, 0x31, 0x02, 0xb3, 0x18, 0x81, 0x79, 0x8c, 0xc0, 0x43, 0x8c, 0xc0, 0xf5, - 0x1a, 0x49, 0xf3, 0x35, 0x92, 0x16, 0x6b, 0x24, 0x0d, 0xf2, 0xc9, 0x4f, 0xfa, 0xeb, 0x29, 0x00, - 0x00, 0xff, 0xff, 0x9d, 0x2f, 0x31, 0x83, 0x64, 0x03, 0x00, 0x00, -} - -type authenticatedWrapperResourceAllocatorServer struct { - local ResourceAllocatorServer - authorize func(context.Context, []string) error -} - -func NewAuthenticatedWrapperResourceAllocatorServer(local ResourceAllocatorServer, authorize func(context.Context, []string) error) ResourceAllocatorServer { - return &authenticatedWrapperResourceAllocatorServer{ - local: local, - authorize: authorize, - } -} - -func (p *authenticatedWrapperResourceAllocatorServer) AttachNetwork(ctx context.Context, r *AttachNetworkRequest) (*AttachNetworkResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-worker", "swarm-manager"}); err != nil { - return nil, err - } - return p.local.AttachNetwork(ctx, r) -} - -func (p *authenticatedWrapperResourceAllocatorServer) DetachNetwork(ctx context.Context, r *DetachNetworkRequest) (*DetachNetworkResponse, error) { - - if err := p.authorize(ctx, []string{"swarm-worker", "swarm-manager"}); err != nil { - return nil, err - } - return p.local.DetachNetwork(ctx, r) -} - -func (m *AttachNetworkRequest) Copy() *AttachNetworkRequest { - if m == nil { - return nil - } - o := &AttachNetworkRequest{} - o.CopyFrom(m) - return o -} - -func (m *AttachNetworkRequest) CopyFrom(src interface{}) { - - o := src.(*AttachNetworkRequest) - *m = *o - if o.Config != nil { - m.Config = &NetworkAttachmentConfig{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Config, o.Config) - } -} - -func (m *AttachNetworkResponse) Copy() *AttachNetworkResponse { - if m == nil { - return nil - } - o := &AttachNetworkResponse{} - o.CopyFrom(m) - return o -} - -func (m *AttachNetworkResponse) CopyFrom(src interface{}) { - - o := src.(*AttachNetworkResponse) - *m = *o -} - -func (m *DetachNetworkRequest) Copy() *DetachNetworkRequest { - if m == nil { - return nil - } - o := &DetachNetworkRequest{} - o.CopyFrom(m) - return o -} - -func (m *DetachNetworkRequest) CopyFrom(src interface{}) { - - o := src.(*DetachNetworkRequest) - *m = *o -} - -func (m *DetachNetworkResponse) Copy() *DetachNetworkResponse { - if m == nil { - return nil - } - o := &DetachNetworkResponse{} - o.CopyFrom(m) - return o -} - -func (m *DetachNetworkResponse) CopyFrom(src interface{}) {} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// ResourceAllocatorClient is the client API for ResourceAllocator service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ResourceAllocatorClient interface { - AttachNetwork(ctx context.Context, in *AttachNetworkRequest, opts ...grpc.CallOption) (*AttachNetworkResponse, error) - DetachNetwork(ctx context.Context, in *DetachNetworkRequest, opts ...grpc.CallOption) (*DetachNetworkResponse, error) -} - -type resourceAllocatorClient struct { - cc *grpc.ClientConn -} - -func NewResourceAllocatorClient(cc *grpc.ClientConn) ResourceAllocatorClient { - return &resourceAllocatorClient{cc} -} - -func (c *resourceAllocatorClient) AttachNetwork(ctx context.Context, in *AttachNetworkRequest, opts ...grpc.CallOption) (*AttachNetworkResponse, error) { - out := new(AttachNetworkResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.ResourceAllocator/AttachNetwork", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *resourceAllocatorClient) DetachNetwork(ctx context.Context, in *DetachNetworkRequest, opts ...grpc.CallOption) (*DetachNetworkResponse, error) { - out := new(DetachNetworkResponse) - err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.ResourceAllocator/DetachNetwork", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ResourceAllocatorServer is the server API for ResourceAllocator service. -type ResourceAllocatorServer interface { - AttachNetwork(context.Context, *AttachNetworkRequest) (*AttachNetworkResponse, error) - DetachNetwork(context.Context, *DetachNetworkRequest) (*DetachNetworkResponse, error) -} - -// UnimplementedResourceAllocatorServer can be embedded to have forward compatible implementations. -type UnimplementedResourceAllocatorServer struct { -} - -func (*UnimplementedResourceAllocatorServer) AttachNetwork(ctx context.Context, req *AttachNetworkRequest) (*AttachNetworkResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AttachNetwork not implemented") -} -func (*UnimplementedResourceAllocatorServer) DetachNetwork(ctx context.Context, req *DetachNetworkRequest) (*DetachNetworkResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DetachNetwork not implemented") -} - -func RegisterResourceAllocatorServer(s *grpc.Server, srv ResourceAllocatorServer) { - s.RegisterService(&_ResourceAllocator_serviceDesc, srv) -} - -func _ResourceAllocator_AttachNetwork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AttachNetworkRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ResourceAllocatorServer).AttachNetwork(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.ResourceAllocator/AttachNetwork", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ResourceAllocatorServer).AttachNetwork(ctx, req.(*AttachNetworkRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ResourceAllocator_DetachNetwork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DetachNetworkRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ResourceAllocatorServer).DetachNetwork(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/docker.swarmkit.v1.ResourceAllocator/DetachNetwork", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ResourceAllocatorServer).DetachNetwork(ctx, req.(*DetachNetworkRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _ResourceAllocator_serviceDesc = grpc.ServiceDesc{ - ServiceName: "docker.swarmkit.v1.ResourceAllocator", - HandlerType: (*ResourceAllocatorServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "AttachNetwork", - Handler: _ResourceAllocator_AttachNetwork_Handler, - }, - { - MethodName: "DetachNetwork", - Handler: _ResourceAllocator_DetachNetwork_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/docker/swarmkit/api/resource.proto", -} - -func (m *AttachNetworkRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AttachNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AttachNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ContainerID) > 0 { - i -= len(m.ContainerID) - copy(dAtA[i:], m.ContainerID) - i = encodeVarintResource(dAtA, i, uint64(len(m.ContainerID))) - i-- - dAtA[i] = 0x12 - } - if m.Config != nil { - { - size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintResource(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AttachNetworkResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AttachNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AttachNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AttachmentID) > 0 { - i -= len(m.AttachmentID) - copy(dAtA[i:], m.AttachmentID) - i = encodeVarintResource(dAtA, i, uint64(len(m.AttachmentID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DetachNetworkRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DetachNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DetachNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AttachmentID) > 0 { - i -= len(m.AttachmentID) - copy(dAtA[i:], m.AttachmentID) - i = encodeVarintResource(dAtA, i, uint64(len(m.AttachmentID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DetachNetworkResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DetachNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DetachNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintResource(dAtA []byte, offset int, v uint64) int { - offset -= sovResource(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -type raftProxyResourceAllocatorServer struct { - local ResourceAllocatorServer - connSelector raftselector.ConnProvider - localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error) -} - -func NewRaftProxyResourceAllocatorServer(local ResourceAllocatorServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) ResourceAllocatorServer { - redirectChecker := func(ctx context.Context) (context.Context, error) { - p, ok := peer.FromContext(ctx) - if !ok { - return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context") - } - addr := p.Addr.String() - md, ok := metadata.FromIncomingContext(ctx) - if ok && len(md["redirect"]) != 0 { - return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"]) - } - if !ok { - md = metadata.New(map[string]string{}) - } - md["redirect"] = append(md["redirect"], addr) - return metadata.NewOutgoingContext(ctx, md), nil - } - remoteMods := []func(context.Context) (context.Context, error){redirectChecker} - remoteMods = append(remoteMods, remoteCtxMod) - - var localMods []func(context.Context) (context.Context, error) - if localCtxMod != nil { - localMods = []func(context.Context) (context.Context, error){localCtxMod} - } - - return &raftProxyResourceAllocatorServer{ - local: local, - connSelector: connSelector, - localCtxMods: localMods, - remoteCtxMods: remoteMods, - } -} -func (p *raftProxyResourceAllocatorServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) { - var err error - for _, mod := range ctxMods { - ctx, err = mod(ctx) - if err != nil { - return ctx, err - } - } - return ctx, nil -} -func (p *raftProxyResourceAllocatorServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) { - ticker := rafttime.NewTicker(500 * rafttime.Millisecond) - defer ticker.Stop() - for { - select { - case <-ticker.C: - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - return nil, err - } - - client := NewHealthClient(conn) - - resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"}) - if err != nil || resp.Status != HealthCheckResponse_SERVING { - continue - } - return conn, nil - case <-ctx.Done(): - return nil, ctx.Err() - } - } -} - -func (p *raftProxyResourceAllocatorServer) AttachNetwork(ctx context.Context, r *AttachNetworkRequest) (*AttachNetworkResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.AttachNetwork(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewResourceAllocatorClient(conn).AttachNetwork(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.AttachNetwork(ctx, r) - } - return nil, err - } - return NewResourceAllocatorClient(conn).AttachNetwork(modCtx, r) - } - return resp, err -} - -func (p *raftProxyResourceAllocatorServer) DetachNetwork(ctx context.Context, r *DetachNetworkRequest) (*DetachNetworkResponse, error) { - - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return nil, err - } - return p.local.DetachNetwork(ctx, r) - } - return nil, err - } - modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return nil, err - } - - resp, err := NewResourceAllocatorClient(conn).DetachNetwork(modCtx, r) - if err != nil { - if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { - return resp, err - } - conn, err := p.pollNewLeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - return p.local.DetachNetwork(ctx, r) - } - return nil, err - } - return NewResourceAllocatorClient(conn).DetachNetwork(modCtx, r) - } - return resp, err -} - -func (m *AttachNetworkRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Config != nil { - l = m.Config.Size() - n += 1 + l + sovResource(uint64(l)) - } - l = len(m.ContainerID) - if l > 0 { - n += 1 + l + sovResource(uint64(l)) - } - return n -} - -func (m *AttachNetworkResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AttachmentID) - if l > 0 { - n += 1 + l + sovResource(uint64(l)) - } - return n -} - -func (m *DetachNetworkRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AttachmentID) - if l > 0 { - n += 1 + l + sovResource(uint64(l)) - } - return n -} - -func (m *DetachNetworkResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovResource(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozResource(x uint64) (n int) { - return sovResource(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *AttachNetworkRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AttachNetworkRequest{`, - `Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "NetworkAttachmentConfig", "NetworkAttachmentConfig", 1) + `,`, - `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, - `}`, - }, "") - return s -} -func (this *AttachNetworkResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AttachNetworkResponse{`, - `AttachmentID:` + fmt.Sprintf("%v", this.AttachmentID) + `,`, - `}`, - }, "") - return s -} -func (this *DetachNetworkRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DetachNetworkRequest{`, - `AttachmentID:` + fmt.Sprintf("%v", this.AttachmentID) + `,`, - `}`, - }, "") - return s -} -func (this *DetachNetworkResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DetachNetworkResponse{`, - `}`, - }, "") - return s -} -func valueToStringResource(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *AttachNetworkRequest) Unmarshal(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 ErrIntOverflowResource - } - 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: AttachNetworkRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AttachNetworkRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResource - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthResource - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthResource - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Config == nil { - m.Config = &NetworkAttachmentConfig{} - } - if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResource - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthResource - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthResource - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContainerID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipResource(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthResource - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AttachNetworkResponse) Unmarshal(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 ErrIntOverflowResource - } - 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: AttachNetworkResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AttachNetworkResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AttachmentID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResource - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthResource - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthResource - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AttachmentID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipResource(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthResource - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DetachNetworkRequest) Unmarshal(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 ErrIntOverflowResource - } - 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: DetachNetworkRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DetachNetworkRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AttachmentID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowResource - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthResource - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthResource - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AttachmentID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipResource(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthResource - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DetachNetworkResponse) Unmarshal(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 ErrIntOverflowResource - } - 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: DetachNetworkResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DetachNetworkResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipResource(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthResource - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipResource(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowResource - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowResource - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowResource - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthResource - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupResource - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthResource - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthResource = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowResource = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupResource = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/moby/swarmkit/v2/api/resource.proto b/vendor/github.com/moby/swarmkit/v2/api/resource.proto deleted file mode 100644 index ecaa749ee7..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/resource.proto +++ /dev/null @@ -1,34 +0,0 @@ -syntax = "proto3"; - -package docker.swarmkit.v1; - -import "github.com/docker/swarmkit/api/types.proto"; -import "gogoproto/gogo.proto"; -import "github.com/docker/swarmkit/protobuf/plugin/plugin.proto"; - -// Allocator is the API provided by a manager group for agents to control the allocation of certain entities. -// -// API methods on this service are used only by agent nodes. -service ResourceAllocator { - rpc AttachNetwork(AttachNetworkRequest) returns (AttachNetworkResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-worker" roles: "swarm-manager" }; - }; - rpc DetachNetwork(DetachNetworkRequest) returns (DetachNetworkResponse) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-worker" roles: "swarm-manager" }; - }; -} - -message AttachNetworkRequest { - NetworkAttachmentConfig config = 1; - string container_id = 2; -} - -message AttachNetworkResponse { - string attachment_id = 1; -} - -message DetachNetworkRequest { - string attachment_id = 1; -} - -message DetachNetworkResponse {} diff --git a/vendor/github.com/moby/swarmkit/v2/api/snapshot.pb.go b/vendor/github.com/moby/swarmkit/v2/api/snapshot.pb.go deleted file mode 100644 index 7ab5d978d0..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/snapshot.pb.go +++ /dev/null @@ -1,1611 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/docker/swarmkit/api/snapshot.proto - -package api - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - github_com_moby_swarmkit_v2_api_deepcopy "github.com/moby/swarmkit/v2/api/deepcopy" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Snapshot_Version int32 - -const ( - // V0 is the initial version of the StoreSnapshot message. - Snapshot_V0 Snapshot_Version = 0 -) - -var Snapshot_Version_name = map[int32]string{ - 0: "V0", -} - -var Snapshot_Version_value = map[string]int32{ - "V0": 0, -} - -func (x Snapshot_Version) String() string { - return proto.EnumName(Snapshot_Version_name, int32(x)) -} - -func (Snapshot_Version) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_c5cad0b62cecd9af, []int{2, 0} -} - -// StoreSnapshot is used to store snapshots of the store. -type StoreSnapshot struct { - Nodes []*Node `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` - Services []*Service `protobuf:"bytes,2,rep,name=services,proto3" json:"services,omitempty"` - Networks []*Network `protobuf:"bytes,3,rep,name=networks,proto3" json:"networks,omitempty"` - Tasks []*Task `protobuf:"bytes,4,rep,name=tasks,proto3" json:"tasks,omitempty"` - Clusters []*Cluster `protobuf:"bytes,5,rep,name=clusters,proto3" json:"clusters,omitempty"` - Secrets []*Secret `protobuf:"bytes,6,rep,name=secrets,proto3" json:"secrets,omitempty"` - Resources []*Resource `protobuf:"bytes,7,rep,name=resources,proto3" json:"resources,omitempty"` - Extensions []*Extension `protobuf:"bytes,8,rep,name=extensions,proto3" json:"extensions,omitempty"` - Configs []*Config `protobuf:"bytes,9,rep,name=configs,proto3" json:"configs,omitempty"` - Volumes []*Volume `protobuf:"bytes,10,rep,name=volumes,proto3" json:"volumes,omitempty"` -} - -func (m *StoreSnapshot) Reset() { *m = StoreSnapshot{} } -func (*StoreSnapshot) ProtoMessage() {} -func (*StoreSnapshot) Descriptor() ([]byte, []int) { - return fileDescriptor_c5cad0b62cecd9af, []int{0} -} -func (m *StoreSnapshot) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StoreSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StoreSnapshot.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StoreSnapshot) XXX_Merge(src proto.Message) { - xxx_messageInfo_StoreSnapshot.Merge(m, src) -} -func (m *StoreSnapshot) XXX_Size() int { - return m.Size() -} -func (m *StoreSnapshot) XXX_DiscardUnknown() { - xxx_messageInfo_StoreSnapshot.DiscardUnknown(m) -} - -var xxx_messageInfo_StoreSnapshot proto.InternalMessageInfo - -// ClusterSnapshot stores cluster membership information in snapshots. -type ClusterSnapshot struct { - Members []*RaftMember `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"` - Removed []uint64 `protobuf:"varint,2,rep,name=removed,proto3" json:"removed,omitempty"` -} - -func (m *ClusterSnapshot) Reset() { *m = ClusterSnapshot{} } -func (*ClusterSnapshot) ProtoMessage() {} -func (*ClusterSnapshot) Descriptor() ([]byte, []int) { - return fileDescriptor_c5cad0b62cecd9af, []int{1} -} -func (m *ClusterSnapshot) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ClusterSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ClusterSnapshot.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ClusterSnapshot) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClusterSnapshot.Merge(m, src) -} -func (m *ClusterSnapshot) XXX_Size() int { - return m.Size() -} -func (m *ClusterSnapshot) XXX_DiscardUnknown() { - xxx_messageInfo_ClusterSnapshot.DiscardUnknown(m) -} - -var xxx_messageInfo_ClusterSnapshot proto.InternalMessageInfo - -type Snapshot struct { - Version Snapshot_Version `protobuf:"varint,1,opt,name=version,proto3,enum=docker.swarmkit.v1.Snapshot_Version" json:"version,omitempty"` - Membership ClusterSnapshot `protobuf:"bytes,2,opt,name=membership,proto3" json:"membership"` - Store StoreSnapshot `protobuf:"bytes,3,opt,name=store,proto3" json:"store"` -} - -func (m *Snapshot) Reset() { *m = Snapshot{} } -func (*Snapshot) ProtoMessage() {} -func (*Snapshot) Descriptor() ([]byte, []int) { - return fileDescriptor_c5cad0b62cecd9af, []int{2} -} -func (m *Snapshot) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Snapshot.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Snapshot) XXX_Merge(src proto.Message) { - xxx_messageInfo_Snapshot.Merge(m, src) -} -func (m *Snapshot) XXX_Size() int { - return m.Size() -} -func (m *Snapshot) XXX_DiscardUnknown() { - xxx_messageInfo_Snapshot.DiscardUnknown(m) -} - -var xxx_messageInfo_Snapshot proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("docker.swarmkit.v1.Snapshot_Version", Snapshot_Version_name, Snapshot_Version_value) - proto.RegisterType((*StoreSnapshot)(nil), "docker.swarmkit.v1.StoreSnapshot") - proto.RegisterType((*ClusterSnapshot)(nil), "docker.swarmkit.v1.ClusterSnapshot") - proto.RegisterType((*Snapshot)(nil), "docker.swarmkit.v1.Snapshot") -} - -func init() { - proto.RegisterFile("github.com/docker/swarmkit/api/snapshot.proto", fileDescriptor_c5cad0b62cecd9af) -} - -var fileDescriptor_c5cad0b62cecd9af = []byte{ - // 523 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0x41, 0x8f, 0x12, 0x31, - 0x14, 0xc7, 0x67, 0x58, 0x60, 0xd8, 0x6e, 0xd4, 0xb5, 0xf1, 0xd0, 0xe0, 0x5a, 0x11, 0xf7, 0x80, - 0x89, 0x0e, 0x8a, 0x26, 0x1a, 0x93, 0xf5, 0xc0, 0xc6, 0x83, 0x07, 0xf7, 0x50, 0x0c, 0xf1, 0x3a, - 0x0c, 0x05, 0x46, 0x76, 0xa6, 0xa4, 0xaf, 0xb0, 0x1e, 0xfd, 0x08, 0x7e, 0x1b, 0xbf, 0x02, 0xc7, - 0x3d, 0xee, 0xc9, 0xb8, 0x70, 0xf0, 0x6b, 0x98, 0xb6, 0x53, 0x24, 0x71, 0x70, 0x6f, 0x93, 0xe6, - 0xf7, 0x7b, 0xef, 0xdf, 0xce, 0x7b, 0xe8, 0xd9, 0x38, 0x51, 0x93, 0xf9, 0x20, 0x8c, 0x45, 0xda, - 0x1e, 0x8a, 0x78, 0xca, 0x65, 0x1b, 0x2e, 0x22, 0x99, 0x4e, 0x13, 0xd5, 0x8e, 0x66, 0x49, 0x1b, - 0xb2, 0x68, 0x06, 0x13, 0xa1, 0xc2, 0x99, 0x14, 0x4a, 0x60, 0x6c, 0x99, 0xd0, 0x31, 0xe1, 0xe2, - 0x45, 0xfd, 0xe9, 0x0d, 0x25, 0xc4, 0xe0, 0x0b, 0x8f, 0x15, 0xd8, 0x0a, 0xf5, 0x27, 0x37, 0xd0, - 0x32, 0x1a, 0xe5, 0xcd, 0xea, 0xf7, 0xc6, 0x62, 0x2c, 0xcc, 0x67, 0x5b, 0x7f, 0xd9, 0xd3, 0xe6, - 0x8f, 0x32, 0xba, 0xd5, 0x53, 0x42, 0xf2, 0x5e, 0x1e, 0x0d, 0x87, 0xa8, 0x92, 0x89, 0x21, 0x07, - 0xe2, 0x37, 0xf6, 0x5a, 0x07, 0x1d, 0x12, 0xfe, 0x1b, 0x32, 0x3c, 0x13, 0x43, 0xce, 0x2c, 0x86, - 0x5f, 0xa3, 0x1a, 0x70, 0xb9, 0x48, 0x62, 0x0e, 0xa4, 0x64, 0x94, 0xfb, 0x45, 0x4a, 0xcf, 0x32, - 0x6c, 0x03, 0x6b, 0x31, 0xe3, 0xea, 0x42, 0xc8, 0x29, 0x90, 0xbd, 0xdd, 0xe2, 0x99, 0x65, 0xd8, - 0x06, 0xd6, 0x09, 0x55, 0x04, 0x53, 0x20, 0xe5, 0xdd, 0x09, 0x3f, 0x45, 0x30, 0x65, 0x16, 0xd3, - 0x8d, 0xe2, 0xf3, 0x39, 0x28, 0x2e, 0x81, 0x54, 0x76, 0x37, 0x3a, 0xb5, 0x0c, 0xdb, 0xc0, 0xf8, - 0x15, 0x0a, 0x80, 0xc7, 0x92, 0x2b, 0x20, 0x55, 0xe3, 0xd5, 0x8b, 0x6f, 0xa6, 0x11, 0xe6, 0x50, - 0xfc, 0x16, 0xed, 0x4b, 0x0e, 0x62, 0x2e, 0xf5, 0x8b, 0x04, 0xc6, 0x3b, 0x2a, 0xf2, 0x58, 0x0e, - 0xb1, 0xbf, 0x38, 0x3e, 0x41, 0x88, 0x7f, 0x55, 0x3c, 0x83, 0x44, 0x64, 0x40, 0x6a, 0x46, 0x7e, - 0x50, 0x24, 0xbf, 0x77, 0x14, 0xdb, 0x12, 0x74, 0xe0, 0x58, 0x64, 0xa3, 0x64, 0x0c, 0x64, 0x7f, - 0x77, 0xe0, 0x53, 0x83, 0x30, 0x87, 0x6a, 0x6b, 0x21, 0xce, 0xe7, 0x29, 0x07, 0x82, 0x76, 0x5b, - 0x7d, 0x83, 0x30, 0x87, 0x36, 0x13, 0x74, 0x27, 0x7f, 0xb1, 0xcd, 0xe8, 0xbc, 0x41, 0x41, 0xca, - 0xd3, 0x81, 0x7e, 0x67, 0x3b, 0x3c, 0xb4, 0xf0, 0xde, 0xd1, 0x48, 0x7d, 0x34, 0x18, 0x73, 0x38, - 0x3e, 0x42, 0x81, 0xe4, 0xa9, 0x58, 0xf0, 0xa1, 0x99, 0xa1, 0x72, 0xb7, 0x74, 0xe8, 0x31, 0x77, - 0xd4, 0xfc, 0xed, 0xa3, 0xda, 0xa6, 0xc9, 0x3b, 0x14, 0x2c, 0xb8, 0xd4, 0xf7, 0x25, 0x7e, 0xc3, - 0x6f, 0xdd, 0xee, 0x1c, 0x17, 0xfe, 0x14, 0xb7, 0x69, 0x7d, 0xcb, 0x32, 0x27, 0xe1, 0x0f, 0x08, - 0xe5, 0x5d, 0x27, 0xc9, 0x8c, 0x94, 0x1a, 0x7e, 0xeb, 0xa0, 0xf3, 0xf8, 0x3f, 0xf3, 0xe0, 0x2a, - 0x75, 0xcb, 0xcb, 0x9f, 0x0f, 0x3d, 0xb6, 0x25, 0xe3, 0x13, 0x54, 0x01, 0xbd, 0x3b, 0x64, 0xcf, - 0x54, 0x79, 0x54, 0x18, 0x64, 0x7b, 0xb9, 0xf2, 0x1a, 0xd6, 0x6a, 0xde, 0x45, 0x41, 0x9e, 0x0e, - 0x57, 0x51, 0xa9, 0xff, 0xfc, 0xd0, 0xeb, 0x1e, 0x2f, 0xaf, 0xa9, 0x77, 0x75, 0x4d, 0xbd, 0x6f, - 0x2b, 0xea, 0x2f, 0x57, 0xd4, 0xbf, 0x5c, 0x51, 0xff, 0xd7, 0x8a, 0xfa, 0xdf, 0xd7, 0xd4, 0xbb, - 0x5c, 0x53, 0xef, 0x6a, 0x4d, 0xbd, 0xcf, 0xa5, 0x41, 0xd5, 0x6c, 0xef, 0xcb, 0x3f, 0x01, 0x00, - 0x00, 0xff, 0xff, 0x27, 0xb3, 0xad, 0x75, 0x71, 0x04, 0x00, 0x00, -} - -func (m *StoreSnapshot) Copy() *StoreSnapshot { - if m == nil { - return nil - } - o := &StoreSnapshot{} - o.CopyFrom(m) - return o -} - -func (m *StoreSnapshot) CopyFrom(src interface{}) { - - o := src.(*StoreSnapshot) - *m = *o - if o.Nodes != nil { - m.Nodes = make([]*Node, len(o.Nodes)) - for i := range m.Nodes { - m.Nodes[i] = &Node{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Nodes[i], o.Nodes[i]) - } - } - - if o.Services != nil { - m.Services = make([]*Service, len(o.Services)) - for i := range m.Services { - m.Services[i] = &Service{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Services[i], o.Services[i]) - } - } - - if o.Networks != nil { - m.Networks = make([]*Network, len(o.Networks)) - for i := range m.Networks { - m.Networks[i] = &Network{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Networks[i], o.Networks[i]) - } - } - - if o.Tasks != nil { - m.Tasks = make([]*Task, len(o.Tasks)) - for i := range m.Tasks { - m.Tasks[i] = &Task{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Tasks[i], o.Tasks[i]) - } - } - - if o.Clusters != nil { - m.Clusters = make([]*Cluster, len(o.Clusters)) - for i := range m.Clusters { - m.Clusters[i] = &Cluster{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Clusters[i], o.Clusters[i]) - } - } - - if o.Secrets != nil { - m.Secrets = make([]*Secret, len(o.Secrets)) - for i := range m.Secrets { - m.Secrets[i] = &Secret{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Secrets[i], o.Secrets[i]) - } - } - - if o.Resources != nil { - m.Resources = make([]*Resource, len(o.Resources)) - for i := range m.Resources { - m.Resources[i] = &Resource{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Resources[i], o.Resources[i]) - } - } - - if o.Extensions != nil { - m.Extensions = make([]*Extension, len(o.Extensions)) - for i := range m.Extensions { - m.Extensions[i] = &Extension{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Extensions[i], o.Extensions[i]) - } - } - - if o.Configs != nil { - m.Configs = make([]*Config, len(o.Configs)) - for i := range m.Configs { - m.Configs[i] = &Config{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Configs[i], o.Configs[i]) - } - } - - if o.Volumes != nil { - m.Volumes = make([]*Volume, len(o.Volumes)) - for i := range m.Volumes { - m.Volumes[i] = &Volume{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Volumes[i], o.Volumes[i]) - } - } - -} - -func (m *ClusterSnapshot) Copy() *ClusterSnapshot { - if m == nil { - return nil - } - o := &ClusterSnapshot{} - o.CopyFrom(m) - return o -} - -func (m *ClusterSnapshot) CopyFrom(src interface{}) { - - o := src.(*ClusterSnapshot) - *m = *o - if o.Members != nil { - m.Members = make([]*RaftMember, len(o.Members)) - for i := range m.Members { - m.Members[i] = &RaftMember{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Members[i], o.Members[i]) - } - } - - if o.Removed != nil { - m.Removed = make([]uint64, len(o.Removed)) - copy(m.Removed, o.Removed) - } - -} - -func (m *Snapshot) Copy() *Snapshot { - if m == nil { - return nil - } - o := &Snapshot{} - o.CopyFrom(m) - return o -} - -func (m *Snapshot) CopyFrom(src interface{}) { - - o := src.(*Snapshot) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Membership, &o.Membership) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Store, &o.Store) -} - -func (m *StoreSnapshot) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StoreSnapshot) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Volumes) > 0 { - for iNdEx := len(m.Volumes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Volumes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - } - if len(m.Configs) > 0 { - for iNdEx := len(m.Configs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Configs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - if len(m.Extensions) > 0 { - for iNdEx := len(m.Extensions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Extensions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } - if len(m.Resources) > 0 { - for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if len(m.Secrets) > 0 { - for iNdEx := len(m.Secrets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Secrets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if len(m.Clusters) > 0 { - for iNdEx := len(m.Clusters) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Clusters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.Tasks) > 0 { - for iNdEx := len(m.Tasks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Tasks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Networks) > 0 { - for iNdEx := len(m.Networks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Networks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Services) > 0 { - for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Services[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Nodes) > 0 { - for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ClusterSnapshot) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ClusterSnapshot) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ClusterSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Removed) > 0 { - for iNdEx := len(m.Removed) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarintSnapshot(dAtA, i, uint64(m.Removed[iNdEx])) - i-- - dAtA[i] = 0x10 - } - } - if len(m.Members) > 0 { - for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Members[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Snapshot) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Snapshot) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Store.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Membership.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.Version != 0 { - i = encodeVarintSnapshot(dAtA, i, uint64(m.Version)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintSnapshot(dAtA []byte, offset int, v uint64) int { - offset -= sovSnapshot(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *StoreSnapshot) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Nodes) > 0 { - for _, e := range m.Nodes { - l = e.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - } - if len(m.Services) > 0 { - for _, e := range m.Services { - l = e.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - } - if len(m.Networks) > 0 { - for _, e := range m.Networks { - l = e.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - } - if len(m.Tasks) > 0 { - for _, e := range m.Tasks { - l = e.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - } - if len(m.Clusters) > 0 { - for _, e := range m.Clusters { - l = e.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - } - if len(m.Secrets) > 0 { - for _, e := range m.Secrets { - l = e.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - } - if len(m.Extensions) > 0 { - for _, e := range m.Extensions { - l = e.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - } - if len(m.Configs) > 0 { - for _, e := range m.Configs { - l = e.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - } - if len(m.Volumes) > 0 { - for _, e := range m.Volumes { - l = e.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - } - return n -} - -func (m *ClusterSnapshot) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Members) > 0 { - for _, e := range m.Members { - l = e.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - } - if len(m.Removed) > 0 { - for _, e := range m.Removed { - n += 1 + sovSnapshot(uint64(e)) - } - } - return n -} - -func (m *Snapshot) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Version != 0 { - n += 1 + sovSnapshot(uint64(m.Version)) - } - l = m.Membership.Size() - n += 1 + l + sovSnapshot(uint64(l)) - l = m.Store.Size() - n += 1 + l + sovSnapshot(uint64(l)) - return n -} - -func sovSnapshot(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSnapshot(x uint64) (n int) { - return sovSnapshot(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *StoreSnapshot) String() string { - if this == nil { - return "nil" - } - repeatedStringForNodes := "[]*Node{" - for _, f := range this.Nodes { - repeatedStringForNodes += strings.Replace(fmt.Sprintf("%v", f), "Node", "Node", 1) + "," - } - repeatedStringForNodes += "}" - repeatedStringForServices := "[]*Service{" - for _, f := range this.Services { - repeatedStringForServices += strings.Replace(fmt.Sprintf("%v", f), "Service", "Service", 1) + "," - } - repeatedStringForServices += "}" - repeatedStringForNetworks := "[]*Network{" - for _, f := range this.Networks { - repeatedStringForNetworks += strings.Replace(fmt.Sprintf("%v", f), "Network", "Network", 1) + "," - } - repeatedStringForNetworks += "}" - repeatedStringForTasks := "[]*Task{" - for _, f := range this.Tasks { - repeatedStringForTasks += strings.Replace(fmt.Sprintf("%v", f), "Task", "Task", 1) + "," - } - repeatedStringForTasks += "}" - repeatedStringForClusters := "[]*Cluster{" - for _, f := range this.Clusters { - repeatedStringForClusters += strings.Replace(fmt.Sprintf("%v", f), "Cluster", "Cluster", 1) + "," - } - repeatedStringForClusters += "}" - repeatedStringForSecrets := "[]*Secret{" - for _, f := range this.Secrets { - repeatedStringForSecrets += strings.Replace(fmt.Sprintf("%v", f), "Secret", "Secret", 1) + "," - } - repeatedStringForSecrets += "}" - repeatedStringForResources := "[]*Resource{" - for _, f := range this.Resources { - repeatedStringForResources += strings.Replace(fmt.Sprintf("%v", f), "Resource", "Resource", 1) + "," - } - repeatedStringForResources += "}" - repeatedStringForExtensions := "[]*Extension{" - for _, f := range this.Extensions { - repeatedStringForExtensions += strings.Replace(fmt.Sprintf("%v", f), "Extension", "Extension", 1) + "," - } - repeatedStringForExtensions += "}" - repeatedStringForConfigs := "[]*Config{" - for _, f := range this.Configs { - repeatedStringForConfigs += strings.Replace(fmt.Sprintf("%v", f), "Config", "Config", 1) + "," - } - repeatedStringForConfigs += "}" - repeatedStringForVolumes := "[]*Volume{" - for _, f := range this.Volumes { - repeatedStringForVolumes += strings.Replace(fmt.Sprintf("%v", f), "Volume", "Volume", 1) + "," - } - repeatedStringForVolumes += "}" - s := strings.Join([]string{`&StoreSnapshot{`, - `Nodes:` + repeatedStringForNodes + `,`, - `Services:` + repeatedStringForServices + `,`, - `Networks:` + repeatedStringForNetworks + `,`, - `Tasks:` + repeatedStringForTasks + `,`, - `Clusters:` + repeatedStringForClusters + `,`, - `Secrets:` + repeatedStringForSecrets + `,`, - `Resources:` + repeatedStringForResources + `,`, - `Extensions:` + repeatedStringForExtensions + `,`, - `Configs:` + repeatedStringForConfigs + `,`, - `Volumes:` + repeatedStringForVolumes + `,`, - `}`, - }, "") - return s -} -func (this *ClusterSnapshot) String() string { - if this == nil { - return "nil" - } - repeatedStringForMembers := "[]*RaftMember{" - for _, f := range this.Members { - repeatedStringForMembers += strings.Replace(fmt.Sprintf("%v", f), "RaftMember", "RaftMember", 1) + "," - } - repeatedStringForMembers += "}" - s := strings.Join([]string{`&ClusterSnapshot{`, - `Members:` + repeatedStringForMembers + `,`, - `Removed:` + fmt.Sprintf("%v", this.Removed) + `,`, - `}`, - }, "") - return s -} -func (this *Snapshot) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Snapshot{`, - `Version:` + fmt.Sprintf("%v", this.Version) + `,`, - `Membership:` + strings.Replace(strings.Replace(this.Membership.String(), "ClusterSnapshot", "ClusterSnapshot", 1), `&`, ``, 1) + `,`, - `Store:` + strings.Replace(strings.Replace(this.Store.String(), "StoreSnapshot", "StoreSnapshot", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func valueToStringSnapshot(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *StoreSnapshot) Unmarshal(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 ErrIntOverflowSnapshot - } - 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: StoreSnapshot: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StoreSnapshot: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Nodes = append(m.Nodes, &Node{}) - if err := m.Nodes[len(m.Nodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Services = append(m.Services, &Service{}) - if err := m.Services[len(m.Services)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Networks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Networks = append(m.Networks, &Network{}) - if err := m.Networks[len(m.Networks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tasks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tasks = append(m.Tasks, &Task{}) - if err := m.Tasks[len(m.Tasks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Clusters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Clusters = append(m.Clusters, &Cluster{}) - if err := m.Clusters[len(m.Clusters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secrets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Secrets = append(m.Secrets, &Secret{}) - if err := m.Secrets[len(m.Secrets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extensions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Extensions = append(m.Extensions, &Extension{}) - if err := m.Extensions[len(m.Extensions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Configs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Configs = append(m.Configs, &Config{}) - if err := m.Configs[len(m.Configs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Volumes = append(m.Volumes, &Volume{}) - if err := m.Volumes[len(m.Volumes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSnapshot(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ClusterSnapshot) Unmarshal(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 ErrIntOverflowSnapshot - } - 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: ClusterSnapshot: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterSnapshot: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Members = append(m.Members, &RaftMember{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Removed = append(m.Removed, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.Removed) == 0 { - m.Removed = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Removed = append(m.Removed, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Removed", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipSnapshot(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Snapshot) Unmarshal(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 ErrIntOverflowSnapshot - } - 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: Snapshot: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - m.Version = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Version |= Snapshot_Version(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Membership", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Membership.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Store", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Store.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSnapshot(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSnapshot(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSnapshot - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSnapshot - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSnapshot - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthSnapshot - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSnapshot - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSnapshot - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthSnapshot = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSnapshot = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSnapshot = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/moby/swarmkit/v2/api/snapshot.proto b/vendor/github.com/moby/swarmkit/v2/api/snapshot.proto deleted file mode 100644 index 42dc0b5c38..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/snapshot.proto +++ /dev/null @@ -1,45 +0,0 @@ -syntax = "proto3"; - -package docker.swarmkit.v1; - -import "github.com/docker/swarmkit/api/objects.proto"; -import "github.com/docker/swarmkit/api/raft.proto"; -import weak "gogoproto/gogo.proto"; - -// StoreSnapshot is used to store snapshots of the store. -message StoreSnapshot { - // TODO(aaronl): The current method of assembling a StoreSnapshot - // structure and marshalling it is not optimal. It may be better to - // write out nodes, networks, tasks, etc. one at a time to an io.Writer - // using gogo-protobuf's io.DelimitedWriter. A new value of the version - // field could support this approach. - - repeated Node nodes = 1; - repeated Service services = 2; - repeated Network networks = 3; - repeated Task tasks = 4; - repeated Cluster clusters = 5; - repeated Secret secrets = 6; - repeated Resource resources = 7; - repeated Extension extensions = 8; - repeated Config configs = 9; - repeated Volume volumes = 10; -} - -// ClusterSnapshot stores cluster membership information in snapshots. -message ClusterSnapshot { - repeated RaftMember members = 1; - repeated uint64 removed = 2 [packed=false]; -} - -message Snapshot { - enum Version { - // V0 is the initial version of the StoreSnapshot message. - V0 = 0; - } - - Version version = 1; - - ClusterSnapshot membership = 2 [(gogoproto.nullable) = false]; - StoreSnapshot store = 3 [(gogoproto.nullable) = false]; -} diff --git a/vendor/github.com/moby/swarmkit/v2/api/specs.pb.go b/vendor/github.com/moby/swarmkit/v2/api/specs.pb.go deleted file mode 100644 index 959749c9f0..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/specs.pb.go +++ /dev/null @@ -1,9304 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/docker/swarmkit/api/specs.proto - -package api - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - types "github.com/gogo/protobuf/types" - github_com_moby_swarmkit_v2_api_deepcopy "github.com/moby/swarmkit/v2/api/deepcopy" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type NodeSpec_Membership int32 - -const ( - NodeMembershipPending NodeSpec_Membership = 0 - NodeMembershipAccepted NodeSpec_Membership = 1 -) - -var NodeSpec_Membership_name = map[int32]string{ - 0: "PENDING", - 1: "ACCEPTED", -} - -var NodeSpec_Membership_value = map[string]int32{ - "PENDING": 0, - "ACCEPTED": 1, -} - -func (x NodeSpec_Membership) String() string { - return proto.EnumName(NodeSpec_Membership_name, int32(x)) -} - -func (NodeSpec_Membership) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{0, 0} -} - -type NodeSpec_Availability int32 - -const ( - // Active nodes. - NodeAvailabilityActive NodeSpec_Availability = 0 - // Paused nodes won't be considered by the scheduler, preventing any - // further task to run on them. - NodeAvailabilityPause NodeSpec_Availability = 1 - // Drained nodes are paused and any task already running on them will - // be evicted. - NodeAvailabilityDrain NodeSpec_Availability = 2 -) - -var NodeSpec_Availability_name = map[int32]string{ - 0: "ACTIVE", - 1: "PAUSE", - 2: "DRAIN", -} - -var NodeSpec_Availability_value = map[string]int32{ - "ACTIVE": 0, - "PAUSE": 1, - "DRAIN": 2, -} - -func (x NodeSpec_Availability) String() string { - return proto.EnumName(NodeSpec_Availability_name, int32(x)) -} - -func (NodeSpec_Availability) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{0, 1} -} - -type ContainerSpec_Isolation int32 - -const ( - // ISOLATION_DEFAULT uses whatever default value from the container runtime - ContainerIsolationDefault ContainerSpec_Isolation = 0 - // ISOLATION_PROCESS forces windows container isolation - ContainerIsolationProcess ContainerSpec_Isolation = 1 - // ISOLATION_HYPERV forces Hyper-V isolation - ContainerIsolationHyperV ContainerSpec_Isolation = 2 -) - -var ContainerSpec_Isolation_name = map[int32]string{ - 0: "ISOLATION_DEFAULT", - 1: "ISOLATION_PROCESS", - 2: "ISOLATION_HYPERV", -} - -var ContainerSpec_Isolation_value = map[string]int32{ - "ISOLATION_DEFAULT": 0, - "ISOLATION_PROCESS": 1, - "ISOLATION_HYPERV": 2, -} - -func (x ContainerSpec_Isolation) String() string { - return proto.EnumName(ContainerSpec_Isolation_name, int32(x)) -} - -func (ContainerSpec_Isolation) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{10, 0} -} - -// ResolutionMode specifies the mode of resolution to use for -// internal loadbalancing between tasks which are all within -// the cluster. This is sometimes calls east-west data path. -type EndpointSpec_ResolutionMode int32 - -const ( - // VIP resolution mode specifies that the - // service resolves to a logical IP and the requests - // are sent to that logical IP. Packets hitting that - // logical IP are load balanced to a chosen backend. - ResolutionModeVirtualIP EndpointSpec_ResolutionMode = 0 - // DNSRR resolution mode specifies that the - // service directly gets resolved to one of the - // backend IP and the client directly initiates a - // request towards the actual backend. This requires - // that the client does not cache the DNS responses - // when the DNS response TTL is 0. - ResolutionModeDNSRoundRobin EndpointSpec_ResolutionMode = 1 -) - -var EndpointSpec_ResolutionMode_name = map[int32]string{ - 0: "VIP", - 1: "DNSRR", -} - -var EndpointSpec_ResolutionMode_value = map[string]int32{ - "VIP": 0, - "DNSRR": 1, -} - -func (x EndpointSpec_ResolutionMode) String() string { - return proto.EnumName(EndpointSpec_ResolutionMode_name, int32(x)) -} - -func (EndpointSpec_ResolutionMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{11, 0} -} - -type VolumeSpec_VolumeAvailability int32 - -const ( - // Active allows a volume to be used and scheduled to. This is the - // default state. - VolumeAvailabilityActive VolumeSpec_VolumeAvailability = 0 - // Pause prevents volumes from having new workloads scheduled to use - // them, even if they're already published on a Node. - VolumeAvailabilityPause VolumeSpec_VolumeAvailability = 1 - // Drain causes existing workloads using this volume to be rescheduled, - // causing the volume to be unpublished and removed from nodes. - VolumeAvailabilityDrain VolumeSpec_VolumeAvailability = 2 -) - -var VolumeSpec_VolumeAvailability_name = map[int32]string{ - 0: "ACTIVE", - 1: "PAUSE", - 2: "DRAIN", -} - -var VolumeSpec_VolumeAvailability_value = map[string]int32{ - "ACTIVE": 0, - "PAUSE": 1, - "DRAIN": 2, -} - -func (x VolumeSpec_VolumeAvailability) String() string { - return proto.EnumName(VolumeSpec_VolumeAvailability_name, int32(x)) -} - -func (VolumeSpec_VolumeAvailability) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{16, 0} -} - -type NodeSpec struct { - Annotations Annotations `protobuf:"bytes,1,opt,name=annotations,proto3" json:"annotations"` - // DesiredRole defines the role the node should have. - DesiredRole NodeRole `protobuf:"varint,2,opt,name=desired_role,json=desiredRole,proto3,enum=docker.swarmkit.v1.NodeRole" json:"desired_role,omitempty"` - // Membership controls the admission of the node into the cluster. - Membership NodeSpec_Membership `protobuf:"varint,3,opt,name=membership,proto3,enum=docker.swarmkit.v1.NodeSpec_Membership" json:"membership,omitempty"` - // Availability allows a user to control the current scheduling status of a - // node. - Availability NodeSpec_Availability `protobuf:"varint,4,opt,name=availability,proto3,enum=docker.swarmkit.v1.NodeSpec_Availability" json:"availability,omitempty"` -} - -func (m *NodeSpec) Reset() { *m = NodeSpec{} } -func (*NodeSpec) ProtoMessage() {} -func (*NodeSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{0} -} -func (m *NodeSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodeSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NodeSpec.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NodeSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeSpec.Merge(m, src) -} -func (m *NodeSpec) XXX_Size() int { - return m.Size() -} -func (m *NodeSpec) XXX_DiscardUnknown() { - xxx_messageInfo_NodeSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeSpec proto.InternalMessageInfo - -// ServiceSpec defines the properties of a service. -// -// A service instructs the cluster in orchestrating repeated instances of a -// template, implemented as tasks. Based on the number of instances, scheduling -// strategy and restart policy, a number of application-level behaviors can be -// defined. -type ServiceSpec struct { - Annotations Annotations `protobuf:"bytes,1,opt,name=annotations,proto3" json:"annotations"` - // Task defines the task template this service will spawn. - Task TaskSpec `protobuf:"bytes,2,opt,name=task,proto3" json:"task"` - // Types that are valid to be assigned to Mode: - // *ServiceSpec_Replicated - // *ServiceSpec_Global - // *ServiceSpec_ReplicatedJob - // *ServiceSpec_GlobalJob - Mode isServiceSpec_Mode `protobuf_oneof:"mode"` - // Update contains settings which affect updates. - Update *UpdateConfig `protobuf:"bytes,6,opt,name=update,proto3" json:"update,omitempty"` - // Rollback contains settings which affect rollbacks of updates. - Rollback *UpdateConfig `protobuf:"bytes,9,opt,name=rollback,proto3" json:"rollback,omitempty"` - // ServiceSpec.Networks has been deprecated and is replaced by - // Networks field in Task (TaskSpec.Networks). - // This field (ServiceSpec.Networks) is kept for compatibility. - // In case TaskSpec.Networks does not exist, ServiceSpec.Networks - // is still honored if it exists. - Networks []*NetworkAttachmentConfig `protobuf:"bytes,7,rep,name=networks,proto3" json:"networks,omitempty"` // Deprecated: Do not use. - // Service endpoint specifies the user provided configuration - // to properly discover and load balance a service. - Endpoint *EndpointSpec `protobuf:"bytes,8,opt,name=endpoint,proto3" json:"endpoint,omitempty"` -} - -func (m *ServiceSpec) Reset() { *m = ServiceSpec{} } -func (*ServiceSpec) ProtoMessage() {} -func (*ServiceSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{1} -} -func (m *ServiceSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ServiceSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ServiceSpec.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ServiceSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceSpec.Merge(m, src) -} -func (m *ServiceSpec) XXX_Size() int { - return m.Size() -} -func (m *ServiceSpec) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceSpec proto.InternalMessageInfo - -type isServiceSpec_Mode interface { - isServiceSpec_Mode() - MarshalTo([]byte) (int, error) - Size() int -} - -type ServiceSpec_Replicated struct { - Replicated *ReplicatedService `protobuf:"bytes,3,opt,name=replicated,proto3,oneof" json:"replicated,omitempty"` -} -type ServiceSpec_Global struct { - Global *GlobalService `protobuf:"bytes,4,opt,name=global,proto3,oneof" json:"global,omitempty"` -} -type ServiceSpec_ReplicatedJob struct { - ReplicatedJob *ReplicatedJob `protobuf:"bytes,10,opt,name=replicated_job,json=replicatedJob,proto3,oneof" json:"replicated_job,omitempty"` -} -type ServiceSpec_GlobalJob struct { - GlobalJob *GlobalJob `protobuf:"bytes,11,opt,name=global_job,json=globalJob,proto3,oneof" json:"global_job,omitempty"` -} - -func (*ServiceSpec_Replicated) isServiceSpec_Mode() {} -func (*ServiceSpec_Global) isServiceSpec_Mode() {} -func (*ServiceSpec_ReplicatedJob) isServiceSpec_Mode() {} -func (*ServiceSpec_GlobalJob) isServiceSpec_Mode() {} - -func (m *ServiceSpec) GetMode() isServiceSpec_Mode { - if m != nil { - return m.Mode - } - return nil -} - -func (m *ServiceSpec) GetReplicated() *ReplicatedService { - if x, ok := m.GetMode().(*ServiceSpec_Replicated); ok { - return x.Replicated - } - return nil -} - -func (m *ServiceSpec) GetGlobal() *GlobalService { - if x, ok := m.GetMode().(*ServiceSpec_Global); ok { - return x.Global - } - return nil -} - -func (m *ServiceSpec) GetReplicatedJob() *ReplicatedJob { - if x, ok := m.GetMode().(*ServiceSpec_ReplicatedJob); ok { - return x.ReplicatedJob - } - return nil -} - -func (m *ServiceSpec) GetGlobalJob() *GlobalJob { - if x, ok := m.GetMode().(*ServiceSpec_GlobalJob); ok { - return x.GlobalJob - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ServiceSpec) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ServiceSpec_Replicated)(nil), - (*ServiceSpec_Global)(nil), - (*ServiceSpec_ReplicatedJob)(nil), - (*ServiceSpec_GlobalJob)(nil), - } -} - -// ReplicatedService sets the reconciliation target to certain number of replicas. -type ReplicatedService struct { - Replicas uint64 `protobuf:"varint,1,opt,name=replicas,proto3" json:"replicas,omitempty"` -} - -func (m *ReplicatedService) Reset() { *m = ReplicatedService{} } -func (*ReplicatedService) ProtoMessage() {} -func (*ReplicatedService) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{2} -} -func (m *ReplicatedService) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ReplicatedService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ReplicatedService.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ReplicatedService) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReplicatedService.Merge(m, src) -} -func (m *ReplicatedService) XXX_Size() int { - return m.Size() -} -func (m *ReplicatedService) XXX_DiscardUnknown() { - xxx_messageInfo_ReplicatedService.DiscardUnknown(m) -} - -var xxx_messageInfo_ReplicatedService proto.InternalMessageInfo - -// GlobalService represents global service. -type GlobalService struct { -} - -func (m *GlobalService) Reset() { *m = GlobalService{} } -func (*GlobalService) ProtoMessage() {} -func (*GlobalService) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{3} -} -func (m *GlobalService) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GlobalService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GlobalService.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GlobalService) XXX_Merge(src proto.Message) { - xxx_messageInfo_GlobalService.Merge(m, src) -} -func (m *GlobalService) XXX_Size() int { - return m.Size() -} -func (m *GlobalService) XXX_DiscardUnknown() { - xxx_messageInfo_GlobalService.DiscardUnknown(m) -} - -var xxx_messageInfo_GlobalService proto.InternalMessageInfo - -// ReplicatedJob is a certain type of one-off job which executes many Tasks in -// parallel until the specified number of Tasks have succeeded. -type ReplicatedJob struct { - // MaxConcurrent indicates the maximum number of Tasks that should be - // executing simultaneously at any given time. - MaxConcurrent uint64 `protobuf:"varint,1,opt,name=max_concurrent,json=maxConcurrent,proto3" json:"max_concurrent,omitempty"` - // TotalCompletions sets the total number of Tasks desired to run to - // completion. This is also the absolute maximum number of Tasks that will - // be executed in parallel. That is, if this number is smaller than - // MaxConcurrent, only this many replicas will run. - TotalCompletions uint64 `protobuf:"varint,2,opt,name=total_completions,json=totalCompletions,proto3" json:"total_completions,omitempty"` -} - -func (m *ReplicatedJob) Reset() { *m = ReplicatedJob{} } -func (*ReplicatedJob) ProtoMessage() {} -func (*ReplicatedJob) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{4} -} -func (m *ReplicatedJob) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ReplicatedJob) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ReplicatedJob.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ReplicatedJob) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReplicatedJob.Merge(m, src) -} -func (m *ReplicatedJob) XXX_Size() int { - return m.Size() -} -func (m *ReplicatedJob) XXX_DiscardUnknown() { - xxx_messageInfo_ReplicatedJob.DiscardUnknown(m) -} - -var xxx_messageInfo_ReplicatedJob proto.InternalMessageInfo - -// GlobalJob is a type of one-off job which executes one Task on every node -// matching the service's placement constraints. -type GlobalJob struct { -} - -func (m *GlobalJob) Reset() { *m = GlobalJob{} } -func (*GlobalJob) ProtoMessage() {} -func (*GlobalJob) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{5} -} -func (m *GlobalJob) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GlobalJob) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GlobalJob.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GlobalJob) XXX_Merge(src proto.Message) { - xxx_messageInfo_GlobalJob.Merge(m, src) -} -func (m *GlobalJob) XXX_Size() int { - return m.Size() -} -func (m *GlobalJob) XXX_DiscardUnknown() { - xxx_messageInfo_GlobalJob.DiscardUnknown(m) -} - -var xxx_messageInfo_GlobalJob proto.InternalMessageInfo - -type TaskSpec struct { - // Types that are valid to be assigned to Runtime: - // *TaskSpec_Attachment - // *TaskSpec_Container - // *TaskSpec_Generic - Runtime isTaskSpec_Runtime `protobuf_oneof:"runtime"` - // Resource requirements for the container. - Resources *ResourceRequirements `protobuf:"bytes,2,opt,name=resources,proto3" json:"resources,omitempty"` - // RestartPolicy specifies what to do when a task fails or finishes. - Restart *RestartPolicy `protobuf:"bytes,4,opt,name=restart,proto3" json:"restart,omitempty"` - // Placement specifies node selection constraints - Placement *Placement `protobuf:"bytes,5,opt,name=placement,proto3" json:"placement,omitempty"` - // LogDriver specifies the log driver to use for the task. Any runtime will - // direct logs into the specified driver for the duration of the task. - LogDriver *Driver `protobuf:"bytes,6,opt,name=log_driver,json=logDriver,proto3" json:"log_driver,omitempty"` - // Networks specifies the list of network attachment - // configurations (which specify the network and per-network - // aliases) that this task spec is bound to. - Networks []*NetworkAttachmentConfig `protobuf:"bytes,7,rep,name=networks,proto3" json:"networks,omitempty"` - // ForceUpdate is a counter that triggers an update even if no relevant - // parameters have been changed. We do this to allow forced restarts - // using the same reconciliation-based mechanism that performs rolling - // updates. - ForceUpdate uint64 `protobuf:"varint,9,opt,name=force_update,json=forceUpdate,proto3" json:"force_update,omitempty"` - // ResourceReferences provides a generic way to specify resources that - // are used by this task, and should be sent down to agents along with - // the task. Inside the runtime field there may be more specific - // information about how to use the resource, but ResourceReferences - // establishes the relationship at the store level, and instructs the - // dispatcher to send the related objects. - // - // ResourceReferences is a list of ResourceReferences used by the task. - ResourceReferences []ResourceReference `protobuf:"bytes,11,rep,name=resource_references,json=resourceReferences,proto3" json:"resource_references"` -} - -func (m *TaskSpec) Reset() { *m = TaskSpec{} } -func (*TaskSpec) ProtoMessage() {} -func (*TaskSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{6} -} -func (m *TaskSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TaskSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TaskSpec.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TaskSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_TaskSpec.Merge(m, src) -} -func (m *TaskSpec) XXX_Size() int { - return m.Size() -} -func (m *TaskSpec) XXX_DiscardUnknown() { - xxx_messageInfo_TaskSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_TaskSpec proto.InternalMessageInfo - -type isTaskSpec_Runtime interface { - isTaskSpec_Runtime() - MarshalTo([]byte) (int, error) - Size() int -} - -type TaskSpec_Attachment struct { - Attachment *NetworkAttachmentSpec `protobuf:"bytes,8,opt,name=attachment,proto3,oneof" json:"attachment,omitempty"` -} -type TaskSpec_Container struct { - Container *ContainerSpec `protobuf:"bytes,1,opt,name=container,proto3,oneof" json:"container,omitempty"` -} -type TaskSpec_Generic struct { - Generic *GenericRuntimeSpec `protobuf:"bytes,10,opt,name=generic,proto3,oneof" json:"generic,omitempty"` -} - -func (*TaskSpec_Attachment) isTaskSpec_Runtime() {} -func (*TaskSpec_Container) isTaskSpec_Runtime() {} -func (*TaskSpec_Generic) isTaskSpec_Runtime() {} - -func (m *TaskSpec) GetRuntime() isTaskSpec_Runtime { - if m != nil { - return m.Runtime - } - return nil -} - -func (m *TaskSpec) GetAttachment() *NetworkAttachmentSpec { - if x, ok := m.GetRuntime().(*TaskSpec_Attachment); ok { - return x.Attachment - } - return nil -} - -func (m *TaskSpec) GetContainer() *ContainerSpec { - if x, ok := m.GetRuntime().(*TaskSpec_Container); ok { - return x.Container - } - return nil -} - -func (m *TaskSpec) GetGeneric() *GenericRuntimeSpec { - if x, ok := m.GetRuntime().(*TaskSpec_Generic); ok { - return x.Generic - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*TaskSpec) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*TaskSpec_Attachment)(nil), - (*TaskSpec_Container)(nil), - (*TaskSpec_Generic)(nil), - } -} - -type ResourceReference struct { - ResourceID string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` - ResourceType ResourceType `protobuf:"varint,2,opt,name=resource_type,json=resourceType,proto3,enum=docker.swarmkit.v1.ResourceType" json:"resource_type,omitempty"` -} - -func (m *ResourceReference) Reset() { *m = ResourceReference{} } -func (*ResourceReference) ProtoMessage() {} -func (*ResourceReference) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{7} -} -func (m *ResourceReference) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResourceReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResourceReference.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ResourceReference) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceReference.Merge(m, src) -} -func (m *ResourceReference) XXX_Size() int { - return m.Size() -} -func (m *ResourceReference) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceReference.DiscardUnknown(m) -} - -var xxx_messageInfo_ResourceReference proto.InternalMessageInfo - -type GenericRuntimeSpec struct { - Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` - Payload *types.Any `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (m *GenericRuntimeSpec) Reset() { *m = GenericRuntimeSpec{} } -func (*GenericRuntimeSpec) ProtoMessage() {} -func (*GenericRuntimeSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{8} -} -func (m *GenericRuntimeSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenericRuntimeSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenericRuntimeSpec.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GenericRuntimeSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenericRuntimeSpec.Merge(m, src) -} -func (m *GenericRuntimeSpec) XXX_Size() int { - return m.Size() -} -func (m *GenericRuntimeSpec) XXX_DiscardUnknown() { - xxx_messageInfo_GenericRuntimeSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_GenericRuntimeSpec proto.InternalMessageInfo - -// NetworkAttachmentSpec specifies runtime parameters required to attach -// a container to a network. -type NetworkAttachmentSpec struct { - // ContainerID specifies a unique ID of the container for which - // this attachment is for. - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` -} - -func (m *NetworkAttachmentSpec) Reset() { *m = NetworkAttachmentSpec{} } -func (*NetworkAttachmentSpec) ProtoMessage() {} -func (*NetworkAttachmentSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{9} -} -func (m *NetworkAttachmentSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NetworkAttachmentSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NetworkAttachmentSpec.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NetworkAttachmentSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_NetworkAttachmentSpec.Merge(m, src) -} -func (m *NetworkAttachmentSpec) XXX_Size() int { - return m.Size() -} -func (m *NetworkAttachmentSpec) XXX_DiscardUnknown() { - xxx_messageInfo_NetworkAttachmentSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_NetworkAttachmentSpec proto.InternalMessageInfo - -// Container specifies runtime parameters for a container. -type ContainerSpec struct { - // image defines the image reference, as specified in the - // distribution/reference package. This may include a registry host, name, - // tag or digest. - // - // The field will be directly passed to the engine pulling. Well-behaved - // service definitions will used immutable references, either through tags - // that don't change or verifiable digests. - Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` - // Labels defines labels to be added to the container at creation time. If - // collisions with system labels occur, these labels will be overridden. - // - // This field *must* remain compatible with the Labels field of - // Annotations. - Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Command to run the the container. The first element is a path to the - // executable and the following elements are treated as arguments. - // - // If command is empty, execution will fall back to the image's entrypoint. - // - // Command should only be used when overriding entrypoint. - Command []string `protobuf:"bytes,3,rep,name=command,proto3" json:"command,omitempty"` - // Args specifies arguments provided to the image's entrypoint. - // - // If Command and Args are provided, Args will be appended to Command. - Args []string `protobuf:"bytes,4,rep,name=args,proto3" json:"args,omitempty"` - // Hostname specifies the hostname that will be set on containers created by docker swarm. - // All containers for a given service will have the same hostname - Hostname string `protobuf:"bytes,14,opt,name=hostname,proto3" json:"hostname,omitempty"` - // Env specifies the environment variables for the container in NAME=VALUE - // format. These must be compliant with [IEEE Std - // 1003.1-2001](http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html). - Env []string `protobuf:"bytes,5,rep,name=env,proto3" json:"env,omitempty"` - // Dir defines the working directory to set for the container process. - Dir string `protobuf:"bytes,6,opt,name=dir,proto3" json:"dir,omitempty"` - // User specifies the user that should be employed to run the container. - // - // Note that the primary group may be specified by appending the group name - // or id to the user name, separated by a `:`. This syntax is - // `:`. - User string `protobuf:"bytes,7,opt,name=user,proto3" json:"user,omitempty"` - // Groups specifies supplementary groups available to the user. - Groups []string `protobuf:"bytes,11,rep,name=groups,proto3" json:"groups,omitempty"` - // Privileges specifies security configuration/permissions. - Privileges *Privileges `protobuf:"bytes,22,opt,name=privileges,proto3" json:"privileges,omitempty"` - // Init declares that a custom init will be running inside the container, if null, use the daemon's configured settings - Init *types.BoolValue `protobuf:"bytes,23,opt,name=init,proto3" json:"init,omitempty"` - // TTY declares that a TTY should be attached to the standard streams, - // including stdin if it is still open. - TTY bool `protobuf:"varint,13,opt,name=tty,proto3" json:"tty,omitempty"` - // OpenStdin declares that the standard input (stdin) should be open. - OpenStdin bool `protobuf:"varint,18,opt,name=open_stdin,json=openStdin,proto3" json:"open_stdin,omitempty"` - // ReadOnly declares that the container root filesystem is read-only. - // This only impacts the root filesystem, not additional mounts (including - // tmpfs). For additional mounts that are not part of the initial rootfs, - // they will be decided by the modes passed in the mount definition. - ReadOnly bool `protobuf:"varint,19,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` - // StopSignal defines the signal to stop the container. - StopSignal string `protobuf:"bytes,20,opt,name=stop_signal,json=stopSignal,proto3" json:"stop_signal,omitempty"` - Mounts []Mount `protobuf:"bytes,8,rep,name=mounts,proto3" json:"mounts"` - // StopGracePeriod the grace period for stopping the container before - // forcefully killing the container. - // Note: Can't use stdduration here because this needs to be nullable. - StopGracePeriod *types.Duration `protobuf:"bytes,9,opt,name=stop_grace_period,json=stopGracePeriod,proto3" json:"stop_grace_period,omitempty"` - // PullOptions parameterize the behavior of image pulls. - PullOptions *ContainerSpec_PullOptions `protobuf:"bytes,10,opt,name=pull_options,json=pullOptions,proto3" json:"pull_options,omitempty"` - // SecretReference contains references to zero or more secrets that - // will be exposed to the container. - Secrets []*SecretReference `protobuf:"bytes,12,rep,name=secrets,proto3" json:"secrets,omitempty"` - // ConfigReference contains references to zero or more configs that - // will be exposed to the container. - Configs []*ConfigReference `protobuf:"bytes,21,rep,name=configs,proto3" json:"configs,omitempty"` - // Hosts allow additional entries to be specified in /etc/hosts - // that associates IP addresses with hostnames. - // Detailed documentation is available in: - // http://man7.org/linux/man-pages/man5/hosts.5.html - // IP_address canonical_hostname [aliases...] - // - // The format of the Hosts in swarmkit follows the same as - // above. - // This is different from `docker run --add-host :` - // where format is `:` - Hosts []string `protobuf:"bytes,17,rep,name=hosts,proto3" json:"hosts,omitempty"` - // DNSConfig allows one to specify DNS related configuration in resolv.conf - DNSConfig *ContainerSpec_DNSConfig `protobuf:"bytes,15,opt,name=dns_config,json=dnsConfig,proto3" json:"dns_config,omitempty"` - // Healthcheck describes how to check the container is healthy. If the - // container is considered unhealthy, it will be destroyed, its creating - // task will exit and a new task will be rescheduled elsewhere. A container - // is considered unhealthy after `Retries` number of consecutive failures. - Healthcheck *HealthConfig `protobuf:"bytes,16,opt,name=healthcheck,proto3" json:"healthcheck,omitempty"` - // Isolation defines the isolation level for windows containers (default, process, hyperv). - // Runtimes that don't support it ignore that field - Isolation ContainerSpec_Isolation `protobuf:"varint,24,opt,name=isolation,proto3,enum=docker.swarmkit.v1.ContainerSpec_Isolation" json:"isolation,omitempty"` - // PidsLimit prevents from OS resource damage by applications inside the container - // using fork bomb attack. - PidsLimit int64 `protobuf:"varint,25,opt,name=pidsLimit,proto3" json:"pidsLimit,omitempty"` - // Sysctls sets namespaced kernel parameters (sysctls) in the container. This - // option is equivalent to passing --sysctl to docker run. - // - // Note that while options are subject to the same restrictions as arguments - // passed to the --sysctl flag on docker run, those options are not further - // validated to ensure that they are safe or sensible in a clustered - // environment. - // - // Additionally, sysctls are not validated for support in the underlying - // daemon. For information about supported options, refer to the - // documentation at: - // - // https://docs.docker.com/engine/reference/commandline/run/#configure-namespaced-kernel-parameters-sysctls-at-runtime - Sysctls map[string]string `protobuf:"bytes,26,rep,name=sysctls,proto3" json:"sysctls,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // CapabilityAdd sets the list of capabilities to add to the default capability list - CapabilityAdd []string `protobuf:"bytes,27,rep,name=capability_add,json=capabilityAdd,proto3" json:"capability_add,omitempty"` - // CapabilityDrop sets the list of capabilities to drop from the default capability list - CapabilityDrop []string `protobuf:"bytes,28,rep,name=capability_drop,json=capabilityDrop,proto3" json:"capability_drop,omitempty"` - // Ulimits defines the list of ulimits to set in the container. This option - // is equivalent to passing --ulimit to docker run. - Ulimits []*ContainerSpec_Ulimit `protobuf:"bytes,29,rep,name=ulimits,proto3" json:"ulimits,omitempty"` - // OOmScoreAdj defines the relative value used for destroying a container during an OOM - // Values are between -1000 and 1000 - OomScoreAdj int64 `protobuf:"varint,30,opt,name=oom_score_adj,json=oomScoreAdj,proto3" json:"oom_score_adj,omitempty"` -} - -func (m *ContainerSpec) Reset() { *m = ContainerSpec{} } -func (*ContainerSpec) ProtoMessage() {} -func (*ContainerSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{10} -} -func (m *ContainerSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ContainerSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ContainerSpec.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ContainerSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContainerSpec.Merge(m, src) -} -func (m *ContainerSpec) XXX_Size() int { - return m.Size() -} -func (m *ContainerSpec) XXX_DiscardUnknown() { - xxx_messageInfo_ContainerSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_ContainerSpec proto.InternalMessageInfo - -// PullOptions allows one to parameterize an image pull. -type ContainerSpec_PullOptions struct { - // RegistryAuth is the registry auth token obtained from the client, required - // to pull private images. This is the unmodified JSON used as part of - // the `X-Registry-Auth` header. - // TODO(nishanttotla): This field will later be deprecated - RegistryAuth string `protobuf:"bytes,64,opt,name=registry_auth,json=registryAuth,proto3" json:"registry_auth,omitempty"` -} - -func (m *ContainerSpec_PullOptions) Reset() { *m = ContainerSpec_PullOptions{} } -func (*ContainerSpec_PullOptions) ProtoMessage() {} -func (*ContainerSpec_PullOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{10, 1} -} -func (m *ContainerSpec_PullOptions) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ContainerSpec_PullOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ContainerSpec_PullOptions.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ContainerSpec_PullOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContainerSpec_PullOptions.Merge(m, src) -} -func (m *ContainerSpec_PullOptions) XXX_Size() int { - return m.Size() -} -func (m *ContainerSpec_PullOptions) XXX_DiscardUnknown() { - xxx_messageInfo_ContainerSpec_PullOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_ContainerSpec_PullOptions proto.InternalMessageInfo - -// DNSConfig specifies DNS related configurations in resolver configuration file (resolv.conf) -// Detailed documentation is available in: -// http://man7.org/linux/man-pages/man5/resolv.conf.5.html -// TODO: domain is not supported yet -type ContainerSpec_DNSConfig struct { - // Nameservers specifies the IP addresses of the name servers - Nameservers []string `protobuf:"bytes,1,rep,name=nameservers,proto3" json:"nameservers,omitempty"` - // Search specifies the search list for host-name lookup - Search []string `protobuf:"bytes,2,rep,name=search,proto3" json:"search,omitempty"` - // Options allows certain internal resolver variables to be modified - Options []string `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` -} - -func (m *ContainerSpec_DNSConfig) Reset() { *m = ContainerSpec_DNSConfig{} } -func (*ContainerSpec_DNSConfig) ProtoMessage() {} -func (*ContainerSpec_DNSConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{10, 2} -} -func (m *ContainerSpec_DNSConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ContainerSpec_DNSConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ContainerSpec_DNSConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ContainerSpec_DNSConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContainerSpec_DNSConfig.Merge(m, src) -} -func (m *ContainerSpec_DNSConfig) XXX_Size() int { - return m.Size() -} -func (m *ContainerSpec_DNSConfig) XXX_DiscardUnknown() { - xxx_messageInfo_ContainerSpec_DNSConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_ContainerSpec_DNSConfig proto.InternalMessageInfo - -type ContainerSpec_Ulimit struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Soft int64 `protobuf:"varint,2,opt,name=soft,proto3" json:"soft,omitempty"` - Hard int64 `protobuf:"varint,3,opt,name=hard,proto3" json:"hard,omitempty"` -} - -func (m *ContainerSpec_Ulimit) Reset() { *m = ContainerSpec_Ulimit{} } -func (*ContainerSpec_Ulimit) ProtoMessage() {} -func (*ContainerSpec_Ulimit) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{10, 4} -} -func (m *ContainerSpec_Ulimit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ContainerSpec_Ulimit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ContainerSpec_Ulimit.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ContainerSpec_Ulimit) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContainerSpec_Ulimit.Merge(m, src) -} -func (m *ContainerSpec_Ulimit) XXX_Size() int { - return m.Size() -} -func (m *ContainerSpec_Ulimit) XXX_DiscardUnknown() { - xxx_messageInfo_ContainerSpec_Ulimit.DiscardUnknown(m) -} - -var xxx_messageInfo_ContainerSpec_Ulimit proto.InternalMessageInfo - -// EndpointSpec defines the properties that can be configured to -// access and loadbalance the service. -type EndpointSpec struct { - Mode EndpointSpec_ResolutionMode `protobuf:"varint,1,opt,name=mode,proto3,enum=docker.swarmkit.v1.EndpointSpec_ResolutionMode" json:"mode,omitempty"` - // List of exposed ports that this service is accessible from - // external to the cluster. - Ports []*PortConfig `protobuf:"bytes,2,rep,name=ports,proto3" json:"ports,omitempty"` -} - -func (m *EndpointSpec) Reset() { *m = EndpointSpec{} } -func (*EndpointSpec) ProtoMessage() {} -func (*EndpointSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{11} -} -func (m *EndpointSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EndpointSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EndpointSpec.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EndpointSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_EndpointSpec.Merge(m, src) -} -func (m *EndpointSpec) XXX_Size() int { - return m.Size() -} -func (m *EndpointSpec) XXX_DiscardUnknown() { - xxx_messageInfo_EndpointSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_EndpointSpec proto.InternalMessageInfo - -// NetworkSpec specifies user defined network parameters. -type NetworkSpec struct { - Annotations Annotations `protobuf:"bytes,1,opt,name=annotations,proto3" json:"annotations"` - // DriverConfig specific configuration consumed by the network driver. - DriverConfig *Driver `protobuf:"bytes,2,opt,name=driver_config,json=driverConfig,proto3" json:"driver_config,omitempty"` - // IPv6Enabled enables support for IPv6 on the network. - Ipv6Enabled bool `protobuf:"varint,3,opt,name=ipv6_enabled,json=ipv6Enabled,proto3" json:"ipv6_enabled,omitempty"` - // internal restricts external access to the network. This may be - // accomplished by disabling the default gateway or through other means. - Internal bool `protobuf:"varint,4,opt,name=internal,proto3" json:"internal,omitempty"` - IPAM *IPAMOptions `protobuf:"bytes,5,opt,name=ipam,proto3" json:"ipam,omitempty"` - // Attachable allows external(to swarm) entities to manually - // attach to this network. With this flag enabled, external - // entities such as containers running in an worker node in - // the cluster can manually attach to this network and access - // the services attached to this network. If this flag is not - // enabled(default case) no manual attachment to this network - // can happen. - Attachable bool `protobuf:"varint,6,opt,name=attachable,proto3" json:"attachable,omitempty"` - // Ingress indicates this network will provide the routing-mesh. - // In older versions, the network providing the routing mesh was - // swarm internally created only and it was identified by the name - // "ingress" and the label "com.docker.swarm.internal": "true". - Ingress bool `protobuf:"varint,7,opt,name=ingress,proto3" json:"ingress,omitempty"` - // ConfigFrom is the source of the configuration for this network. - // - // Types that are valid to be assigned to ConfigFrom: - // *NetworkSpec_Network - ConfigFrom isNetworkSpec_ConfigFrom `protobuf_oneof:"config_from"` -} - -func (m *NetworkSpec) Reset() { *m = NetworkSpec{} } -func (*NetworkSpec) ProtoMessage() {} -func (*NetworkSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{12} -} -func (m *NetworkSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NetworkSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NetworkSpec.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NetworkSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_NetworkSpec.Merge(m, src) -} -func (m *NetworkSpec) XXX_Size() int { - return m.Size() -} -func (m *NetworkSpec) XXX_DiscardUnknown() { - xxx_messageInfo_NetworkSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_NetworkSpec proto.InternalMessageInfo - -type isNetworkSpec_ConfigFrom interface { - isNetworkSpec_ConfigFrom() - MarshalTo([]byte) (int, error) - Size() int -} - -type NetworkSpec_Network struct { - Network string `protobuf:"bytes,8,opt,name=network,proto3,oneof" json:"network,omitempty"` -} - -func (*NetworkSpec_Network) isNetworkSpec_ConfigFrom() {} - -func (m *NetworkSpec) GetConfigFrom() isNetworkSpec_ConfigFrom { - if m != nil { - return m.ConfigFrom - } - return nil -} - -func (m *NetworkSpec) GetNetwork() string { - if x, ok := m.GetConfigFrom().(*NetworkSpec_Network); ok { - return x.Network - } - return "" -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*NetworkSpec) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*NetworkSpec_Network)(nil), - } -} - -// ClusterSpec specifies global cluster settings. -type ClusterSpec struct { - Annotations Annotations `protobuf:"bytes,1,opt,name=annotations,proto3" json:"annotations"` - // DEPRECATED: AcceptancePolicy defines the certificate issuance policy. - // Acceptance policy is no longer customizable, and secrets have been - // replaced with join tokens. - AcceptancePolicy AcceptancePolicy `protobuf:"bytes,2,opt,name=acceptance_policy,json=acceptancePolicy,proto3" json:"acceptance_policy"` // Deprecated: Do not use. - // Orchestration defines cluster-level orchestration settings. - Orchestration OrchestrationConfig `protobuf:"bytes,3,opt,name=orchestration,proto3" json:"orchestration"` - // Raft defines the cluster's raft settings. - Raft RaftConfig `protobuf:"bytes,4,opt,name=raft,proto3" json:"raft"` - // Dispatcher defines cluster-level dispatcher settings. - Dispatcher DispatcherConfig `protobuf:"bytes,5,opt,name=dispatcher,proto3" json:"dispatcher"` - // CAConfig defines cluster-level certificate authority settings. - CAConfig CAConfig `protobuf:"bytes,6,opt,name=ca_config,json=caConfig,proto3" json:"ca_config"` - // TaskDefaults specifies the default values to use for task creation. - TaskDefaults TaskDefaults `protobuf:"bytes,7,opt,name=task_defaults,json=taskDefaults,proto3" json:"task_defaults"` - // EncryptionConfig defines the cluster's encryption settings. - EncryptionConfig EncryptionConfig `protobuf:"bytes,8,opt,name=encryption_config,json=encryptionConfig,proto3" json:"encryption_config"` -} - -func (m *ClusterSpec) Reset() { *m = ClusterSpec{} } -func (*ClusterSpec) ProtoMessage() {} -func (*ClusterSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{13} -} -func (m *ClusterSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ClusterSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ClusterSpec.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ClusterSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClusterSpec.Merge(m, src) -} -func (m *ClusterSpec) XXX_Size() int { - return m.Size() -} -func (m *ClusterSpec) XXX_DiscardUnknown() { - xxx_messageInfo_ClusterSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_ClusterSpec proto.InternalMessageInfo - -// SecretSpec specifies a user-provided secret. -type SecretSpec struct { - Annotations Annotations `protobuf:"bytes,1,opt,name=annotations,proto3" json:"annotations"` - // Data is the secret payload - the maximum size is 500KB (that is, 500*1024 bytes) - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - // Templating controls whether and how to evaluate the secret payload as - // a template. If it is not set, no templating is used. - // - // The currently recognized values are: - // - golang: Go templating - Templating *Driver `protobuf:"bytes,3,opt,name=templating,proto3" json:"templating,omitempty"` - // Driver is the the secret driver that is used to store the specified secret - Driver *Driver `protobuf:"bytes,4,opt,name=driver,proto3" json:"driver,omitempty"` -} - -func (m *SecretSpec) Reset() { *m = SecretSpec{} } -func (*SecretSpec) ProtoMessage() {} -func (*SecretSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{14} -} -func (m *SecretSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SecretSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SecretSpec.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SecretSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecretSpec.Merge(m, src) -} -func (m *SecretSpec) XXX_Size() int { - return m.Size() -} -func (m *SecretSpec) XXX_DiscardUnknown() { - xxx_messageInfo_SecretSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_SecretSpec proto.InternalMessageInfo - -// ConfigSpec specifies user-provided configuration files. -type ConfigSpec struct { - Annotations Annotations `protobuf:"bytes,1,opt,name=annotations,proto3" json:"annotations"` - // Data is the config payload - the maximum size is 500KB (that is, 500*1024 bytes) - // TODO(aaronl): Do we want to revise this to include multiple payloads in a single - // ConfigSpec? Define this to be a tar? etc... - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - // Templating controls whether and how to evaluate the secret payload as - // a template. If it is not set, no templating is used. - // - // The currently recognized values are: - // - golang: Go templating - Templating *Driver `protobuf:"bytes,3,opt,name=templating,proto3" json:"templating,omitempty"` -} - -func (m *ConfigSpec) Reset() { *m = ConfigSpec{} } -func (*ConfigSpec) ProtoMessage() {} -func (*ConfigSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{15} -} -func (m *ConfigSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConfigSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConfigSpec.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ConfigSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigSpec.Merge(m, src) -} -func (m *ConfigSpec) XXX_Size() int { - return m.Size() -} -func (m *ConfigSpec) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigSpec proto.InternalMessageInfo - -type VolumeSpec struct { - // Annotations includes the name and labels of a volume. The name used in the - // spec's Annotations will be passed to the Plugin as the "Name" in the - // CreateVolume request. - Annotations Annotations `protobuf:"bytes,1,opt,name=annotations,proto3" json:"annotations"` - // Group defines the volume group this particular volume belongs to. When - // requesting volumes for a workload, the group name can be used instead of - // the volume's name, which tells swarmkit to pick one from the many volumes - // belonging to that group. - Group string `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` - // Driver represents the CSI Plugin object and its configuration parameters. - // The "options" field of the Driver object is passed in the CSI - // CreateVolumeRequest as the "parameters" field. The Driver must be - // specified; there is no default CSI Plugin. - Driver *Driver `protobuf:"bytes,3,opt,name=driver,proto3" json:"driver,omitempty"` - // AccessMode is similar to, and used to determine, the volume access mode as - // defined in the CSI spec, as well as the volume type (block vs mount). In - // this way, it is more similar to the VolumeCapability message in the CSI - // spec. - AccessMode *VolumeAccessMode `protobuf:"bytes,4,opt,name=access_mode,json=accessMode,proto3" json:"access_mode,omitempty"` - // Secrets represents a set of key/value pairs to pass to the CSI plugin. The - // keys of the secrets can be anything, but the values refer to swarmkit - // Secret objects. See the "Secrets Requirements" section of the CSI Plugin - // Spec for more information. - Secrets []*VolumeSecret `protobuf:"bytes,5,rep,name=secrets,proto3" json:"secrets,omitempty"` - // AccessibilityRequirements specifies where a volume must be accessible - // from. - // - // This field must be empty if the plugin does not support - // VOLUME_ACCESSIBILITY_CONSTRAINTS capabilities. If it is present but the - // plugin does not support it, volume will not be created. - // - // If AccessibilityRequirements is empty, but the plugin does support - // VOLUME_ACCESSIBILITY_CONSTRAINTS, then Swarmkit will assume the entire - // cluster is a valid target for the volume. - AccessibilityRequirements *TopologyRequirement `protobuf:"bytes,6,opt,name=AccessibilityRequirements,proto3" json:"AccessibilityRequirements,omitempty"` - // CapacityRange is the capacity this volume should be created with. If nil, - // the plugin will decide the capacity. - CapacityRange *CapacityRange `protobuf:"bytes,7,opt,name=capacity_range,json=capacityRange,proto3" json:"capacity_range,omitempty"` - // Availability is the Volume's desired availability. Analogous to Node - // Availability, this allows the user to take volumes offline in order to - // update or delete them. - Availability VolumeSpec_VolumeAvailability `protobuf:"varint,8,opt,name=availability,proto3,enum=docker.swarmkit.v1.VolumeSpec_VolumeAvailability" json:"availability,omitempty"` -} - -func (m *VolumeSpec) Reset() { *m = VolumeSpec{} } -func (*VolumeSpec) ProtoMessage() {} -func (*VolumeSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6589acc608f7d4fd, []int{16} -} -func (m *VolumeSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VolumeSpec.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VolumeSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeSpec.Merge(m, src) -} -func (m *VolumeSpec) XXX_Size() int { - return m.Size() -} -func (m *VolumeSpec) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeSpec proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("docker.swarmkit.v1.NodeSpec_Membership", NodeSpec_Membership_name, NodeSpec_Membership_value) - proto.RegisterEnum("docker.swarmkit.v1.NodeSpec_Availability", NodeSpec_Availability_name, NodeSpec_Availability_value) - proto.RegisterEnum("docker.swarmkit.v1.ContainerSpec_Isolation", ContainerSpec_Isolation_name, ContainerSpec_Isolation_value) - proto.RegisterEnum("docker.swarmkit.v1.EndpointSpec_ResolutionMode", EndpointSpec_ResolutionMode_name, EndpointSpec_ResolutionMode_value) - proto.RegisterEnum("docker.swarmkit.v1.VolumeSpec_VolumeAvailability", VolumeSpec_VolumeAvailability_name, VolumeSpec_VolumeAvailability_value) - proto.RegisterType((*NodeSpec)(nil), "docker.swarmkit.v1.NodeSpec") - proto.RegisterType((*ServiceSpec)(nil), "docker.swarmkit.v1.ServiceSpec") - proto.RegisterType((*ReplicatedService)(nil), "docker.swarmkit.v1.ReplicatedService") - proto.RegisterType((*GlobalService)(nil), "docker.swarmkit.v1.GlobalService") - proto.RegisterType((*ReplicatedJob)(nil), "docker.swarmkit.v1.ReplicatedJob") - proto.RegisterType((*GlobalJob)(nil), "docker.swarmkit.v1.GlobalJob") - proto.RegisterType((*TaskSpec)(nil), "docker.swarmkit.v1.TaskSpec") - proto.RegisterType((*ResourceReference)(nil), "docker.swarmkit.v1.ResourceReference") - proto.RegisterType((*GenericRuntimeSpec)(nil), "docker.swarmkit.v1.GenericRuntimeSpec") - proto.RegisterType((*NetworkAttachmentSpec)(nil), "docker.swarmkit.v1.NetworkAttachmentSpec") - proto.RegisterType((*ContainerSpec)(nil), "docker.swarmkit.v1.ContainerSpec") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.ContainerSpec.LabelsEntry") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.ContainerSpec.SysctlsEntry") - proto.RegisterType((*ContainerSpec_PullOptions)(nil), "docker.swarmkit.v1.ContainerSpec.PullOptions") - proto.RegisterType((*ContainerSpec_DNSConfig)(nil), "docker.swarmkit.v1.ContainerSpec.DNSConfig") - proto.RegisterType((*ContainerSpec_Ulimit)(nil), "docker.swarmkit.v1.ContainerSpec.Ulimit") - proto.RegisterType((*EndpointSpec)(nil), "docker.swarmkit.v1.EndpointSpec") - proto.RegisterType((*NetworkSpec)(nil), "docker.swarmkit.v1.NetworkSpec") - proto.RegisterType((*ClusterSpec)(nil), "docker.swarmkit.v1.ClusterSpec") - proto.RegisterType((*SecretSpec)(nil), "docker.swarmkit.v1.SecretSpec") - proto.RegisterType((*ConfigSpec)(nil), "docker.swarmkit.v1.ConfigSpec") - proto.RegisterType((*VolumeSpec)(nil), "docker.swarmkit.v1.VolumeSpec") -} - -func init() { - proto.RegisterFile("github.com/docker/swarmkit/api/specs.proto", fileDescriptor_6589acc608f7d4fd) -} - -var fileDescriptor_6589acc608f7d4fd = []byte{ - // 2563 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0x41, 0x73, 0x1b, 0xb7, - 0xf5, 0x27, 0x25, 0x8a, 0x22, 0xdf, 0x92, 0x32, 0x8d, 0x38, 0xc9, 0x8a, 0xb6, 0x29, 0x86, 0x71, - 0x1c, 0x25, 0x99, 0x3f, 0x35, 0xd1, 0x3f, 0x93, 0x26, 0x4e, 0xd3, 0x96, 0x14, 0x19, 0x8b, 0xb1, - 0x2d, 0x73, 0x40, 0x59, 0xad, 0x67, 0x3a, 0xc3, 0x81, 0x76, 0x21, 0x72, 0xa3, 0xe5, 0x62, 0x8b, - 0x05, 0x95, 0xf0, 0xd6, 0x63, 0xc6, 0xbd, 0xf4, 0xd0, 0xab, 0x4e, 0x9d, 0x9e, 0x7a, 0x69, 0x3f, - 0x42, 0x6f, 0x39, 0xe6, 0x98, 0x5e, 0x34, 0x8d, 0xd2, 0x6f, 0xd0, 0x5b, 0x2f, 0xed, 0x00, 0x8b, - 0x5d, 0x2e, 0x25, 0xd2, 0x72, 0xa7, 0x3e, 0xf4, 0x06, 0x3c, 0xfe, 0x7e, 0x6f, 0x81, 0x87, 0xf7, - 0x1e, 0xde, 0x03, 0xe1, 0xdd, 0x81, 0x23, 0x86, 0xe3, 0xc3, 0xba, 0xc5, 0x46, 0x5b, 0x36, 0xb3, - 0x8e, 0x29, 0xdf, 0x0a, 0xbe, 0x24, 0x7c, 0x74, 0xec, 0x88, 0x2d, 0xe2, 0x3b, 0x5b, 0x81, 0x4f, - 0xad, 0xa0, 0xee, 0x73, 0x26, 0x18, 0x42, 0x21, 0xa0, 0x1e, 0x01, 0xea, 0x27, 0xef, 0x97, 0xaf, - 0xe2, 0x8b, 0x89, 0x4f, 0x35, 0xbf, 0x7c, 0x63, 0xc0, 0x06, 0x4c, 0x0d, 0xb7, 0xe4, 0x48, 0x4b, - 0x2b, 0x03, 0xc6, 0x06, 0x2e, 0xdd, 0x52, 0xb3, 0xc3, 0xf1, 0xd1, 0x96, 0x3d, 0xe6, 0x44, 0x38, - 0xcc, 0xd3, 0xbf, 0xaf, 0x5f, 0xfc, 0x9d, 0x78, 0x93, 0x45, 0xd4, 0x2f, 0x39, 0xf1, 0x7d, 0xca, - 0xf5, 0x07, 0x6b, 0xa7, 0x19, 0xc8, 0xed, 0x31, 0x9b, 0xf6, 0x7c, 0x6a, 0xa1, 0xfb, 0x60, 0x10, - 0xcf, 0x63, 0x42, 0xe9, 0x0e, 0xcc, 0x74, 0x35, 0xbd, 0x69, 0x6c, 0x6f, 0xd4, 0x2f, 0xef, 0xa9, - 0xde, 0x98, 0xc2, 0x9a, 0x99, 0x6f, 0xce, 0x36, 0x52, 0x38, 0xc9, 0x44, 0x3f, 0x85, 0x82, 0x4d, - 0x03, 0x87, 0x53, 0xbb, 0xcf, 0x99, 0x4b, 0xcd, 0xa5, 0x6a, 0x7a, 0x73, 0x6d, 0xfb, 0xd6, 0x3c, - 0x4d, 0xf2, 0xe3, 0x98, 0xb9, 0x14, 0x1b, 0x9a, 0x21, 0x27, 0xe8, 0x3e, 0xc0, 0x88, 0x8e, 0x0e, - 0x29, 0x0f, 0x86, 0x8e, 0x6f, 0x2e, 0x2b, 0xfa, 0xdb, 0x8b, 0xe8, 0x72, 0xed, 0xf5, 0x47, 0x31, - 0x1c, 0x27, 0xa8, 0xe8, 0x11, 0x14, 0xc8, 0x09, 0x71, 0x5c, 0x72, 0xe8, 0xb8, 0x8e, 0x98, 0x98, - 0x19, 0xa5, 0xea, 0x9d, 0xe7, 0xaa, 0x6a, 0x24, 0x08, 0x78, 0x86, 0x5e, 0xb3, 0x01, 0xa6, 0x1f, - 0x42, 0x77, 0x61, 0xb5, 0xdb, 0xde, 0x6b, 0x75, 0xf6, 0xee, 0x97, 0x52, 0xe5, 0xf5, 0x67, 0xa7, - 0xd5, 0x57, 0xa5, 0x8e, 0x29, 0xa0, 0x4b, 0x3d, 0xdb, 0xf1, 0x06, 0x68, 0x13, 0x72, 0x8d, 0x9d, - 0x9d, 0x76, 0x77, 0xbf, 0xdd, 0x2a, 0xa5, 0xcb, 0xe5, 0x67, 0xa7, 0xd5, 0xd7, 0x66, 0x81, 0x0d, - 0xcb, 0xa2, 0xbe, 0xa0, 0x76, 0x39, 0xf3, 0xf5, 0xef, 0x2b, 0xa9, 0xda, 0xd7, 0x69, 0x28, 0x24, - 0x17, 0x81, 0xee, 0x42, 0xb6, 0xb1, 0xb3, 0xdf, 0x39, 0x68, 0x97, 0x52, 0x53, 0x7a, 0x12, 0xd1, - 0xb0, 0x84, 0x73, 0x42, 0xd1, 0x1d, 0x58, 0xe9, 0x36, 0x9e, 0xf4, 0xda, 0xa5, 0xf4, 0x74, 0x39, - 0x49, 0x58, 0x97, 0x8c, 0x03, 0x85, 0x6a, 0xe1, 0x46, 0x67, 0xaf, 0xb4, 0x34, 0x1f, 0xd5, 0xe2, - 0xc4, 0xf1, 0xf4, 0x52, 0xfe, 0xb8, 0x02, 0x46, 0x8f, 0xf2, 0x13, 0xc7, 0x7a, 0xc9, 0x2e, 0xf2, - 0x21, 0x64, 0x04, 0x09, 0x8e, 0x95, 0x6b, 0x18, 0xf3, 0x5d, 0x63, 0x9f, 0x04, 0xc7, 0xf2, 0xa3, - 0x9a, 0xae, 0xf0, 0xd2, 0x33, 0x38, 0xf5, 0x5d, 0xc7, 0x22, 0x82, 0xda, 0xca, 0x33, 0x8c, 0xed, - 0xb7, 0xe6, 0xb1, 0x71, 0x8c, 0xd2, 0xeb, 0xdf, 0x4d, 0xe1, 0x04, 0x15, 0x7d, 0x02, 0xd9, 0x81, - 0xcb, 0x0e, 0x89, 0xab, 0x7c, 0xc2, 0xd8, 0x7e, 0x63, 0x9e, 0x92, 0xfb, 0x0a, 0x31, 0x55, 0xa0, - 0x29, 0xe8, 0x73, 0x58, 0x9b, 0xaa, 0xea, 0x7f, 0xc1, 0x0e, 0x4d, 0x58, 0xac, 0x64, 0xba, 0x92, - 0xcf, 0xd9, 0xe1, 0x6e, 0x0a, 0x17, 0x79, 0x52, 0x80, 0x7e, 0x02, 0x10, 0x6a, 0x55, 0x7a, 0x0c, - 0xa5, 0xe7, 0xf6, 0xe2, 0xc5, 0x84, 0x3a, 0xf2, 0x83, 0x68, 0x82, 0x3e, 0x82, 0xec, 0xd8, 0xb7, - 0x89, 0xa0, 0x66, 0x56, 0x71, 0xab, 0xf3, 0xb8, 0x4f, 0x14, 0x62, 0x87, 0x79, 0x47, 0xce, 0x00, - 0x6b, 0x3c, 0xfa, 0x31, 0xe4, 0x38, 0x73, 0xdd, 0x43, 0x62, 0x1d, 0x9b, 0xf9, 0x17, 0xe4, 0xc6, - 0x0c, 0xf4, 0x00, 0x72, 0x1e, 0x15, 0x5f, 0x32, 0x7e, 0x1c, 0x98, 0xab, 0xd5, 0xe5, 0x4d, 0x63, - 0xfb, 0xbd, 0xb9, 0x61, 0x15, 0x62, 0x1a, 0x42, 0x10, 0x6b, 0x38, 0xa2, 0x9e, 0x08, 0x15, 0x35, - 0x97, 0xcc, 0x34, 0x8e, 0x15, 0xc8, 0xa5, 0x50, 0xcf, 0xf6, 0x99, 0xe3, 0x09, 0x33, 0xb7, 0x78, - 0x29, 0x6d, 0x8d, 0x91, 0x6e, 0x81, 0x63, 0x46, 0x33, 0x0b, 0x99, 0x11, 0xb3, 0x69, 0x6d, 0x0b, - 0xae, 0x5f, 0x3a, 0x76, 0x54, 0x86, 0x9c, 0x36, 0x78, 0xe8, 0xaf, 0x19, 0x1c, 0xcf, 0x6b, 0xd7, - 0xa0, 0x38, 0x73, 0xc4, 0x35, 0x0b, 0x8a, 0x33, 0xc7, 0x85, 0xde, 0x82, 0xb5, 0x11, 0xf9, 0xaa, - 0x6f, 0x31, 0xcf, 0x1a, 0x73, 0x4e, 0x3d, 0xa1, 0x75, 0x14, 0x47, 0xe4, 0xab, 0x9d, 0x58, 0x88, - 0xde, 0x83, 0xeb, 0x82, 0x09, 0xe2, 0xf6, 0x2d, 0x36, 0xf2, 0x5d, 0x1a, 0x46, 0xc7, 0x92, 0x42, - 0x96, 0xd4, 0x0f, 0x3b, 0x53, 0x79, 0xcd, 0x80, 0x7c, 0x7c, 0x96, 0xb5, 0x3f, 0xad, 0x40, 0x2e, - 0xf2, 0x74, 0xf4, 0x00, 0x80, 0xc4, 0x86, 0xd2, 0x86, 0x78, 0xe7, 0x85, 0xac, 0x2a, 0xe9, 0xd2, - 0xc3, 0xa7, 0x74, 0xd4, 0x80, 0xbc, 0xc5, 0x3c, 0x41, 0x1c, 0x8f, 0x72, 0x1d, 0xa9, 0x73, 0xfd, - 0x73, 0x27, 0x02, 0x69, 0x1d, 0x53, 0x16, 0x6a, 0xc2, 0xea, 0x80, 0x7a, 0x94, 0x3b, 0x96, 0x76, - 0xf0, 0xbb, 0x73, 0x1d, 0x33, 0x84, 0xe0, 0xb1, 0x27, 0x9c, 0x11, 0xd5, 0x5a, 0x22, 0x22, 0xfa, - 0x0c, 0xf2, 0x9c, 0x06, 0x6c, 0xcc, 0x2d, 0x1a, 0xe8, 0x70, 0xdf, 0x9c, 0x1f, 0x26, 0x21, 0x08, - 0xd3, 0x5f, 0x8d, 0x1d, 0x4e, 0xe5, 0x16, 0x02, 0x3c, 0xa5, 0xa2, 0x4f, 0x60, 0x95, 0xd3, 0x40, - 0x10, 0x2e, 0x9e, 0x17, 0xb1, 0x38, 0x84, 0x74, 0x99, 0xeb, 0x58, 0x13, 0x1c, 0x31, 0xd0, 0x27, - 0x90, 0xf7, 0x5d, 0x62, 0x29, 0xad, 0xe6, 0xca, 0xe2, 0x18, 0xeb, 0x46, 0x20, 0x3c, 0xc5, 0xa3, - 0x8f, 0x01, 0x5c, 0x36, 0xe8, 0xdb, 0xdc, 0x39, 0xa1, 0x5c, 0x47, 0x59, 0x79, 0x1e, 0xbb, 0xa5, - 0x10, 0x38, 0xef, 0xb2, 0x41, 0x38, 0x44, 0xf7, 0xff, 0xab, 0x20, 0x49, 0x04, 0xc8, 0x1b, 0x50, - 0x38, 0x62, 0xdc, 0xa2, 0x7d, 0x1d, 0xeb, 0x79, 0xe5, 0x5b, 0x86, 0x92, 0x85, 0x01, 0x8a, 0x7e, - 0x09, 0xaf, 0x44, 0xd6, 0xea, 0x73, 0x7a, 0x44, 0x39, 0xf5, 0xa4, 0xc9, 0x0d, 0xf5, 0xd9, 0xb7, - 0x9e, 0x6f, 0x72, 0x8d, 0xd6, 0xa9, 0x16, 0xf1, 0x8b, 0x3f, 0x04, 0xcd, 0x3c, 0xac, 0xf2, 0xf0, - 0x80, 0x6b, 0xbf, 0x49, 0xcb, 0x38, 0xbb, 0x80, 0x40, 0x5b, 0x60, 0xc4, 0x9f, 0x77, 0x6c, 0xe5, - 0x70, 0xf9, 0xe6, 0xda, 0xf9, 0xd9, 0x06, 0x44, 0xd8, 0x4e, 0x4b, 0x66, 0x60, 0x3d, 0xb6, 0x51, - 0x1b, 0x8a, 0x31, 0x41, 0x16, 0x41, 0xba, 0x4c, 0xa8, 0x3e, 0x6f, 0xa5, 0xfb, 0x13, 0x9f, 0xe2, - 0x02, 0x4f, 0xcc, 0x6a, 0xbf, 0x00, 0x74, 0xd9, 0x01, 0x11, 0x82, 0xcc, 0xb1, 0xe3, 0xe9, 0x65, - 0x60, 0x35, 0x46, 0x75, 0x58, 0xf5, 0xc9, 0xc4, 0x65, 0xc4, 0xd6, 0x7e, 0x78, 0xa3, 0x1e, 0x96, - 0x47, 0xf5, 0xa8, 0x3c, 0xaa, 0x37, 0xbc, 0x09, 0x8e, 0x40, 0xb5, 0x07, 0xf0, 0xea, 0xdc, 0x38, - 0x43, 0xdb, 0x50, 0x88, 0x63, 0x64, 0xba, 0xd7, 0x6b, 0xe7, 0x67, 0x1b, 0x46, 0x1c, 0x4c, 0x9d, - 0x16, 0x36, 0x62, 0x50, 0xc7, 0xae, 0xfd, 0x7d, 0x0d, 0x8a, 0x33, 0x91, 0x86, 0x6e, 0xc0, 0x8a, - 0x33, 0x22, 0x03, 0xaa, 0xd7, 0x18, 0x4e, 0x50, 0x1b, 0xb2, 0x2e, 0x39, 0xa4, 0xae, 0x8c, 0x15, - 0x79, 0x70, 0xff, 0x77, 0x65, 0xc8, 0xd6, 0x1f, 0x2a, 0x7c, 0xdb, 0x13, 0x7c, 0x82, 0x35, 0x19, - 0x99, 0xb0, 0x6a, 0xb1, 0xd1, 0x88, 0x78, 0xf2, 0x92, 0x5c, 0xde, 0xcc, 0xe3, 0x68, 0x2a, 0x2d, - 0x43, 0xf8, 0x20, 0x30, 0x33, 0x4a, 0xac, 0xc6, 0x32, 0x47, 0x0e, 0x59, 0x20, 0x3c, 0x32, 0xa2, - 0xe6, 0x9a, 0x5a, 0x4d, 0x3c, 0x47, 0x25, 0x58, 0xa6, 0xde, 0x89, 0xb9, 0xa2, 0xe0, 0x72, 0x28, - 0x25, 0xb6, 0x13, 0x06, 0x42, 0x1e, 0xcb, 0xa1, 0xd4, 0x39, 0x0e, 0x28, 0x37, 0x57, 0x43, 0x6b, - 0xcb, 0x31, 0x7a, 0x0d, 0xb2, 0x03, 0xce, 0xc6, 0x7e, 0xe8, 0x81, 0x79, 0xac, 0x67, 0xf2, 0xbe, - 0xf3, 0xb9, 0x73, 0xe2, 0xb8, 0x74, 0x40, 0x03, 0xf3, 0x35, 0x75, 0x10, 0x95, 0xb9, 0xb1, 0x18, - 0xa3, 0x70, 0x82, 0x81, 0xea, 0x90, 0x71, 0x3c, 0x47, 0x98, 0xaf, 0xeb, 0x38, 0xbc, 0x78, 0x84, - 0x4d, 0xc6, 0xdc, 0x03, 0xe2, 0x8e, 0x29, 0x56, 0x38, 0xb4, 0x0e, 0xcb, 0x42, 0x4c, 0xcc, 0x62, - 0x35, 0xbd, 0x99, 0x6b, 0xae, 0x9e, 0x9f, 0x6d, 0x2c, 0xef, 0xef, 0x3f, 0xc5, 0x52, 0x86, 0x6e, - 0x03, 0x30, 0x9f, 0x7a, 0xfd, 0x40, 0xd8, 0x8e, 0x67, 0x22, 0x89, 0xc0, 0x79, 0x29, 0xe9, 0x49, - 0x01, 0xba, 0x29, 0x33, 0x17, 0xb1, 0xfb, 0xcc, 0x73, 0x27, 0xe6, 0x2b, 0xea, 0xd7, 0x9c, 0x14, - 0x3c, 0xf6, 0xdc, 0x09, 0xda, 0x00, 0x23, 0x10, 0xcc, 0xef, 0x07, 0xce, 0xc0, 0x23, 0xae, 0x79, - 0x43, 0xed, 0x1c, 0xa4, 0xa8, 0xa7, 0x24, 0xe8, 0x47, 0x90, 0x1d, 0xb1, 0xb1, 0x27, 0x02, 0x33, - 0xa7, 0x0e, 0x72, 0x7d, 0xde, 0x1e, 0x1f, 0x49, 0x84, 0x8e, 0x3a, 0x0d, 0x47, 0x6d, 0xb8, 0xae, - 0x34, 0x0f, 0x38, 0xb1, 0x68, 0xdf, 0xa7, 0xdc, 0x61, 0xb6, 0xbe, 0x9f, 0xd7, 0x2f, 0xed, 0xb6, - 0xa5, 0x5b, 0x01, 0x7c, 0x4d, 0x72, 0xee, 0x4b, 0x4a, 0x57, 0x31, 0x50, 0x17, 0x0a, 0xfe, 0xd8, - 0x75, 0xfb, 0xcc, 0x0f, 0x6f, 0xa3, 0x30, 0x81, 0xbf, 0x80, 0x3b, 0x75, 0xc7, 0xae, 0xfb, 0x38, - 0x24, 0x61, 0xc3, 0x9f, 0x4e, 0xd0, 0xa7, 0xb0, 0x1a, 0x50, 0x8b, 0x53, 0x11, 0x98, 0x05, 0xb5, - 0xa5, 0x37, 0xe7, 0x29, 0xeb, 0x29, 0x48, 0x9c, 0x17, 0x70, 0xc4, 0x91, 0x74, 0x4b, 0xa5, 0xb5, - 0xc0, 0x7c, 0x75, 0x31, 0x5d, 0x67, 0xbe, 0x29, 0x5d, 0x73, 0x64, 0xb8, 0x48, 0x9f, 0x0c, 0xcc, - 0xeb, 0xca, 0x9d, 0xc2, 0x09, 0x7a, 0x0a, 0x60, 0x7b, 0x41, 0x3f, 0x04, 0x99, 0xd7, 0xd4, 0x1e, - 0xdf, 0xbb, 0x7a, 0x8f, 0xad, 0xbd, 0x9e, 0xae, 0x43, 0x8a, 0xe7, 0x67, 0x1b, 0xf9, 0x78, 0x8a, - 0xf3, 0xb6, 0x17, 0x84, 0x43, 0xd4, 0x04, 0x63, 0x48, 0x89, 0x2b, 0x86, 0xd6, 0x90, 0x5a, 0xc7, - 0x66, 0x69, 0x71, 0x59, 0xb2, 0xab, 0x60, 0x5a, 0x43, 0x92, 0x84, 0x3a, 0x90, 0x77, 0x02, 0xe6, - 0xaa, 0x23, 0x32, 0x4d, 0x95, 0xdf, 0x5e, 0x60, 0x75, 0x9d, 0x88, 0x82, 0xa7, 0x6c, 0x74, 0x0b, - 0xf2, 0xbe, 0x63, 0x07, 0x0f, 0x9d, 0x91, 0x23, 0xcc, 0xf5, 0x6a, 0x7a, 0x73, 0x19, 0x4f, 0x05, - 0x68, 0x17, 0x56, 0x83, 0x49, 0x60, 0x09, 0x37, 0x30, 0xcb, 0xca, 0xb8, 0xf5, 0xab, 0x3f, 0xd3, - 0x0b, 0x09, 0x61, 0xe2, 0x88, 0xe8, 0xb2, 0xe2, 0xb1, 0x88, 0xaf, 0x7b, 0x81, 0x3e, 0xb1, 0x6d, - 0xf3, 0xa6, 0x32, 0x78, 0x71, 0x2a, 0x6d, 0xd8, 0x36, 0x7a, 0x1b, 0xae, 0x25, 0x60, 0x36, 0x67, - 0xbe, 0x79, 0x4b, 0xe1, 0x12, 0xec, 0x16, 0x67, 0xbe, 0xac, 0x21, 0xc6, 0xae, 0x5c, 0x63, 0x60, - 0xde, 0x56, 0x2b, 0xdb, 0xbc, 0x7a, 0x65, 0x4f, 0x14, 0x01, 0x47, 0x44, 0x54, 0x83, 0x22, 0x63, - 0xa3, 0x7e, 0x60, 0x31, 0x4e, 0xfb, 0xc4, 0xfe, 0xc2, 0xac, 0xa8, 0xfd, 0x1b, 0x8c, 0x8d, 0x7a, - 0x52, 0xd6, 0xb0, 0xbf, 0x28, 0x7f, 0x0c, 0x46, 0x22, 0x11, 0xca, 0x24, 0x75, 0x4c, 0x27, 0x3a, - 0xb7, 0xca, 0xa1, 0x74, 0xa0, 0x13, 0x99, 0x17, 0x54, 0xf2, 0xcf, 0xe3, 0x70, 0x72, 0x6f, 0xe9, - 0xa3, 0x74, 0x79, 0x1b, 0x8c, 0x84, 0xd3, 0xa3, 0x37, 0xe5, 0xc5, 0x34, 0x70, 0x02, 0xc1, 0x27, - 0x7d, 0x32, 0x16, 0x43, 0xf3, 0x67, 0x8a, 0x50, 0x88, 0x84, 0x8d, 0xb1, 0x18, 0x96, 0xfb, 0x30, - 0xf5, 0x1a, 0x54, 0x05, 0x43, 0xe6, 0xca, 0x80, 0xf2, 0x13, 0xca, 0x65, 0x99, 0x29, 0x0d, 0x91, - 0x14, 0xc9, 0x6c, 0x18, 0x50, 0xc2, 0xad, 0xa1, 0x4a, 0xeb, 0x79, 0xac, 0x67, 0x32, 0x4f, 0x47, - 0x01, 0xaa, 0xf3, 0xb4, 0x9e, 0x96, 0xef, 0x41, 0x21, 0x79, 0x40, 0xff, 0xd1, 0x86, 0x5a, 0x90, - 0x0d, 0x4d, 0x28, 0x33, 0xb3, 0xca, 0xea, 0xfa, 0x1e, 0x54, 0x19, 0x1d, 0x41, 0x26, 0x60, 0x47, - 0x42, 0xd1, 0x96, 0xb1, 0x1a, 0x4b, 0xd9, 0x90, 0xf0, 0xb0, 0xa3, 0x5a, 0xc6, 0x6a, 0x5c, 0xfb, - 0x73, 0x1a, 0xf2, 0xb1, 0x2b, 0xa2, 0x0f, 0xe0, 0x7a, 0xa7, 0xf7, 0xf8, 0x61, 0x63, 0xbf, 0xf3, - 0x78, 0xaf, 0xdf, 0x6a, 0x7f, 0xd6, 0x78, 0xf2, 0x70, 0xbf, 0x94, 0x2a, 0xdf, 0x7e, 0x76, 0x5a, - 0x5d, 0x9f, 0xde, 0x7a, 0x11, 0xbc, 0x45, 0x8f, 0xc8, 0xd8, 0x15, 0xb3, 0xac, 0x2e, 0x7e, 0xbc, - 0xd3, 0xee, 0xf5, 0x4a, 0xe9, 0x45, 0xac, 0x2e, 0x67, 0x16, 0x0d, 0x02, 0xb4, 0x0d, 0xa5, 0x29, - 0x6b, 0xf7, 0x69, 0xb7, 0x8d, 0x0f, 0x4a, 0x4b, 0xe5, 0x5b, 0xcf, 0x4e, 0xab, 0xe6, 0x65, 0xd2, - 0xee, 0xc4, 0xa7, 0xfc, 0x40, 0x37, 0xac, 0xff, 0x48, 0x43, 0x21, 0xd9, 0x25, 0xa0, 0x9d, 0xb0, - 0x37, 0x50, 0x06, 0x58, 0xdb, 0xde, 0xba, 0xaa, 0xab, 0x50, 0x95, 0x86, 0x3b, 0x96, 0x7a, 0x1f, - 0x31, 0x9b, 0x62, 0x45, 0x46, 0x1f, 0xc0, 0x8a, 0xcf, 0xb8, 0x88, 0xee, 0xe4, 0xf9, 0xd7, 0x15, - 0xe3, 0x51, 0xd9, 0x16, 0x82, 0x6b, 0x43, 0x58, 0x9b, 0xd5, 0x86, 0xee, 0xc0, 0xf2, 0x41, 0xa7, - 0x5b, 0x4a, 0x95, 0x6f, 0x3e, 0x3b, 0xad, 0xbe, 0x3e, 0xfb, 0xe3, 0x81, 0xc3, 0xc5, 0x98, 0xb8, - 0x9d, 0x2e, 0x7a, 0x17, 0x56, 0x5a, 0x7b, 0x3d, 0x8c, 0x4b, 0xe9, 0xf2, 0xc6, 0xb3, 0xd3, 0xea, - 0xcd, 0x59, 0x9c, 0xfc, 0x89, 0x8d, 0x3d, 0x1b, 0xb3, 0xc3, 0xb8, 0x4d, 0xff, 0xe7, 0x12, 0x18, - 0xba, 0x54, 0x79, 0xd9, 0x2f, 0x39, 0xc5, 0xb0, 0xec, 0x8d, 0x32, 0xec, 0xd2, 0x95, 0xd5, 0x6f, - 0x21, 0x24, 0xe8, 0xc8, 0x78, 0x03, 0x0a, 0x8e, 0x7f, 0xf2, 0x61, 0x9f, 0x7a, 0xe4, 0xd0, 0xd5, - 0x1d, 0x7b, 0x0e, 0x1b, 0x52, 0xd6, 0x0e, 0x45, 0xb2, 0xf8, 0x70, 0x3c, 0x41, 0xb9, 0xa7, 0x7b, - 0xf1, 0x1c, 0x8e, 0xe7, 0xe8, 0x53, 0xc8, 0x38, 0x3e, 0x19, 0xe9, 0x92, 0x7d, 0xee, 0x0e, 0x3a, - 0xdd, 0xc6, 0x23, 0x1d, 0xb9, 0xcd, 0xdc, 0xf9, 0xd9, 0x46, 0x46, 0x0a, 0xb0, 0xa2, 0xa1, 0x4a, - 0xd4, 0x4f, 0xc9, 0x2f, 0xa9, 0x82, 0x25, 0x87, 0x13, 0x12, 0x19, 0x7d, 0x8e, 0x37, 0xe0, 0x34, - 0x08, 0x54, 0xe9, 0x92, 0xc3, 0xd1, 0x14, 0x95, 0x61, 0x55, 0xd7, 0xde, 0xaa, 0x0d, 0xcb, 0xcb, - 0x8e, 0x46, 0x0b, 0x9a, 0x45, 0x30, 0x42, 0x6b, 0xf4, 0x8f, 0x38, 0x1b, 0xd5, 0xfe, 0x95, 0x01, - 0x63, 0xc7, 0x1d, 0x07, 0x42, 0xd7, 0x75, 0x2f, 0xcd, 0xf8, 0x4f, 0xe1, 0x3a, 0x51, 0x2f, 0x43, - 0xc4, 0x93, 0x85, 0x80, 0x6a, 0x69, 0xf4, 0x01, 0xdc, 0x99, 0xab, 0x2e, 0x06, 0x87, 0xed, 0x4f, - 0x33, 0x2b, 0x75, 0x9a, 0x69, 0x5c, 0x22, 0x17, 0x7e, 0x41, 0x3d, 0x28, 0x32, 0x6e, 0x0d, 0x69, - 0x20, 0xc2, 0xf2, 0x41, 0xbf, 0xa4, 0xcc, 0x7d, 0x63, 0x7b, 0x9c, 0x04, 0xea, 0x5b, 0x33, 0x5c, - 0xed, 0xac, 0x0e, 0xf4, 0x11, 0x64, 0x38, 0x39, 0x8a, 0xda, 0xb3, 0xb9, 0x41, 0x82, 0xc9, 0x91, - 0x98, 0x51, 0xa1, 0x18, 0xe8, 0x73, 0x00, 0xdb, 0x09, 0x7c, 0x22, 0xac, 0x21, 0xe5, 0xfa, 0xb0, - 0xe7, 0x6e, 0xb1, 0x15, 0xa3, 0x66, 0xb4, 0x24, 0xd8, 0xe8, 0x01, 0xe4, 0x2d, 0x12, 0xb9, 0x6b, - 0x76, 0xf1, 0xf3, 0xd2, 0x4e, 0x43, 0xab, 0x28, 0x49, 0x15, 0xe7, 0x67, 0x1b, 0xb9, 0x48, 0x82, - 0x73, 0x16, 0xd1, 0xee, 0xfb, 0x00, 0x8a, 0x82, 0x04, 0xc7, 0x7d, 0x3b, 0x4c, 0x67, 0xa1, 0x9b, - 0x2c, 0xa8, 0x02, 0x64, 0x17, 0xaf, 0xd3, 0x5e, 0x74, 0x9c, 0x05, 0x91, 0x90, 0xa1, 0x9f, 0xc3, - 0x75, 0xea, 0x59, 0x7c, 0xa2, 0x9c, 0x35, 0x5a, 0x61, 0x6e, 0xf1, 0x66, 0xdb, 0x31, 0x78, 0x66, - 0xb3, 0x25, 0x7a, 0x41, 0x5e, 0xfb, 0x6b, 0x1a, 0x20, 0x2c, 0xbb, 0x5e, 0xae, 0x03, 0x22, 0xc8, - 0xd8, 0x44, 0x10, 0xe5, 0x73, 0x05, 0xac, 0xc6, 0xe8, 0x1e, 0x80, 0xa0, 0x23, 0x5f, 0xa6, 0x5e, - 0x6f, 0xa0, 0xdd, 0xe6, 0x79, 0xe9, 0x20, 0x81, 0x46, 0xdb, 0x90, 0xd5, 0x4d, 0x74, 0xe6, 0x4a, - 0x9e, 0x46, 0xd6, 0xfe, 0x90, 0x06, 0x08, 0xb7, 0xf9, 0x3f, 0xbd, 0xb7, 0xda, 0x5f, 0x56, 0x00, - 0x0e, 0x98, 0x3b, 0x1e, 0xbd, 0xe4, 0x87, 0xd2, 0x1b, 0xb0, 0xa2, 0x1a, 0xa7, 0xe8, 0x92, 0x57, - 0x93, 0x84, 0x25, 0x97, 0x5f, 0xd4, 0x92, 0xa8, 0x0d, 0x86, 0xcc, 0x03, 0x41, 0xd0, 0x57, 0x17, - 0x62, 0x66, 0xb1, 0xe3, 0x85, 0xfb, 0x68, 0x28, 0xb0, 0xba, 0x05, 0x81, 0xc4, 0x63, 0x74, 0x6f, - 0xda, 0x05, 0xac, 0xa8, 0xdb, 0xb0, 0xba, 0x58, 0x85, 0xee, 0x05, 0xe2, 0x16, 0x80, 0xc2, 0x7a, - 0xa8, 0xd5, 0xd1, 0xcf, 0xeb, 0x89, 0xb7, 0x1e, 0x1d, 0xab, 0x73, 0x53, 0xd0, 0x3e, 0xf3, 0x99, - 0xcb, 0x06, 0x49, 0x3c, 0x5e, 0xac, 0x09, 0xed, 0x86, 0x25, 0xac, 0x25, 0x2b, 0x53, 0x4e, 0xbc, - 0x01, 0xd5, 0x61, 0x3b, 0xff, 0xf9, 0x4b, 0x23, 0xb1, 0x04, 0x86, 0x55, 0x6e, 0x3c, 0x45, 0x4f, - 0x2e, 0xfc, 0x7f, 0x90, 0x53, 0x55, 0xc4, 0xfb, 0xcf, 0xd9, 0xb1, 0xac, 0x21, 0xb4, 0xfd, 0x16, - 0xff, 0x8f, 0xf0, 0xbb, 0x34, 0xa0, 0xcb, 0x20, 0xb4, 0x99, 0x78, 0xe7, 0x57, 0xc5, 0xce, 0x65, - 0x8c, 0x7e, 0xe9, 0xbf, 0x3b, 0x7d, 0xe9, 0x57, 0xa5, 0xc4, 0x65, 0x60, 0xf8, 0xd6, 0x7f, 0x77, - 0xfa, 0xd6, 0xbf, 0x00, 0x97, 0x78, 0xed, 0x6f, 0xde, 0xf9, 0xe6, 0xfb, 0x4a, 0xea, 0xbb, 0xef, - 0x2b, 0xa9, 0x5f, 0x9f, 0x57, 0xd2, 0xdf, 0x9c, 0x57, 0xd2, 0xdf, 0x9e, 0x57, 0xd2, 0x7f, 0x3b, - 0xaf, 0xa4, 0x7f, 0xfb, 0x43, 0x25, 0xf5, 0xed, 0x0f, 0x95, 0xd4, 0x77, 0x3f, 0x54, 0x52, 0x87, - 0x59, 0xd5, 0x7c, 0xfe, 0xff, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x51, 0x6a, 0xd3, 0x1b, 0x19, - 0x1b, 0x00, 0x00, -} - -func (m *NodeSpec) Copy() *NodeSpec { - if m == nil { - return nil - } - o := &NodeSpec{} - o.CopyFrom(m) - return o -} - -func (m *NodeSpec) CopyFrom(src interface{}) { - - o := src.(*NodeSpec) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Annotations, &o.Annotations) -} - -func (m *ServiceSpec) Copy() *ServiceSpec { - if m == nil { - return nil - } - o := &ServiceSpec{} - o.CopyFrom(m) - return o -} - -func (m *ServiceSpec) CopyFrom(src interface{}) { - - o := src.(*ServiceSpec) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Annotations, &o.Annotations) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Task, &o.Task) - if o.Update != nil { - m.Update = &UpdateConfig{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Update, o.Update) - } - if o.Rollback != nil { - m.Rollback = &UpdateConfig{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Rollback, o.Rollback) - } - if o.Networks != nil { - m.Networks = make([]*NetworkAttachmentConfig, len(o.Networks)) - for i := range m.Networks { - m.Networks[i] = &NetworkAttachmentConfig{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Networks[i], o.Networks[i]) - } - } - - if o.Endpoint != nil { - m.Endpoint = &EndpointSpec{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Endpoint, o.Endpoint) - } - if o.Mode != nil { - switch o.Mode.(type) { - case *ServiceSpec_Replicated: - v := ServiceSpec_Replicated{ - Replicated: &ReplicatedService{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Replicated, o.GetReplicated()) - m.Mode = &v - case *ServiceSpec_Global: - v := ServiceSpec_Global{ - Global: &GlobalService{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Global, o.GetGlobal()) - m.Mode = &v - case *ServiceSpec_ReplicatedJob: - v := ServiceSpec_ReplicatedJob{ - ReplicatedJob: &ReplicatedJob{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.ReplicatedJob, o.GetReplicatedJob()) - m.Mode = &v - case *ServiceSpec_GlobalJob: - v := ServiceSpec_GlobalJob{ - GlobalJob: &GlobalJob{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.GlobalJob, o.GetGlobalJob()) - m.Mode = &v - } - } - -} - -func (m *ReplicatedService) Copy() *ReplicatedService { - if m == nil { - return nil - } - o := &ReplicatedService{} - o.CopyFrom(m) - return o -} - -func (m *ReplicatedService) CopyFrom(src interface{}) { - - o := src.(*ReplicatedService) - *m = *o -} - -func (m *GlobalService) Copy() *GlobalService { - if m == nil { - return nil - } - o := &GlobalService{} - o.CopyFrom(m) - return o -} - -func (m *GlobalService) CopyFrom(src interface{}) {} -func (m *ReplicatedJob) Copy() *ReplicatedJob { - if m == nil { - return nil - } - o := &ReplicatedJob{} - o.CopyFrom(m) - return o -} - -func (m *ReplicatedJob) CopyFrom(src interface{}) { - - o := src.(*ReplicatedJob) - *m = *o -} - -func (m *GlobalJob) Copy() *GlobalJob { - if m == nil { - return nil - } - o := &GlobalJob{} - o.CopyFrom(m) - return o -} - -func (m *GlobalJob) CopyFrom(src interface{}) {} -func (m *TaskSpec) Copy() *TaskSpec { - if m == nil { - return nil - } - o := &TaskSpec{} - o.CopyFrom(m) - return o -} - -func (m *TaskSpec) CopyFrom(src interface{}) { - - o := src.(*TaskSpec) - *m = *o - if o.Resources != nil { - m.Resources = &ResourceRequirements{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Resources, o.Resources) - } - if o.Restart != nil { - m.Restart = &RestartPolicy{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Restart, o.Restart) - } - if o.Placement != nil { - m.Placement = &Placement{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Placement, o.Placement) - } - if o.LogDriver != nil { - m.LogDriver = &Driver{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.LogDriver, o.LogDriver) - } - if o.Networks != nil { - m.Networks = make([]*NetworkAttachmentConfig, len(o.Networks)) - for i := range m.Networks { - m.Networks[i] = &NetworkAttachmentConfig{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Networks[i], o.Networks[i]) - } - } - - if o.ResourceReferences != nil { - m.ResourceReferences = make([]ResourceReference, len(o.ResourceReferences)) - for i := range m.ResourceReferences { - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.ResourceReferences[i], &o.ResourceReferences[i]) - } - } - - if o.Runtime != nil { - switch o.Runtime.(type) { - case *TaskSpec_Attachment: - v := TaskSpec_Attachment{ - Attachment: &NetworkAttachmentSpec{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Attachment, o.GetAttachment()) - m.Runtime = &v - case *TaskSpec_Container: - v := TaskSpec_Container{ - Container: &ContainerSpec{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Container, o.GetContainer()) - m.Runtime = &v - case *TaskSpec_Generic: - v := TaskSpec_Generic{ - Generic: &GenericRuntimeSpec{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Generic, o.GetGeneric()) - m.Runtime = &v - } - } - -} - -func (m *ResourceReference) Copy() *ResourceReference { - if m == nil { - return nil - } - o := &ResourceReference{} - o.CopyFrom(m) - return o -} - -func (m *ResourceReference) CopyFrom(src interface{}) { - - o := src.(*ResourceReference) - *m = *o -} - -func (m *GenericRuntimeSpec) Copy() *GenericRuntimeSpec { - if m == nil { - return nil - } - o := &GenericRuntimeSpec{} - o.CopyFrom(m) - return o -} - -func (m *GenericRuntimeSpec) CopyFrom(src interface{}) { - - o := src.(*GenericRuntimeSpec) - *m = *o - if o.Payload != nil { - m.Payload = &types.Any{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Payload, o.Payload) - } -} - -func (m *NetworkAttachmentSpec) Copy() *NetworkAttachmentSpec { - if m == nil { - return nil - } - o := &NetworkAttachmentSpec{} - o.CopyFrom(m) - return o -} - -func (m *NetworkAttachmentSpec) CopyFrom(src interface{}) { - - o := src.(*NetworkAttachmentSpec) - *m = *o -} - -func (m *ContainerSpec) Copy() *ContainerSpec { - if m == nil { - return nil - } - o := &ContainerSpec{} - o.CopyFrom(m) - return o -} - -func (m *ContainerSpec) CopyFrom(src interface{}) { - - o := src.(*ContainerSpec) - *m = *o - if o.Labels != nil { - m.Labels = make(map[string]string, len(o.Labels)) - for k, v := range o.Labels { - m.Labels[k] = v - } - } - - if o.Command != nil { - m.Command = make([]string, len(o.Command)) - copy(m.Command, o.Command) - } - - if o.Args != nil { - m.Args = make([]string, len(o.Args)) - copy(m.Args, o.Args) - } - - if o.Env != nil { - m.Env = make([]string, len(o.Env)) - copy(m.Env, o.Env) - } - - if o.Groups != nil { - m.Groups = make([]string, len(o.Groups)) - copy(m.Groups, o.Groups) - } - - if o.Privileges != nil { - m.Privileges = &Privileges{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Privileges, o.Privileges) - } - if o.Init != nil { - m.Init = &types.BoolValue{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Init, o.Init) - } - if o.Mounts != nil { - m.Mounts = make([]Mount, len(o.Mounts)) - for i := range m.Mounts { - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Mounts[i], &o.Mounts[i]) - } - } - - if o.StopGracePeriod != nil { - m.StopGracePeriod = &types.Duration{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.StopGracePeriod, o.StopGracePeriod) - } - if o.PullOptions != nil { - m.PullOptions = &ContainerSpec_PullOptions{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.PullOptions, o.PullOptions) - } - if o.Secrets != nil { - m.Secrets = make([]*SecretReference, len(o.Secrets)) - for i := range m.Secrets { - m.Secrets[i] = &SecretReference{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Secrets[i], o.Secrets[i]) - } - } - - if o.Configs != nil { - m.Configs = make([]*ConfigReference, len(o.Configs)) - for i := range m.Configs { - m.Configs[i] = &ConfigReference{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Configs[i], o.Configs[i]) - } - } - - if o.Hosts != nil { - m.Hosts = make([]string, len(o.Hosts)) - copy(m.Hosts, o.Hosts) - } - - if o.DNSConfig != nil { - m.DNSConfig = &ContainerSpec_DNSConfig{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.DNSConfig, o.DNSConfig) - } - if o.Healthcheck != nil { - m.Healthcheck = &HealthConfig{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Healthcheck, o.Healthcheck) - } - if o.Sysctls != nil { - m.Sysctls = make(map[string]string, len(o.Sysctls)) - for k, v := range o.Sysctls { - m.Sysctls[k] = v - } - } - - if o.CapabilityAdd != nil { - m.CapabilityAdd = make([]string, len(o.CapabilityAdd)) - copy(m.CapabilityAdd, o.CapabilityAdd) - } - - if o.CapabilityDrop != nil { - m.CapabilityDrop = make([]string, len(o.CapabilityDrop)) - copy(m.CapabilityDrop, o.CapabilityDrop) - } - - if o.Ulimits != nil { - m.Ulimits = make([]*ContainerSpec_Ulimit, len(o.Ulimits)) - for i := range m.Ulimits { - m.Ulimits[i] = &ContainerSpec_Ulimit{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Ulimits[i], o.Ulimits[i]) - } - } - -} - -func (m *ContainerSpec_PullOptions) Copy() *ContainerSpec_PullOptions { - if m == nil { - return nil - } - o := &ContainerSpec_PullOptions{} - o.CopyFrom(m) - return o -} - -func (m *ContainerSpec_PullOptions) CopyFrom(src interface{}) { - - o := src.(*ContainerSpec_PullOptions) - *m = *o -} - -func (m *ContainerSpec_DNSConfig) Copy() *ContainerSpec_DNSConfig { - if m == nil { - return nil - } - o := &ContainerSpec_DNSConfig{} - o.CopyFrom(m) - return o -} - -func (m *ContainerSpec_DNSConfig) CopyFrom(src interface{}) { - - o := src.(*ContainerSpec_DNSConfig) - *m = *o - if o.Nameservers != nil { - m.Nameservers = make([]string, len(o.Nameservers)) - copy(m.Nameservers, o.Nameservers) - } - - if o.Search != nil { - m.Search = make([]string, len(o.Search)) - copy(m.Search, o.Search) - } - - if o.Options != nil { - m.Options = make([]string, len(o.Options)) - copy(m.Options, o.Options) - } - -} - -func (m *ContainerSpec_Ulimit) Copy() *ContainerSpec_Ulimit { - if m == nil { - return nil - } - o := &ContainerSpec_Ulimit{} - o.CopyFrom(m) - return o -} - -func (m *ContainerSpec_Ulimit) CopyFrom(src interface{}) { - - o := src.(*ContainerSpec_Ulimit) - *m = *o -} - -func (m *EndpointSpec) Copy() *EndpointSpec { - if m == nil { - return nil - } - o := &EndpointSpec{} - o.CopyFrom(m) - return o -} - -func (m *EndpointSpec) CopyFrom(src interface{}) { - - o := src.(*EndpointSpec) - *m = *o - if o.Ports != nil { - m.Ports = make([]*PortConfig, len(o.Ports)) - for i := range m.Ports { - m.Ports[i] = &PortConfig{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Ports[i], o.Ports[i]) - } - } - -} - -func (m *NetworkSpec) Copy() *NetworkSpec { - if m == nil { - return nil - } - o := &NetworkSpec{} - o.CopyFrom(m) - return o -} - -func (m *NetworkSpec) CopyFrom(src interface{}) { - - o := src.(*NetworkSpec) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Annotations, &o.Annotations) - if o.DriverConfig != nil { - m.DriverConfig = &Driver{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.DriverConfig, o.DriverConfig) - } - if o.IPAM != nil { - m.IPAM = &IPAMOptions{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.IPAM, o.IPAM) - } - if o.ConfigFrom != nil { - switch o.ConfigFrom.(type) { - case *NetworkSpec_Network: - v := NetworkSpec_Network{ - Network: o.GetNetwork(), - } - m.ConfigFrom = &v - } - } - -} - -func (m *ClusterSpec) Copy() *ClusterSpec { - if m == nil { - return nil - } - o := &ClusterSpec{} - o.CopyFrom(m) - return o -} - -func (m *ClusterSpec) CopyFrom(src interface{}) { - - o := src.(*ClusterSpec) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Annotations, &o.Annotations) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.AcceptancePolicy, &o.AcceptancePolicy) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Orchestration, &o.Orchestration) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Raft, &o.Raft) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Dispatcher, &o.Dispatcher) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.CAConfig, &o.CAConfig) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.TaskDefaults, &o.TaskDefaults) - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.EncryptionConfig, &o.EncryptionConfig) -} - -func (m *SecretSpec) Copy() *SecretSpec { - if m == nil { - return nil - } - o := &SecretSpec{} - o.CopyFrom(m) - return o -} - -func (m *SecretSpec) CopyFrom(src interface{}) { - - o := src.(*SecretSpec) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Annotations, &o.Annotations) - if o.Data != nil { - m.Data = make([]byte, len(o.Data)) - copy(m.Data, o.Data) - } - if o.Templating != nil { - m.Templating = &Driver{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Templating, o.Templating) - } - if o.Driver != nil { - m.Driver = &Driver{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Driver, o.Driver) - } -} - -func (m *ConfigSpec) Copy() *ConfigSpec { - if m == nil { - return nil - } - o := &ConfigSpec{} - o.CopyFrom(m) - return o -} - -func (m *ConfigSpec) CopyFrom(src interface{}) { - - o := src.(*ConfigSpec) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Annotations, &o.Annotations) - if o.Data != nil { - m.Data = make([]byte, len(o.Data)) - copy(m.Data, o.Data) - } - if o.Templating != nil { - m.Templating = &Driver{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Templating, o.Templating) - } -} - -func (m *VolumeSpec) Copy() *VolumeSpec { - if m == nil { - return nil - } - o := &VolumeSpec{} - o.CopyFrom(m) - return o -} - -func (m *VolumeSpec) CopyFrom(src interface{}) { - - o := src.(*VolumeSpec) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Annotations, &o.Annotations) - if o.Driver != nil { - m.Driver = &Driver{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Driver, o.Driver) - } - if o.AccessMode != nil { - m.AccessMode = &VolumeAccessMode{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.AccessMode, o.AccessMode) - } - if o.Secrets != nil { - m.Secrets = make([]*VolumeSecret, len(o.Secrets)) - for i := range m.Secrets { - m.Secrets[i] = &VolumeSecret{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Secrets[i], o.Secrets[i]) - } - } - - if o.AccessibilityRequirements != nil { - m.AccessibilityRequirements = &TopologyRequirement{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.AccessibilityRequirements, o.AccessibilityRequirements) - } - if o.CapacityRange != nil { - m.CapacityRange = &CapacityRange{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.CapacityRange, o.CapacityRange) - } -} - -func (m *NodeSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NodeSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodeSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Availability != 0 { - i = encodeVarintSpecs(dAtA, i, uint64(m.Availability)) - i-- - dAtA[i] = 0x20 - } - if m.Membership != 0 { - i = encodeVarintSpecs(dAtA, i, uint64(m.Membership)) - i-- - dAtA[i] = 0x18 - } - if m.DesiredRole != 0 { - i = encodeVarintSpecs(dAtA, i, uint64(m.DesiredRole)) - i-- - dAtA[i] = 0x10 - } - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ServiceSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ServiceSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ServiceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Mode != nil { - { - size := m.Mode.Size() - i -= size - if _, err := m.Mode.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.Rollback != nil { - { - size, err := m.Rollback.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - if m.Endpoint != nil { - { - size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if len(m.Networks) > 0 { - for iNdEx := len(m.Networks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Networks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if m.Update != nil { - { - size, err := m.Update.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - { - size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ServiceSpec_Replicated) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ServiceSpec_Replicated) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Replicated != nil { - { - size, err := m.Replicated.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *ServiceSpec_Global) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ServiceSpec_Global) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Global != nil { - { - size, err := m.Global.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *ServiceSpec_ReplicatedJob) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ServiceSpec_ReplicatedJob) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ReplicatedJob != nil { - { - size, err := m.ReplicatedJob.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - return len(dAtA) - i, nil -} -func (m *ServiceSpec_GlobalJob) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ServiceSpec_GlobalJob) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.GlobalJob != nil { - { - size, err := m.GlobalJob.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - } - return len(dAtA) - i, nil -} -func (m *ReplicatedService) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ReplicatedService) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ReplicatedService) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Replicas != 0 { - i = encodeVarintSpecs(dAtA, i, uint64(m.Replicas)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *GlobalService) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GlobalService) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GlobalService) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *ReplicatedJob) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ReplicatedJob) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ReplicatedJob) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TotalCompletions != 0 { - i = encodeVarintSpecs(dAtA, i, uint64(m.TotalCompletions)) - i-- - dAtA[i] = 0x10 - } - if m.MaxConcurrent != 0 { - i = encodeVarintSpecs(dAtA, i, uint64(m.MaxConcurrent)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *GlobalJob) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GlobalJob) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GlobalJob) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *TaskSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TaskSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TaskSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ResourceReferences) > 0 { - for iNdEx := len(m.ResourceReferences) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ResourceReferences[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - } - } - if m.Runtime != nil { - { - size := m.Runtime.Size() - i -= size - if _, err := m.Runtime.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.ForceUpdate != 0 { - i = encodeVarintSpecs(dAtA, i, uint64(m.ForceUpdate)) - i-- - dAtA[i] = 0x48 - } - if len(m.Networks) > 0 { - for iNdEx := len(m.Networks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Networks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if m.LogDriver != nil { - { - size, err := m.LogDriver.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.Placement != nil { - { - size, err := m.Placement.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.Restart != nil { - { - size, err := m.Restart.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Resources != nil { - { - size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} - -func (m *TaskSpec_Container) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TaskSpec_Container) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Container != nil { - { - size, err := m.Container.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *TaskSpec_Attachment) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TaskSpec_Attachment) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Attachment != nil { - { - size, err := m.Attachment.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - return len(dAtA) - i, nil -} -func (m *TaskSpec_Generic) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TaskSpec_Generic) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Generic != nil { - { - size, err := m.Generic.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - return len(dAtA) - i, nil -} -func (m *ResourceReference) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResourceReference) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResourceReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ResourceType != 0 { - i = encodeVarintSpecs(dAtA, i, uint64(m.ResourceType)) - i-- - dAtA[i] = 0x10 - } - if len(m.ResourceID) > 0 { - i -= len(m.ResourceID) - copy(dAtA[i:], m.ResourceID) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.ResourceID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GenericRuntimeSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GenericRuntimeSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenericRuntimeSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Payload != nil { - { - size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Kind) > 0 { - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *NetworkAttachmentSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NetworkAttachmentSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NetworkAttachmentSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ContainerID) > 0 { - i -= len(m.ContainerID) - copy(dAtA[i:], m.ContainerID) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.ContainerID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ContainerSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ContainerSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ContainerSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.OomScoreAdj != 0 { - i = encodeVarintSpecs(dAtA, i, uint64(m.OomScoreAdj)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xf0 - } - if len(m.Ulimits) > 0 { - for iNdEx := len(m.Ulimits) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Ulimits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xea - } - } - if len(m.CapabilityDrop) > 0 { - for iNdEx := len(m.CapabilityDrop) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.CapabilityDrop[iNdEx]) - copy(dAtA[i:], m.CapabilityDrop[iNdEx]) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.CapabilityDrop[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xe2 - } - } - if len(m.CapabilityAdd) > 0 { - for iNdEx := len(m.CapabilityAdd) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.CapabilityAdd[iNdEx]) - copy(dAtA[i:], m.CapabilityAdd[iNdEx]) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.CapabilityAdd[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xda - } - } - if len(m.Sysctls) > 0 { - for k := range m.Sysctls { - v := m.Sysctls[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintSpecs(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintSpecs(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintSpecs(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xd2 - } - } - if m.PidsLimit != 0 { - i = encodeVarintSpecs(dAtA, i, uint64(m.PidsLimit)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xc8 - } - if m.Isolation != 0 { - i = encodeVarintSpecs(dAtA, i, uint64(m.Isolation)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xc0 - } - if m.Init != nil { - { - size, err := m.Init.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xba - } - if m.Privileges != nil { - { - size, err := m.Privileges.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xb2 - } - if len(m.Configs) > 0 { - for iNdEx := len(m.Configs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Configs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xaa - } - } - if len(m.StopSignal) > 0 { - i -= len(m.StopSignal) - copy(dAtA[i:], m.StopSignal) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.StopSignal))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa2 - } - if m.ReadOnly { - i-- - if m.ReadOnly { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x98 - } - if m.OpenStdin { - i-- - if m.OpenStdin { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x90 - } - if len(m.Hosts) > 0 { - for iNdEx := len(m.Hosts) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Hosts[iNdEx]) - copy(dAtA[i:], m.Hosts[iNdEx]) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Hosts[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } - } - if m.Healthcheck != nil { - { - size, err := m.Healthcheck.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - if m.DNSConfig != nil { - { - size, err := m.DNSConfig.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x7a - } - if len(m.Hostname) > 0 { - i -= len(m.Hostname) - copy(dAtA[i:], m.Hostname) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Hostname))) - i-- - dAtA[i] = 0x72 - } - if m.TTY { - i-- - if m.TTY { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x68 - } - if len(m.Secrets) > 0 { - for iNdEx := len(m.Secrets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Secrets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - } - } - if len(m.Groups) > 0 { - for iNdEx := len(m.Groups) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Groups[iNdEx]) - copy(dAtA[i:], m.Groups[iNdEx]) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Groups[iNdEx]))) - i-- - dAtA[i] = 0x5a - } - } - if m.PullOptions != nil { - { - size, err := m.PullOptions.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - if m.StopGracePeriod != nil { - { - size, err := m.StopGracePeriod.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - if len(m.Mounts) > 0 { - for iNdEx := len(m.Mounts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Mounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } - if len(m.User) > 0 { - i -= len(m.User) - copy(dAtA[i:], m.User) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.User))) - i-- - dAtA[i] = 0x3a - } - if len(m.Dir) > 0 { - i -= len(m.Dir) - copy(dAtA[i:], m.Dir) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Dir))) - i-- - dAtA[i] = 0x32 - } - if len(m.Env) > 0 { - for iNdEx := len(m.Env) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Env[iNdEx]) - copy(dAtA[i:], m.Env[iNdEx]) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Env[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(m.Args) > 0 { - for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Args[iNdEx]) - copy(dAtA[i:], m.Args[iNdEx]) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Args[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Command) > 0 { - for iNdEx := len(m.Command) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Command[iNdEx]) - copy(dAtA[i:], m.Command[iNdEx]) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Command[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintSpecs(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintSpecs(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintSpecs(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Image) > 0 { - i -= len(m.Image) - copy(dAtA[i:], m.Image) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Image))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ContainerSpec_PullOptions) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ContainerSpec_PullOptions) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ContainerSpec_PullOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.RegistryAuth) > 0 { - i -= len(m.RegistryAuth) - copy(dAtA[i:], m.RegistryAuth) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.RegistryAuth))) - i-- - dAtA[i] = 0x4 - i-- - dAtA[i] = 0x82 - } - return len(dAtA) - i, nil -} - -func (m *ContainerSpec_DNSConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ContainerSpec_DNSConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ContainerSpec_DNSConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Options) > 0 { - for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Options[iNdEx]) - copy(dAtA[i:], m.Options[iNdEx]) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Options[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.Search) > 0 { - for iNdEx := len(m.Search) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Search[iNdEx]) - copy(dAtA[i:], m.Search[iNdEx]) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Search[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Nameservers) > 0 { - for iNdEx := len(m.Nameservers) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Nameservers[iNdEx]) - copy(dAtA[i:], m.Nameservers[iNdEx]) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Nameservers[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ContainerSpec_Ulimit) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ContainerSpec_Ulimit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ContainerSpec_Ulimit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Hard != 0 { - i = encodeVarintSpecs(dAtA, i, uint64(m.Hard)) - i-- - dAtA[i] = 0x18 - } - if m.Soft != 0 { - i = encodeVarintSpecs(dAtA, i, uint64(m.Soft)) - i-- - dAtA[i] = 0x10 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EndpointSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EndpointSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EndpointSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Ports) > 0 { - for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Mode != 0 { - i = encodeVarintSpecs(dAtA, i, uint64(m.Mode)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *NetworkSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NetworkSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NetworkSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ConfigFrom != nil { - { - size := m.ConfigFrom.Size() - i -= size - if _, err := m.ConfigFrom.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.Ingress { - i-- - if m.Ingress { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - if m.Attachable { - i-- - if m.Attachable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if m.IPAM != nil { - { - size, err := m.IPAM.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.Internal { - i-- - if m.Internal { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.Ipv6Enabled { - i-- - if m.Ipv6Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.DriverConfig != nil { - { - size, err := m.DriverConfig.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *NetworkSpec_Network) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NetworkSpec_Network) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.Network) - copy(dAtA[i:], m.Network) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Network))) - i-- - dAtA[i] = 0x42 - return len(dAtA) - i, nil -} -func (m *ClusterSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ClusterSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ClusterSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.EncryptionConfig.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - { - size, err := m.TaskDefaults.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - { - size, err := m.CAConfig.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size, err := m.Dispatcher.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size, err := m.Raft.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size, err := m.Orchestration.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.AcceptancePolicy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *SecretSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SecretSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SecretSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Driver != nil { - { - size, err := m.Driver.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Templating != nil { - { - size, err := m.Templating.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ConfigSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConfigSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConfigSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Templating != nil { - { - size, err := m.Templating.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *VolumeSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumeSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Availability != 0 { - i = encodeVarintSpecs(dAtA, i, uint64(m.Availability)) - i-- - dAtA[i] = 0x40 - } - if m.CapacityRange != nil { - { - size, err := m.CapacityRange.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if m.AccessibilityRequirements != nil { - { - size, err := m.AccessibilityRequirements.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if len(m.Secrets) > 0 { - for iNdEx := len(m.Secrets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Secrets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if m.AccessMode != nil { - { - size, err := m.AccessMode.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Driver != nil { - { - size, err := m.Driver.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Group) > 0 { - i -= len(m.Group) - copy(dAtA[i:], m.Group) - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Group))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpecs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintSpecs(dAtA []byte, offset int, v uint64) int { - offset -= sovSpecs(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *NodeSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Annotations.Size() - n += 1 + l + sovSpecs(uint64(l)) - if m.DesiredRole != 0 { - n += 1 + sovSpecs(uint64(m.DesiredRole)) - } - if m.Membership != 0 { - n += 1 + sovSpecs(uint64(m.Membership)) - } - if m.Availability != 0 { - n += 1 + sovSpecs(uint64(m.Availability)) - } - return n -} - -func (m *ServiceSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Annotations.Size() - n += 1 + l + sovSpecs(uint64(l)) - l = m.Task.Size() - n += 1 + l + sovSpecs(uint64(l)) - if m.Mode != nil { - n += m.Mode.Size() - } - if m.Update != nil { - l = m.Update.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - if len(m.Networks) > 0 { - for _, e := range m.Networks { - l = e.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - } - if m.Endpoint != nil { - l = m.Endpoint.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - if m.Rollback != nil { - l = m.Rollback.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - return n -} - -func (m *ServiceSpec_Replicated) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Replicated != nil { - l = m.Replicated.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - return n -} -func (m *ServiceSpec_Global) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Global != nil { - l = m.Global.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - return n -} -func (m *ServiceSpec_ReplicatedJob) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ReplicatedJob != nil { - l = m.ReplicatedJob.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - return n -} -func (m *ServiceSpec_GlobalJob) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.GlobalJob != nil { - l = m.GlobalJob.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - return n -} -func (m *ReplicatedService) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Replicas != 0 { - n += 1 + sovSpecs(uint64(m.Replicas)) - } - return n -} - -func (m *GlobalService) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *ReplicatedJob) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MaxConcurrent != 0 { - n += 1 + sovSpecs(uint64(m.MaxConcurrent)) - } - if m.TotalCompletions != 0 { - n += 1 + sovSpecs(uint64(m.TotalCompletions)) - } - return n -} - -func (m *GlobalJob) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *TaskSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Runtime != nil { - n += m.Runtime.Size() - } - if m.Resources != nil { - l = m.Resources.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - if m.Restart != nil { - l = m.Restart.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - if m.Placement != nil { - l = m.Placement.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - if m.LogDriver != nil { - l = m.LogDriver.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - if len(m.Networks) > 0 { - for _, e := range m.Networks { - l = e.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - } - if m.ForceUpdate != 0 { - n += 1 + sovSpecs(uint64(m.ForceUpdate)) - } - if len(m.ResourceReferences) > 0 { - for _, e := range m.ResourceReferences { - l = e.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - } - return n -} - -func (m *TaskSpec_Container) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Container != nil { - l = m.Container.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - return n -} -func (m *TaskSpec_Attachment) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Attachment != nil { - l = m.Attachment.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - return n -} -func (m *TaskSpec_Generic) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Generic != nil { - l = m.Generic.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - return n -} -func (m *ResourceReference) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ResourceID) - if l > 0 { - n += 1 + l + sovSpecs(uint64(l)) - } - if m.ResourceType != 0 { - n += 1 + sovSpecs(uint64(m.ResourceType)) - } - return n -} - -func (m *GenericRuntimeSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Kind) - if l > 0 { - n += 1 + l + sovSpecs(uint64(l)) - } - if m.Payload != nil { - l = m.Payload.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - return n -} - -func (m *NetworkAttachmentSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContainerID) - if l > 0 { - n += 1 + l + sovSpecs(uint64(l)) - } - return n -} - -func (m *ContainerSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Image) - if l > 0 { - n += 1 + l + sovSpecs(uint64(l)) - } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovSpecs(uint64(len(k))) + 1 + len(v) + sovSpecs(uint64(len(v))) - n += mapEntrySize + 1 + sovSpecs(uint64(mapEntrySize)) - } - } - if len(m.Command) > 0 { - for _, s := range m.Command { - l = len(s) - n += 1 + l + sovSpecs(uint64(l)) - } - } - if len(m.Args) > 0 { - for _, s := range m.Args { - l = len(s) - n += 1 + l + sovSpecs(uint64(l)) - } - } - if len(m.Env) > 0 { - for _, s := range m.Env { - l = len(s) - n += 1 + l + sovSpecs(uint64(l)) - } - } - l = len(m.Dir) - if l > 0 { - n += 1 + l + sovSpecs(uint64(l)) - } - l = len(m.User) - if l > 0 { - n += 1 + l + sovSpecs(uint64(l)) - } - if len(m.Mounts) > 0 { - for _, e := range m.Mounts { - l = e.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - } - if m.StopGracePeriod != nil { - l = m.StopGracePeriod.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - if m.PullOptions != nil { - l = m.PullOptions.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - if len(m.Groups) > 0 { - for _, s := range m.Groups { - l = len(s) - n += 1 + l + sovSpecs(uint64(l)) - } - } - if len(m.Secrets) > 0 { - for _, e := range m.Secrets { - l = e.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - } - if m.TTY { - n += 2 - } - l = len(m.Hostname) - if l > 0 { - n += 1 + l + sovSpecs(uint64(l)) - } - if m.DNSConfig != nil { - l = m.DNSConfig.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - if m.Healthcheck != nil { - l = m.Healthcheck.Size() - n += 2 + l + sovSpecs(uint64(l)) - } - if len(m.Hosts) > 0 { - for _, s := range m.Hosts { - l = len(s) - n += 2 + l + sovSpecs(uint64(l)) - } - } - if m.OpenStdin { - n += 3 - } - if m.ReadOnly { - n += 3 - } - l = len(m.StopSignal) - if l > 0 { - n += 2 + l + sovSpecs(uint64(l)) - } - if len(m.Configs) > 0 { - for _, e := range m.Configs { - l = e.Size() - n += 2 + l + sovSpecs(uint64(l)) - } - } - if m.Privileges != nil { - l = m.Privileges.Size() - n += 2 + l + sovSpecs(uint64(l)) - } - if m.Init != nil { - l = m.Init.Size() - n += 2 + l + sovSpecs(uint64(l)) - } - if m.Isolation != 0 { - n += 2 + sovSpecs(uint64(m.Isolation)) - } - if m.PidsLimit != 0 { - n += 2 + sovSpecs(uint64(m.PidsLimit)) - } - if len(m.Sysctls) > 0 { - for k, v := range m.Sysctls { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovSpecs(uint64(len(k))) + 1 + len(v) + sovSpecs(uint64(len(v))) - n += mapEntrySize + 2 + sovSpecs(uint64(mapEntrySize)) - } - } - if len(m.CapabilityAdd) > 0 { - for _, s := range m.CapabilityAdd { - l = len(s) - n += 2 + l + sovSpecs(uint64(l)) - } - } - if len(m.CapabilityDrop) > 0 { - for _, s := range m.CapabilityDrop { - l = len(s) - n += 2 + l + sovSpecs(uint64(l)) - } - } - if len(m.Ulimits) > 0 { - for _, e := range m.Ulimits { - l = e.Size() - n += 2 + l + sovSpecs(uint64(l)) - } - } - if m.OomScoreAdj != 0 { - n += 2 + sovSpecs(uint64(m.OomScoreAdj)) - } - return n -} - -func (m *ContainerSpec_PullOptions) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.RegistryAuth) - if l > 0 { - n += 2 + l + sovSpecs(uint64(l)) - } - return n -} - -func (m *ContainerSpec_DNSConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Nameservers) > 0 { - for _, s := range m.Nameservers { - l = len(s) - n += 1 + l + sovSpecs(uint64(l)) - } - } - if len(m.Search) > 0 { - for _, s := range m.Search { - l = len(s) - n += 1 + l + sovSpecs(uint64(l)) - } - } - if len(m.Options) > 0 { - for _, s := range m.Options { - l = len(s) - n += 1 + l + sovSpecs(uint64(l)) - } - } - return n -} - -func (m *ContainerSpec_Ulimit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovSpecs(uint64(l)) - } - if m.Soft != 0 { - n += 1 + sovSpecs(uint64(m.Soft)) - } - if m.Hard != 0 { - n += 1 + sovSpecs(uint64(m.Hard)) - } - return n -} - -func (m *EndpointSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Mode != 0 { - n += 1 + sovSpecs(uint64(m.Mode)) - } - if len(m.Ports) > 0 { - for _, e := range m.Ports { - l = e.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - } - return n -} - -func (m *NetworkSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Annotations.Size() - n += 1 + l + sovSpecs(uint64(l)) - if m.DriverConfig != nil { - l = m.DriverConfig.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - if m.Ipv6Enabled { - n += 2 - } - if m.Internal { - n += 2 - } - if m.IPAM != nil { - l = m.IPAM.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - if m.Attachable { - n += 2 - } - if m.Ingress { - n += 2 - } - if m.ConfigFrom != nil { - n += m.ConfigFrom.Size() - } - return n -} - -func (m *NetworkSpec_Network) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Network) - n += 1 + l + sovSpecs(uint64(l)) - return n -} -func (m *ClusterSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Annotations.Size() - n += 1 + l + sovSpecs(uint64(l)) - l = m.AcceptancePolicy.Size() - n += 1 + l + sovSpecs(uint64(l)) - l = m.Orchestration.Size() - n += 1 + l + sovSpecs(uint64(l)) - l = m.Raft.Size() - n += 1 + l + sovSpecs(uint64(l)) - l = m.Dispatcher.Size() - n += 1 + l + sovSpecs(uint64(l)) - l = m.CAConfig.Size() - n += 1 + l + sovSpecs(uint64(l)) - l = m.TaskDefaults.Size() - n += 1 + l + sovSpecs(uint64(l)) - l = m.EncryptionConfig.Size() - n += 1 + l + sovSpecs(uint64(l)) - return n -} - -func (m *SecretSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Annotations.Size() - n += 1 + l + sovSpecs(uint64(l)) - l = len(m.Data) - if l > 0 { - n += 1 + l + sovSpecs(uint64(l)) - } - if m.Templating != nil { - l = m.Templating.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - if m.Driver != nil { - l = m.Driver.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - return n -} - -func (m *ConfigSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Annotations.Size() - n += 1 + l + sovSpecs(uint64(l)) - l = len(m.Data) - if l > 0 { - n += 1 + l + sovSpecs(uint64(l)) - } - if m.Templating != nil { - l = m.Templating.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - return n -} - -func (m *VolumeSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Annotations.Size() - n += 1 + l + sovSpecs(uint64(l)) - l = len(m.Group) - if l > 0 { - n += 1 + l + sovSpecs(uint64(l)) - } - if m.Driver != nil { - l = m.Driver.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - if m.AccessMode != nil { - l = m.AccessMode.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - if len(m.Secrets) > 0 { - for _, e := range m.Secrets { - l = e.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - } - if m.AccessibilityRequirements != nil { - l = m.AccessibilityRequirements.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - if m.CapacityRange != nil { - l = m.CapacityRange.Size() - n += 1 + l + sovSpecs(uint64(l)) - } - if m.Availability != 0 { - n += 1 + sovSpecs(uint64(m.Availability)) - } - return n -} - -func sovSpecs(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSpecs(x uint64) (n int) { - return sovSpecs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *NodeSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NodeSpec{`, - `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `DesiredRole:` + fmt.Sprintf("%v", this.DesiredRole) + `,`, - `Membership:` + fmt.Sprintf("%v", this.Membership) + `,`, - `Availability:` + fmt.Sprintf("%v", this.Availability) + `,`, - `}`, - }, "") - return s -} -func (this *ServiceSpec) String() string { - if this == nil { - return "nil" - } - repeatedStringForNetworks := "[]*NetworkAttachmentConfig{" - for _, f := range this.Networks { - repeatedStringForNetworks += strings.Replace(fmt.Sprintf("%v", f), "NetworkAttachmentConfig", "NetworkAttachmentConfig", 1) + "," - } - repeatedStringForNetworks += "}" - s := strings.Join([]string{`&ServiceSpec{`, - `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `Task:` + strings.Replace(strings.Replace(this.Task.String(), "TaskSpec", "TaskSpec", 1), `&`, ``, 1) + `,`, - `Mode:` + fmt.Sprintf("%v", this.Mode) + `,`, - `Update:` + strings.Replace(fmt.Sprintf("%v", this.Update), "UpdateConfig", "UpdateConfig", 1) + `,`, - `Networks:` + repeatedStringForNetworks + `,`, - `Endpoint:` + strings.Replace(this.Endpoint.String(), "EndpointSpec", "EndpointSpec", 1) + `,`, - `Rollback:` + strings.Replace(fmt.Sprintf("%v", this.Rollback), "UpdateConfig", "UpdateConfig", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ServiceSpec_Replicated) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ServiceSpec_Replicated{`, - `Replicated:` + strings.Replace(fmt.Sprintf("%v", this.Replicated), "ReplicatedService", "ReplicatedService", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ServiceSpec_Global) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ServiceSpec_Global{`, - `Global:` + strings.Replace(fmt.Sprintf("%v", this.Global), "GlobalService", "GlobalService", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ServiceSpec_ReplicatedJob) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ServiceSpec_ReplicatedJob{`, - `ReplicatedJob:` + strings.Replace(fmt.Sprintf("%v", this.ReplicatedJob), "ReplicatedJob", "ReplicatedJob", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ServiceSpec_GlobalJob) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ServiceSpec_GlobalJob{`, - `GlobalJob:` + strings.Replace(fmt.Sprintf("%v", this.GlobalJob), "GlobalJob", "GlobalJob", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ReplicatedService) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ReplicatedService{`, - `Replicas:` + fmt.Sprintf("%v", this.Replicas) + `,`, - `}`, - }, "") - return s -} -func (this *GlobalService) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GlobalService{`, - `}`, - }, "") - return s -} -func (this *ReplicatedJob) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ReplicatedJob{`, - `MaxConcurrent:` + fmt.Sprintf("%v", this.MaxConcurrent) + `,`, - `TotalCompletions:` + fmt.Sprintf("%v", this.TotalCompletions) + `,`, - `}`, - }, "") - return s -} -func (this *GlobalJob) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GlobalJob{`, - `}`, - }, "") - return s -} -func (this *TaskSpec) String() string { - if this == nil { - return "nil" - } - repeatedStringForNetworks := "[]*NetworkAttachmentConfig{" - for _, f := range this.Networks { - repeatedStringForNetworks += strings.Replace(fmt.Sprintf("%v", f), "NetworkAttachmentConfig", "NetworkAttachmentConfig", 1) + "," - } - repeatedStringForNetworks += "}" - repeatedStringForResourceReferences := "[]ResourceReference{" - for _, f := range this.ResourceReferences { - repeatedStringForResourceReferences += strings.Replace(strings.Replace(f.String(), "ResourceReference", "ResourceReference", 1), `&`, ``, 1) + "," - } - repeatedStringForResourceReferences += "}" - s := strings.Join([]string{`&TaskSpec{`, - `Runtime:` + fmt.Sprintf("%v", this.Runtime) + `,`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "ResourceRequirements", "ResourceRequirements", 1) + `,`, - `Restart:` + strings.Replace(fmt.Sprintf("%v", this.Restart), "RestartPolicy", "RestartPolicy", 1) + `,`, - `Placement:` + strings.Replace(fmt.Sprintf("%v", this.Placement), "Placement", "Placement", 1) + `,`, - `LogDriver:` + strings.Replace(fmt.Sprintf("%v", this.LogDriver), "Driver", "Driver", 1) + `,`, - `Networks:` + repeatedStringForNetworks + `,`, - `ForceUpdate:` + fmt.Sprintf("%v", this.ForceUpdate) + `,`, - `ResourceReferences:` + repeatedStringForResourceReferences + `,`, - `}`, - }, "") - return s -} -func (this *TaskSpec_Container) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskSpec_Container{`, - `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "ContainerSpec", "ContainerSpec", 1) + `,`, - `}`, - }, "") - return s -} -func (this *TaskSpec_Attachment) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskSpec_Attachment{`, - `Attachment:` + strings.Replace(fmt.Sprintf("%v", this.Attachment), "NetworkAttachmentSpec", "NetworkAttachmentSpec", 1) + `,`, - `}`, - }, "") - return s -} -func (this *TaskSpec_Generic) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskSpec_Generic{`, - `Generic:` + strings.Replace(fmt.Sprintf("%v", this.Generic), "GenericRuntimeSpec", "GenericRuntimeSpec", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceReference) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceReference{`, - `ResourceID:` + fmt.Sprintf("%v", this.ResourceID) + `,`, - `ResourceType:` + fmt.Sprintf("%v", this.ResourceType) + `,`, - `}`, - }, "") - return s -} -func (this *GenericRuntimeSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GenericRuntimeSpec{`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `Payload:` + strings.Replace(fmt.Sprintf("%v", this.Payload), "Any", "types.Any", 1) + `,`, - `}`, - }, "") - return s -} -func (this *NetworkAttachmentSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NetworkAttachmentSpec{`, - `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, - `}`, - }, "") - return s -} -func (this *ContainerSpec) String() string { - if this == nil { - return "nil" - } - repeatedStringForMounts := "[]Mount{" - for _, f := range this.Mounts { - repeatedStringForMounts += fmt.Sprintf("%v", f) + "," - } - repeatedStringForMounts += "}" - repeatedStringForSecrets := "[]*SecretReference{" - for _, f := range this.Secrets { - repeatedStringForSecrets += strings.Replace(fmt.Sprintf("%v", f), "SecretReference", "SecretReference", 1) + "," - } - repeatedStringForSecrets += "}" - repeatedStringForConfigs := "[]*ConfigReference{" - for _, f := range this.Configs { - repeatedStringForConfigs += strings.Replace(fmt.Sprintf("%v", f), "ConfigReference", "ConfigReference", 1) + "," - } - repeatedStringForConfigs += "}" - repeatedStringForUlimits := "[]*ContainerSpec_Ulimit{" - for _, f := range this.Ulimits { - repeatedStringForUlimits += strings.Replace(fmt.Sprintf("%v", f), "ContainerSpec_Ulimit", "ContainerSpec_Ulimit", 1) + "," - } - repeatedStringForUlimits += "}" - keysForLabels := make([]string, 0, len(this.Labels)) - for k, _ := range this.Labels { - keysForLabels = append(keysForLabels, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]string{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) - } - mapStringForLabels += "}" - keysForSysctls := make([]string, 0, len(this.Sysctls)) - for k, _ := range this.Sysctls { - keysForSysctls = append(keysForSysctls, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForSysctls) - mapStringForSysctls := "map[string]string{" - for _, k := range keysForSysctls { - mapStringForSysctls += fmt.Sprintf("%v: %v,", k, this.Sysctls[k]) - } - mapStringForSysctls += "}" - s := strings.Join([]string{`&ContainerSpec{`, - `Image:` + fmt.Sprintf("%v", this.Image) + `,`, - `Labels:` + mapStringForLabels + `,`, - `Command:` + fmt.Sprintf("%v", this.Command) + `,`, - `Args:` + fmt.Sprintf("%v", this.Args) + `,`, - `Env:` + fmt.Sprintf("%v", this.Env) + `,`, - `Dir:` + fmt.Sprintf("%v", this.Dir) + `,`, - `User:` + fmt.Sprintf("%v", this.User) + `,`, - `Mounts:` + repeatedStringForMounts + `,`, - `StopGracePeriod:` + strings.Replace(fmt.Sprintf("%v", this.StopGracePeriod), "Duration", "types.Duration", 1) + `,`, - `PullOptions:` + strings.Replace(fmt.Sprintf("%v", this.PullOptions), "ContainerSpec_PullOptions", "ContainerSpec_PullOptions", 1) + `,`, - `Groups:` + fmt.Sprintf("%v", this.Groups) + `,`, - `Secrets:` + repeatedStringForSecrets + `,`, - `TTY:` + fmt.Sprintf("%v", this.TTY) + `,`, - `Hostname:` + fmt.Sprintf("%v", this.Hostname) + `,`, - `DNSConfig:` + strings.Replace(fmt.Sprintf("%v", this.DNSConfig), "ContainerSpec_DNSConfig", "ContainerSpec_DNSConfig", 1) + `,`, - `Healthcheck:` + strings.Replace(fmt.Sprintf("%v", this.Healthcheck), "HealthConfig", "HealthConfig", 1) + `,`, - `Hosts:` + fmt.Sprintf("%v", this.Hosts) + `,`, - `OpenStdin:` + fmt.Sprintf("%v", this.OpenStdin) + `,`, - `ReadOnly:` + fmt.Sprintf("%v", this.ReadOnly) + `,`, - `StopSignal:` + fmt.Sprintf("%v", this.StopSignal) + `,`, - `Configs:` + repeatedStringForConfigs + `,`, - `Privileges:` + strings.Replace(fmt.Sprintf("%v", this.Privileges), "Privileges", "Privileges", 1) + `,`, - `Init:` + strings.Replace(fmt.Sprintf("%v", this.Init), "BoolValue", "types.BoolValue", 1) + `,`, - `Isolation:` + fmt.Sprintf("%v", this.Isolation) + `,`, - `PidsLimit:` + fmt.Sprintf("%v", this.PidsLimit) + `,`, - `Sysctls:` + mapStringForSysctls + `,`, - `CapabilityAdd:` + fmt.Sprintf("%v", this.CapabilityAdd) + `,`, - `CapabilityDrop:` + fmt.Sprintf("%v", this.CapabilityDrop) + `,`, - `Ulimits:` + repeatedStringForUlimits + `,`, - `OomScoreAdj:` + fmt.Sprintf("%v", this.OomScoreAdj) + `,`, - `}`, - }, "") - return s -} -func (this *ContainerSpec_PullOptions) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ContainerSpec_PullOptions{`, - `RegistryAuth:` + fmt.Sprintf("%v", this.RegistryAuth) + `,`, - `}`, - }, "") - return s -} -func (this *ContainerSpec_DNSConfig) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ContainerSpec_DNSConfig{`, - `Nameservers:` + fmt.Sprintf("%v", this.Nameservers) + `,`, - `Search:` + fmt.Sprintf("%v", this.Search) + `,`, - `Options:` + fmt.Sprintf("%v", this.Options) + `,`, - `}`, - }, "") - return s -} -func (this *ContainerSpec_Ulimit) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ContainerSpec_Ulimit{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Soft:` + fmt.Sprintf("%v", this.Soft) + `,`, - `Hard:` + fmt.Sprintf("%v", this.Hard) + `,`, - `}`, - }, "") - return s -} -func (this *EndpointSpec) String() string { - if this == nil { - return "nil" - } - repeatedStringForPorts := "[]*PortConfig{" - for _, f := range this.Ports { - repeatedStringForPorts += strings.Replace(fmt.Sprintf("%v", f), "PortConfig", "PortConfig", 1) + "," - } - repeatedStringForPorts += "}" - s := strings.Join([]string{`&EndpointSpec{`, - `Mode:` + fmt.Sprintf("%v", this.Mode) + `,`, - `Ports:` + repeatedStringForPorts + `,`, - `}`, - }, "") - return s -} -func (this *NetworkSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NetworkSpec{`, - `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `DriverConfig:` + strings.Replace(fmt.Sprintf("%v", this.DriverConfig), "Driver", "Driver", 1) + `,`, - `Ipv6Enabled:` + fmt.Sprintf("%v", this.Ipv6Enabled) + `,`, - `Internal:` + fmt.Sprintf("%v", this.Internal) + `,`, - `IPAM:` + strings.Replace(fmt.Sprintf("%v", this.IPAM), "IPAMOptions", "IPAMOptions", 1) + `,`, - `Attachable:` + fmt.Sprintf("%v", this.Attachable) + `,`, - `Ingress:` + fmt.Sprintf("%v", this.Ingress) + `,`, - `ConfigFrom:` + fmt.Sprintf("%v", this.ConfigFrom) + `,`, - `}`, - }, "") - return s -} -func (this *NetworkSpec_Network) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NetworkSpec_Network{`, - `Network:` + fmt.Sprintf("%v", this.Network) + `,`, - `}`, - }, "") - return s -} -func (this *ClusterSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ClusterSpec{`, - `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `AcceptancePolicy:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.AcceptancePolicy), "AcceptancePolicy", "AcceptancePolicy", 1), `&`, ``, 1) + `,`, - `Orchestration:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Orchestration), "OrchestrationConfig", "OrchestrationConfig", 1), `&`, ``, 1) + `,`, - `Raft:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Raft), "RaftConfig", "RaftConfig", 1), `&`, ``, 1) + `,`, - `Dispatcher:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Dispatcher), "DispatcherConfig", "DispatcherConfig", 1), `&`, ``, 1) + `,`, - `CAConfig:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CAConfig), "CAConfig", "CAConfig", 1), `&`, ``, 1) + `,`, - `TaskDefaults:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.TaskDefaults), "TaskDefaults", "TaskDefaults", 1), `&`, ``, 1) + `,`, - `EncryptionConfig:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.EncryptionConfig), "EncryptionConfig", "EncryptionConfig", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *SecretSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SecretSpec{`, - `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `Data:` + fmt.Sprintf("%v", this.Data) + `,`, - `Templating:` + strings.Replace(fmt.Sprintf("%v", this.Templating), "Driver", "Driver", 1) + `,`, - `Driver:` + strings.Replace(fmt.Sprintf("%v", this.Driver), "Driver", "Driver", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ConfigSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ConfigSpec{`, - `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `Data:` + fmt.Sprintf("%v", this.Data) + `,`, - `Templating:` + strings.Replace(fmt.Sprintf("%v", this.Templating), "Driver", "Driver", 1) + `,`, - `}`, - }, "") - return s -} -func (this *VolumeSpec) String() string { - if this == nil { - return "nil" - } - repeatedStringForSecrets := "[]*VolumeSecret{" - for _, f := range this.Secrets { - repeatedStringForSecrets += strings.Replace(fmt.Sprintf("%v", f), "VolumeSecret", "VolumeSecret", 1) + "," - } - repeatedStringForSecrets += "}" - s := strings.Join([]string{`&VolumeSpec{`, - `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `Group:` + fmt.Sprintf("%v", this.Group) + `,`, - `Driver:` + strings.Replace(fmt.Sprintf("%v", this.Driver), "Driver", "Driver", 1) + `,`, - `AccessMode:` + strings.Replace(fmt.Sprintf("%v", this.AccessMode), "VolumeAccessMode", "VolumeAccessMode", 1) + `,`, - `Secrets:` + repeatedStringForSecrets + `,`, - `AccessibilityRequirements:` + strings.Replace(fmt.Sprintf("%v", this.AccessibilityRequirements), "TopologyRequirement", "TopologyRequirement", 1) + `,`, - `CapacityRange:` + strings.Replace(fmt.Sprintf("%v", this.CapacityRange), "CapacityRange", "CapacityRange", 1) + `,`, - `Availability:` + fmt.Sprintf("%v", this.Availability) + `,`, - `}`, - }, "") - return s -} -func valueToStringSpecs(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *NodeSpec) Unmarshal(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 ErrIntOverflowSpecs - } - 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: NodeSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodeSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredRole", wireType) - } - m.DesiredRole = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DesiredRole |= NodeRole(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Membership", wireType) - } - m.Membership = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Membership |= NodeSpec_Membership(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Availability", wireType) - } - m.Availability = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Availability |= NodeSpec_Availability(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ServiceSpec) Unmarshal(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 ErrIntOverflowSpecs - } - 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: ServiceSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Task", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Task.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Replicated", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ReplicatedService{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Mode = &ServiceSpec_Replicated{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Global", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &GlobalService{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Mode = &ServiceSpec_Global{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Update", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Update == nil { - m.Update = &UpdateConfig{} - } - if err := m.Update.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Networks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Networks = append(m.Networks, &NetworkAttachmentConfig{}) - if err := m.Networks[len(m.Networks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Endpoint == nil { - m.Endpoint = &EndpointSpec{} - } - if err := m.Endpoint.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rollback", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Rollback == nil { - m.Rollback = &UpdateConfig{} - } - if err := m.Rollback.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ReplicatedJob", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ReplicatedJob{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Mode = &ServiceSpec_ReplicatedJob{v} - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GlobalJob", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &GlobalJob{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Mode = &ServiceSpec_GlobalJob{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ReplicatedService) Unmarshal(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 ErrIntOverflowSpecs - } - 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: ReplicatedService: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ReplicatedService: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Replicas", wireType) - } - m.Replicas = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Replicas |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GlobalService) Unmarshal(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 ErrIntOverflowSpecs - } - 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: GlobalService: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GlobalService: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ReplicatedJob) Unmarshal(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 ErrIntOverflowSpecs - } - 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: ReplicatedJob: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ReplicatedJob: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxConcurrent", wireType) - } - m.MaxConcurrent = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxConcurrent |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalCompletions", wireType) - } - m.TotalCompletions = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalCompletions |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GlobalJob) Unmarshal(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 ErrIntOverflowSpecs - } - 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: GlobalJob: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GlobalJob: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TaskSpec) Unmarshal(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 ErrIntOverflowSpecs - } - 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: TaskSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TaskSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ContainerSpec{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Runtime = &TaskSpec_Container{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Resources == nil { - m.Resources = &ResourceRequirements{} - } - if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Restart", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Restart == nil { - m.Restart = &RestartPolicy{} - } - if err := m.Restart.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Placement", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Placement == nil { - m.Placement = &Placement{} - } - if err := m.Placement.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogDriver", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LogDriver == nil { - m.LogDriver = &Driver{} - } - if err := m.LogDriver.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Networks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Networks = append(m.Networks, &NetworkAttachmentConfig{}) - if err := m.Networks[len(m.Networks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attachment", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &NetworkAttachmentSpec{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Runtime = &TaskSpec_Attachment{v} - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ForceUpdate", wireType) - } - m.ForceUpdate = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ForceUpdate |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Generic", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &GenericRuntimeSpec{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Runtime = &TaskSpec_Generic{v} - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceReferences", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResourceReferences = append(m.ResourceReferences, ResourceReference{}) - if err := m.ResourceReferences[len(m.ResourceReferences)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResourceReference) Unmarshal(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 ErrIntOverflowSpecs - } - 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: ResourceReference: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceReference: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResourceID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceType", wireType) - } - m.ResourceType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ResourceType |= ResourceType(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GenericRuntimeSpec) Unmarshal(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 ErrIntOverflowSpecs - } - 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: GenericRuntimeSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenericRuntimeSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Payload == nil { - m.Payload = &types.Any{} - } - if err := m.Payload.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NetworkAttachmentSpec) Unmarshal(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 ErrIntOverflowSpecs - } - 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: NetworkAttachmentSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NetworkAttachmentSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContainerID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ContainerSpec) Unmarshal(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 ErrIntOverflowSpecs - } - 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: ContainerSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ContainerSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Image = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - 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 ErrIntOverflowSpecs - } - 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 ErrInvalidLengthSpecs - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthSpecs - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthSpecs - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthSpecs - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Labels[mapkey] = mapvalue - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Command = append(m.Command, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Args = append(m.Args, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Env", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Env = append(m.Env, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Dir", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Dir = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.User = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Mounts = append(m.Mounts, Mount{}) - if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StopGracePeriod", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.StopGracePeriod == nil { - m.StopGracePeriod = &types.Duration{} - } - if err := m.StopGracePeriod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PullOptions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PullOptions == nil { - m.PullOptions = &ContainerSpec_PullOptions{} - } - if err := m.PullOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Groups", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Groups = append(m.Groups, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secrets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Secrets = append(m.Secrets, &SecretReference{}) - if err := m.Secrets[len(m.Secrets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TTY", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.TTY = bool(v != 0) - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hostname = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DNSConfig", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DNSConfig == nil { - m.DNSConfig = &ContainerSpec_DNSConfig{} - } - if err := m.DNSConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Healthcheck", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Healthcheck == nil { - m.Healthcheck = &HealthConfig{} - } - if err := m.Healthcheck.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hosts", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hosts = append(m.Hosts, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 18: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OpenStdin", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.OpenStdin = bool(v != 0) - case 19: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ReadOnly", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ReadOnly = bool(v != 0) - case 20: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StopSignal", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StopSignal = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 21: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Configs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Configs = append(m.Configs, &ConfigReference{}) - if err := m.Configs[len(m.Configs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 22: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Privileges", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Privileges == nil { - m.Privileges = &Privileges{} - } - if err := m.Privileges.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 23: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Init", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Init == nil { - m.Init = &types.BoolValue{} - } - if err := m.Init.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 24: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Isolation", wireType) - } - m.Isolation = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Isolation |= ContainerSpec_Isolation(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 25: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PidsLimit", wireType) - } - m.PidsLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PidsLimit |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 26: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sysctls", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Sysctls == nil { - m.Sysctls = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - 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 ErrIntOverflowSpecs - } - 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 ErrInvalidLengthSpecs - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthSpecs - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthSpecs - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthSpecs - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Sysctls[mapkey] = mapvalue - iNdEx = postIndex - case 27: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CapabilityAdd", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CapabilityAdd = append(m.CapabilityAdd, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 28: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CapabilityDrop", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CapabilityDrop = append(m.CapabilityDrop, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 29: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ulimits", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Ulimits = append(m.Ulimits, &ContainerSpec_Ulimit{}) - if err := m.Ulimits[len(m.Ulimits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 30: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OomScoreAdj", wireType) - } - m.OomScoreAdj = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.OomScoreAdj |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ContainerSpec_PullOptions) Unmarshal(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 ErrIntOverflowSpecs - } - 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: PullOptions: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PullOptions: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 64: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RegistryAuth", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RegistryAuth = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ContainerSpec_DNSConfig) Unmarshal(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 ErrIntOverflowSpecs - } - 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: DNSConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DNSConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nameservers", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Nameservers = append(m.Nameservers, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Search", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Search = append(m.Search, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Options = append(m.Options, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ContainerSpec_Ulimit) Unmarshal(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 ErrIntOverflowSpecs - } - 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: Ulimit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Ulimit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Soft", wireType) - } - m.Soft = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Soft |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Hard", wireType) - } - m.Hard = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Hard |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EndpointSpec) Unmarshal(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 ErrIntOverflowSpecs - } - 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: EndpointSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EndpointSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) - } - m.Mode = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Mode |= EndpointSpec_ResolutionMode(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Ports = append(m.Ports, &PortConfig{}) - if err := m.Ports[len(m.Ports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NetworkSpec) Unmarshal(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 ErrIntOverflowSpecs - } - 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: NetworkSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NetworkSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DriverConfig", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DriverConfig == nil { - m.DriverConfig = &Driver{} - } - if err := m.DriverConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Ipv6Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Ipv6Enabled = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Internal", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Internal = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IPAM", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.IPAM == nil { - m.IPAM = &IPAMOptions{} - } - if err := m.IPAM.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Attachable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Attachable = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Ingress", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Ingress = bool(v != 0) - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConfigFrom = &NetworkSpec_Network{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ClusterSpec) Unmarshal(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 ErrIntOverflowSpecs - } - 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: ClusterSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AcceptancePolicy", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.AcceptancePolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Orchestration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Orchestration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Raft", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Raft.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Dispatcher", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Dispatcher.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CAConfig", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.CAConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskDefaults", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TaskDefaults.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EncryptionConfig", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.EncryptionConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SecretSpec) Unmarshal(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 ErrIntOverflowSpecs - } - 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: SecretSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SecretSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Templating", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Templating == nil { - m.Templating = &Driver{} - } - if err := m.Templating.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Driver == nil { - m.Driver = &Driver{} - } - if err := m.Driver.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConfigSpec) Unmarshal(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 ErrIntOverflowSpecs - } - 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: ConfigSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConfigSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Templating", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Templating == nil { - m.Templating = &Driver{} - } - if err := m.Templating.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumeSpec) Unmarshal(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 ErrIntOverflowSpecs - } - 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: VolumeSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VolumeSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Annotations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Group = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Driver == nil { - m.Driver = &Driver{} - } - if err := m.Driver.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AccessMode", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AccessMode == nil { - m.AccessMode = &VolumeAccessMode{} - } - if err := m.AccessMode.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secrets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Secrets = append(m.Secrets, &VolumeSecret{}) - if err := m.Secrets[len(m.Secrets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AccessibilityRequirements", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AccessibilityRequirements == nil { - m.AccessibilityRequirements = &TopologyRequirement{} - } - if err := m.AccessibilityRequirements.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CapacityRange", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpecs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpecs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CapacityRange == nil { - m.CapacityRange = &CapacityRange{} - } - if err := m.CapacityRange.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Availability", wireType) - } - m.Availability = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpecs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Availability |= VolumeSpec_VolumeAvailability(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSpecs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSpecs(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSpecs - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSpecs - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSpecs - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthSpecs - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSpecs - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSpecs - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthSpecs = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSpecs = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSpecs = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/moby/swarmkit/v2/api/specs.proto b/vendor/github.com/moby/swarmkit/v2/api/specs.proto deleted file mode 100644 index c1aeaccf77..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/specs.proto +++ /dev/null @@ -1,581 +0,0 @@ -syntax = "proto3"; - -package docker.swarmkit.v1; - -import "github.com/docker/swarmkit/api/types.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/wrappers.proto"; - -// Specs are container objects for user provided input. All creations and -// updates are done through spec types. As a convention, user input from a spec -// is never touched in created objects. This allows one to verify that the -// users intent has not been modified. -// -// Put differently, spec types can be said to represent the desired state of -// the system. In situations where modifications need to be made to a -// particular component, API objects will either contain a copy of the spec -// component or a different representation to reflect allocation or resolution. - -message NodeSpec { - Annotations annotations = 1 [(gogoproto.nullable) = false]; - - enum Membership { - option (gogoproto.goproto_enum_prefix) = false; - - PENDING = 0 [(gogoproto.enumvalue_customname) = "NodeMembershipPending"]; - ACCEPTED = 1 [(gogoproto.enumvalue_customname) = "NodeMembershipAccepted"]; - } - - enum Availability { - option (gogoproto.goproto_enum_prefix) = false; - - // Active nodes. - ACTIVE = 0 [(gogoproto.enumvalue_customname) = "NodeAvailabilityActive"]; - - // Paused nodes won't be considered by the scheduler, preventing any - // further task to run on them. - PAUSE = 1 [(gogoproto.enumvalue_customname) = "NodeAvailabilityPause"]; - - // Drained nodes are paused and any task already running on them will - // be evicted. - DRAIN = 2 [(gogoproto.enumvalue_customname) = "NodeAvailabilityDrain"]; - } - - // DesiredRole defines the role the node should have. - NodeRole desired_role = 2; - - // Membership controls the admission of the node into the cluster. - Membership membership = 3; - - // Availability allows a user to control the current scheduling status of a - // node. - Availability availability = 4; -} - -// ServiceSpec defines the properties of a service. -// -// A service instructs the cluster in orchestrating repeated instances of a -// template, implemented as tasks. Based on the number of instances, scheduling -// strategy and restart policy, a number of application-level behaviors can be -// defined. -message ServiceSpec { - Annotations annotations = 1 [(gogoproto.nullable) = false]; - - // Task defines the task template this service will spawn. - TaskSpec task = 2 [(gogoproto.nullable) = false]; - - oneof mode { - ReplicatedService replicated = 3; - GlobalService global = 4; - ReplicatedJob replicated_job = 10; - GlobalJob global_job = 11; - } - - // Update contains settings which affect updates. - UpdateConfig update = 6; - - // Rollback contains settings which affect rollbacks of updates. - UpdateConfig rollback = 9; - - // ServiceSpec.Networks has been deprecated and is replaced by - // Networks field in Task (TaskSpec.Networks). - // This field (ServiceSpec.Networks) is kept for compatibility. - // In case TaskSpec.Networks does not exist, ServiceSpec.Networks - // is still honored if it exists. - repeated NetworkAttachmentConfig networks = 7 [deprecated=true]; - - // Service endpoint specifies the user provided configuration - // to properly discover and load balance a service. - EndpointSpec endpoint = 8; -} - -// ReplicatedService sets the reconciliation target to certain number of replicas. -message ReplicatedService { - uint64 replicas = 1; -} - -// GlobalService represents global service. -message GlobalService { - // Empty message for now. -} - -// ReplicatedJob is a certain type of one-off job which executes many Tasks in -// parallel until the specified number of Tasks have succeeded. -message ReplicatedJob { - // MaxConcurrent indicates the maximum number of Tasks that should be - // executing simultaneously at any given time. - uint64 max_concurrent = 1; - - // TotalCompletions sets the total number of Tasks desired to run to - // completion. This is also the absolute maximum number of Tasks that will - // be executed in parallel. That is, if this number is smaller than - // MaxConcurrent, only this many replicas will run. - uint64 total_completions = 2; -} - -// GlobalJob is a type of one-off job which executes one Task on every node -// matching the service's placement constraints. -message GlobalJob { - // Empty message for now. -} - -message TaskSpec { - oneof runtime { - NetworkAttachmentSpec attachment = 8; - ContainerSpec container = 1; - GenericRuntimeSpec generic = 10; - } - - // Resource requirements for the container. - ResourceRequirements resources = 2; - - // RestartPolicy specifies what to do when a task fails or finishes. - RestartPolicy restart = 4; - - // Placement specifies node selection constraints - Placement placement = 5; - - - - // LogDriver specifies the log driver to use for the task. Any runtime will - // direct logs into the specified driver for the duration of the task. - Driver log_driver = 6; - - // Networks specifies the list of network attachment - // configurations (which specify the network and per-network - // aliases) that this task spec is bound to. - repeated NetworkAttachmentConfig networks = 7; - - // ForceUpdate is a counter that triggers an update even if no relevant - // parameters have been changed. We do this to allow forced restarts - // using the same reconciliation-based mechanism that performs rolling - // updates. - uint64 force_update = 9; - - // ResourceReferences provides a generic way to specify resources that - // are used by this task, and should be sent down to agents along with - // the task. Inside the runtime field there may be more specific - // information about how to use the resource, but ResourceReferences - // establishes the relationship at the store level, and instructs the - // dispatcher to send the related objects. - // - // ResourceReferences is a list of ResourceReferences used by the task. - repeated ResourceReference resource_references = 11 [(gogoproto.nullable) = false]; -} - -message ResourceReference { - string resource_id = 1; - ResourceType resource_type = 2; -} - -message GenericRuntimeSpec { - string kind = 1; - google.protobuf.Any payload = 2; -} - -// NetworkAttachmentSpec specifies runtime parameters required to attach -// a container to a network. -message NetworkAttachmentSpec { - // ContainerID specifies a unique ID of the container for which - // this attachment is for. - string container_id = 1; -} - - -// Container specifies runtime parameters for a container. -message ContainerSpec { - // image defines the image reference, as specified in the - // distribution/reference package. This may include a registry host, name, - // tag or digest. - // - // The field will be directly passed to the engine pulling. Well-behaved - // service definitions will used immutable references, either through tags - // that don't change or verifiable digests. - string image = 1; - - // Labels defines labels to be added to the container at creation time. If - // collisions with system labels occur, these labels will be overridden. - // - // This field *must* remain compatible with the Labels field of - // Annotations. - map labels = 2; - - // Command to run the the container. The first element is a path to the - // executable and the following elements are treated as arguments. - // - // If command is empty, execution will fall back to the image's entrypoint. - // - // Command should only be used when overriding entrypoint. - repeated string command = 3; - - // Args specifies arguments provided to the image's entrypoint. - // - // If Command and Args are provided, Args will be appended to Command. - repeated string args = 4; - - // Hostname specifies the hostname that will be set on containers created by docker swarm. - // All containers for a given service will have the same hostname - string hostname = 14; - - // Env specifies the environment variables for the container in NAME=VALUE - // format. These must be compliant with [IEEE Std - // 1003.1-2001](http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html). - repeated string env = 5; - - // Dir defines the working directory to set for the container process. - string dir = 6; - - // User specifies the user that should be employed to run the container. - // - // Note that the primary group may be specified by appending the group name - // or id to the user name, separated by a `:`. This syntax is - // `:`. - string user = 7; - - // Groups specifies supplementary groups available to the user. - repeated string groups = 11; - - // Privileges specifies security configuration/permissions. - Privileges privileges = 22; - - // Init declares that a custom init will be running inside the container, if null, use the daemon's configured settings - google.protobuf.BoolValue init = 23; - - // TTY declares that a TTY should be attached to the standard streams, - // including stdin if it is still open. - bool tty = 13 [(gogoproto.customname) = "TTY"]; - - // OpenStdin declares that the standard input (stdin) should be open. - bool open_stdin = 18; - - // ReadOnly declares that the container root filesystem is read-only. - // This only impacts the root filesystem, not additional mounts (including - // tmpfs). For additional mounts that are not part of the initial rootfs, - // they will be decided by the modes passed in the mount definition. - bool read_only = 19; - - // StopSignal defines the signal to stop the container. - string stop_signal = 20; - - repeated Mount mounts = 8 [(gogoproto.nullable) = false]; - - // StopGracePeriod the grace period for stopping the container before - // forcefully killing the container. - // Note: Can't use stdduration here because this needs to be nullable. - google.protobuf.Duration stop_grace_period = 9; - - // PullOptions allows one to parameterize an image pull. - message PullOptions { - // RegistryAuth is the registry auth token obtained from the client, required - // to pull private images. This is the unmodified JSON used as part of - // the `X-Registry-Auth` header. - // TODO(nishanttotla): This field will later be deprecated - string registry_auth = 64; - } - - // PullOptions parameterize the behavior of image pulls. - PullOptions pull_options = 10; - - // SecretReference contains references to zero or more secrets that - // will be exposed to the container. - repeated SecretReference secrets = 12; - - // ConfigReference contains references to zero or more configs that - // will be exposed to the container. - repeated ConfigReference configs = 21; - - // Hosts allow additional entries to be specified in /etc/hosts - // that associates IP addresses with hostnames. - // Detailed documentation is available in: - // http://man7.org/linux/man-pages/man5/hosts.5.html - // IP_address canonical_hostname [aliases...] - // - // The format of the Hosts in swarmkit follows the same as - // above. - // This is different from `docker run --add-host :` - // where format is `:` - repeated string hosts = 17; - - // DNSConfig specifies DNS related configurations in resolver configuration file (resolv.conf) - // Detailed documentation is available in: - // http://man7.org/linux/man-pages/man5/resolv.conf.5.html - // TODO: domain is not supported yet - message DNSConfig { - // Nameservers specifies the IP addresses of the name servers - repeated string nameservers = 1; - - // Search specifies the search list for host-name lookup - repeated string search = 2; - - // Options allows certain internal resolver variables to be modified - repeated string options = 3; - } - - // DNSConfig allows one to specify DNS related configuration in resolv.conf - DNSConfig dns_config = 15 [(gogoproto.customname) = "DNSConfig"]; - - // Healthcheck describes how to check the container is healthy. If the - // container is considered unhealthy, it will be destroyed, its creating - // task will exit and a new task will be rescheduled elsewhere. A container - // is considered unhealthy after `Retries` number of consecutive failures. - HealthConfig healthcheck = 16; - - enum Isolation { - option (gogoproto.goproto_enum_prefix) = false; - - // ISOLATION_DEFAULT uses whatever default value from the container runtime - ISOLATION_DEFAULT = 0 [(gogoproto.enumvalue_customname) = "ContainerIsolationDefault"]; - - // ISOLATION_PROCESS forces windows container isolation - ISOLATION_PROCESS = 1 [(gogoproto.enumvalue_customname) = "ContainerIsolationProcess"]; - - // ISOLATION_HYPERV forces Hyper-V isolation - ISOLATION_HYPERV = 2 [(gogoproto.enumvalue_customname) = "ContainerIsolationHyperV"]; - } - - // Isolation defines the isolation level for windows containers (default, process, hyperv). - // Runtimes that don't support it ignore that field - Isolation isolation = 24; - - // PidsLimit prevents from OS resource damage by applications inside the container - // using fork bomb attack. - int64 pidsLimit = 25; - - // Sysctls sets namespaced kernel parameters (sysctls) in the container. This - // option is equivalent to passing --sysctl to docker run. - // - // Note that while options are subject to the same restrictions as arguments - // passed to the --sysctl flag on docker run, those options are not further - // validated to ensure that they are safe or sensible in a clustered - // environment. - // - // Additionally, sysctls are not validated for support in the underlying - // daemon. For information about supported options, refer to the - // documentation at: - // - // https://docs.docker.com/engine/reference/commandline/run/#configure-namespaced-kernel-parameters-sysctls-at-runtime - map sysctls = 26; - - // CapabilityAdd sets the list of capabilities to add to the default capability list - repeated string capability_add = 27; - // CapabilityDrop sets the list of capabilities to drop from the default capability list - repeated string capability_drop = 28; - - message Ulimit { - string name = 1; - int64 soft = 2; - int64 hard = 3; - } - - // Ulimits defines the list of ulimits to set in the container. This option - // is equivalent to passing --ulimit to docker run. - repeated Ulimit ulimits = 29; - // OOmScoreAdj defines the relative value used for destroying a container during an OOM - // Values are between -1000 and 1000 - int64 oom_score_adj = 30; -} - -// EndpointSpec defines the properties that can be configured to -// access and loadbalance the service. -message EndpointSpec { - // ResolutionMode specifies the mode of resolution to use for - // internal loadbalancing between tasks which are all within - // the cluster. This is sometimes calls east-west data path. - enum ResolutionMode { - option (gogoproto.goproto_enum_prefix) = false; - - // VIP resolution mode specifies that the - // service resolves to a logical IP and the requests - // are sent to that logical IP. Packets hitting that - // logical IP are load balanced to a chosen backend. - VIP = 0 [(gogoproto.enumvalue_customname) = "ResolutionModeVirtualIP"]; - - // DNSRR resolution mode specifies that the - // service directly gets resolved to one of the - // backend IP and the client directly initiates a - // request towards the actual backend. This requires - // that the client does not cache the DNS responses - // when the DNS response TTL is 0. - DNSRR = 1 [(gogoproto.enumvalue_customname) = "ResolutionModeDNSRoundRobin"]; - } - - ResolutionMode mode = 1; - - // List of exposed ports that this service is accessible from - // external to the cluster. - repeated PortConfig ports = 2; -} - -// NetworkSpec specifies user defined network parameters. -message NetworkSpec { - Annotations annotations = 1 [(gogoproto.nullable) = false]; - - // DriverConfig specific configuration consumed by the network driver. - Driver driver_config = 2; - - // IPv6Enabled enables support for IPv6 on the network. - bool ipv6_enabled = 3; - - // internal restricts external access to the network. This may be - // accomplished by disabling the default gateway or through other means. - bool internal = 4; - - IPAMOptions ipam = 5 [(gogoproto.customname) = "IPAM"]; - - // Attachable allows external(to swarm) entities to manually - // attach to this network. With this flag enabled, external - // entities such as containers running in an worker node in - // the cluster can manually attach to this network and access - // the services attached to this network. If this flag is not - // enabled(default case) no manual attachment to this network - // can happen. - bool attachable = 6; - - // Ingress indicates this network will provide the routing-mesh. - // In older versions, the network providing the routing mesh was - // swarm internally created only and it was identified by the name - // "ingress" and the label "com.docker.swarm.internal": "true". - bool ingress = 7; - - // ConfigFrom is the source of the configuration for this network. - oneof config_from { - // Network is the name of a network that provides the network - // specific configuration for this network, locally on the node - // where this network is being plumbed. - string network = 8; - } - -} - -// ClusterSpec specifies global cluster settings. -message ClusterSpec { - Annotations annotations = 1 [(gogoproto.nullable) = false]; - - // DEPRECATED: AcceptancePolicy defines the certificate issuance policy. - // Acceptance policy is no longer customizable, and secrets have been - // replaced with join tokens. - AcceptancePolicy acceptance_policy = 2 [deprecated=true, (gogoproto.nullable) = false]; - - // Orchestration defines cluster-level orchestration settings. - OrchestrationConfig orchestration = 3 [(gogoproto.nullable) = false]; - - // Raft defines the cluster's raft settings. - RaftConfig raft = 4 [(gogoproto.nullable) = false]; - - // Dispatcher defines cluster-level dispatcher settings. - DispatcherConfig dispatcher = 5 [(gogoproto.nullable) = false]; - - // CAConfig defines cluster-level certificate authority settings. - CAConfig ca_config = 6 [(gogoproto.nullable) = false, (gogoproto.customname) = "CAConfig"]; - - // TaskDefaults specifies the default values to use for task creation. - TaskDefaults task_defaults = 7 [(gogoproto.nullable) = false]; - - // EncryptionConfig defines the cluster's encryption settings. - EncryptionConfig encryption_config = 8 [(gogoproto.nullable) = false]; -} - -// SecretSpec specifies a user-provided secret. -message SecretSpec { - Annotations annotations = 1 [(gogoproto.nullable) = false]; - - // Data is the secret payload - the maximum size is 500KB (that is, 500*1024 bytes) - bytes data = 2; - - // Templating controls whether and how to evaluate the secret payload as - // a template. If it is not set, no templating is used. - // - // The currently recognized values are: - // - golang: Go templating - Driver templating = 3; - - // Driver is the the secret driver that is used to store the specified secret - Driver driver = 4; -} - -// ConfigSpec specifies user-provided configuration files. -message ConfigSpec { - Annotations annotations = 1 [(gogoproto.nullable) = false]; - - // Data is the config payload - the maximum size is 500KB (that is, 500*1024 bytes) - // TODO(aaronl): Do we want to revise this to include multiple payloads in a single - // ConfigSpec? Define this to be a tar? etc... - bytes data = 2; - - // Templating controls whether and how to evaluate the secret payload as - // a template. If it is not set, no templating is used. - // - // The currently recognized values are: - // - golang: Go templating - Driver templating = 3; -} - -message VolumeSpec { - // Annotations includes the name and labels of a volume. The name used in the - // spec's Annotations will be passed to the Plugin as the "Name" in the - // CreateVolume request. - Annotations annotations = 1 [(gogoproto.nullable) = false]; - - // Group defines the volume group this particular volume belongs to. When - // requesting volumes for a workload, the group name can be used instead of - // the volume's name, which tells swarmkit to pick one from the many volumes - // belonging to that group. - string group = 2; - - // Driver represents the CSI Plugin object and its configuration parameters. - // The "options" field of the Driver object is passed in the CSI - // CreateVolumeRequest as the "parameters" field. The Driver must be - // specified; there is no default CSI Plugin. - Driver driver = 3; - - // AccessMode is similar to, and used to determine, the volume access mode as - // defined in the CSI spec, as well as the volume type (block vs mount). In - // this way, it is more similar to the VolumeCapability message in the CSI - // spec. - VolumeAccessMode access_mode = 4; - - // Secrets represents a set of key/value pairs to pass to the CSI plugin. The - // keys of the secrets can be anything, but the values refer to swarmkit - // Secret objects. See the "Secrets Requirements" section of the CSI Plugin - // Spec for more information. - repeated VolumeSecret secrets = 5; - - // AccessibilityRequirements specifies where a volume must be accessible - // from. - // - // This field must be empty if the plugin does not support - // VOLUME_ACCESSIBILITY_CONSTRAINTS capabilities. If it is present but the - // plugin does not support it, volume will not be created. - // - // If AccessibilityRequirements is empty, but the plugin does support - // VOLUME_ACCESSIBILITY_CONSTRAINTS, then Swarmkit will assume the entire - // cluster is a valid target for the volume. - TopologyRequirement AccessibilityRequirements = 6; - - // CapacityRange is the capacity this volume should be created with. If nil, - // the plugin will decide the capacity. - CapacityRange capacity_range = 7; - - enum VolumeAvailability { - option (gogoproto.goproto_enum_prefix) = false; - - // Active allows a volume to be used and scheduled to. This is the - // default state. - ACTIVE = 0 [(gogoproto.enumvalue_customname) = "VolumeAvailabilityActive"]; - - // Pause prevents volumes from having new workloads scheduled to use - // them, even if they're already published on a Node. - PAUSE = 1 [(gogoproto.enumvalue_customname) = "VolumeAvailabilityPause"]; - - // Drain causes existing workloads using this volume to be rescheduled, - // causing the volume to be unpublished and removed from nodes. - DRAIN = 2 [(gogoproto.enumvalue_customname) = "VolumeAvailabilityDrain"]; - } - - // Availability is the Volume's desired availability. Analogous to Node - // Availability, this allows the user to take volumes offline in order to - // update or delete them. - VolumeAvailability availability = 8; -} diff --git a/vendor/github.com/moby/swarmkit/v2/api/storeobject.go b/vendor/github.com/moby/swarmkit/v2/api/storeobject.go deleted file mode 100644 index f7e483d973..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/storeobject.go +++ /dev/null @@ -1,123 +0,0 @@ -package api - -import ( - "errors" - "fmt" - "strings" - - "github.com/docker/go-events" -) - -var ( - errUnknownStoreAction = errors.New("unrecognized action type") - errConflictingFilters = errors.New("conflicting filters specified") - errNoKindSpecified = errors.New("no kind of object specified") - errUnrecognizedAction = errors.New("unrecognized action") -) - -// StoreObject is an abstract object that can be handled by the store. -type StoreObject interface { - GetID() string // Get ID - GetMeta() Meta // Retrieve metadata - SetMeta(Meta) // Set metadata - CopyStoreObject() StoreObject // Return a copy of this object - EventCreate() Event // Return a creation event - EventUpdate(oldObject StoreObject) Event // Return an update event - EventDelete() Event // Return a deletion event -} - -// Event is the type used for events passed over watcher channels, and also -// the type used to specify filtering in calls to Watch. -type Event interface { - // TODO(stevvooe): Consider whether it makes sense to squish both the - // matcher type and the primary type into the same type. It might be better - // to build a matcher from an event prototype. - - // Matches checks if this item in a watch queue Matches the event - // description. - Matches(events.Event) bool -} - -// EventCreate is an interface implemented by every creation event type -type EventCreate interface { - IsEventCreate() bool -} - -// EventUpdate is an interface implemented by every update event type -type EventUpdate interface { - IsEventUpdate() bool -} - -// EventDelete is an interface implemented by every delete event type -type EventDelete interface { - IsEventDelete() -} - -func customIndexer(kind string, annotations *Annotations) (bool, [][]byte, error) { - var converted [][]byte - - for _, entry := range annotations.Indices { - index := make([]byte, 0, len(kind)+1+len(entry.Key)+1+len(entry.Val)+1) - if kind != "" { - index = append(index, []byte(kind)...) - index = append(index, '|') - } - index = append(index, []byte(entry.Key)...) - index = append(index, '|') - index = append(index, []byte(entry.Val)...) - index = append(index, '\x00') - converted = append(converted, index) - } - - // Add the null character as a terminator - return len(converted) != 0, converted, nil -} - -func fromArgs(args ...interface{}) ([]byte, error) { - if len(args) != 1 { - return nil, fmt.Errorf("must provide only a single argument") - } - arg, ok := args[0].(string) - if !ok { - return nil, fmt.Errorf("argument must be a string: %#v", args[0]) - } - // Add the null character as a terminator - arg += "\x00" - return []byte(arg), nil -} - -func prefixFromArgs(args ...interface{}) ([]byte, error) { - val, err := fromArgs(args...) - if err != nil { - return nil, err - } - - // Strip the null terminator, the rest is a prefix - n := len(val) - if n > 0 { - return val[:n-1], nil - } - return val, nil -} - -func checkCustom(a1, a2 Annotations) bool { - if len(a1.Indices) == 1 { - for _, ind := range a2.Indices { - if ind.Key == a1.Indices[0].Key && ind.Val == a1.Indices[0].Val { - return true - } - } - } - return false -} - -func checkCustomPrefix(a1, a2 Annotations) bool { - if len(a1.Indices) == 1 { - for _, ind := range a2.Indices { - if ind.Key == a1.Indices[0].Key && strings.HasPrefix(ind.Val, a1.Indices[0].Val) { - return true - } - } - } - return false -} diff --git a/vendor/github.com/moby/swarmkit/v2/api/types.pb.go b/vendor/github.com/moby/swarmkit/v2/api/types.pb.go deleted file mode 100644 index 8fe2107d73..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/types.pb.go +++ /dev/null @@ -1,27423 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/docker/swarmkit/api/types.proto - -package api - -import ( - encoding_binary "encoding/binary" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - types "github.com/gogo/protobuf/types" - github_com_moby_swarmkit_v2_api_deepcopy "github.com/moby/swarmkit/v2/api/deepcopy" - io "io" - math "math" - math_bits "math/bits" - os "os" - reflect "reflect" - strings "strings" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type ResourceType int32 - -const ( - ResourceType_TASK ResourceType = 0 - ResourceType_SECRET ResourceType = 1 - ResourceType_CONFIG ResourceType = 2 - ResourceType_VOLUME ResourceType = 3 -) - -var ResourceType_name = map[int32]string{ - 0: "TASK", - 1: "SECRET", - 2: "CONFIG", - 3: "VOLUME", -} - -var ResourceType_value = map[string]int32{ - "TASK": 0, - "SECRET": 1, - "CONFIG": 2, - "VOLUME": 3, -} - -func (x ResourceType) String() string { - return proto.EnumName(ResourceType_name, int32(x)) -} - -func (ResourceType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{0} -} - -// Only the manager create a NEW task, and move the task to PENDING and ASSIGNED. -// Afterward, the manager must rely on the agent to update the task status -// (pre-run: preparing, ready, starting; -// running; -// end-state: complete, shutdown, failed, rejected) -type TaskState int32 - -const ( - TaskStateNew TaskState = 0 - TaskStatePending TaskState = 64 - TaskStateAssigned TaskState = 192 - TaskStateAccepted TaskState = 256 - TaskStatePreparing TaskState = 320 - TaskStateReady TaskState = 384 - TaskStateStarting TaskState = 448 - TaskStateRunning TaskState = 512 - TaskStateCompleted TaskState = 576 - TaskStateShutdown TaskState = 640 - TaskStateFailed TaskState = 704 - // TaskStateRejected means a task never ran, for instance if something about - // the environment failed (e.g. setting up a port on that node failed). - TaskStateRejected TaskState = 768 - // TaskStateRemove is used to correctly handle service deletions and scale - // downs. This allows us to keep track of tasks that have been marked for - // deletion, but can't yet be removed because the agent is in the process of - // shutting them down. Once the agent has shut down tasks with desired state - // REMOVE, the task reaper is responsible for removing them. - TaskStateRemove TaskState = 800 - // TaskStateOrphaned is used to free up resources associated with service - // tasks on unresponsive nodes without having to delete those tasks. This - // state is directly assigned to the task by the orchestrator. - TaskStateOrphaned TaskState = 832 -) - -var TaskState_name = map[int32]string{ - 0: "NEW", - 64: "PENDING", - 192: "ASSIGNED", - 256: "ACCEPTED", - 320: "PREPARING", - 384: "READY", - 448: "STARTING", - 512: "RUNNING", - 576: "COMPLETE", - 640: "SHUTDOWN", - 704: "FAILED", - 768: "REJECTED", - 800: "REMOVE", - 832: "ORPHANED", -} - -var TaskState_value = map[string]int32{ - "NEW": 0, - "PENDING": 64, - "ASSIGNED": 192, - "ACCEPTED": 256, - "PREPARING": 320, - "READY": 384, - "STARTING": 448, - "RUNNING": 512, - "COMPLETE": 576, - "SHUTDOWN": 640, - "FAILED": 704, - "REJECTED": 768, - "REMOVE": 800, - "ORPHANED": 832, -} - -func (x TaskState) String() string { - return proto.EnumName(TaskState_name, int32(x)) -} - -func (TaskState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{1} -} - -type NodeRole int32 - -const ( - NodeRoleWorker NodeRole = 0 - NodeRoleManager NodeRole = 1 -) - -var NodeRole_name = map[int32]string{ - 0: "WORKER", - 1: "MANAGER", -} - -var NodeRole_value = map[string]int32{ - "WORKER": 0, - "MANAGER": 1, -} - -func (x NodeRole) String() string { - return proto.EnumName(NodeRole_name, int32(x)) -} - -func (NodeRole) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{2} -} - -type RaftMemberStatus_Reachability int32 - -const ( - // Unknown indicates that the manager state cannot be resolved - RaftMemberStatus_UNKNOWN RaftMemberStatus_Reachability = 0 - // Unreachable indicates that the node cannot be contacted by other - // raft cluster members. - RaftMemberStatus_UNREACHABLE RaftMemberStatus_Reachability = 1 - // Reachable indicates that the node is healthy and reachable - // by other members. - RaftMemberStatus_REACHABLE RaftMemberStatus_Reachability = 2 -) - -var RaftMemberStatus_Reachability_name = map[int32]string{ - 0: "UNKNOWN", - 1: "UNREACHABLE", - 2: "REACHABLE", -} - -var RaftMemberStatus_Reachability_value = map[string]int32{ - "UNKNOWN": 0, - "UNREACHABLE": 1, - "REACHABLE": 2, -} - -func (x RaftMemberStatus_Reachability) String() string { - return proto.EnumName(RaftMemberStatus_Reachability_name, int32(x)) -} - -func (RaftMemberStatus_Reachability) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{14, 0} -} - -// TODO(aluzzardi) These should be using `gogoproto.enumvalue_customname`. -type NodeStatus_State int32 - -const ( - // Unknown indicates the node state cannot be resolved. - NodeStatus_UNKNOWN NodeStatus_State = 0 - // Down indicates the node is down. - NodeStatus_DOWN NodeStatus_State = 1 - // Ready indicates the node is ready to accept tasks. - NodeStatus_READY NodeStatus_State = 2 - // Disconnected indicates the node is currently trying to find new manager. - NodeStatus_DISCONNECTED NodeStatus_State = 3 -) - -var NodeStatus_State_name = map[int32]string{ - 0: "UNKNOWN", - 1: "DOWN", - 2: "READY", - 3: "DISCONNECTED", -} - -var NodeStatus_State_value = map[string]int32{ - "UNKNOWN": 0, - "DOWN": 1, - "READY": 2, - "DISCONNECTED": 3, -} - -func (x NodeStatus_State) String() string { - return proto.EnumName(NodeStatus_State_name, int32(x)) -} - -func (NodeStatus_State) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{15, 0} -} - -type Mount_MountType int32 - -const ( - MountTypeBind Mount_MountType = 0 - MountTypeVolume Mount_MountType = 1 - MountTypeTmpfs Mount_MountType = 2 - MountTypeNamedPipe Mount_MountType = 3 - MountTypeCluster Mount_MountType = 4 -) - -var Mount_MountType_name = map[int32]string{ - 0: "BIND", - 1: "VOLUME", - 2: "TMPFS", - 3: "NPIPE", - 4: "CLUSTER", -} - -var Mount_MountType_value = map[string]int32{ - "BIND": 0, - "VOLUME": 1, - "TMPFS": 2, - "NPIPE": 3, - "CLUSTER": 4, -} - -func (x Mount_MountType) String() string { - return proto.EnumName(Mount_MountType_name, int32(x)) -} - -func (Mount_MountType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{17, 0} -} - -// Consistency indicates the tolerable level of file system consistency -type Mount_MountConsistency int32 - -const ( - MountConsistencyDefault Mount_MountConsistency = 0 - MountConsistencyFull Mount_MountConsistency = 1 - MountConsistencyCached Mount_MountConsistency = 2 - MountConsistencyDelegated Mount_MountConsistency = 3 -) - -var Mount_MountConsistency_name = map[int32]string{ - 0: "DEFAULT", - 1: "CONSISTENT", - 2: "CACHED", - 3: "DELEGATED", -} - -var Mount_MountConsistency_value = map[string]int32{ - "DEFAULT": 0, - "CONSISTENT": 1, - "CACHED": 2, - "DELEGATED": 3, -} - -func (x Mount_MountConsistency) String() string { - return proto.EnumName(Mount_MountConsistency_name, int32(x)) -} - -func (Mount_MountConsistency) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{17, 1} -} - -type Mount_BindOptions_MountPropagation int32 - -const ( - MountPropagationRPrivate Mount_BindOptions_MountPropagation = 0 - MountPropagationPrivate Mount_BindOptions_MountPropagation = 1 - MountPropagationRShared Mount_BindOptions_MountPropagation = 2 - MountPropagationShared Mount_BindOptions_MountPropagation = 3 - MountPropagationRSlave Mount_BindOptions_MountPropagation = 4 - MountPropagationSlave Mount_BindOptions_MountPropagation = 5 -) - -var Mount_BindOptions_MountPropagation_name = map[int32]string{ - 0: "RPRIVATE", - 1: "PRIVATE", - 2: "RSHARED", - 3: "SHARED", - 4: "RSLAVE", - 5: "SLAVE", -} - -var Mount_BindOptions_MountPropagation_value = map[string]int32{ - "RPRIVATE": 0, - "PRIVATE": 1, - "RSHARED": 2, - "SHARED": 3, - "RSLAVE": 4, - "SLAVE": 5, -} - -func (x Mount_BindOptions_MountPropagation) String() string { - return proto.EnumName(Mount_BindOptions_MountPropagation_name, int32(x)) -} - -func (Mount_BindOptions_MountPropagation) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{17, 0, 0} -} - -type RestartPolicy_RestartCondition int32 - -const ( - RestartOnNone RestartPolicy_RestartCondition = 0 - RestartOnFailure RestartPolicy_RestartCondition = 1 - RestartOnAny RestartPolicy_RestartCondition = 2 -) - -var RestartPolicy_RestartCondition_name = map[int32]string{ - 0: "NONE", - 1: "ON_FAILURE", - 2: "ANY", -} - -var RestartPolicy_RestartCondition_value = map[string]int32{ - "NONE": 0, - "ON_FAILURE": 1, - "ANY": 2, -} - -func (x RestartPolicy_RestartCondition) String() string { - return proto.EnumName(RestartPolicy_RestartCondition_name, int32(x)) -} - -func (RestartPolicy_RestartCondition) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{18, 0} -} - -type UpdateConfig_FailureAction int32 - -const ( - UpdateConfig_PAUSE UpdateConfig_FailureAction = 0 - UpdateConfig_CONTINUE UpdateConfig_FailureAction = 1 - UpdateConfig_ROLLBACK UpdateConfig_FailureAction = 2 -) - -var UpdateConfig_FailureAction_name = map[int32]string{ - 0: "PAUSE", - 1: "CONTINUE", - 2: "ROLLBACK", -} - -var UpdateConfig_FailureAction_value = map[string]int32{ - "PAUSE": 0, - "CONTINUE": 1, - "ROLLBACK": 2, -} - -func (x UpdateConfig_FailureAction) String() string { - return proto.EnumName(UpdateConfig_FailureAction_name, int32(x)) -} - -func (UpdateConfig_FailureAction) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{19, 0} -} - -// UpdateOrder controls the order of operations when rolling out an -// updated task. Either the old task is shut down before the new task -// is started, or the new task is started before the old task is shut -// down. -type UpdateConfig_UpdateOrder int32 - -const ( - UpdateConfig_STOP_FIRST UpdateConfig_UpdateOrder = 0 - UpdateConfig_START_FIRST UpdateConfig_UpdateOrder = 1 -) - -var UpdateConfig_UpdateOrder_name = map[int32]string{ - 0: "STOP_FIRST", - 1: "START_FIRST", -} - -var UpdateConfig_UpdateOrder_value = map[string]int32{ - "STOP_FIRST": 0, - "START_FIRST": 1, -} - -func (x UpdateConfig_UpdateOrder) String() string { - return proto.EnumName(UpdateConfig_UpdateOrder_name, int32(x)) -} - -func (UpdateConfig_UpdateOrder) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{19, 1} -} - -type UpdateStatus_UpdateState int32 - -const ( - UpdateStatus_UNKNOWN UpdateStatus_UpdateState = 0 - UpdateStatus_UPDATING UpdateStatus_UpdateState = 1 - UpdateStatus_PAUSED UpdateStatus_UpdateState = 2 - UpdateStatus_COMPLETED UpdateStatus_UpdateState = 3 - UpdateStatus_ROLLBACK_STARTED UpdateStatus_UpdateState = 4 - UpdateStatus_ROLLBACK_PAUSED UpdateStatus_UpdateState = 5 - UpdateStatus_ROLLBACK_COMPLETED UpdateStatus_UpdateState = 6 -) - -var UpdateStatus_UpdateState_name = map[int32]string{ - 0: "UNKNOWN", - 1: "UPDATING", - 2: "PAUSED", - 3: "COMPLETED", - 4: "ROLLBACK_STARTED", - 5: "ROLLBACK_PAUSED", - 6: "ROLLBACK_COMPLETED", -} - -var UpdateStatus_UpdateState_value = map[string]int32{ - "UNKNOWN": 0, - "UPDATING": 1, - "PAUSED": 2, - "COMPLETED": 3, - "ROLLBACK_STARTED": 4, - "ROLLBACK_PAUSED": 5, - "ROLLBACK_COMPLETED": 6, -} - -func (x UpdateStatus_UpdateState) String() string { - return proto.EnumName(UpdateStatus_UpdateState_name, int32(x)) -} - -func (UpdateStatus_UpdateState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{20, 0} -} - -// AddressFamily specifies the network address family that -// this IPAMConfig belongs to. -type IPAMConfig_AddressFamily int32 - -const ( - IPAMConfig_UNKNOWN IPAMConfig_AddressFamily = 0 - IPAMConfig_IPV4 IPAMConfig_AddressFamily = 4 - IPAMConfig_IPV6 IPAMConfig_AddressFamily = 6 -) - -var IPAMConfig_AddressFamily_name = map[int32]string{ - 0: "UNKNOWN", - 4: "IPV4", - 6: "IPV6", -} - -var IPAMConfig_AddressFamily_value = map[string]int32{ - "UNKNOWN": 0, - "IPV4": 4, - "IPV6": 6, -} - -func (x IPAMConfig_AddressFamily) String() string { - return proto.EnumName(IPAMConfig_AddressFamily_name, int32(x)) -} - -func (IPAMConfig_AddressFamily) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{25, 0} -} - -type PortConfig_Protocol int32 - -const ( - ProtocolTCP PortConfig_Protocol = 0 - ProtocolUDP PortConfig_Protocol = 1 - ProtocolSCTP PortConfig_Protocol = 2 -) - -var PortConfig_Protocol_name = map[int32]string{ - 0: "TCP", - 1: "UDP", - 2: "SCTP", -} - -var PortConfig_Protocol_value = map[string]int32{ - "TCP": 0, - "UDP": 1, - "SCTP": 2, -} - -func (x PortConfig_Protocol) String() string { - return proto.EnumName(PortConfig_Protocol_name, int32(x)) -} - -func (PortConfig_Protocol) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{26, 0} -} - -// PublishMode controls how ports are published on the swarm. -type PortConfig_PublishMode int32 - -const ( - // PublishModeIngress exposes the port across the cluster on all nodes. - PublishModeIngress PortConfig_PublishMode = 0 - // PublishModeHost exposes the port on just the target host. If the - // published port is undefined, an ephemeral port will be allocated. If - // the published port is defined, the node will attempt to allocate it, - // erroring the task if it fails. - PublishModeHost PortConfig_PublishMode = 1 -) - -var PortConfig_PublishMode_name = map[int32]string{ - 0: "INGRESS", - 1: "HOST", -} - -var PortConfig_PublishMode_value = map[string]int32{ - "INGRESS": 0, - "HOST": 1, -} - -func (x PortConfig_PublishMode) String() string { - return proto.EnumName(PortConfig_PublishMode_name, int32(x)) -} - -func (PortConfig_PublishMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{26, 1} -} - -type IssuanceStatus_State int32 - -const ( - IssuanceStateUnknown IssuanceStatus_State = 0 - // A new certificate should be issued - IssuanceStateRenew IssuanceStatus_State = 1 - // Certificate is pending acceptance - IssuanceStatePending IssuanceStatus_State = 2 - // successful completion certificate issuance - IssuanceStateIssued IssuanceStatus_State = 3 - // Certificate issuance failed - IssuanceStateFailed IssuanceStatus_State = 4 - // Signals workers to renew their certificate. From the CA's perspective - // this is equivalent to IssuanceStateIssued: a noop. - IssuanceStateRotate IssuanceStatus_State = 5 -) - -var IssuanceStatus_State_name = map[int32]string{ - 0: "UNKNOWN", - 1: "RENEW", - 2: "PENDING", - 3: "ISSUED", - 4: "FAILED", - 5: "ROTATE", -} - -var IssuanceStatus_State_value = map[string]int32{ - "UNKNOWN": 0, - "RENEW": 1, - "PENDING": 2, - "ISSUED": 3, - "FAILED": 4, - "ROTATE": 5, -} - -func (x IssuanceStatus_State) String() string { - return proto.EnumName(IssuanceStatus_State_name, int32(x)) -} - -func (IssuanceStatus_State) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{31, 0} -} - -type ExternalCA_CAProtocol int32 - -const ( - ExternalCA_CAProtocolCFSSL ExternalCA_CAProtocol = 0 -) - -var ExternalCA_CAProtocol_name = map[int32]string{ - 0: "CFSSL", -} - -var ExternalCA_CAProtocol_value = map[string]int32{ - "CFSSL": 0, -} - -func (x ExternalCA_CAProtocol) String() string { - return proto.EnumName(ExternalCA_CAProtocol_name, int32(x)) -} - -func (ExternalCA_CAProtocol) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{33, 0} -} - -// Encryption algorithm that can implemented using this key -type EncryptionKey_Algorithm int32 - -const ( - AES_128_GCM EncryptionKey_Algorithm = 0 -) - -var EncryptionKey_Algorithm_name = map[int32]string{ - 0: "AES_128_GCM", -} - -var EncryptionKey_Algorithm_value = map[string]int32{ - "AES_128_GCM": 0, -} - -func (x EncryptionKey_Algorithm) String() string { - return proto.EnumName(EncryptionKey_Algorithm_name, int32(x)) -} - -func (EncryptionKey_Algorithm) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{46, 0} -} - -type MaybeEncryptedRecord_Algorithm int32 - -const ( - MaybeEncryptedRecord_NotEncrypted MaybeEncryptedRecord_Algorithm = 0 - MaybeEncryptedRecord_NACLSecretboxSalsa20Poly1305 MaybeEncryptedRecord_Algorithm = 1 - MaybeEncryptedRecord_FernetAES128CBC MaybeEncryptedRecord_Algorithm = 2 -) - -var MaybeEncryptedRecord_Algorithm_name = map[int32]string{ - 0: "NONE", - 1: "SECRETBOX_SALSA20_POLY1305", - 2: "FERNET_AES_128_CBC", -} - -var MaybeEncryptedRecord_Algorithm_value = map[string]int32{ - "NONE": 0, - "SECRETBOX_SALSA20_POLY1305": 1, - "FERNET_AES_128_CBC": 2, -} - -func (x MaybeEncryptedRecord_Algorithm) String() string { - return proto.EnumName(MaybeEncryptedRecord_Algorithm_name, int32(x)) -} - -func (MaybeEncryptedRecord_Algorithm) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{54, 0} -} - -type Privileges_SeccompOpts_SeccompMode int32 - -const ( - Privileges_SeccompOpts_DEFAULT Privileges_SeccompOpts_SeccompMode = 0 - Privileges_SeccompOpts_UNCONFINED Privileges_SeccompOpts_SeccompMode = 1 - Privileges_SeccompOpts_CUSTOM Privileges_SeccompOpts_SeccompMode = 2 -) - -var Privileges_SeccompOpts_SeccompMode_name = map[int32]string{ - 0: "DEFAULT", - 1: "UNCONFINED", - 2: "CUSTOM", -} - -var Privileges_SeccompOpts_SeccompMode_value = map[string]int32{ - "DEFAULT": 0, - "UNCONFINED": 1, - "CUSTOM": 2, -} - -func (x Privileges_SeccompOpts_SeccompMode) String() string { - return proto.EnumName(Privileges_SeccompOpts_SeccompMode_name, int32(x)) -} - -func (Privileges_SeccompOpts_SeccompMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{56, 2, 0} -} - -type Privileges_AppArmorOpts_AppArmorMode int32 - -const ( - Privileges_AppArmorOpts_DEFAULT Privileges_AppArmorOpts_AppArmorMode = 0 - Privileges_AppArmorOpts_DISABLED Privileges_AppArmorOpts_AppArmorMode = 1 -) - -var Privileges_AppArmorOpts_AppArmorMode_name = map[int32]string{ - 0: "DEFAULT", - 1: "DISABLED", -} - -var Privileges_AppArmorOpts_AppArmorMode_value = map[string]int32{ - "DEFAULT": 0, - "DISABLED": 1, -} - -func (x Privileges_AppArmorOpts_AppArmorMode) String() string { - return proto.EnumName(Privileges_AppArmorOpts_AppArmorMode_name, int32(x)) -} - -func (Privileges_AppArmorOpts_AppArmorMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{56, 3, 0} -} - -// Scope enumerates the possible volume access scopes. -type VolumeAccessMode_Scope int32 - -const ( - // VolumeScopeSingleNode indicates that only one node at a time may have - // access to the volume. - VolumeScopeSingleNode VolumeAccessMode_Scope = 0 - // VolumeScopeMultiNode indicates that multiple nodes may access the volume - // at the same time. - VolumeScopeMultiNode VolumeAccessMode_Scope = 1 -) - -var VolumeAccessMode_Scope_name = map[int32]string{ - 0: "SINGLE_NODE", - 1: "MULTI_NODE", -} - -var VolumeAccessMode_Scope_value = map[string]int32{ - "SINGLE_NODE": 0, - "MULTI_NODE": 1, -} - -func (x VolumeAccessMode_Scope) String() string { - return proto.EnumName(VolumeAccessMode_Scope_name, int32(x)) -} - -func (VolumeAccessMode_Scope) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{58, 0} -} - -// Sharing enumerates the possible volume sharing modes. -type VolumeAccessMode_Sharing int32 - -const ( - // VolumeSharingNone indicates that the volume may only be used by a single - // Task at any given time. - VolumeSharingNone VolumeAccessMode_Sharing = 0 - // VolumeSharingReadOnly indicates that the volume may be accessed by - // multiple Tasks, but all Tasks only have have read access. - VolumeSharingReadOnly VolumeAccessMode_Sharing = 1 - // VolumeSharingOneWriter indicates that the Volume may be accessed by - // multiple Tasks, but only the one Task may have write permission for the - // Volume. - VolumeSharingOneWriter VolumeAccessMode_Sharing = 2 - // VolumeSharingAll indicates that any number of Tasks may have read and - // write access to the volume. - VolumeSharingAll VolumeAccessMode_Sharing = 3 -) - -var VolumeAccessMode_Sharing_name = map[int32]string{ - 0: "NONE", - 1: "READ_ONLY", - 2: "ONE_WRITER", - 3: "ALL", -} - -var VolumeAccessMode_Sharing_value = map[string]int32{ - "NONE": 0, - "READ_ONLY": 1, - "ONE_WRITER": 2, - "ALL": 3, -} - -func (x VolumeAccessMode_Sharing) String() string { - return proto.EnumName(VolumeAccessMode_Sharing_name, int32(x)) -} - -func (VolumeAccessMode_Sharing) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{58, 1} -} - -// State is the state of the volume in the publish/unpublish -// lifecycle, on a particular node. -type VolumePublishStatus_State int32 - -const ( - // PendingPublish indicates that the volume should be published on this - // node, but the call to ControllerPublishVolume has not been - // successfully completed yet and the result recorded by swarmkit. - VolumePublishStatus_PENDING_PUBLISH VolumePublishStatus_State = 0 - // Published means the volume is published successfully to the node. - VolumePublishStatus_PUBLISHED VolumePublishStatus_State = 1 - // PendingNodeUnpublish indicates that the Volume should be unpublished - // on the Node, and we're waiting for confirmation that it has done so. - // After the Node has confirmed that the Volume has been unpublished, - // the state will move to PendingUnpublish. - VolumePublishStatus_PENDING_NODE_UNPUBLISH VolumePublishStatus_State = 2 - // PendingUnpublish means the volume is published to the node, and - // needs to not be, but the call to ControllerUnpublishVolume has not - // verifiably succeeded yet. There is no Unpublished state, because - // after the volume has been verifiably unpublished, the - // VolumePublishStatus for the node is removed. - VolumePublishStatus_PENDING_UNPUBLISH VolumePublishStatus_State = 3 -) - -var VolumePublishStatus_State_name = map[int32]string{ - 0: "PENDING_PUBLISH", - 1: "PUBLISHED", - 2: "PENDING_NODE_UNPUBLISH", - 3: "PENDING_UNPUBLISH", -} - -var VolumePublishStatus_State_value = map[string]int32{ - "PENDING_PUBLISH": 0, - "PUBLISHED": 1, - "PENDING_NODE_UNPUBLISH": 2, - "PENDING_UNPUBLISH": 3, -} - -func (x VolumePublishStatus_State) String() string { - return proto.EnumName(VolumePublishStatus_State_name, int32(x)) -} - -func (VolumePublishStatus_State) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{60, 0} -} - -type VolumeCapability_AccessMode_Mode int32 - -const ( - VolumeCapability_AccessMode_UNKNOWN VolumeCapability_AccessMode_Mode = 0 - // Can only be published once as read/write on a single node, at - // any given time. - VolumeCapability_AccessMode_SINGLE_NODE_WRITER VolumeCapability_AccessMode_Mode = 1 - // Can only be published once as readonly on a single node, at - // any given time. - VolumeCapability_AccessMode_SINGLE_NODE_READER_ONLY VolumeCapability_AccessMode_Mode = 2 - // Can be published as readonly at multiple nodes simultaneously. - VolumeCapability_AccessMode_MULTI_NODE_READER_ONLY VolumeCapability_AccessMode_Mode = 3 - // Can be published at multiple nodes simultaneously. Only one of - // the node can be used as read/write. The rest will be readonly. - VolumeCapability_AccessMode_MULTI_NODE_SINGLE_WRITER VolumeCapability_AccessMode_Mode = 4 - // Can be published as read/write at multiple nodes - // simultaneously. - VolumeCapability_AccessMode_MULTI_NODE_MULTI_WRITER VolumeCapability_AccessMode_Mode = 5 -) - -var VolumeCapability_AccessMode_Mode_name = map[int32]string{ - 0: "UNKNOWN", - 1: "SINGLE_NODE_WRITER", - 2: "SINGLE_NODE_READER_ONLY", - 3: "MULTI_NODE_READER_ONLY", - 4: "MULTI_NODE_SINGLE_WRITER", - 5: "MULTI_NODE_MULTI_WRITER", -} - -var VolumeCapability_AccessMode_Mode_value = map[string]int32{ - "UNKNOWN": 0, - "SINGLE_NODE_WRITER": 1, - "SINGLE_NODE_READER_ONLY": 2, - "MULTI_NODE_READER_ONLY": 3, - "MULTI_NODE_SINGLE_WRITER": 4, - "MULTI_NODE_MULTI_WRITER": 5, -} - -func (x VolumeCapability_AccessMode_Mode) String() string { - return proto.EnumName(VolumeCapability_AccessMode_Mode_name, int32(x)) -} - -func (VolumeCapability_AccessMode_Mode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{67, 2, 0} -} - -// Version tracks the last time an object in the store was updated. -type Version struct { - Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` -} - -func (m *Version) Reset() { *m = Version{} } -func (*Version) ProtoMessage() {} -func (*Version) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{0} -} -func (m *Version) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Version.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Version) XXX_Merge(src proto.Message) { - xxx_messageInfo_Version.Merge(m, src) -} -func (m *Version) XXX_Size() int { - return m.Size() -} -func (m *Version) XXX_DiscardUnknown() { - xxx_messageInfo_Version.DiscardUnknown(m) -} - -var xxx_messageInfo_Version proto.InternalMessageInfo - -type IndexEntry struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Val string `protobuf:"bytes,2,opt,name=val,proto3" json:"val,omitempty"` -} - -func (m *IndexEntry) Reset() { *m = IndexEntry{} } -func (*IndexEntry) ProtoMessage() {} -func (*IndexEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{1} -} -func (m *IndexEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IndexEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IndexEntry.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *IndexEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_IndexEntry.Merge(m, src) -} -func (m *IndexEntry) XXX_Size() int { - return m.Size() -} -func (m *IndexEntry) XXX_DiscardUnknown() { - xxx_messageInfo_IndexEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_IndexEntry proto.InternalMessageInfo - -// Annotations provide useful information to identify API objects. They are -// common to all API specs. -type Annotations struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Indices provides keys and values for indexing this object. - // A single key may have multiple values. - Indices []IndexEntry `protobuf:"bytes,4,rep,name=indices,proto3" json:"indices"` -} - -func (m *Annotations) Reset() { *m = Annotations{} } -func (*Annotations) ProtoMessage() {} -func (*Annotations) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{2} -} -func (m *Annotations) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Annotations) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Annotations.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Annotations) XXX_Merge(src proto.Message) { - xxx_messageInfo_Annotations.Merge(m, src) -} -func (m *Annotations) XXX_Size() int { - return m.Size() -} -func (m *Annotations) XXX_DiscardUnknown() { - xxx_messageInfo_Annotations.DiscardUnknown(m) -} - -var xxx_messageInfo_Annotations proto.InternalMessageInfo - -// NamedGenericResource represents a "user defined" resource which is defined -// as a string. -// "Kind" is used to describe the Kind of a resource (e.g: "GPU", "FPGA", "SSD", ...) -// Value is used to identify the resource (GPU="UUID-1", FPGA="/dev/sdb5", ...) -type NamedGenericResource struct { - Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *NamedGenericResource) Reset() { *m = NamedGenericResource{} } -func (*NamedGenericResource) ProtoMessage() {} -func (*NamedGenericResource) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{3} -} -func (m *NamedGenericResource) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NamedGenericResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NamedGenericResource.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NamedGenericResource) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedGenericResource.Merge(m, src) -} -func (m *NamedGenericResource) XXX_Size() int { - return m.Size() -} -func (m *NamedGenericResource) XXX_DiscardUnknown() { - xxx_messageInfo_NamedGenericResource.DiscardUnknown(m) -} - -var xxx_messageInfo_NamedGenericResource proto.InternalMessageInfo - -// DiscreteGenericResource represents a "user defined" resource which is defined -// as an integer -// "Kind" is used to describe the Kind of a resource (e.g: "GPU", "FPGA", "SSD", ...) -// Value is used to count the resource (SSD=5, HDD=3, ...) -type DiscreteGenericResource struct { - Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` - Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *DiscreteGenericResource) Reset() { *m = DiscreteGenericResource{} } -func (*DiscreteGenericResource) ProtoMessage() {} -func (*DiscreteGenericResource) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{4} -} -func (m *DiscreteGenericResource) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DiscreteGenericResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DiscreteGenericResource.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DiscreteGenericResource) XXX_Merge(src proto.Message) { - xxx_messageInfo_DiscreteGenericResource.Merge(m, src) -} -func (m *DiscreteGenericResource) XXX_Size() int { - return m.Size() -} -func (m *DiscreteGenericResource) XXX_DiscardUnknown() { - xxx_messageInfo_DiscreteGenericResource.DiscardUnknown(m) -} - -var xxx_messageInfo_DiscreteGenericResource proto.InternalMessageInfo - -// GenericResource represents a "user defined" resource which can -// be either an integer (e.g: SSD=3) or a string (e.g: SSD=sda1) -type GenericResource struct { - // Types that are valid to be assigned to Resource: - // *GenericResource_NamedResourceSpec - // *GenericResource_DiscreteResourceSpec - Resource isGenericResource_Resource `protobuf_oneof:"resource"` -} - -func (m *GenericResource) Reset() { *m = GenericResource{} } -func (*GenericResource) ProtoMessage() {} -func (*GenericResource) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{5} -} -func (m *GenericResource) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenericResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenericResource.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GenericResource) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenericResource.Merge(m, src) -} -func (m *GenericResource) XXX_Size() int { - return m.Size() -} -func (m *GenericResource) XXX_DiscardUnknown() { - xxx_messageInfo_GenericResource.DiscardUnknown(m) -} - -var xxx_messageInfo_GenericResource proto.InternalMessageInfo - -type isGenericResource_Resource interface { - isGenericResource_Resource() - MarshalTo([]byte) (int, error) - Size() int -} - -type GenericResource_NamedResourceSpec struct { - NamedResourceSpec *NamedGenericResource `protobuf:"bytes,1,opt,name=named_resource_spec,json=namedResourceSpec,proto3,oneof" json:"named_resource_spec,omitempty"` -} -type GenericResource_DiscreteResourceSpec struct { - DiscreteResourceSpec *DiscreteGenericResource `protobuf:"bytes,2,opt,name=discrete_resource_spec,json=discreteResourceSpec,proto3,oneof" json:"discrete_resource_spec,omitempty"` -} - -func (*GenericResource_NamedResourceSpec) isGenericResource_Resource() {} -func (*GenericResource_DiscreteResourceSpec) isGenericResource_Resource() {} - -func (m *GenericResource) GetResource() isGenericResource_Resource { - if m != nil { - return m.Resource - } - return nil -} - -func (m *GenericResource) GetNamedResourceSpec() *NamedGenericResource { - if x, ok := m.GetResource().(*GenericResource_NamedResourceSpec); ok { - return x.NamedResourceSpec - } - return nil -} - -func (m *GenericResource) GetDiscreteResourceSpec() *DiscreteGenericResource { - if x, ok := m.GetResource().(*GenericResource_DiscreteResourceSpec); ok { - return x.DiscreteResourceSpec - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*GenericResource) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*GenericResource_NamedResourceSpec)(nil), - (*GenericResource_DiscreteResourceSpec)(nil), - } -} - -type Resources struct { - // Amount of CPUs (e.g. 2000000000 = 2 CPU cores) - NanoCPUs int64 `protobuf:"varint,1,opt,name=nano_cpus,json=nanoCpus,proto3" json:"nano_cpus,omitempty"` - // Amount of memory in bytes. - MemoryBytes int64 `protobuf:"varint,2,opt,name=memory_bytes,json=memoryBytes,proto3" json:"memory_bytes,omitempty"` - // User specified resource (e.g: bananas=2;apple={red,yellow,green}) - Generic []*GenericResource `protobuf:"bytes,3,rep,name=generic,proto3" json:"generic,omitempty"` -} - -func (m *Resources) Reset() { *m = Resources{} } -func (*Resources) ProtoMessage() {} -func (*Resources) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{6} -} -func (m *Resources) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Resources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Resources.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Resources) XXX_Merge(src proto.Message) { - xxx_messageInfo_Resources.Merge(m, src) -} -func (m *Resources) XXX_Size() int { - return m.Size() -} -func (m *Resources) XXX_DiscardUnknown() { - xxx_messageInfo_Resources.DiscardUnknown(m) -} - -var xxx_messageInfo_Resources proto.InternalMessageInfo - -type ResourceRequirements struct { - Limits *Resources `protobuf:"bytes,1,opt,name=limits,proto3" json:"limits,omitempty"` - Reservations *Resources `protobuf:"bytes,2,opt,name=reservations,proto3" json:"reservations,omitempty"` - // Amount of swap in bytes - can only be used together with a memory limit - // -1 means unlimited - // a null pointer indicates that the default behaviour of granting twice - // the memory is maintained - SwapBytes *types.Int64Value `protobuf:"bytes,3,opt,name=swap_bytes,json=swapBytes,proto3" json:"swap_bytes,omitempty"` - // Tune container memory swappiness (0 to 100) - if not specified, defaults - // to the container OS's default - generally 60, or the value predefined in - // the image; set to -1 to unset a previously set value - MemorySwappiness *types.Int64Value `protobuf:"bytes,4,opt,name=memory_swappiness,json=memorySwappiness,proto3" json:"memory_swappiness,omitempty"` -} - -func (m *ResourceRequirements) Reset() { *m = ResourceRequirements{} } -func (*ResourceRequirements) ProtoMessage() {} -func (*ResourceRequirements) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{7} -} -func (m *ResourceRequirements) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResourceRequirements) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResourceRequirements.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ResourceRequirements) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceRequirements.Merge(m, src) -} -func (m *ResourceRequirements) XXX_Size() int { - return m.Size() -} -func (m *ResourceRequirements) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceRequirements.DiscardUnknown(m) -} - -var xxx_messageInfo_ResourceRequirements proto.InternalMessageInfo - -type Platform struct { - // Architecture (e.g. x86_64) - Architecture string `protobuf:"bytes,1,opt,name=architecture,proto3" json:"architecture,omitempty"` - // Operating System (e.g. linux) - OS string `protobuf:"bytes,2,opt,name=os,proto3" json:"os,omitempty"` -} - -func (m *Platform) Reset() { *m = Platform{} } -func (*Platform) ProtoMessage() {} -func (*Platform) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{8} -} -func (m *Platform) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Platform) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Platform.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Platform) XXX_Merge(src proto.Message) { - xxx_messageInfo_Platform.Merge(m, src) -} -func (m *Platform) XXX_Size() int { - return m.Size() -} -func (m *Platform) XXX_DiscardUnknown() { - xxx_messageInfo_Platform.DiscardUnknown(m) -} - -var xxx_messageInfo_Platform proto.InternalMessageInfo - -// PluginDescription describes an engine plugin. -type PluginDescription struct { - // Type of plugin. Canonical values for existing types are - // Volume, Network, and Authorization. More types could be - // supported in the future. - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - // Name of the plugin - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (m *PluginDescription) Reset() { *m = PluginDescription{} } -func (*PluginDescription) ProtoMessage() {} -func (*PluginDescription) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{9} -} -func (m *PluginDescription) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PluginDescription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PluginDescription.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PluginDescription) XXX_Merge(src proto.Message) { - xxx_messageInfo_PluginDescription.Merge(m, src) -} -func (m *PluginDescription) XXX_Size() int { - return m.Size() -} -func (m *PluginDescription) XXX_DiscardUnknown() { - xxx_messageInfo_PluginDescription.DiscardUnknown(m) -} - -var xxx_messageInfo_PluginDescription proto.InternalMessageInfo - -type EngineDescription struct { - // Docker daemon version running on the node. - EngineVersion string `protobuf:"bytes,1,opt,name=engine_version,json=engineVersion,proto3" json:"engine_version,omitempty"` - // Labels attached to the engine. - Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Volume, Network, and Auth plugins - Plugins []PluginDescription `protobuf:"bytes,3,rep,name=plugins,proto3" json:"plugins"` -} - -func (m *EngineDescription) Reset() { *m = EngineDescription{} } -func (*EngineDescription) ProtoMessage() {} -func (*EngineDescription) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{10} -} -func (m *EngineDescription) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EngineDescription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EngineDescription.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EngineDescription) XXX_Merge(src proto.Message) { - xxx_messageInfo_EngineDescription.Merge(m, src) -} -func (m *EngineDescription) XXX_Size() int { - return m.Size() -} -func (m *EngineDescription) XXX_DiscardUnknown() { - xxx_messageInfo_EngineDescription.DiscardUnknown(m) -} - -var xxx_messageInfo_EngineDescription proto.InternalMessageInfo - -type NodeDescription struct { - // Hostname of the node as reported by the agent. - // This is different from spec.meta.name which is user-defined. - Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"` - // Platform of the node. - Platform *Platform `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform,omitempty"` - // Total resources on the node. - Resources *Resources `protobuf:"bytes,3,opt,name=resources,proto3" json:"resources,omitempty"` - // Information about the Docker Engine on the node. - Engine *EngineDescription `protobuf:"bytes,4,opt,name=engine,proto3" json:"engine,omitempty"` - // Information on the node's TLS setup - TLSInfo *NodeTLSInfo `protobuf:"bytes,5,opt,name=tls_info,json=tlsInfo,proto3" json:"tls_info,omitempty"` - // FIPS indicates whether the node has FIPS-enabled - FIPS bool `protobuf:"varint,6,opt,name=fips,proto3" json:"fips,omitempty"` - CSIInfo []*NodeCSIInfo `protobuf:"bytes,7,rep,name=csi_info,json=csiInfo,proto3" json:"csi_info,omitempty"` -} - -func (m *NodeDescription) Reset() { *m = NodeDescription{} } -func (*NodeDescription) ProtoMessage() {} -func (*NodeDescription) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{11} -} -func (m *NodeDescription) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodeDescription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NodeDescription.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NodeDescription) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeDescription.Merge(m, src) -} -func (m *NodeDescription) XXX_Size() int { - return m.Size() -} -func (m *NodeDescription) XXX_DiscardUnknown() { - xxx_messageInfo_NodeDescription.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeDescription proto.InternalMessageInfo - -type NodeTLSInfo struct { - // Information about which root certs the node trusts - TrustRoot []byte `protobuf:"bytes,1,opt,name=trust_root,json=trustRoot,proto3" json:"trust_root,omitempty"` - // Information about the node's current TLS certificate - CertIssuerSubject []byte `protobuf:"bytes,2,opt,name=cert_issuer_subject,json=certIssuerSubject,proto3" json:"cert_issuer_subject,omitempty"` - CertIssuerPublicKey []byte `protobuf:"bytes,3,opt,name=cert_issuer_public_key,json=certIssuerPublicKey,proto3" json:"cert_issuer_public_key,omitempty"` -} - -func (m *NodeTLSInfo) Reset() { *m = NodeTLSInfo{} } -func (*NodeTLSInfo) ProtoMessage() {} -func (*NodeTLSInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{12} -} -func (m *NodeTLSInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodeTLSInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NodeTLSInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NodeTLSInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeTLSInfo.Merge(m, src) -} -func (m *NodeTLSInfo) XXX_Size() int { - return m.Size() -} -func (m *NodeTLSInfo) XXX_DiscardUnknown() { - xxx_messageInfo_NodeTLSInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeTLSInfo proto.InternalMessageInfo - -// NodeCSIInfo represents information about a Node returned by calling the -// NodeGetInfo RPC on the CSI plugin present on the node. There is a separate -// NodeCSIInfo object for each CSI plugin present. -type NodeCSIInfo struct { - // PluginName is the name of the CSI plugin. - PluginName string `protobuf:"bytes,1,opt,name=plugin_name,json=pluginName,proto3" json:"plugin_name,omitempty"` - // NodeID is the ID of the node as reported by the CSI plugin. This will be - // different from the swarmkit node ID. - NodeID string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // MaxVolumesPerNode is the maximum number of volumes that may be published - // to this node. - MaxVolumesPerNode int64 `protobuf:"varint,3,opt,name=max_volumes_per_node,json=maxVolumesPerNode,proto3" json:"max_volumes_per_node,omitempty"` - // AccessibleTopology indicates the location of this node in the CSI plugin's - // topology - AccessibleTopology *Topology `protobuf:"bytes,4,opt,name=accessible_topology,json=accessibleTopology,proto3" json:"accessible_topology,omitempty"` -} - -func (m *NodeCSIInfo) Reset() { *m = NodeCSIInfo{} } -func (*NodeCSIInfo) ProtoMessage() {} -func (*NodeCSIInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{13} -} -func (m *NodeCSIInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodeCSIInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NodeCSIInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NodeCSIInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeCSIInfo.Merge(m, src) -} -func (m *NodeCSIInfo) XXX_Size() int { - return m.Size() -} -func (m *NodeCSIInfo) XXX_DiscardUnknown() { - xxx_messageInfo_NodeCSIInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeCSIInfo proto.InternalMessageInfo - -type RaftMemberStatus struct { - Leader bool `protobuf:"varint,1,opt,name=leader,proto3" json:"leader,omitempty"` - Reachability RaftMemberStatus_Reachability `protobuf:"varint,2,opt,name=reachability,proto3,enum=docker.swarmkit.v1.RaftMemberStatus_Reachability" json:"reachability,omitempty"` - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` -} - -func (m *RaftMemberStatus) Reset() { *m = RaftMemberStatus{} } -func (*RaftMemberStatus) ProtoMessage() {} -func (*RaftMemberStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{14} -} -func (m *RaftMemberStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RaftMemberStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RaftMemberStatus.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RaftMemberStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_RaftMemberStatus.Merge(m, src) -} -func (m *RaftMemberStatus) XXX_Size() int { - return m.Size() -} -func (m *RaftMemberStatus) XXX_DiscardUnknown() { - xxx_messageInfo_RaftMemberStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_RaftMemberStatus proto.InternalMessageInfo - -type NodeStatus struct { - State NodeStatus_State `protobuf:"varint,1,opt,name=state,proto3,enum=docker.swarmkit.v1.NodeStatus_State" json:"state,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - // Addr is the node's IP address as observed by the manager - Addr string `protobuf:"bytes,3,opt,name=addr,proto3" json:"addr,omitempty"` -} - -func (m *NodeStatus) Reset() { *m = NodeStatus{} } -func (*NodeStatus) ProtoMessage() {} -func (*NodeStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{15} -} -func (m *NodeStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodeStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NodeStatus.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NodeStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeStatus.Merge(m, src) -} -func (m *NodeStatus) XXX_Size() int { - return m.Size() -} -func (m *NodeStatus) XXX_DiscardUnknown() { - xxx_messageInfo_NodeStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeStatus proto.InternalMessageInfo - -type Image struct { - // reference is a docker image reference. This can include a rpository, tag - // or be fully qualified witha digest. The format is specified in the - // distribution/reference package. - Reference string `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"` -} - -func (m *Image) Reset() { *m = Image{} } -func (*Image) ProtoMessage() {} -func (*Image) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{16} -} -func (m *Image) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Image) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Image.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Image) XXX_Merge(src proto.Message) { - xxx_messageInfo_Image.Merge(m, src) -} -func (m *Image) XXX_Size() int { - return m.Size() -} -func (m *Image) XXX_DiscardUnknown() { - xxx_messageInfo_Image.DiscardUnknown(m) -} - -var xxx_messageInfo_Image proto.InternalMessageInfo - -// Mount describes volume mounts for a container. -// -// The Mount type follows the structure of the mount syscall, including a type, -// source, target. Top-level flags, such as writable, are common to all kinds -// of mounts, where we also provide options that are specific to a type of -// mount. This corresponds to flags and data, respectively, in the syscall. -type Mount struct { - // Type defines the nature of the mount. - Type Mount_MountType `protobuf:"varint,1,opt,name=type,proto3,enum=docker.swarmkit.v1.Mount_MountType" json:"type,omitempty"` - // Source specifies the name of the mount. Depending on mount type, this - // may be a volume name or a host path, or even ignored. - // - // For CSI type mounts, the source is either the name of the volume or the - // name of the volume group. To specify a volume group, the source should be - // prefixed with "group:", as in "group:groupname" - Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` - // Target path in container - Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"` - // ReadOnly should be set to true if the mount should not be writable. - ReadOnly bool `protobuf:"varint,4,opt,name=readonly,proto3" json:"readonly,omitempty"` - Consistency Mount_MountConsistency `protobuf:"varint,8,opt,name=consistency,proto3,enum=docker.swarmkit.v1.Mount_MountConsistency" json:"consistency,omitempty"` - // BindOptions configures properties of a bind mount type. - // - // For mounts of type bind, the source must be an absolute host path. - BindOptions *Mount_BindOptions `protobuf:"bytes,5,opt,name=bind_options,json=bindOptions,proto3" json:"bind_options,omitempty"` - // VolumeOptions configures the properties specific to a volume mount type. - // - // For mounts of type volume, the source will be used as the volume name. - VolumeOptions *Mount_VolumeOptions `protobuf:"bytes,6,opt,name=volume_options,json=volumeOptions,proto3" json:"volume_options,omitempty"` - // TmpfsOptions allows one to set options for mounting a temporary - // filesystem. - // - // The source field will be ignored when using mounts of type tmpfs. - TmpfsOptions *Mount_TmpfsOptions `protobuf:"bytes,7,opt,name=tmpfs_options,json=tmpfsOptions,proto3" json:"tmpfs_options,omitempty"` -} - -func (m *Mount) Reset() { *m = Mount{} } -func (*Mount) ProtoMessage() {} -func (*Mount) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{17} -} -func (m *Mount) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Mount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Mount.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Mount) XXX_Merge(src proto.Message) { - xxx_messageInfo_Mount.Merge(m, src) -} -func (m *Mount) XXX_Size() int { - return m.Size() -} -func (m *Mount) XXX_DiscardUnknown() { - xxx_messageInfo_Mount.DiscardUnknown(m) -} - -var xxx_messageInfo_Mount proto.InternalMessageInfo - -// BindOptions specifies options that are specific to a bind mount. -type Mount_BindOptions struct { - // Propagation mode of mount. - Propagation Mount_BindOptions_MountPropagation `protobuf:"varint,1,opt,name=propagation,proto3,enum=docker.swarmkit.v1.Mount_BindOptions_MountPropagation" json:"propagation,omitempty"` - // allows non-recursive bind-mount, i.e. mount(2) with "bind" rather than "rbind". - NonRecursive bool `protobuf:"varint,2,opt,name=nonrecursive,proto3" json:"nonrecursive,omitempty"` - // Create the mount point - CreateMountpoint bool `protobuf:"varint,3,opt,name=createmountpoint,proto3" json:"createmountpoint,omitempty"` - // ReadOnlyNonRecursive makes the mount non-recursively read-only, but still leaves the mount recursive - // (unless NonRecursive is set to true in conjunction). - ReadOnlyNonRecursive bool `protobuf:"varint,4,opt,name=readonlynonrecursive,proto3" json:"readonlynonrecursive,omitempty"` - // ReadOnlyForceRecursive raises an error if the mount cannot be made recursively read-only. - ReadOnlyForceRecursive bool `protobuf:"varint,5,opt,name=readonlyforcerecursive,proto3" json:"readonlyforcerecursive,omitempty"` -} - -func (m *Mount_BindOptions) Reset() { *m = Mount_BindOptions{} } -func (*Mount_BindOptions) ProtoMessage() {} -func (*Mount_BindOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{17, 0} -} -func (m *Mount_BindOptions) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Mount_BindOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Mount_BindOptions.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Mount_BindOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_Mount_BindOptions.Merge(m, src) -} -func (m *Mount_BindOptions) XXX_Size() int { - return m.Size() -} -func (m *Mount_BindOptions) XXX_DiscardUnknown() { - xxx_messageInfo_Mount_BindOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_Mount_BindOptions proto.InternalMessageInfo - -// VolumeOptions contains parameters for mounting the volume. -type Mount_VolumeOptions struct { - // nocopy prevents automatic copying of data to the volume with data from target - NoCopy bool `protobuf:"varint,1,opt,name=nocopy,proto3" json:"nocopy,omitempty"` - // labels to apply to the volume if creating - Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // DriverConfig specifies the options that may be passed to the driver - // if the volume is created. - // - // If this is empty, no volume will be created if the volume is missing. - DriverConfig *Driver `protobuf:"bytes,3,opt,name=driver_config,json=driverConfig,proto3" json:"driver_config,omitempty"` - // subpath inside the volume to mount. - Subpath string `protobuf:"bytes,4,opt,name=subpath,proto3" json:"subpath,omitempty"` -} - -func (m *Mount_VolumeOptions) Reset() { *m = Mount_VolumeOptions{} } -func (*Mount_VolumeOptions) ProtoMessage() {} -func (*Mount_VolumeOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{17, 1} -} -func (m *Mount_VolumeOptions) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Mount_VolumeOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Mount_VolumeOptions.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Mount_VolumeOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_Mount_VolumeOptions.Merge(m, src) -} -func (m *Mount_VolumeOptions) XXX_Size() int { - return m.Size() -} -func (m *Mount_VolumeOptions) XXX_DiscardUnknown() { - xxx_messageInfo_Mount_VolumeOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_Mount_VolumeOptions proto.InternalMessageInfo - -type Mount_TmpfsOptions struct { - // Size sets the size of the tmpfs, in bytes. - // - // This will be converted to an operating system specific value - // depending on the host. For example, on linux, it will be convered to - // use a 'k', 'm' or 'g' syntax. BSD, though not widely supported with - // docker, uses a straight byte value. - // - // Percentages are not supported. - SizeBytes int64 `protobuf:"varint,1,opt,name=size_bytes,json=sizeBytes,proto3" json:"size_bytes,omitempty"` - // Mode of the tmpfs upon creation - Mode os.FileMode `protobuf:"varint,2,opt,name=mode,proto3,customtype=os.FileMode" json:"mode"` - // Options passed to tmpfs mount - Options string `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"` -} - -func (m *Mount_TmpfsOptions) Reset() { *m = Mount_TmpfsOptions{} } -func (*Mount_TmpfsOptions) ProtoMessage() {} -func (*Mount_TmpfsOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{17, 2} -} -func (m *Mount_TmpfsOptions) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Mount_TmpfsOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Mount_TmpfsOptions.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Mount_TmpfsOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_Mount_TmpfsOptions.Merge(m, src) -} -func (m *Mount_TmpfsOptions) XXX_Size() int { - return m.Size() -} -func (m *Mount_TmpfsOptions) XXX_DiscardUnknown() { - xxx_messageInfo_Mount_TmpfsOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_Mount_TmpfsOptions proto.InternalMessageInfo - -type RestartPolicy struct { - Condition RestartPolicy_RestartCondition `protobuf:"varint,1,opt,name=condition,proto3,enum=docker.swarmkit.v1.RestartPolicy_RestartCondition" json:"condition,omitempty"` - // Delay between restart attempts - // Note: can't use stdduration because this field needs to be nullable. - Delay *types.Duration `protobuf:"bytes,2,opt,name=delay,proto3" json:"delay,omitempty"` - // MaxAttempts is the maximum number of restarts to attempt on an - // instance before giving up. Ignored if 0. - MaxAttempts uint64 `protobuf:"varint,3,opt,name=max_attempts,json=maxAttempts,proto3" json:"max_attempts,omitempty"` - // Window is the time window used to evaluate the restart policy. - // The time window is unbounded if this is 0. - // Note: can't use stdduration because this field needs to be nullable. - Window *types.Duration `protobuf:"bytes,4,opt,name=window,proto3" json:"window,omitempty"` -} - -func (m *RestartPolicy) Reset() { *m = RestartPolicy{} } -func (*RestartPolicy) ProtoMessage() {} -func (*RestartPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{18} -} -func (m *RestartPolicy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RestartPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RestartPolicy.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RestartPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_RestartPolicy.Merge(m, src) -} -func (m *RestartPolicy) XXX_Size() int { - return m.Size() -} -func (m *RestartPolicy) XXX_DiscardUnknown() { - xxx_messageInfo_RestartPolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_RestartPolicy proto.InternalMessageInfo - -// UpdateConfig specifies the rate and policy of updates. -// TODO(aluzzardi): Consider making this a oneof with RollingStrategy and LockstepStrategy. -type UpdateConfig struct { - // Maximum number of tasks to be updated in one iteration. - // 0 means unlimited parallelism. - Parallelism uint64 `protobuf:"varint,1,opt,name=parallelism,proto3" json:"parallelism,omitempty"` - // Amount of time between updates. - Delay time.Duration `protobuf:"bytes,2,opt,name=delay,proto3,stdduration" json:"delay"` - // FailureAction is the action to take when an update failures. - FailureAction UpdateConfig_FailureAction `protobuf:"varint,3,opt,name=failure_action,json=failureAction,proto3,enum=docker.swarmkit.v1.UpdateConfig_FailureAction" json:"failure_action,omitempty"` - // Monitor indicates how long to monitor a task for failure after it is - // created. If the task fails by ending up in one of the states - // REJECTED, COMPLETED, or FAILED, within Monitor from its creation, - // this counts as a failure. If it fails after Monitor, it does not - // count as a failure. If Monitor is unspecified, a default value will - // be used. - // Note: can't use stdduration because this field needs to be nullable. - Monitor *types.Duration `protobuf:"bytes,4,opt,name=monitor,proto3" json:"monitor,omitempty"` - // MaxFailureRatio is the fraction of tasks that may fail during - // an update before the failure action is invoked. Any task created by - // the current update which ends up in one of the states REJECTED, - // COMPLETED or FAILED within Monitor from its creation counts as a - // failure. The number of failures is divided by the number of tasks - // being updated, and if this fraction is greater than - // MaxFailureRatio, the failure action is invoked. - // - // If the failure action is CONTINUE, there is no effect. - // If the failure action is PAUSE, no more tasks will be updated until - // another update is started. - // If the failure action is ROLLBACK, the orchestrator will attempt to - // roll back to the previous service spec. If the MaxFailureRatio - // threshold is hit during the rollback, the rollback will pause. - MaxFailureRatio float32 `protobuf:"fixed32,5,opt,name=max_failure_ratio,json=maxFailureRatio,proto3" json:"max_failure_ratio,omitempty"` - Order UpdateConfig_UpdateOrder `protobuf:"varint,6,opt,name=order,proto3,enum=docker.swarmkit.v1.UpdateConfig_UpdateOrder" json:"order,omitempty"` -} - -func (m *UpdateConfig) Reset() { *m = UpdateConfig{} } -func (*UpdateConfig) ProtoMessage() {} -func (*UpdateConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{19} -} -func (m *UpdateConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateConfig.Merge(m, src) -} -func (m *UpdateConfig) XXX_Size() int { - return m.Size() -} -func (m *UpdateConfig) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateConfig proto.InternalMessageInfo - -// UpdateStatus is the status of an update in progress. -type UpdateStatus struct { - // State is the state of this update. It indicates whether the - // update is in progress, completed, paused, rolling back, or - // finished rolling back. - State UpdateStatus_UpdateState `protobuf:"varint,1,opt,name=state,proto3,enum=docker.swarmkit.v1.UpdateStatus_UpdateState" json:"state,omitempty"` - // StartedAt is the time at which the update was started. - // Note: can't use stdtime because this field is nullable. - StartedAt *types.Timestamp `protobuf:"bytes,2,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` - // CompletedAt is the time at which the update completed successfully, - // paused, or finished rolling back. - // Note: can't use stdtime because this field is nullable. - CompletedAt *types.Timestamp `protobuf:"bytes,3,opt,name=completed_at,json=completedAt,proto3" json:"completed_at,omitempty"` - // Message explains how the update got into its current state. For - // example, if the update is paused, it will explain what is preventing - // the update from proceeding (typically the failure of a task to start up - // when OnFailure is PAUSE). - Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` -} - -func (m *UpdateStatus) Reset() { *m = UpdateStatus{} } -func (*UpdateStatus) ProtoMessage() {} -func (*UpdateStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{20} -} -func (m *UpdateStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateStatus.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateStatus.Merge(m, src) -} -func (m *UpdateStatus) XXX_Size() int { - return m.Size() -} -func (m *UpdateStatus) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateStatus proto.InternalMessageInfo - -// Container specific status. -type ContainerStatus struct { - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - PID int32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"` - ExitCode int32 `protobuf:"varint,3,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` -} - -func (m *ContainerStatus) Reset() { *m = ContainerStatus{} } -func (*ContainerStatus) ProtoMessage() {} -func (*ContainerStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{21} -} -func (m *ContainerStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ContainerStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ContainerStatus.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ContainerStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContainerStatus.Merge(m, src) -} -func (m *ContainerStatus) XXX_Size() int { - return m.Size() -} -func (m *ContainerStatus) XXX_DiscardUnknown() { - xxx_messageInfo_ContainerStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_ContainerStatus proto.InternalMessageInfo - -// PortStatus specifies the actual allocated runtime state of a list -// of port configs. -type PortStatus struct { - Ports []*PortConfig `protobuf:"bytes,1,rep,name=ports,proto3" json:"ports,omitempty"` -} - -func (m *PortStatus) Reset() { *m = PortStatus{} } -func (*PortStatus) ProtoMessage() {} -func (*PortStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{22} -} -func (m *PortStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PortStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PortStatus.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PortStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_PortStatus.Merge(m, src) -} -func (m *PortStatus) XXX_Size() int { - return m.Size() -} -func (m *PortStatus) XXX_DiscardUnknown() { - xxx_messageInfo_PortStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_PortStatus proto.InternalMessageInfo - -type TaskStatus struct { - // Note: can't use stdtime because this field is nullable. - Timestamp *types.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // State expresses the current state of the task. - State TaskState `protobuf:"varint,2,opt,name=state,proto3,enum=docker.swarmkit.v1.TaskState" json:"state,omitempty"` - // Message reports a message for the task status. This should provide a - // human readable message that can point to how the task actually arrived - // at a current state. - // - // As a convention, we place the a small message here that led to the - // current state. For example, if the task is in ready, because it was - // prepared, we'd place "prepared" in this field. If we skipped preparation - // because the task is prepared, we would put "already prepared" in this - // field. - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` - // Err is set if the task is in an error state, or is unable to - // progress from an earlier state because a precondition is - // unsatisfied. - // - // The following states should report a companion error: - // - // FAILED, REJECTED - // - // In general, messages that should be surfaced to users belong in the - // Err field, and notes on routine state transitions belong in Message. - // - // TODO(stevvooe) Integrate this field with the error interface. - Err string `protobuf:"bytes,4,opt,name=err,proto3" json:"err,omitempty"` - // Container status contains container specific status information. - // - // Types that are valid to be assigned to RuntimeStatus: - // *TaskStatus_Container - RuntimeStatus isTaskStatus_RuntimeStatus `protobuf_oneof:"runtime_status"` - // HostPorts provides a list of ports allocated at the host - // level. - PortStatus *PortStatus `protobuf:"bytes,6,opt,name=port_status,json=portStatus,proto3" json:"port_status,omitempty"` - // AppliedBy gives the node ID of the manager that applied this task - // status update to the Task object. - AppliedBy string `protobuf:"bytes,7,opt,name=applied_by,json=appliedBy,proto3" json:"applied_by,omitempty"` - // AppliedAt gives a timestamp of when this status update was applied to - // the Task object. - // Note: can't use stdtime because this field is nullable. - AppliedAt *types.Timestamp `protobuf:"bytes,8,opt,name=applied_at,json=appliedAt,proto3" json:"applied_at,omitempty"` -} - -func (m *TaskStatus) Reset() { *m = TaskStatus{} } -func (*TaskStatus) ProtoMessage() {} -func (*TaskStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{23} -} -func (m *TaskStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TaskStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TaskStatus.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TaskStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_TaskStatus.Merge(m, src) -} -func (m *TaskStatus) XXX_Size() int { - return m.Size() -} -func (m *TaskStatus) XXX_DiscardUnknown() { - xxx_messageInfo_TaskStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_TaskStatus proto.InternalMessageInfo - -type isTaskStatus_RuntimeStatus interface { - isTaskStatus_RuntimeStatus() - MarshalTo([]byte) (int, error) - Size() int -} - -type TaskStatus_Container struct { - Container *ContainerStatus `protobuf:"bytes,5,opt,name=container,proto3,oneof" json:"container,omitempty"` -} - -func (*TaskStatus_Container) isTaskStatus_RuntimeStatus() {} - -func (m *TaskStatus) GetRuntimeStatus() isTaskStatus_RuntimeStatus { - if m != nil { - return m.RuntimeStatus - } - return nil -} - -func (m *TaskStatus) GetContainer() *ContainerStatus { - if x, ok := m.GetRuntimeStatus().(*TaskStatus_Container); ok { - return x.Container - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*TaskStatus) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*TaskStatus_Container)(nil), - } -} - -// NetworkAttachmentConfig specifies how a service should be attached to a particular network. -// -// For now, this is a simple struct, but this can include future information -// instructing Swarm on how this service should work on the particular -// network. -type NetworkAttachmentConfig struct { - // Target specifies the target network for attachment. This value must be a - // network ID. - Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` - // Aliases specifies a list of discoverable alternate names for the service on this Target. - Aliases []string `protobuf:"bytes,2,rep,name=aliases,proto3" json:"aliases,omitempty"` - // Addresses specifies a list of ipv4 and ipv6 addresses - // preferred. If these addresses are not available then the - // attachment might fail. - Addresses []string `protobuf:"bytes,3,rep,name=addresses,proto3" json:"addresses,omitempty"` - // DriverAttachmentOpts is a map of driver attachment options for the network target - DriverAttachmentOpts map[string]string `protobuf:"bytes,4,rep,name=driver_attachment_opts,json=driverAttachmentOpts,proto3" json:"driver_attachment_opts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *NetworkAttachmentConfig) Reset() { *m = NetworkAttachmentConfig{} } -func (*NetworkAttachmentConfig) ProtoMessage() {} -func (*NetworkAttachmentConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{24} -} -func (m *NetworkAttachmentConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NetworkAttachmentConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NetworkAttachmentConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NetworkAttachmentConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_NetworkAttachmentConfig.Merge(m, src) -} -func (m *NetworkAttachmentConfig) XXX_Size() int { - return m.Size() -} -func (m *NetworkAttachmentConfig) XXX_DiscardUnknown() { - xxx_messageInfo_NetworkAttachmentConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_NetworkAttachmentConfig proto.InternalMessageInfo - -// IPAMConfig specifies parameters for IP Address Management. -type IPAMConfig struct { - Family IPAMConfig_AddressFamily `protobuf:"varint,1,opt,name=family,proto3,enum=docker.swarmkit.v1.IPAMConfig_AddressFamily" json:"family,omitempty"` - // Subnet defines a network as a CIDR address (ie network and mask - // 192.168.0.1/24). - Subnet string `protobuf:"bytes,2,opt,name=subnet,proto3" json:"subnet,omitempty"` - // Range defines the portion of the subnet to allocate to tasks. This is - // defined as a subnet within the primary subnet. - Range string `protobuf:"bytes,3,opt,name=range,proto3" json:"range,omitempty"` - // Gateway address within the subnet. - Gateway string `protobuf:"bytes,4,opt,name=gateway,proto3" json:"gateway,omitempty"` - // Reserved is a list of address from the master pool that should *not* be - // allocated. These addresses may have already been allocated or may be - // reserved for another allocation manager. - Reserved map[string]string `protobuf:"bytes,5,rep,name=reserved,proto3" json:"reserved,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *IPAMConfig) Reset() { *m = IPAMConfig{} } -func (*IPAMConfig) ProtoMessage() {} -func (*IPAMConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{25} -} -func (m *IPAMConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IPAMConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IPAMConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *IPAMConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_IPAMConfig.Merge(m, src) -} -func (m *IPAMConfig) XXX_Size() int { - return m.Size() -} -func (m *IPAMConfig) XXX_DiscardUnknown() { - xxx_messageInfo_IPAMConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_IPAMConfig proto.InternalMessageInfo - -// PortConfig specifies an exposed port which can be -// addressed using the given name. This can be later queried -// using a service discovery api or a DNS SRV query. The node -// port specifies a port that can be used to address this -// service external to the cluster by sending a connection -// request to this port to any node on the cluster. -type PortConfig struct { - // Name for the port. If provided the port information can - // be queried using the name as in a DNS SRV query. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Protocol for the port which is exposed. - Protocol PortConfig_Protocol `protobuf:"varint,2,opt,name=protocol,proto3,enum=docker.swarmkit.v1.PortConfig_Protocol" json:"protocol,omitempty"` - // The port which the application is exposing and is bound to. - TargetPort uint32 `protobuf:"varint,3,opt,name=target_port,json=targetPort,proto3" json:"target_port,omitempty"` - // PublishedPort specifies the port on which the service is exposed. If - // specified, the port must be within the available range. If not specified - // (value is zero), an available port is automatically assigned. - PublishedPort uint32 `protobuf:"varint,4,opt,name=published_port,json=publishedPort,proto3" json:"published_port,omitempty"` - // PublishMode controls how the port is published. - PublishMode PortConfig_PublishMode `protobuf:"varint,5,opt,name=publish_mode,json=publishMode,proto3,enum=docker.swarmkit.v1.PortConfig_PublishMode" json:"publish_mode,omitempty"` -} - -func (m *PortConfig) Reset() { *m = PortConfig{} } -func (*PortConfig) ProtoMessage() {} -func (*PortConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{26} -} -func (m *PortConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PortConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PortConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PortConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_PortConfig.Merge(m, src) -} -func (m *PortConfig) XXX_Size() int { - return m.Size() -} -func (m *PortConfig) XXX_DiscardUnknown() { - xxx_messageInfo_PortConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_PortConfig proto.InternalMessageInfo - -// Driver is a generic driver type to be used throughout the API. For now, a -// driver is simply a name and set of options. The field contents depend on the -// target use case and driver application. For example, a network driver may -// have different rules than a volume driver. -type Driver struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Options map[string]string `protobuf:"bytes,2,rep,name=options,proto3" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *Driver) Reset() { *m = Driver{} } -func (*Driver) ProtoMessage() {} -func (*Driver) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{27} -} -func (m *Driver) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Driver) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Driver.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Driver) XXX_Merge(src proto.Message) { - xxx_messageInfo_Driver.Merge(m, src) -} -func (m *Driver) XXX_Size() int { - return m.Size() -} -func (m *Driver) XXX_DiscardUnknown() { - xxx_messageInfo_Driver.DiscardUnknown(m) -} - -var xxx_messageInfo_Driver proto.InternalMessageInfo - -type IPAMOptions struct { - Driver *Driver `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"` - Configs []*IPAMConfig `protobuf:"bytes,3,rep,name=configs,proto3" json:"configs,omitempty"` -} - -func (m *IPAMOptions) Reset() { *m = IPAMOptions{} } -func (*IPAMOptions) ProtoMessage() {} -func (*IPAMOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{28} -} -func (m *IPAMOptions) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IPAMOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IPAMOptions.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *IPAMOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_IPAMOptions.Merge(m, src) -} -func (m *IPAMOptions) XXX_Size() int { - return m.Size() -} -func (m *IPAMOptions) XXX_DiscardUnknown() { - xxx_messageInfo_IPAMOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_IPAMOptions proto.InternalMessageInfo - -// Peer should be used anywhere where we are describing a remote peer. -type Peer struct { - NodeID string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` -} - -func (m *Peer) Reset() { *m = Peer{} } -func (*Peer) ProtoMessage() {} -func (*Peer) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{29} -} -func (m *Peer) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Peer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Peer.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Peer) XXX_Merge(src proto.Message) { - xxx_messageInfo_Peer.Merge(m, src) -} -func (m *Peer) XXX_Size() int { - return m.Size() -} -func (m *Peer) XXX_DiscardUnknown() { - xxx_messageInfo_Peer.DiscardUnknown(m) -} - -var xxx_messageInfo_Peer proto.InternalMessageInfo - -// WeightedPeer should be used anywhere where we are describing a remote peer -// with a weight. -type WeightedPeer struct { - Peer *Peer `protobuf:"bytes,1,opt,name=peer,proto3" json:"peer,omitempty"` - Weight int64 `protobuf:"varint,2,opt,name=weight,proto3" json:"weight,omitempty"` -} - -func (m *WeightedPeer) Reset() { *m = WeightedPeer{} } -func (*WeightedPeer) ProtoMessage() {} -func (*WeightedPeer) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{30} -} -func (m *WeightedPeer) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WeightedPeer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WeightedPeer.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *WeightedPeer) XXX_Merge(src proto.Message) { - xxx_messageInfo_WeightedPeer.Merge(m, src) -} -func (m *WeightedPeer) XXX_Size() int { - return m.Size() -} -func (m *WeightedPeer) XXX_DiscardUnknown() { - xxx_messageInfo_WeightedPeer.DiscardUnknown(m) -} - -var xxx_messageInfo_WeightedPeer proto.InternalMessageInfo - -type IssuanceStatus struct { - State IssuanceStatus_State `protobuf:"varint,1,opt,name=state,proto3,enum=docker.swarmkit.v1.IssuanceStatus_State" json:"state,omitempty"` - // Err is set if the Certificate Issuance is in an error state. - // The following states should report a companion error: - // FAILED - Err string `protobuf:"bytes,2,opt,name=err,proto3" json:"err,omitempty"` -} - -func (m *IssuanceStatus) Reset() { *m = IssuanceStatus{} } -func (*IssuanceStatus) ProtoMessage() {} -func (*IssuanceStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{31} -} -func (m *IssuanceStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IssuanceStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IssuanceStatus.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *IssuanceStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_IssuanceStatus.Merge(m, src) -} -func (m *IssuanceStatus) XXX_Size() int { - return m.Size() -} -func (m *IssuanceStatus) XXX_DiscardUnknown() { - xxx_messageInfo_IssuanceStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_IssuanceStatus proto.InternalMessageInfo - -type AcceptancePolicy struct { - Policies []*AcceptancePolicy_RoleAdmissionPolicy `protobuf:"bytes,1,rep,name=policies,proto3" json:"policies,omitempty"` -} - -func (m *AcceptancePolicy) Reset() { *m = AcceptancePolicy{} } -func (*AcceptancePolicy) ProtoMessage() {} -func (*AcceptancePolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{32} -} -func (m *AcceptancePolicy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AcceptancePolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AcceptancePolicy.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AcceptancePolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_AcceptancePolicy.Merge(m, src) -} -func (m *AcceptancePolicy) XXX_Size() int { - return m.Size() -} -func (m *AcceptancePolicy) XXX_DiscardUnknown() { - xxx_messageInfo_AcceptancePolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_AcceptancePolicy proto.InternalMessageInfo - -type AcceptancePolicy_RoleAdmissionPolicy struct { - Role NodeRole `protobuf:"varint,1,opt,name=role,proto3,enum=docker.swarmkit.v1.NodeRole" json:"role,omitempty"` - // Autoaccept controls which roles' certificates are automatically - // issued without administrator intervention. - Autoaccept bool `protobuf:"varint,2,opt,name=autoaccept,proto3" json:"autoaccept,omitempty"` - // Secret represents a user-provided string that is necessary for new - // nodes to join the cluster - Secret *AcceptancePolicy_RoleAdmissionPolicy_Secret `protobuf:"bytes,3,opt,name=secret,proto3" json:"secret,omitempty"` -} - -func (m *AcceptancePolicy_RoleAdmissionPolicy) Reset() { *m = AcceptancePolicy_RoleAdmissionPolicy{} } -func (*AcceptancePolicy_RoleAdmissionPolicy) ProtoMessage() {} -func (*AcceptancePolicy_RoleAdmissionPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{32, 0} -} -func (m *AcceptancePolicy_RoleAdmissionPolicy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AcceptancePolicy_RoleAdmissionPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AcceptancePolicy_RoleAdmissionPolicy.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AcceptancePolicy_RoleAdmissionPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_AcceptancePolicy_RoleAdmissionPolicy.Merge(m, src) -} -func (m *AcceptancePolicy_RoleAdmissionPolicy) XXX_Size() int { - return m.Size() -} -func (m *AcceptancePolicy_RoleAdmissionPolicy) XXX_DiscardUnknown() { - xxx_messageInfo_AcceptancePolicy_RoleAdmissionPolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_AcceptancePolicy_RoleAdmissionPolicy proto.InternalMessageInfo - -type AcceptancePolicy_RoleAdmissionPolicy_Secret struct { - // The actual content (possibly hashed) - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - // The type of hash we are using, or "plaintext" - Alg string `protobuf:"bytes,2,opt,name=alg,proto3" json:"alg,omitempty"` -} - -func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) Reset() { - *m = AcceptancePolicy_RoleAdmissionPolicy_Secret{} -} -func (*AcceptancePolicy_RoleAdmissionPolicy_Secret) ProtoMessage() {} -func (*AcceptancePolicy_RoleAdmissionPolicy_Secret) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{32, 0, 0} -} -func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AcceptancePolicy_RoleAdmissionPolicy_Secret.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) XXX_Merge(src proto.Message) { - xxx_messageInfo_AcceptancePolicy_RoleAdmissionPolicy_Secret.Merge(m, src) -} -func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) XXX_Size() int { - return m.Size() -} -func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) XXX_DiscardUnknown() { - xxx_messageInfo_AcceptancePolicy_RoleAdmissionPolicy_Secret.DiscardUnknown(m) -} - -var xxx_messageInfo_AcceptancePolicy_RoleAdmissionPolicy_Secret proto.InternalMessageInfo - -type ExternalCA struct { - // Protocol is the protocol used by this external CA. - Protocol ExternalCA_CAProtocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=docker.swarmkit.v1.ExternalCA_CAProtocol" json:"protocol,omitempty"` - // URL is the URL where the external CA can be reached. - URL string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - // Options is a set of additional key/value pairs whose interpretation - // depends on the specified CA type. - Options map[string]string `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // CACert specifies which root CA is used by this external CA - CACert []byte `protobuf:"bytes,4,opt,name=ca_cert,json=caCert,proto3" json:"ca_cert,omitempty"` -} - -func (m *ExternalCA) Reset() { *m = ExternalCA{} } -func (*ExternalCA) ProtoMessage() {} -func (*ExternalCA) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{33} -} -func (m *ExternalCA) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ExternalCA) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ExternalCA.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ExternalCA) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExternalCA.Merge(m, src) -} -func (m *ExternalCA) XXX_Size() int { - return m.Size() -} -func (m *ExternalCA) XXX_DiscardUnknown() { - xxx_messageInfo_ExternalCA.DiscardUnknown(m) -} - -var xxx_messageInfo_ExternalCA proto.InternalMessageInfo - -type CAConfig struct { - // NodeCertExpiry is the duration certificates should be issued for - // Note: can't use stdduration because this field needs to be nullable. - NodeCertExpiry *types.Duration `protobuf:"bytes,1,opt,name=node_cert_expiry,json=nodeCertExpiry,proto3" json:"node_cert_expiry,omitempty"` - // ExternalCAs is a list of CAs to which a manager node will make - // certificate signing requests for node certificates. - ExternalCAs []*ExternalCA `protobuf:"bytes,2,rep,name=external_cas,json=externalCas,proto3" json:"external_cas,omitempty"` - // SigningCACert is the desired CA certificate to be used as the root and - // signing CA for the swarm. If not provided, indicates that we are either happy - // with the current configuration, or (together with a bump in the ForceRotate value) - // that we want a certificate and key generated for us. - SigningCACert []byte `protobuf:"bytes,3,opt,name=signing_ca_cert,json=signingCaCert,proto3" json:"signing_ca_cert,omitempty"` - // SigningCAKey is the desired private key, matching the signing CA cert, to be used - // to sign certificates for the swarm - SigningCAKey []byte `protobuf:"bytes,4,opt,name=signing_ca_key,json=signingCaKey,proto3" json:"signing_ca_key,omitempty"` - // ForceRotate is a counter that triggers a root CA rotation even if no relevant - // parameters have been in the spec. This will force the manager to generate a new - // certificate and key, if none have been provided. - ForceRotate uint64 `protobuf:"varint,5,opt,name=force_rotate,json=forceRotate,proto3" json:"force_rotate,omitempty"` -} - -func (m *CAConfig) Reset() { *m = CAConfig{} } -func (*CAConfig) ProtoMessage() {} -func (*CAConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{34} -} -func (m *CAConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CAConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CAConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CAConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_CAConfig.Merge(m, src) -} -func (m *CAConfig) XXX_Size() int { - return m.Size() -} -func (m *CAConfig) XXX_DiscardUnknown() { - xxx_messageInfo_CAConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_CAConfig proto.InternalMessageInfo - -// OrchestrationConfig defines cluster-level orchestration settings. -type OrchestrationConfig struct { - // TaskHistoryRetentionLimit is the number of historic tasks to keep per instance or - // node. If negative, never remove completed or failed tasks. - TaskHistoryRetentionLimit int64 `protobuf:"varint,1,opt,name=task_history_retention_limit,json=taskHistoryRetentionLimit,proto3" json:"task_history_retention_limit,omitempty"` -} - -func (m *OrchestrationConfig) Reset() { *m = OrchestrationConfig{} } -func (*OrchestrationConfig) ProtoMessage() {} -func (*OrchestrationConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{35} -} -func (m *OrchestrationConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *OrchestrationConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_OrchestrationConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *OrchestrationConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrchestrationConfig.Merge(m, src) -} -func (m *OrchestrationConfig) XXX_Size() int { - return m.Size() -} -func (m *OrchestrationConfig) XXX_DiscardUnknown() { - xxx_messageInfo_OrchestrationConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_OrchestrationConfig proto.InternalMessageInfo - -// TaskDefaults specifies default values for task creation. -type TaskDefaults struct { - // LogDriver specifies the log driver to use for the cluster if not - // specified for each task. - // - // If this is changed, only new tasks will pick up the new log driver. - // Existing tasks will continue to use the previous default until rescheduled. - LogDriver *Driver `protobuf:"bytes,1,opt,name=log_driver,json=logDriver,proto3" json:"log_driver,omitempty"` -} - -func (m *TaskDefaults) Reset() { *m = TaskDefaults{} } -func (*TaskDefaults) ProtoMessage() {} -func (*TaskDefaults) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{36} -} -func (m *TaskDefaults) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TaskDefaults) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TaskDefaults.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TaskDefaults) XXX_Merge(src proto.Message) { - xxx_messageInfo_TaskDefaults.Merge(m, src) -} -func (m *TaskDefaults) XXX_Size() int { - return m.Size() -} -func (m *TaskDefaults) XXX_DiscardUnknown() { - xxx_messageInfo_TaskDefaults.DiscardUnknown(m) -} - -var xxx_messageInfo_TaskDefaults proto.InternalMessageInfo - -// DispatcherConfig defines cluster-level dispatcher settings. -type DispatcherConfig struct { - // HeartbeatPeriod defines how often agent should send heartbeats to - // dispatcher. - // Note: can't use stdduration because this field needs to be nullable. - HeartbeatPeriod *types.Duration `protobuf:"bytes,1,opt,name=heartbeat_period,json=heartbeatPeriod,proto3" json:"heartbeat_period,omitempty"` -} - -func (m *DispatcherConfig) Reset() { *m = DispatcherConfig{} } -func (*DispatcherConfig) ProtoMessage() {} -func (*DispatcherConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{37} -} -func (m *DispatcherConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DispatcherConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DispatcherConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DispatcherConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_DispatcherConfig.Merge(m, src) -} -func (m *DispatcherConfig) XXX_Size() int { - return m.Size() -} -func (m *DispatcherConfig) XXX_DiscardUnknown() { - xxx_messageInfo_DispatcherConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_DispatcherConfig proto.InternalMessageInfo - -// RaftConfig defines raft settings for the cluster. -type RaftConfig struct { - // SnapshotInterval is the number of log entries between snapshots. - SnapshotInterval uint64 `protobuf:"varint,1,opt,name=snapshot_interval,json=snapshotInterval,proto3" json:"snapshot_interval,omitempty"` - // KeepOldSnapshots is the number of snapshots to keep beyond the - // current snapshot. - KeepOldSnapshots uint64 `protobuf:"varint,2,opt,name=keep_old_snapshots,json=keepOldSnapshots,proto3" json:"keep_old_snapshots,omitempty"` - // LogEntriesForSlowFollowers is the number of log entries to keep - // around to sync up slow followers after a snapshot is created. - LogEntriesForSlowFollowers uint64 `protobuf:"varint,3,opt,name=log_entries_for_slow_followers,json=logEntriesForSlowFollowers,proto3" json:"log_entries_for_slow_followers,omitempty"` - // HeartbeatTick defines the amount of ticks (in seconds) between - // each heartbeat message sent to other members for health-check. - HeartbeatTick uint32 `protobuf:"varint,4,opt,name=heartbeat_tick,json=heartbeatTick,proto3" json:"heartbeat_tick,omitempty"` - // ElectionTick defines the amount of ticks (in seconds) needed - // without a leader to trigger a new election. - ElectionTick uint32 `protobuf:"varint,5,opt,name=election_tick,json=electionTick,proto3" json:"election_tick,omitempty"` -} - -func (m *RaftConfig) Reset() { *m = RaftConfig{} } -func (*RaftConfig) ProtoMessage() {} -func (*RaftConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{38} -} -func (m *RaftConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RaftConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RaftConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RaftConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_RaftConfig.Merge(m, src) -} -func (m *RaftConfig) XXX_Size() int { - return m.Size() -} -func (m *RaftConfig) XXX_DiscardUnknown() { - xxx_messageInfo_RaftConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_RaftConfig proto.InternalMessageInfo - -type EncryptionConfig struct { - // AutoLockManagers specifies whether or not managers TLS keys and raft data - // should be encrypted at rest in such a way that they must be unlocked - // before the manager node starts up again. - AutoLockManagers bool `protobuf:"varint,1,opt,name=auto_lock_managers,json=autoLockManagers,proto3" json:"auto_lock_managers,omitempty"` -} - -func (m *EncryptionConfig) Reset() { *m = EncryptionConfig{} } -func (*EncryptionConfig) ProtoMessage() {} -func (*EncryptionConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{39} -} -func (m *EncryptionConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EncryptionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EncryptionConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EncryptionConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_EncryptionConfig.Merge(m, src) -} -func (m *EncryptionConfig) XXX_Size() int { - return m.Size() -} -func (m *EncryptionConfig) XXX_DiscardUnknown() { - xxx_messageInfo_EncryptionConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_EncryptionConfig proto.InternalMessageInfo - -type SpreadOver struct { - SpreadDescriptor string `protobuf:"bytes,1,opt,name=spread_descriptor,json=spreadDescriptor,proto3" json:"spread_descriptor,omitempty"` -} - -func (m *SpreadOver) Reset() { *m = SpreadOver{} } -func (*SpreadOver) ProtoMessage() {} -func (*SpreadOver) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{40} -} -func (m *SpreadOver) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SpreadOver) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SpreadOver.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SpreadOver) XXX_Merge(src proto.Message) { - xxx_messageInfo_SpreadOver.Merge(m, src) -} -func (m *SpreadOver) XXX_Size() int { - return m.Size() -} -func (m *SpreadOver) XXX_DiscardUnknown() { - xxx_messageInfo_SpreadOver.DiscardUnknown(m) -} - -var xxx_messageInfo_SpreadOver proto.InternalMessageInfo - -type PlacementPreference struct { - // Types that are valid to be assigned to Preference: - // *PlacementPreference_Spread - Preference isPlacementPreference_Preference `protobuf_oneof:"Preference"` -} - -func (m *PlacementPreference) Reset() { *m = PlacementPreference{} } -func (*PlacementPreference) ProtoMessage() {} -func (*PlacementPreference) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{41} -} -func (m *PlacementPreference) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PlacementPreference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PlacementPreference.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PlacementPreference) XXX_Merge(src proto.Message) { - xxx_messageInfo_PlacementPreference.Merge(m, src) -} -func (m *PlacementPreference) XXX_Size() int { - return m.Size() -} -func (m *PlacementPreference) XXX_DiscardUnknown() { - xxx_messageInfo_PlacementPreference.DiscardUnknown(m) -} - -var xxx_messageInfo_PlacementPreference proto.InternalMessageInfo - -type isPlacementPreference_Preference interface { - isPlacementPreference_Preference() - MarshalTo([]byte) (int, error) - Size() int -} - -type PlacementPreference_Spread struct { - Spread *SpreadOver `protobuf:"bytes,1,opt,name=spread,proto3,oneof" json:"spread,omitempty"` -} - -func (*PlacementPreference_Spread) isPlacementPreference_Preference() {} - -func (m *PlacementPreference) GetPreference() isPlacementPreference_Preference { - if m != nil { - return m.Preference - } - return nil -} - -func (m *PlacementPreference) GetSpread() *SpreadOver { - if x, ok := m.GetPreference().(*PlacementPreference_Spread); ok { - return x.Spread - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*PlacementPreference) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*PlacementPreference_Spread)(nil), - } -} - -// Placement specifies task distribution constraints. -type Placement struct { - // Constraints specifies a set of requirements a node should meet for a task. - Constraints []string `protobuf:"bytes,1,rep,name=constraints,proto3" json:"constraints,omitempty"` - // Preferences provide a way to make the scheduler aware of factors - // such as topology. They are provided in order from highest to lowest - // precedence. - Preferences []*PlacementPreference `protobuf:"bytes,2,rep,name=preferences,proto3" json:"preferences,omitempty"` - // Platforms stores all the platforms that the image can run on. - // This field is used in the platform filter for scheduling. If empty, - // then the platform filter is off, meaning there are no scheduling restrictions. - Platforms []*Platform `protobuf:"bytes,3,rep,name=platforms,proto3" json:"platforms,omitempty"` - // MaxReplicas specifies the limit for maximum number of replicas running on one node. - MaxReplicas uint64 `protobuf:"varint,4,opt,name=max_replicas,json=maxReplicas,proto3" json:"max_replicas,omitempty"` -} - -func (m *Placement) Reset() { *m = Placement{} } -func (*Placement) ProtoMessage() {} -func (*Placement) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{42} -} -func (m *Placement) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Placement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Placement.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Placement) XXX_Merge(src proto.Message) { - xxx_messageInfo_Placement.Merge(m, src) -} -func (m *Placement) XXX_Size() int { - return m.Size() -} -func (m *Placement) XXX_DiscardUnknown() { - xxx_messageInfo_Placement.DiscardUnknown(m) -} - -var xxx_messageInfo_Placement proto.InternalMessageInfo - -// JoinToken contains the join tokens for workers and managers. -type JoinTokens struct { - // Worker is the join token workers may use to join the swarm. - Worker string `protobuf:"bytes,1,opt,name=worker,proto3" json:"worker,omitempty"` - // Manager is the join token workers may use to join the swarm. - Manager string `protobuf:"bytes,2,opt,name=manager,proto3" json:"manager,omitempty"` -} - -func (m *JoinTokens) Reset() { *m = JoinTokens{} } -func (*JoinTokens) ProtoMessage() {} -func (*JoinTokens) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{43} -} -func (m *JoinTokens) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *JoinTokens) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_JoinTokens.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *JoinTokens) XXX_Merge(src proto.Message) { - xxx_messageInfo_JoinTokens.Merge(m, src) -} -func (m *JoinTokens) XXX_Size() int { - return m.Size() -} -func (m *JoinTokens) XXX_DiscardUnknown() { - xxx_messageInfo_JoinTokens.DiscardUnknown(m) -} - -var xxx_messageInfo_JoinTokens proto.InternalMessageInfo - -type RootCA struct { - // CAKey is the root CA private key. - CAKey []byte `protobuf:"bytes,1,opt,name=ca_key,json=caKey,proto3" json:"ca_key,omitempty"` - // CACert is the root CA certificate. - CACert []byte `protobuf:"bytes,2,opt,name=ca_cert,json=caCert,proto3" json:"ca_cert,omitempty"` - // CACertHash is the digest of the CA Certificate. - CACertHash string `protobuf:"bytes,3,opt,name=ca_cert_hash,json=caCertHash,proto3" json:"ca_cert_hash,omitempty"` - // JoinTokens contains the join tokens for workers and managers. - JoinTokens JoinTokens `protobuf:"bytes,4,opt,name=join_tokens,json=joinTokens,proto3" json:"join_tokens"` - // RootRotation contains the new root cert and key we want to rotate to - if this is nil, we are not in the - // middle of a root rotation - RootRotation *RootRotation `protobuf:"bytes,5,opt,name=root_rotation,json=rootRotation,proto3" json:"root_rotation,omitempty"` - // LastForcedRotation matches the Cluster Spec's CAConfig's ForceRotation counter. - // It indicates when the current CA cert and key were generated (or updated). - LastForcedRotation uint64 `protobuf:"varint,6,opt,name=last_forced_rotation,json=lastForcedRotation,proto3" json:"last_forced_rotation,omitempty"` -} - -func (m *RootCA) Reset() { *m = RootCA{} } -func (*RootCA) ProtoMessage() {} -func (*RootCA) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{44} -} -func (m *RootCA) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RootCA) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RootCA.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RootCA) XXX_Merge(src proto.Message) { - xxx_messageInfo_RootCA.Merge(m, src) -} -func (m *RootCA) XXX_Size() int { - return m.Size() -} -func (m *RootCA) XXX_DiscardUnknown() { - xxx_messageInfo_RootCA.DiscardUnknown(m) -} - -var xxx_messageInfo_RootCA proto.InternalMessageInfo - -type Certificate struct { - Role NodeRole `protobuf:"varint,1,opt,name=role,proto3,enum=docker.swarmkit.v1.NodeRole" json:"role,omitempty"` - CSR []byte `protobuf:"bytes,2,opt,name=csr,proto3" json:"csr,omitempty"` - Status IssuanceStatus `protobuf:"bytes,3,opt,name=status,proto3" json:"status"` - Certificate []byte `protobuf:"bytes,4,opt,name=certificate,proto3" json:"certificate,omitempty"` - // CN represents the node ID. - CN string `protobuf:"bytes,5,opt,name=cn,proto3" json:"cn,omitempty"` -} - -func (m *Certificate) Reset() { *m = Certificate{} } -func (*Certificate) ProtoMessage() {} -func (*Certificate) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{45} -} -func (m *Certificate) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Certificate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Certificate.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Certificate) XXX_Merge(src proto.Message) { - xxx_messageInfo_Certificate.Merge(m, src) -} -func (m *Certificate) XXX_Size() int { - return m.Size() -} -func (m *Certificate) XXX_DiscardUnknown() { - xxx_messageInfo_Certificate.DiscardUnknown(m) -} - -var xxx_messageInfo_Certificate proto.InternalMessageInfo - -// Symmetric keys to encrypt inter-agent communication. -type EncryptionKey struct { - // Agent subsystem the key is intended for. Example: - // networking:gossip - Subsystem string `protobuf:"bytes,1,opt,name=subsystem,proto3" json:"subsystem,omitempty"` - Algorithm EncryptionKey_Algorithm `protobuf:"varint,2,opt,name=algorithm,proto3,enum=docker.swarmkit.v1.EncryptionKey_Algorithm" json:"algorithm,omitempty"` - Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - // Time stamp from the lamport clock of the key allocator to - // identify the relative age of the key. - LamportTime uint64 `protobuf:"varint,4,opt,name=lamport_time,json=lamportTime,proto3" json:"lamport_time,omitempty"` -} - -func (m *EncryptionKey) Reset() { *m = EncryptionKey{} } -func (*EncryptionKey) ProtoMessage() {} -func (*EncryptionKey) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{46} -} -func (m *EncryptionKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EncryptionKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EncryptionKey.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EncryptionKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_EncryptionKey.Merge(m, src) -} -func (m *EncryptionKey) XXX_Size() int { - return m.Size() -} -func (m *EncryptionKey) XXX_DiscardUnknown() { - xxx_messageInfo_EncryptionKey.DiscardUnknown(m) -} - -var xxx_messageInfo_EncryptionKey proto.InternalMessageInfo - -// ManagerStatus provides informations about the state of a manager in the cluster. -type ManagerStatus struct { - // RaftID specifies the internal ID used by the manager in a raft context, it can never be modified - // and is used only for information purposes - RaftID uint64 `protobuf:"varint,1,opt,name=raft_id,json=raftId,proto3" json:"raft_id,omitempty"` - // Addr is the address advertised to raft. - Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` - // Leader is set to true if this node is the raft leader. - Leader bool `protobuf:"varint,3,opt,name=leader,proto3" json:"leader,omitempty"` - // Reachability specifies whether this node is reachable. - Reachability RaftMemberStatus_Reachability `protobuf:"varint,4,opt,name=reachability,proto3,enum=docker.swarmkit.v1.RaftMemberStatus_Reachability" json:"reachability,omitempty"` -} - -func (m *ManagerStatus) Reset() { *m = ManagerStatus{} } -func (*ManagerStatus) ProtoMessage() {} -func (*ManagerStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{47} -} -func (m *ManagerStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ManagerStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ManagerStatus.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ManagerStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_ManagerStatus.Merge(m, src) -} -func (m *ManagerStatus) XXX_Size() int { - return m.Size() -} -func (m *ManagerStatus) XXX_DiscardUnknown() { - xxx_messageInfo_ManagerStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_ManagerStatus proto.InternalMessageInfo - -// FileTarget represents a specific target that is backed by a file -type FileTarget struct { - // Name represents the final filename in the filesystem - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // UID represents the file UID - UID string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` - // GID represents the file GID - GID string `protobuf:"bytes,3,opt,name=gid,proto3" json:"gid,omitempty"` - // Mode represents the FileMode of the file - Mode os.FileMode `protobuf:"varint,4,opt,name=mode,proto3,customtype=os.FileMode" json:"mode"` -} - -func (m *FileTarget) Reset() { *m = FileTarget{} } -func (*FileTarget) ProtoMessage() {} -func (*FileTarget) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{48} -} -func (m *FileTarget) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FileTarget) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FileTarget.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *FileTarget) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileTarget.Merge(m, src) -} -func (m *FileTarget) XXX_Size() int { - return m.Size() -} -func (m *FileTarget) XXX_DiscardUnknown() { - xxx_messageInfo_FileTarget.DiscardUnknown(m) -} - -var xxx_messageInfo_FileTarget proto.InternalMessageInfo - -// RuntimeTarget represents that this secret is _not_ mounted into the -// container, but is used for some other purpose by the container runtime. -// -// Currently, RuntimeTarget has no fields; it's just a placeholder. -type RuntimeTarget struct { -} - -func (m *RuntimeTarget) Reset() { *m = RuntimeTarget{} } -func (*RuntimeTarget) ProtoMessage() {} -func (*RuntimeTarget) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{49} -} -func (m *RuntimeTarget) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RuntimeTarget) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RuntimeTarget.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RuntimeTarget) XXX_Merge(src proto.Message) { - xxx_messageInfo_RuntimeTarget.Merge(m, src) -} -func (m *RuntimeTarget) XXX_Size() int { - return m.Size() -} -func (m *RuntimeTarget) XXX_DiscardUnknown() { - xxx_messageInfo_RuntimeTarget.DiscardUnknown(m) -} - -var xxx_messageInfo_RuntimeTarget proto.InternalMessageInfo - -// SecretReference is the linkage between a service and a secret that it uses. -type SecretReference struct { - // SecretID represents the ID of the specific Secret that we're - // referencing. This identifier exists so that SecretReferences don't leak - // any information about the secret contents. - SecretID string `protobuf:"bytes,1,opt,name=secret_id,json=secretId,proto3" json:"secret_id,omitempty"` - // SecretName is the name of the secret that this references, but this is just provided for - // lookup/display purposes. The secret in the reference will be identified by its ID. - SecretName string `protobuf:"bytes,2,opt,name=secret_name,json=secretName,proto3" json:"secret_name,omitempty"` - // Target specifies how this secret should be exposed to the task. - // - // Types that are valid to be assigned to Target: - // *SecretReference_File - Target isSecretReference_Target `protobuf_oneof:"target"` -} - -func (m *SecretReference) Reset() { *m = SecretReference{} } -func (*SecretReference) ProtoMessage() {} -func (*SecretReference) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{50} -} -func (m *SecretReference) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SecretReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SecretReference.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SecretReference) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecretReference.Merge(m, src) -} -func (m *SecretReference) XXX_Size() int { - return m.Size() -} -func (m *SecretReference) XXX_DiscardUnknown() { - xxx_messageInfo_SecretReference.DiscardUnknown(m) -} - -var xxx_messageInfo_SecretReference proto.InternalMessageInfo - -type isSecretReference_Target interface { - isSecretReference_Target() - MarshalTo([]byte) (int, error) - Size() int -} - -type SecretReference_File struct { - File *FileTarget `protobuf:"bytes,3,opt,name=file,proto3,oneof" json:"file,omitempty"` -} - -func (*SecretReference_File) isSecretReference_Target() {} - -func (m *SecretReference) GetTarget() isSecretReference_Target { - if m != nil { - return m.Target - } - return nil -} - -func (m *SecretReference) GetFile() *FileTarget { - if x, ok := m.GetTarget().(*SecretReference_File); ok { - return x.File - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*SecretReference) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*SecretReference_File)(nil), - } -} - -// ConfigReference is the linkage between a service and a config that it uses. -type ConfigReference struct { - // ConfigID represents the ID of the specific Config that we're - // referencing. - ConfigID string `protobuf:"bytes,1,opt,name=config_id,json=configId,proto3" json:"config_id,omitempty"` - // ConfigName is the name of the config that this references, but this is just provided for - // lookup/display purposes. The config in the reference will be identified by its ID. - ConfigName string `protobuf:"bytes,2,opt,name=config_name,json=configName,proto3" json:"config_name,omitempty"` - // Target specifies how this config should be exposed to the task. - // - // Types that are valid to be assigned to Target: - // *ConfigReference_File - // *ConfigReference_Runtime - Target isConfigReference_Target `protobuf_oneof:"target"` -} - -func (m *ConfigReference) Reset() { *m = ConfigReference{} } -func (*ConfigReference) ProtoMessage() {} -func (*ConfigReference) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{51} -} -func (m *ConfigReference) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConfigReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConfigReference.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ConfigReference) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigReference.Merge(m, src) -} -func (m *ConfigReference) XXX_Size() int { - return m.Size() -} -func (m *ConfigReference) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigReference.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigReference proto.InternalMessageInfo - -type isConfigReference_Target interface { - isConfigReference_Target() - MarshalTo([]byte) (int, error) - Size() int -} - -type ConfigReference_File struct { - File *FileTarget `protobuf:"bytes,3,opt,name=file,proto3,oneof" json:"file,omitempty"` -} -type ConfigReference_Runtime struct { - Runtime *RuntimeTarget `protobuf:"bytes,4,opt,name=runtime,proto3,oneof" json:"runtime,omitempty"` -} - -func (*ConfigReference_File) isConfigReference_Target() {} -func (*ConfigReference_Runtime) isConfigReference_Target() {} - -func (m *ConfigReference) GetTarget() isConfigReference_Target { - if m != nil { - return m.Target - } - return nil -} - -func (m *ConfigReference) GetFile() *FileTarget { - if x, ok := m.GetTarget().(*ConfigReference_File); ok { - return x.File - } - return nil -} - -func (m *ConfigReference) GetRuntime() *RuntimeTarget { - if x, ok := m.GetTarget().(*ConfigReference_Runtime); ok { - return x.Runtime - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ConfigReference) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ConfigReference_File)(nil), - (*ConfigReference_Runtime)(nil), - } -} - -// BlacklistedCertificate is a record for a blacklisted certificate. It does not -// contain the certificate's CN, because these records are indexed by CN. -type BlacklistedCertificate struct { - // Expiry is the latest known expiration time of a certificate that - // was issued for the given CN. - // Note: can't use stdtime because this field is nullable. - Expiry *types.Timestamp `protobuf:"bytes,1,opt,name=expiry,proto3" json:"expiry,omitempty"` -} - -func (m *BlacklistedCertificate) Reset() { *m = BlacklistedCertificate{} } -func (*BlacklistedCertificate) ProtoMessage() {} -func (*BlacklistedCertificate) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{52} -} -func (m *BlacklistedCertificate) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BlacklistedCertificate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlacklistedCertificate.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *BlacklistedCertificate) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlacklistedCertificate.Merge(m, src) -} -func (m *BlacklistedCertificate) XXX_Size() int { - return m.Size() -} -func (m *BlacklistedCertificate) XXX_DiscardUnknown() { - xxx_messageInfo_BlacklistedCertificate.DiscardUnknown(m) -} - -var xxx_messageInfo_BlacklistedCertificate proto.InternalMessageInfo - -// HealthConfig holds configuration settings for the HEALTHCHECK feature. -type HealthConfig struct { - // Test is the test to perform to check that the container is healthy. - // An empty slice means to inherit the default. - // The options are: - // {} : inherit healthcheck - // {"NONE"} : disable healthcheck - // {"CMD", args...} : exec arguments directly - // {"CMD-SHELL", command} : run command with system's default shell - Test []string `protobuf:"bytes,1,rep,name=test,proto3" json:"test,omitempty"` - // Interval is the time to wait between checks. Zero means inherit. - // Note: can't use stdduration because this field needs to be nullable. - Interval *types.Duration `protobuf:"bytes,2,opt,name=interval,proto3" json:"interval,omitempty"` - // Timeout is the time to wait before considering the check to have hung. - // Zero means inherit. - // Note: can't use stdduration because this field needs to be nullable. - Timeout *types.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` - // Retries is the number of consecutive failures needed to consider a - // container as unhealthy. Zero means inherit. - Retries int32 `protobuf:"varint,4,opt,name=retries,proto3" json:"retries,omitempty"` - // Start period is the period for container initialization during - // which health check failures will note count towards the maximum - // number of retries. - StartPeriod *types.Duration `protobuf:"bytes,5,opt,name=start_period,json=startPeriod,proto3" json:"start_period,omitempty"` - // StartInterval is the time to wait between checks during the start period. - // Zero means inherit. - // Note: can't use stdduration because this field needs to be nullable. - StartInterval *types.Duration `protobuf:"bytes,6,opt,name=start_interval,json=startInterval,proto3" json:"start_interval,omitempty"` -} - -func (m *HealthConfig) Reset() { *m = HealthConfig{} } -func (*HealthConfig) ProtoMessage() {} -func (*HealthConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{53} -} -func (m *HealthConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HealthConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HealthConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HealthConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_HealthConfig.Merge(m, src) -} -func (m *HealthConfig) XXX_Size() int { - return m.Size() -} -func (m *HealthConfig) XXX_DiscardUnknown() { - xxx_messageInfo_HealthConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_HealthConfig proto.InternalMessageInfo - -type MaybeEncryptedRecord struct { - Algorithm MaybeEncryptedRecord_Algorithm `protobuf:"varint,1,opt,name=algorithm,proto3,enum=docker.swarmkit.v1.MaybeEncryptedRecord_Algorithm" json:"algorithm,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Nonce []byte `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"` -} - -func (m *MaybeEncryptedRecord) Reset() { *m = MaybeEncryptedRecord{} } -func (*MaybeEncryptedRecord) ProtoMessage() {} -func (*MaybeEncryptedRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{54} -} -func (m *MaybeEncryptedRecord) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MaybeEncryptedRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MaybeEncryptedRecord.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MaybeEncryptedRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_MaybeEncryptedRecord.Merge(m, src) -} -func (m *MaybeEncryptedRecord) XXX_Size() int { - return m.Size() -} -func (m *MaybeEncryptedRecord) XXX_DiscardUnknown() { - xxx_messageInfo_MaybeEncryptedRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_MaybeEncryptedRecord proto.InternalMessageInfo - -type RootRotation struct { - CACert []byte `protobuf:"bytes,1,opt,name=ca_cert,json=caCert,proto3" json:"ca_cert,omitempty"` - CAKey []byte `protobuf:"bytes,2,opt,name=ca_key,json=caKey,proto3" json:"ca_key,omitempty"` - // cross-signed CA cert is the CACert that has been cross-signed by the previous root - CrossSignedCACert []byte `protobuf:"bytes,3,opt,name=cross_signed_ca_cert,json=crossSignedCaCert,proto3" json:"cross_signed_ca_cert,omitempty"` -} - -func (m *RootRotation) Reset() { *m = RootRotation{} } -func (*RootRotation) ProtoMessage() {} -func (*RootRotation) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{55} -} -func (m *RootRotation) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RootRotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RootRotation.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RootRotation) XXX_Merge(src proto.Message) { - xxx_messageInfo_RootRotation.Merge(m, src) -} -func (m *RootRotation) XXX_Size() int { - return m.Size() -} -func (m *RootRotation) XXX_DiscardUnknown() { - xxx_messageInfo_RootRotation.DiscardUnknown(m) -} - -var xxx_messageInfo_RootRotation proto.InternalMessageInfo - -// Privileges specifies security configuration/permissions. -type Privileges struct { - CredentialSpec *Privileges_CredentialSpec `protobuf:"bytes,1,opt,name=credential_spec,json=credentialSpec,proto3" json:"credential_spec,omitempty"` - SELinuxContext *Privileges_SELinuxContext `protobuf:"bytes,2,opt,name=selinux_context,json=selinuxContext,proto3" json:"selinux_context,omitempty"` - Seccomp *Privileges_SeccompOpts `protobuf:"bytes,3,opt,name=seccomp,proto3" json:"seccomp,omitempty"` - Apparmor *Privileges_AppArmorOpts `protobuf:"bytes,4,opt,name=apparmor,proto3" json:"apparmor,omitempty"` - // NoNewPrivileges, if set to true, disables the container from gaining new - // privileges. See https://docs.kernel.org/userspace-api/no_new_privs.html - // for details. - NoNewPrivileges bool `protobuf:"varint,5,opt,name=no_new_privileges,json=noNewPrivileges,proto3" json:"no_new_privileges,omitempty"` -} - -func (m *Privileges) Reset() { *m = Privileges{} } -func (*Privileges) ProtoMessage() {} -func (*Privileges) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{56} -} -func (m *Privileges) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Privileges) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Privileges.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Privileges) XXX_Merge(src proto.Message) { - xxx_messageInfo_Privileges.Merge(m, src) -} -func (m *Privileges) XXX_Size() int { - return m.Size() -} -func (m *Privileges) XXX_DiscardUnknown() { - xxx_messageInfo_Privileges.DiscardUnknown(m) -} - -var xxx_messageInfo_Privileges proto.InternalMessageInfo - -// CredentialSpec for managed service account (Windows only). -type Privileges_CredentialSpec struct { - // Types that are valid to be assigned to Source: - // *Privileges_CredentialSpec_File - // *Privileges_CredentialSpec_Registry - // *Privileges_CredentialSpec_Config - Source isPrivileges_CredentialSpec_Source `protobuf_oneof:"source"` -} - -func (m *Privileges_CredentialSpec) Reset() { *m = Privileges_CredentialSpec{} } -func (*Privileges_CredentialSpec) ProtoMessage() {} -func (*Privileges_CredentialSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{56, 0} -} -func (m *Privileges_CredentialSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Privileges_CredentialSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Privileges_CredentialSpec.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Privileges_CredentialSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_Privileges_CredentialSpec.Merge(m, src) -} -func (m *Privileges_CredentialSpec) XXX_Size() int { - return m.Size() -} -func (m *Privileges_CredentialSpec) XXX_DiscardUnknown() { - xxx_messageInfo_Privileges_CredentialSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_Privileges_CredentialSpec proto.InternalMessageInfo - -type isPrivileges_CredentialSpec_Source interface { - isPrivileges_CredentialSpec_Source() - MarshalTo([]byte) (int, error) - Size() int -} - -type Privileges_CredentialSpec_File struct { - File string `protobuf:"bytes,1,opt,name=file,proto3,oneof" json:"file,omitempty"` -} -type Privileges_CredentialSpec_Registry struct { - Registry string `protobuf:"bytes,2,opt,name=registry,proto3,oneof" json:"registry,omitempty"` -} -type Privileges_CredentialSpec_Config struct { - Config string `protobuf:"bytes,3,opt,name=config,proto3,oneof" json:"config,omitempty"` -} - -func (*Privileges_CredentialSpec_File) isPrivileges_CredentialSpec_Source() {} -func (*Privileges_CredentialSpec_Registry) isPrivileges_CredentialSpec_Source() {} -func (*Privileges_CredentialSpec_Config) isPrivileges_CredentialSpec_Source() {} - -func (m *Privileges_CredentialSpec) GetSource() isPrivileges_CredentialSpec_Source { - if m != nil { - return m.Source - } - return nil -} - -func (m *Privileges_CredentialSpec) GetFile() string { - if x, ok := m.GetSource().(*Privileges_CredentialSpec_File); ok { - return x.File - } - return "" -} - -func (m *Privileges_CredentialSpec) GetRegistry() string { - if x, ok := m.GetSource().(*Privileges_CredentialSpec_Registry); ok { - return x.Registry - } - return "" -} - -func (m *Privileges_CredentialSpec) GetConfig() string { - if x, ok := m.GetSource().(*Privileges_CredentialSpec_Config); ok { - return x.Config - } - return "" -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Privileges_CredentialSpec) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Privileges_CredentialSpec_File)(nil), - (*Privileges_CredentialSpec_Registry)(nil), - (*Privileges_CredentialSpec_Config)(nil), - } -} - -// SELinuxContext contains the SELinux labels for the container. -type Privileges_SELinuxContext struct { - Disable bool `protobuf:"varint,1,opt,name=disable,proto3" json:"disable,omitempty"` - User string `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` - Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` - Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` - Level string `protobuf:"bytes,5,opt,name=level,proto3" json:"level,omitempty"` -} - -func (m *Privileges_SELinuxContext) Reset() { *m = Privileges_SELinuxContext{} } -func (*Privileges_SELinuxContext) ProtoMessage() {} -func (*Privileges_SELinuxContext) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{56, 1} -} -func (m *Privileges_SELinuxContext) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Privileges_SELinuxContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Privileges_SELinuxContext.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Privileges_SELinuxContext) XXX_Merge(src proto.Message) { - xxx_messageInfo_Privileges_SELinuxContext.Merge(m, src) -} -func (m *Privileges_SELinuxContext) XXX_Size() int { - return m.Size() -} -func (m *Privileges_SELinuxContext) XXX_DiscardUnknown() { - xxx_messageInfo_Privileges_SELinuxContext.DiscardUnknown(m) -} - -var xxx_messageInfo_Privileges_SELinuxContext proto.InternalMessageInfo - -// SeccompOpts contains options for configuring seccomp profiles on the -// container. See https://docs.docker.com/engine/security/seccomp/ for more -// information. -type Privileges_SeccompOpts struct { - Mode Privileges_SeccompOpts_SeccompMode `protobuf:"varint,1,opt,name=mode,proto3,enum=docker.swarmkit.v1.Privileges_SeccompOpts_SeccompMode" json:"mode,omitempty"` - // Profile contains the json definition of the seccomp profile to use, - // if Mode is set to custom. - Profile []byte `protobuf:"bytes,2,opt,name=profile,proto3" json:"profile,omitempty"` -} - -func (m *Privileges_SeccompOpts) Reset() { *m = Privileges_SeccompOpts{} } -func (*Privileges_SeccompOpts) ProtoMessage() {} -func (*Privileges_SeccompOpts) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{56, 2} -} -func (m *Privileges_SeccompOpts) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Privileges_SeccompOpts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Privileges_SeccompOpts.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Privileges_SeccompOpts) XXX_Merge(src proto.Message) { - xxx_messageInfo_Privileges_SeccompOpts.Merge(m, src) -} -func (m *Privileges_SeccompOpts) XXX_Size() int { - return m.Size() -} -func (m *Privileges_SeccompOpts) XXX_DiscardUnknown() { - xxx_messageInfo_Privileges_SeccompOpts.DiscardUnknown(m) -} - -var xxx_messageInfo_Privileges_SeccompOpts proto.InternalMessageInfo - -// AppArmorOpts contains options for configuring AppArmor profiles on the -// container. Currently, custom profiles are not supported. See -// https://docs.docker.com/engine/security/apparmor/ for more information. -type Privileges_AppArmorOpts struct { - Mode Privileges_AppArmorOpts_AppArmorMode `protobuf:"varint,1,opt,name=mode,proto3,enum=docker.swarmkit.v1.Privileges_AppArmorOpts_AppArmorMode" json:"mode,omitempty"` -} - -func (m *Privileges_AppArmorOpts) Reset() { *m = Privileges_AppArmorOpts{} } -func (*Privileges_AppArmorOpts) ProtoMessage() {} -func (*Privileges_AppArmorOpts) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{56, 3} -} -func (m *Privileges_AppArmorOpts) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Privileges_AppArmorOpts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Privileges_AppArmorOpts.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Privileges_AppArmorOpts) XXX_Merge(src proto.Message) { - xxx_messageInfo_Privileges_AppArmorOpts.Merge(m, src) -} -func (m *Privileges_AppArmorOpts) XXX_Size() int { - return m.Size() -} -func (m *Privileges_AppArmorOpts) XXX_DiscardUnknown() { - xxx_messageInfo_Privileges_AppArmorOpts.DiscardUnknown(m) -} - -var xxx_messageInfo_Privileges_AppArmorOpts proto.InternalMessageInfo - -// JobStatus indicates the status of a Service that is in one of the Job modes. -type JobStatus struct { - // JobIteration is the count of how many times the Job has been excecuted, - // successfully or otherwise. "Executed" refers to the job as a whole being - // started, not to the individual Tasks being launched. This is used to - // disambiguate which Tasks belong to which iteration of a Job. - JobIteration Version `protobuf:"bytes,1,opt,name=job_iteration,json=jobIteration,proto3" json:"job_iteration"` - // LastExecution is the time that the job was last executed. This is set by - // the orchestrator in the same transaction that JobIteration is incremented. - // While time is a fungible concept in distributed systems like Swarmkit, - // this value gives us a best-effort attempt to prevent weird behavior like - // newly added nodes executing long-forgotten jobs. - LastExecution *types.Timestamp `protobuf:"bytes,2,opt,name=last_execution,json=lastExecution,proto3" json:"last_execution,omitempty"` -} - -func (m *JobStatus) Reset() { *m = JobStatus{} } -func (*JobStatus) ProtoMessage() {} -func (*JobStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{57} -} -func (m *JobStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *JobStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_JobStatus.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *JobStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_JobStatus.Merge(m, src) -} -func (m *JobStatus) XXX_Size() int { - return m.Size() -} -func (m *JobStatus) XXX_DiscardUnknown() { - xxx_messageInfo_JobStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_JobStatus proto.InternalMessageInfo - -// VolumeAccessMode is the access mode of the volume, and is used to determine -// the CSI AccessMode value, as well as the volume access type (block vs -// mount). In this way, it is more similar to the CSI VolumeCapability message. -// -// This defines how and where a volume can be accessed by more than -// one Task, but does not imply anything about the accessible topology of the -// volume. -// -// For analogy, a flash drive can be used on many computers, but only one of -// them at a time, and so would have a scope of "Single". But, it can be used -// by any number of programs simultaneously, so would have a sharing of "All". -type VolumeAccessMode struct { - // Scope defines on how many nodes this volume can be accessed - // simultaneously. If unset, will default to the zero-value of SINGLE_NODE. - Scope VolumeAccessMode_Scope `protobuf:"varint,1,opt,name=scope,proto3,enum=docker.swarmkit.v1.VolumeAccessMode_Scope" json:"scope,omitempty"` - // Sharing defines how many tasks can use this volume at the same time, and - // in what way. If unset, will default to the zero-value of NONE. - Sharing VolumeAccessMode_Sharing `protobuf:"varint,2,opt,name=sharing,proto3,enum=docker.swarmkit.v1.VolumeAccessMode_Sharing" json:"sharing,omitempty"` - // AccessType defines the access type of the volume. Unlike Sharing and - // Scope, Swarmkit itself doesn't define either of these as a default, but - // but the upstream is free to do so. However, one of these MUST be set. - // - // Types that are valid to be assigned to AccessType: - // *VolumeAccessMode_Block - // *VolumeAccessMode_Mount - AccessType isVolumeAccessMode_AccessType `protobuf_oneof:"access_type"` -} - -func (m *VolumeAccessMode) Reset() { *m = VolumeAccessMode{} } -func (*VolumeAccessMode) ProtoMessage() {} -func (*VolumeAccessMode) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{58} -} -func (m *VolumeAccessMode) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeAccessMode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VolumeAccessMode.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VolumeAccessMode) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeAccessMode.Merge(m, src) -} -func (m *VolumeAccessMode) XXX_Size() int { - return m.Size() -} -func (m *VolumeAccessMode) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeAccessMode.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeAccessMode proto.InternalMessageInfo - -type isVolumeAccessMode_AccessType interface { - isVolumeAccessMode_AccessType() - MarshalTo([]byte) (int, error) - Size() int -} - -type VolumeAccessMode_Block struct { - Block *VolumeAccessMode_BlockVolume `protobuf:"bytes,3,opt,name=block,proto3,oneof" json:"block,omitempty"` -} -type VolumeAccessMode_Mount struct { - Mount *VolumeAccessMode_MountVolume `protobuf:"bytes,4,opt,name=mount,proto3,oneof" json:"mount,omitempty"` -} - -func (*VolumeAccessMode_Block) isVolumeAccessMode_AccessType() {} -func (*VolumeAccessMode_Mount) isVolumeAccessMode_AccessType() {} - -func (m *VolumeAccessMode) GetAccessType() isVolumeAccessMode_AccessType { - if m != nil { - return m.AccessType - } - return nil -} - -func (m *VolumeAccessMode) GetBlock() *VolumeAccessMode_BlockVolume { - if x, ok := m.GetAccessType().(*VolumeAccessMode_Block); ok { - return x.Block - } - return nil -} - -func (m *VolumeAccessMode) GetMount() *VolumeAccessMode_MountVolume { - if x, ok := m.GetAccessType().(*VolumeAccessMode_Mount); ok { - return x.Mount - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*VolumeAccessMode) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*VolumeAccessMode_Block)(nil), - (*VolumeAccessMode_Mount)(nil), - } -} - -// BlockVolume indicates the volume will be accessed with the block device -// API. -type VolumeAccessMode_BlockVolume struct { -} - -func (m *VolumeAccessMode_BlockVolume) Reset() { *m = VolumeAccessMode_BlockVolume{} } -func (*VolumeAccessMode_BlockVolume) ProtoMessage() {} -func (*VolumeAccessMode_BlockVolume) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{58, 0} -} -func (m *VolumeAccessMode_BlockVolume) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeAccessMode_BlockVolume) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VolumeAccessMode_BlockVolume.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VolumeAccessMode_BlockVolume) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeAccessMode_BlockVolume.Merge(m, src) -} -func (m *VolumeAccessMode_BlockVolume) XXX_Size() int { - return m.Size() -} -func (m *VolumeAccessMode_BlockVolume) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeAccessMode_BlockVolume.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeAccessMode_BlockVolume proto.InternalMessageInfo - -// MountVolume indicates the volume will be access with the filesystem API. -type VolumeAccessMode_MountVolume struct { - // FsType is the filesystem type. This field is optional, and an empty - // string is equal to an unspecified value. - FsType string `protobuf:"bytes,1,opt,name=fs_type,json=fsType,proto3" json:"fs_type,omitempty"` - // MountFlags indicates mount options to be used for the volume. This - // field is optional, and may contain sensitive data. - MountFlags []string `protobuf:"bytes,2,rep,name=mount_flags,json=mountFlags,proto3" json:"mount_flags,omitempty"` -} - -func (m *VolumeAccessMode_MountVolume) Reset() { *m = VolumeAccessMode_MountVolume{} } -func (*VolumeAccessMode_MountVolume) ProtoMessage() {} -func (*VolumeAccessMode_MountVolume) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{58, 1} -} -func (m *VolumeAccessMode_MountVolume) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeAccessMode_MountVolume) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VolumeAccessMode_MountVolume.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VolumeAccessMode_MountVolume) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeAccessMode_MountVolume.Merge(m, src) -} -func (m *VolumeAccessMode_MountVolume) XXX_Size() int { - return m.Size() -} -func (m *VolumeAccessMode_MountVolume) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeAccessMode_MountVolume.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeAccessMode_MountVolume proto.InternalMessageInfo - -// VolumeSecret indicates a secret value that must be passed to CSI plugin -// operations. -type VolumeSecret struct { - // Key represents the key that will be passed as a controller secret to the - // CSI plugin. - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Secret represents the swarmkit Secret object from which to read data to - // use as the value to pass to the CSI plugin. This can be either a secret - // name or ID. - // - // TODO(dperny): should this be a SecretReference instead? - Secret string `protobuf:"bytes,2,opt,name=secret,proto3" json:"secret,omitempty"` -} - -func (m *VolumeSecret) Reset() { *m = VolumeSecret{} } -func (*VolumeSecret) ProtoMessage() {} -func (*VolumeSecret) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{59} -} -func (m *VolumeSecret) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeSecret) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VolumeSecret.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VolumeSecret) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeSecret.Merge(m, src) -} -func (m *VolumeSecret) XXX_Size() int { - return m.Size() -} -func (m *VolumeSecret) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeSecret.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeSecret proto.InternalMessageInfo - -// VolumePublishStatus contains information about the volume's publishing to a -// specific node. -// -// Publishing or unpublishing a volume to a node is a two-step process. -// -// When a Volume is needed on a Node, a VolumePublishStatus with state -// PendingPublish is added. This indicates that the volume should be published, -// but the RPCs have not been executed. -// -// Then, afterward, ControllerPublishVolume is called for the Volume, and the -// State is changed to Published, indicating that the call was a success. -// -// When a Volume is no longer needed, the process is similar, with the State -// being changed to PendingUnpublish. When ControllerUnpublishVolume succeeds, -// the PublishStatus for that Node is simply removed. -// -// Without this two-step process, the following could happen: -// -// 1. ControllerPublishVolume is called and the Volume is successfully -// published. -// 2. A crash or leadership change disrupts the cluster before -// the Volume with the updated VolumePublishStatus can be added to the -// store. -// 3. The Task that required the Volume to be published is deleted. -// -// In this case, the Volume would be published to the Node, but Swarm would be -// unaware of this, and would additionally be unaware that the Volume _should_ -// be published to the Node. -// -// By first committing our intention to publish a Volume, we guarantee that the -// Volume itself is sufficient to know which Nodes it may have been published -// to. -type VolumePublishStatus struct { - // NodeID is the swarm (not CSI plugin) node ID that this volume is - // published to. - NodeID string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // State is the publish state of the volume. - State VolumePublishStatus_State `protobuf:"varint,2,opt,name=state,proto3,enum=docker.swarmkit.v1.VolumePublishStatus_State" json:"state,omitempty"` - // PublishContext is the same PublishContext returned by a call to - // ControllerPublishVolume. - PublishContext map[string]string `protobuf:"bytes,3,rep,name=publish_context,json=publishContext,proto3" json:"publish_context,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Message is a human-readable message explaining the state of the volume. - // It exists to convey the current situation with the volume to the user, - // allowing, for example, the user to see error messages why a volume might - // not be published yet. - Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` -} - -func (m *VolumePublishStatus) Reset() { *m = VolumePublishStatus{} } -func (*VolumePublishStatus) ProtoMessage() {} -func (*VolumePublishStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{60} -} -func (m *VolumePublishStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumePublishStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VolumePublishStatus.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VolumePublishStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumePublishStatus.Merge(m, src) -} -func (m *VolumePublishStatus) XXX_Size() int { - return m.Size() -} -func (m *VolumePublishStatus) XXX_DiscardUnknown() { - xxx_messageInfo_VolumePublishStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumePublishStatus proto.InternalMessageInfo - -// VolumeInfo contains information about the volume originating from the CSI -// plugin. -type VolumeInfo struct { - // CapacityBytes is the capacity of this volume in bytes. A value of 0 - // indicates that the capcity is unknown. - CapacityBytes int64 `protobuf:"varint,1,opt,name=capacity_bytes,json=capacityBytes,proto3" json:"capacity_bytes,omitempty"` - // VolumeContext includes fields that are opaque to Swarmkit. - VolumeContext map[string]string `protobuf:"bytes,2,rep,name=volume_context,json=volumeContext,proto3" json:"volume_context,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // VolumeID is the ID of the volume as reported by the CSI plugin. - // Information about the volume is not cached in swarmkit's object store; - // instead, it is retrieved on-demand as needed. If the VolumeID field is an - // empty string, and the plugin advertises CREATE_DELETE_VOLUME capability, - // then Swarmkit has not yet called CreateVolume. - VolumeID string `protobuf:"bytes,3,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` - // AccessibleTopology is the topology this volume is actually accessible - // from. - AccessibleTopology []*Topology `protobuf:"bytes,4,rep,name=accessible_topology,json=accessibleTopology,proto3" json:"accessible_topology,omitempty"` -} - -func (m *VolumeInfo) Reset() { *m = VolumeInfo{} } -func (*VolumeInfo) ProtoMessage() {} -func (*VolumeInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{61} -} -func (m *VolumeInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VolumeInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VolumeInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeInfo.Merge(m, src) -} -func (m *VolumeInfo) XXX_Size() int { - return m.Size() -} -func (m *VolumeInfo) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeInfo proto.InternalMessageInfo - -// CapacityRange describes the minimum and maximum capacity a volume should be -// created with. -type CapacityRange struct { - // RequiredBytes specifies that a volume must be at least this big. The value - // of 0 indicates an unspecified minimum. Must not be negative. - RequiredBytes int64 `protobuf:"varint,1,opt,name=required_bytes,json=requiredBytes,proto3" json:"required_bytes,omitempty"` - // LimitBytes specifies that a volume must not be bigger than this. The value - // of 0 indicates an unspecified maximum. Must not be negative. - LimitBytes int64 `protobuf:"varint,2,opt,name=limit_bytes,json=limitBytes,proto3" json:"limit_bytes,omitempty"` -} - -func (m *CapacityRange) Reset() { *m = CapacityRange{} } -func (*CapacityRange) ProtoMessage() {} -func (*CapacityRange) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{62} -} -func (m *CapacityRange) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CapacityRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CapacityRange.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CapacityRange) XXX_Merge(src proto.Message) { - xxx_messageInfo_CapacityRange.Merge(m, src) -} -func (m *CapacityRange) XXX_Size() int { - return m.Size() -} -func (m *CapacityRange) XXX_DiscardUnknown() { - xxx_messageInfo_CapacityRange.DiscardUnknown(m) -} - -var xxx_messageInfo_CapacityRange proto.InternalMessageInfo - -// VolumeAssignment contains the information needed by a Node to use a CSI -// volume. This includes the information need to Stage and Publish the volume -// on the node, but never the full Volume object. -type VolumeAssignment struct { - // ID is the swarmkit ID for the volume. This is used by swarmkit components - // to identify the volume. - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // VolumeID is the CSI volume ID as returned from CreateVolume. This is used - // by the CSI driver to identify the volume. - VolumeID string `protobuf:"bytes,2,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` - // Driver is the CSI Driver that this volume is managed by. - Driver *Driver `protobuf:"bytes,3,opt,name=driver,proto3" json:"driver,omitempty"` - // VolumeContext is a map returned from the CSI Controller service when a - // Volume is created. It is optional for the driver to provide, but if it is - // provided, it must be passed to subsequent calls. - VolumeContext map[string]string `protobuf:"bytes,4,rep,name=volume_context,json=volumeContext,proto3" json:"volume_context,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // PublishContext is a map returned from the Controller service when - // ControllerPublishVolume is called. Again, it is optional, but if provided, - // must be passed. - PublishContext map[string]string `protobuf:"bytes,5,rep,name=publish_context,json=publishContext,proto3" json:"publish_context,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // AccessMode specifies the access mode of the volume. - AccessMode *VolumeAccessMode `protobuf:"bytes,6,opt,name=access_mode,json=accessMode,proto3" json:"access_mode,omitempty"` - // Secrets is the set of secrets required by the CSI plugin. These refer to - // swarmkit Secrets that will be distributed separately to the node. - Secrets []*VolumeSecret `protobuf:"bytes,7,rep,name=secrets,proto3" json:"secrets,omitempty"` -} - -func (m *VolumeAssignment) Reset() { *m = VolumeAssignment{} } -func (*VolumeAssignment) ProtoMessage() {} -func (*VolumeAssignment) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{63} -} -func (m *VolumeAssignment) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeAssignment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VolumeAssignment.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VolumeAssignment) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeAssignment.Merge(m, src) -} -func (m *VolumeAssignment) XXX_Size() int { - return m.Size() -} -func (m *VolumeAssignment) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeAssignment.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeAssignment proto.InternalMessageInfo - -// VolumeAttachment is the information associating a Volume with a Task. -type VolumeAttachment struct { - // ID is the swarmkit ID of the volume assigned to this task, not the CSI - // volume ID. - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Source indicates the Mount source that this volume is assigned for. - Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` - // Target indicates the Mount target that this volume is assigned for. - Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"` -} - -func (m *VolumeAttachment) Reset() { *m = VolumeAttachment{} } -func (*VolumeAttachment) ProtoMessage() {} -func (*VolumeAttachment) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{64} -} -func (m *VolumeAttachment) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeAttachment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VolumeAttachment.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VolumeAttachment) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeAttachment.Merge(m, src) -} -func (m *VolumeAttachment) XXX_Size() int { - return m.Size() -} -func (m *VolumeAttachment) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeAttachment.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeAttachment proto.InternalMessageInfo - -// TopologyRequirement expresses the user's requirements for a volume's -// accessible topology. -type TopologyRequirement struct { - // Specifies the list of topologies the provisioned volume MUST be - // accessible from. - // This field is OPTIONAL. If TopologyRequirement is specified either - // requisite or preferred or both MUST be specified. - // - // If requisite is specified, the provisioned volume MUST be - // accessible from at least one of the requisite topologies. - // - // Given - // x = number of topologies provisioned volume is accessible from - // n = number of requisite topologies - // The CO MUST ensure n >= 1. The SP MUST ensure x >= 1 - // If x==n, then the SP MUST make the provisioned volume available to - // all topologies from the list of requisite topologies. If it is - // unable to do so, the SP MUST fail the CreateVolume call. - // For example, if a volume should be accessible from a single zone, - // and requisite = - // {"region": "R1", "zone": "Z2"} - // then the provisioned volume MUST be accessible from the "region" - // "R1" and the "zone" "Z2". - // Similarly, if a volume should be accessible from two zones, and - // requisite = - // {"region": "R1", "zone": "Z2"}, - // {"region": "R1", "zone": "Z3"} - // then the provisioned volume MUST be accessible from the "region" - // "R1" and both "zone" "Z2" and "zone" "Z3". - // - // If xn, then the SP MUST make the provisioned volume available from - // all topologies from the list of requisite topologies and MAY choose - // the remaining x-n unique topologies from the list of all possible - // topologies. If it is unable to do so, the SP MUST fail the - // CreateVolume call. - // For example, if a volume should be accessible from two zones, and - // requisite = - // {"region": "R1", "zone": "Z2"} - // then the provisioned volume MUST be accessible from the "region" - // "R1" and the "zone" "Z2" and the SP may select the second zone - // independently, e.g. "R1/Z4". - Requisite []*Topology `protobuf:"bytes,1,rep,name=requisite,proto3" json:"requisite,omitempty"` - // Specifies the list of topologies the CO would prefer the volume to - // be provisioned in. - // - // This field is OPTIONAL. If TopologyRequirement is specified either - // requisite or preferred or both MUST be specified. - // - // An SP MUST attempt to make the provisioned volume available using - // the preferred topologies in order from first to last. - // - // If requisite is specified, all topologies in preferred list MUST - // also be present in the list of requisite topologies. - // - // If the SP is unable to to make the provisioned volume available - // from any of the preferred topologies, the SP MAY choose a topology - // from the list of requisite topologies. - // If the list of requisite topologies is not specified, then the SP - // MAY choose from the list of all possible topologies. - // If the list of requisite topologies is specified and the SP is - // unable to to make the provisioned volume available from any of the - // requisite topologies it MUST fail the CreateVolume call. - // - // Example 1: - // Given a volume should be accessible from a single zone, and - // requisite = - // {"region": "R1", "zone": "Z2"}, - // {"region": "R1", "zone": "Z3"} - // preferred = - // {"region": "R1", "zone": "Z3"} - // then the the SP SHOULD first attempt to make the provisioned volume - // available from "zone" "Z3" in the "region" "R1" and fall back to - // "zone" "Z2" in the "region" "R1" if that is not possible. - // - // Example 2: - // Given a volume should be accessible from a single zone, and - // requisite = - // {"region": "R1", "zone": "Z2"}, - // {"region": "R1", "zone": "Z3"}, - // {"region": "R1", "zone": "Z4"}, - // {"region": "R1", "zone": "Z5"} - // preferred = - // {"region": "R1", "zone": "Z4"}, - // {"region": "R1", "zone": "Z2"} - // then the the SP SHOULD first attempt to make the provisioned volume - // accessible from "zone" "Z4" in the "region" "R1" and fall back to - // "zone" "Z2" in the "region" "R1" if that is not possible. If that - // is not possible, the SP may choose between either the "zone" - // "Z3" or "Z5" in the "region" "R1". - // - // Example 3: - // Given a volume should be accessible from TWO zones (because an - // opaque parameter in CreateVolumeRequest, for example, specifies - // the volume is accessible from two zones, aka synchronously - // replicated), and - // requisite = - // {"region": "R1", "zone": "Z2"}, - // {"region": "R1", "zone": "Z3"}, - // {"region": "R1", "zone": "Z4"}, - // {"region": "R1", "zone": "Z5"} - // preferred = - // {"region": "R1", "zone": "Z5"}, - // {"region": "R1", "zone": "Z3"} - // then the the SP SHOULD first attempt to make the provisioned volume - // accessible from the combination of the two "zones" "Z5" and "Z3" in - // the "region" "R1". If that's not possible, it should fall back to - // a combination of "Z5" and other possibilities from the list of - // requisite. If that's not possible, it should fall back to a - // combination of "Z3" and other possibilities from the list of - // requisite. If that's not possible, it should fall back to a - // combination of other possibilities from the list of requisite. - Preferred []*Topology `protobuf:"bytes,2,rep,name=preferred,proto3" json:"preferred,omitempty"` -} - -func (m *TopologyRequirement) Reset() { *m = TopologyRequirement{} } -func (*TopologyRequirement) ProtoMessage() {} -func (*TopologyRequirement) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{65} -} -func (m *TopologyRequirement) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TopologyRequirement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TopologyRequirement.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TopologyRequirement) XXX_Merge(src proto.Message) { - xxx_messageInfo_TopologyRequirement.Merge(m, src) -} -func (m *TopologyRequirement) XXX_Size() int { - return m.Size() -} -func (m *TopologyRequirement) XXX_DiscardUnknown() { - xxx_messageInfo_TopologyRequirement.DiscardUnknown(m) -} - -var xxx_messageInfo_TopologyRequirement proto.InternalMessageInfo - -// Topology is a map of topological domains to topological segments. -// A topological domain is a sub-division of a cluster, like "region", -// "zone", "rack", etc. -// A topological segment is a specific instance of a topological domain, -// like "zone3", "rack3", etc. -// For example {"com.company/zone": "Z1", "com.company/rack": "R3"} -// Valid keys have two segments: an OPTIONAL prefix and name, separated -// by a slash (/), for example: "com.company.example/zone". -// The key name segment is REQUIRED. The prefix is OPTIONAL. -// The key name MUST be 63 characters or less, begin and end with an -// alphanumeric character ([a-z0-9A-Z]), and contain only dashes (-), -// underscores (_), dots (.), or alphanumerics in between, for example -// "zone". -// The key prefix MUST be 63 characters or less, begin and end with a -// lower-case alphanumeric character ([a-z0-9]), contain only -// dashes (-), dots (.), or lower-case alphanumerics in between, and -// follow domain name notation format -// (https://tools.ietf.org/html/rfc1035#section-2.3.1). -// The key prefix SHOULD include the plugin's host company name and/or -// the plugin name, to minimize the possibility of collisions with keys -// from other plugins. -// If a key prefix is specified, it MUST be identical across all -// topology keys returned by the SP (across all RPCs). -// Keys MUST be case-insensitive. Meaning the keys "Zone" and "zone" -// MUST not both exist. -// Each value (topological segment) MUST contain 1 or more strings. -// Each string MUST be 63 characters or less and begin and end with an -// alphanumeric character with '-', '_', '.', or alphanumerics in -// between. -type Topology struct { - Segments map[string]string `protobuf:"bytes,1,rep,name=segments,proto3" json:"segments,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *Topology) Reset() { *m = Topology{} } -func (*Topology) ProtoMessage() {} -func (*Topology) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{66} -} -func (m *Topology) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Topology) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Topology.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Topology) XXX_Merge(src proto.Message) { - xxx_messageInfo_Topology.Merge(m, src) -} -func (m *Topology) XXX_Size() int { - return m.Size() -} -func (m *Topology) XXX_DiscardUnknown() { - xxx_messageInfo_Topology.DiscardUnknown(m) -} - -var xxx_messageInfo_Topology proto.InternalMessageInfo - -// VolumeCapability specifies a capability of a volume. -type VolumeCapability struct { - // Specifies what API the volume will be accessed using. One of the - // following fields MUST be specified. - // - // Types that are valid to be assigned to AccessType: - // *VolumeCapability_Block - // *VolumeCapability_Mount - AccessType isVolumeCapability_AccessType `protobuf_oneof:"access_type"` - // This is a REQUIRED field. - AccessMode *VolumeCapability_AccessMode `protobuf:"bytes,3,opt,name=access_mode,json=accessMode,proto3" json:"access_mode,omitempty"` -} - -func (m *VolumeCapability) Reset() { *m = VolumeCapability{} } -func (*VolumeCapability) ProtoMessage() {} -func (*VolumeCapability) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{67} -} -func (m *VolumeCapability) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeCapability) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VolumeCapability.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VolumeCapability) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeCapability.Merge(m, src) -} -func (m *VolumeCapability) XXX_Size() int { - return m.Size() -} -func (m *VolumeCapability) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeCapability.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeCapability proto.InternalMessageInfo - -type isVolumeCapability_AccessType interface { - isVolumeCapability_AccessType() - MarshalTo([]byte) (int, error) - Size() int -} - -type VolumeCapability_Block struct { - Block *VolumeCapability_BlockVolume `protobuf:"bytes,1,opt,name=block,proto3,oneof" json:"block,omitempty"` -} -type VolumeCapability_Mount struct { - Mount *VolumeCapability_MountVolume `protobuf:"bytes,2,opt,name=mount,proto3,oneof" json:"mount,omitempty"` -} - -func (*VolumeCapability_Block) isVolumeCapability_AccessType() {} -func (*VolumeCapability_Mount) isVolumeCapability_AccessType() {} - -func (m *VolumeCapability) GetAccessType() isVolumeCapability_AccessType { - if m != nil { - return m.AccessType - } - return nil -} - -func (m *VolumeCapability) GetBlock() *VolumeCapability_BlockVolume { - if x, ok := m.GetAccessType().(*VolumeCapability_Block); ok { - return x.Block - } - return nil -} - -func (m *VolumeCapability) GetMount() *VolumeCapability_MountVolume { - if x, ok := m.GetAccessType().(*VolumeCapability_Mount); ok { - return x.Mount - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*VolumeCapability) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*VolumeCapability_Block)(nil), - (*VolumeCapability_Mount)(nil), - } -} - -// Indicate that the volume will be accessed via the block device API. -type VolumeCapability_BlockVolume struct { -} - -func (m *VolumeCapability_BlockVolume) Reset() { *m = VolumeCapability_BlockVolume{} } -func (*VolumeCapability_BlockVolume) ProtoMessage() {} -func (*VolumeCapability_BlockVolume) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{67, 0} -} -func (m *VolumeCapability_BlockVolume) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeCapability_BlockVolume) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VolumeCapability_BlockVolume.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VolumeCapability_BlockVolume) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeCapability_BlockVolume.Merge(m, src) -} -func (m *VolumeCapability_BlockVolume) XXX_Size() int { - return m.Size() -} -func (m *VolumeCapability_BlockVolume) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeCapability_BlockVolume.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeCapability_BlockVolume proto.InternalMessageInfo - -// Indicate that the volume will be accessed via the filesystem API. -type VolumeCapability_MountVolume struct { - // The filesystem type. This field is OPTIONAL. - // An empty string is equal to an unspecified field value. - FsType string `protobuf:"bytes,1,opt,name=fs_type,json=fsType,proto3" json:"fs_type,omitempty"` - // The mount options that can be used for the volume. This field is - // OPTIONAL. `mount_flags` MAY contain sensitive information. - // Therefore, the CO and the Plugin MUST NOT leak this information - // to untrusted entities. The total size of this repeated field - // SHALL NOT exceed 4 KiB. - MountFlags []string `protobuf:"bytes,2,rep,name=mount_flags,json=mountFlags,proto3" json:"mount_flags,omitempty"` -} - -func (m *VolumeCapability_MountVolume) Reset() { *m = VolumeCapability_MountVolume{} } -func (*VolumeCapability_MountVolume) ProtoMessage() {} -func (*VolumeCapability_MountVolume) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{67, 1} -} -func (m *VolumeCapability_MountVolume) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeCapability_MountVolume) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VolumeCapability_MountVolume.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VolumeCapability_MountVolume) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeCapability_MountVolume.Merge(m, src) -} -func (m *VolumeCapability_MountVolume) XXX_Size() int { - return m.Size() -} -func (m *VolumeCapability_MountVolume) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeCapability_MountVolume.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeCapability_MountVolume proto.InternalMessageInfo - -// Specify how a volume can be accessed. -type VolumeCapability_AccessMode struct { - // This field is REQUIRED. - Mode VolumeCapability_AccessMode_Mode `protobuf:"varint,1,opt,name=mode,proto3,enum=docker.swarmkit.v1.VolumeCapability_AccessMode_Mode" json:"mode,omitempty"` -} - -func (m *VolumeCapability_AccessMode) Reset() { *m = VolumeCapability_AccessMode{} } -func (*VolumeCapability_AccessMode) ProtoMessage() {} -func (*VolumeCapability_AccessMode) Descriptor() ([]byte, []int) { - return fileDescriptor_0b5eafd0404ded3d, []int{67, 2} -} -func (m *VolumeCapability_AccessMode) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeCapability_AccessMode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VolumeCapability_AccessMode.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VolumeCapability_AccessMode) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeCapability_AccessMode.Merge(m, src) -} -func (m *VolumeCapability_AccessMode) XXX_Size() int { - return m.Size() -} -func (m *VolumeCapability_AccessMode) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeCapability_AccessMode.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeCapability_AccessMode proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("docker.swarmkit.v1.ResourceType", ResourceType_name, ResourceType_value) - proto.RegisterEnum("docker.swarmkit.v1.TaskState", TaskState_name, TaskState_value) - proto.RegisterEnum("docker.swarmkit.v1.NodeRole", NodeRole_name, NodeRole_value) - proto.RegisterEnum("docker.swarmkit.v1.RaftMemberStatus_Reachability", RaftMemberStatus_Reachability_name, RaftMemberStatus_Reachability_value) - proto.RegisterEnum("docker.swarmkit.v1.NodeStatus_State", NodeStatus_State_name, NodeStatus_State_value) - proto.RegisterEnum("docker.swarmkit.v1.Mount_MountType", Mount_MountType_name, Mount_MountType_value) - proto.RegisterEnum("docker.swarmkit.v1.Mount_MountConsistency", Mount_MountConsistency_name, Mount_MountConsistency_value) - proto.RegisterEnum("docker.swarmkit.v1.Mount_BindOptions_MountPropagation", Mount_BindOptions_MountPropagation_name, Mount_BindOptions_MountPropagation_value) - proto.RegisterEnum("docker.swarmkit.v1.RestartPolicy_RestartCondition", RestartPolicy_RestartCondition_name, RestartPolicy_RestartCondition_value) - proto.RegisterEnum("docker.swarmkit.v1.UpdateConfig_FailureAction", UpdateConfig_FailureAction_name, UpdateConfig_FailureAction_value) - proto.RegisterEnum("docker.swarmkit.v1.UpdateConfig_UpdateOrder", UpdateConfig_UpdateOrder_name, UpdateConfig_UpdateOrder_value) - proto.RegisterEnum("docker.swarmkit.v1.UpdateStatus_UpdateState", UpdateStatus_UpdateState_name, UpdateStatus_UpdateState_value) - proto.RegisterEnum("docker.swarmkit.v1.IPAMConfig_AddressFamily", IPAMConfig_AddressFamily_name, IPAMConfig_AddressFamily_value) - proto.RegisterEnum("docker.swarmkit.v1.PortConfig_Protocol", PortConfig_Protocol_name, PortConfig_Protocol_value) - proto.RegisterEnum("docker.swarmkit.v1.PortConfig_PublishMode", PortConfig_PublishMode_name, PortConfig_PublishMode_value) - proto.RegisterEnum("docker.swarmkit.v1.IssuanceStatus_State", IssuanceStatus_State_name, IssuanceStatus_State_value) - proto.RegisterEnum("docker.swarmkit.v1.ExternalCA_CAProtocol", ExternalCA_CAProtocol_name, ExternalCA_CAProtocol_value) - proto.RegisterEnum("docker.swarmkit.v1.EncryptionKey_Algorithm", EncryptionKey_Algorithm_name, EncryptionKey_Algorithm_value) - proto.RegisterEnum("docker.swarmkit.v1.MaybeEncryptedRecord_Algorithm", MaybeEncryptedRecord_Algorithm_name, MaybeEncryptedRecord_Algorithm_value) - proto.RegisterEnum("docker.swarmkit.v1.Privileges_SeccompOpts_SeccompMode", Privileges_SeccompOpts_SeccompMode_name, Privileges_SeccompOpts_SeccompMode_value) - proto.RegisterEnum("docker.swarmkit.v1.Privileges_AppArmorOpts_AppArmorMode", Privileges_AppArmorOpts_AppArmorMode_name, Privileges_AppArmorOpts_AppArmorMode_value) - proto.RegisterEnum("docker.swarmkit.v1.VolumeAccessMode_Scope", VolumeAccessMode_Scope_name, VolumeAccessMode_Scope_value) - proto.RegisterEnum("docker.swarmkit.v1.VolumeAccessMode_Sharing", VolumeAccessMode_Sharing_name, VolumeAccessMode_Sharing_value) - proto.RegisterEnum("docker.swarmkit.v1.VolumePublishStatus_State", VolumePublishStatus_State_name, VolumePublishStatus_State_value) - proto.RegisterEnum("docker.swarmkit.v1.VolumeCapability_AccessMode_Mode", VolumeCapability_AccessMode_Mode_name, VolumeCapability_AccessMode_Mode_value) - proto.RegisterType((*Version)(nil), "docker.swarmkit.v1.Version") - proto.RegisterType((*IndexEntry)(nil), "docker.swarmkit.v1.IndexEntry") - proto.RegisterType((*Annotations)(nil), "docker.swarmkit.v1.Annotations") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.Annotations.LabelsEntry") - proto.RegisterType((*NamedGenericResource)(nil), "docker.swarmkit.v1.NamedGenericResource") - proto.RegisterType((*DiscreteGenericResource)(nil), "docker.swarmkit.v1.DiscreteGenericResource") - proto.RegisterType((*GenericResource)(nil), "docker.swarmkit.v1.GenericResource") - proto.RegisterType((*Resources)(nil), "docker.swarmkit.v1.Resources") - proto.RegisterType((*ResourceRequirements)(nil), "docker.swarmkit.v1.ResourceRequirements") - proto.RegisterType((*Platform)(nil), "docker.swarmkit.v1.Platform") - proto.RegisterType((*PluginDescription)(nil), "docker.swarmkit.v1.PluginDescription") - proto.RegisterType((*EngineDescription)(nil), "docker.swarmkit.v1.EngineDescription") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.EngineDescription.LabelsEntry") - proto.RegisterType((*NodeDescription)(nil), "docker.swarmkit.v1.NodeDescription") - proto.RegisterType((*NodeTLSInfo)(nil), "docker.swarmkit.v1.NodeTLSInfo") - proto.RegisterType((*NodeCSIInfo)(nil), "docker.swarmkit.v1.NodeCSIInfo") - proto.RegisterType((*RaftMemberStatus)(nil), "docker.swarmkit.v1.RaftMemberStatus") - proto.RegisterType((*NodeStatus)(nil), "docker.swarmkit.v1.NodeStatus") - proto.RegisterType((*Image)(nil), "docker.swarmkit.v1.Image") - proto.RegisterType((*Mount)(nil), "docker.swarmkit.v1.Mount") - proto.RegisterType((*Mount_BindOptions)(nil), "docker.swarmkit.v1.Mount.BindOptions") - proto.RegisterType((*Mount_VolumeOptions)(nil), "docker.swarmkit.v1.Mount.VolumeOptions") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.Mount.VolumeOptions.LabelsEntry") - proto.RegisterType((*Mount_TmpfsOptions)(nil), "docker.swarmkit.v1.Mount.TmpfsOptions") - proto.RegisterType((*RestartPolicy)(nil), "docker.swarmkit.v1.RestartPolicy") - proto.RegisterType((*UpdateConfig)(nil), "docker.swarmkit.v1.UpdateConfig") - proto.RegisterType((*UpdateStatus)(nil), "docker.swarmkit.v1.UpdateStatus") - proto.RegisterType((*ContainerStatus)(nil), "docker.swarmkit.v1.ContainerStatus") - proto.RegisterType((*PortStatus)(nil), "docker.swarmkit.v1.PortStatus") - proto.RegisterType((*TaskStatus)(nil), "docker.swarmkit.v1.TaskStatus") - proto.RegisterType((*NetworkAttachmentConfig)(nil), "docker.swarmkit.v1.NetworkAttachmentConfig") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.NetworkAttachmentConfig.DriverAttachmentOptsEntry") - proto.RegisterType((*IPAMConfig)(nil), "docker.swarmkit.v1.IPAMConfig") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.IPAMConfig.ReservedEntry") - proto.RegisterType((*PortConfig)(nil), "docker.swarmkit.v1.PortConfig") - proto.RegisterType((*Driver)(nil), "docker.swarmkit.v1.Driver") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.Driver.OptionsEntry") - proto.RegisterType((*IPAMOptions)(nil), "docker.swarmkit.v1.IPAMOptions") - proto.RegisterType((*Peer)(nil), "docker.swarmkit.v1.Peer") - proto.RegisterType((*WeightedPeer)(nil), "docker.swarmkit.v1.WeightedPeer") - proto.RegisterType((*IssuanceStatus)(nil), "docker.swarmkit.v1.IssuanceStatus") - proto.RegisterType((*AcceptancePolicy)(nil), "docker.swarmkit.v1.AcceptancePolicy") - proto.RegisterType((*AcceptancePolicy_RoleAdmissionPolicy)(nil), "docker.swarmkit.v1.AcceptancePolicy.RoleAdmissionPolicy") - proto.RegisterType((*AcceptancePolicy_RoleAdmissionPolicy_Secret)(nil), "docker.swarmkit.v1.AcceptancePolicy.RoleAdmissionPolicy.Secret") - proto.RegisterType((*ExternalCA)(nil), "docker.swarmkit.v1.ExternalCA") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.ExternalCA.OptionsEntry") - proto.RegisterType((*CAConfig)(nil), "docker.swarmkit.v1.CAConfig") - proto.RegisterType((*OrchestrationConfig)(nil), "docker.swarmkit.v1.OrchestrationConfig") - proto.RegisterType((*TaskDefaults)(nil), "docker.swarmkit.v1.TaskDefaults") - proto.RegisterType((*DispatcherConfig)(nil), "docker.swarmkit.v1.DispatcherConfig") - proto.RegisterType((*RaftConfig)(nil), "docker.swarmkit.v1.RaftConfig") - proto.RegisterType((*EncryptionConfig)(nil), "docker.swarmkit.v1.EncryptionConfig") - proto.RegisterType((*SpreadOver)(nil), "docker.swarmkit.v1.SpreadOver") - proto.RegisterType((*PlacementPreference)(nil), "docker.swarmkit.v1.PlacementPreference") - proto.RegisterType((*Placement)(nil), "docker.swarmkit.v1.Placement") - proto.RegisterType((*JoinTokens)(nil), "docker.swarmkit.v1.JoinTokens") - proto.RegisterType((*RootCA)(nil), "docker.swarmkit.v1.RootCA") - proto.RegisterType((*Certificate)(nil), "docker.swarmkit.v1.Certificate") - proto.RegisterType((*EncryptionKey)(nil), "docker.swarmkit.v1.EncryptionKey") - proto.RegisterType((*ManagerStatus)(nil), "docker.swarmkit.v1.ManagerStatus") - proto.RegisterType((*FileTarget)(nil), "docker.swarmkit.v1.FileTarget") - proto.RegisterType((*RuntimeTarget)(nil), "docker.swarmkit.v1.RuntimeTarget") - proto.RegisterType((*SecretReference)(nil), "docker.swarmkit.v1.SecretReference") - proto.RegisterType((*ConfigReference)(nil), "docker.swarmkit.v1.ConfigReference") - proto.RegisterType((*BlacklistedCertificate)(nil), "docker.swarmkit.v1.BlacklistedCertificate") - proto.RegisterType((*HealthConfig)(nil), "docker.swarmkit.v1.HealthConfig") - proto.RegisterType((*MaybeEncryptedRecord)(nil), "docker.swarmkit.v1.MaybeEncryptedRecord") - proto.RegisterType((*RootRotation)(nil), "docker.swarmkit.v1.RootRotation") - proto.RegisterType((*Privileges)(nil), "docker.swarmkit.v1.Privileges") - proto.RegisterType((*Privileges_CredentialSpec)(nil), "docker.swarmkit.v1.Privileges.CredentialSpec") - proto.RegisterType((*Privileges_SELinuxContext)(nil), "docker.swarmkit.v1.Privileges.SELinuxContext") - proto.RegisterType((*Privileges_SeccompOpts)(nil), "docker.swarmkit.v1.Privileges.SeccompOpts") - proto.RegisterType((*Privileges_AppArmorOpts)(nil), "docker.swarmkit.v1.Privileges.AppArmorOpts") - proto.RegisterType((*JobStatus)(nil), "docker.swarmkit.v1.JobStatus") - proto.RegisterType((*VolumeAccessMode)(nil), "docker.swarmkit.v1.VolumeAccessMode") - proto.RegisterType((*VolumeAccessMode_BlockVolume)(nil), "docker.swarmkit.v1.VolumeAccessMode.BlockVolume") - proto.RegisterType((*VolumeAccessMode_MountVolume)(nil), "docker.swarmkit.v1.VolumeAccessMode.MountVolume") - proto.RegisterType((*VolumeSecret)(nil), "docker.swarmkit.v1.VolumeSecret") - proto.RegisterType((*VolumePublishStatus)(nil), "docker.swarmkit.v1.VolumePublishStatus") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.VolumePublishStatus.PublishContextEntry") - proto.RegisterType((*VolumeInfo)(nil), "docker.swarmkit.v1.VolumeInfo") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.VolumeInfo.VolumeContextEntry") - proto.RegisterType((*CapacityRange)(nil), "docker.swarmkit.v1.CapacityRange") - proto.RegisterType((*VolumeAssignment)(nil), "docker.swarmkit.v1.VolumeAssignment") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.VolumeAssignment.PublishContextEntry") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.VolumeAssignment.VolumeContextEntry") - proto.RegisterType((*VolumeAttachment)(nil), "docker.swarmkit.v1.VolumeAttachment") - proto.RegisterType((*TopologyRequirement)(nil), "docker.swarmkit.v1.TopologyRequirement") - proto.RegisterType((*Topology)(nil), "docker.swarmkit.v1.Topology") - proto.RegisterMapType((map[string]string)(nil), "docker.swarmkit.v1.Topology.SegmentsEntry") - proto.RegisterType((*VolumeCapability)(nil), "docker.swarmkit.v1.VolumeCapability") - proto.RegisterType((*VolumeCapability_BlockVolume)(nil), "docker.swarmkit.v1.VolumeCapability.BlockVolume") - proto.RegisterType((*VolumeCapability_MountVolume)(nil), "docker.swarmkit.v1.VolumeCapability.MountVolume") - proto.RegisterType((*VolumeCapability_AccessMode)(nil), "docker.swarmkit.v1.VolumeCapability.AccessMode") -} - -func init() { - proto.RegisterFile("github.com/docker/swarmkit/api/types.proto", fileDescriptor_0b5eafd0404ded3d) -} - -var fileDescriptor_0b5eafd0404ded3d = []byte{ - // 6589 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x7b, 0x5d, 0x6c, 0x24, 0xc7, - 0x99, 0x18, 0xe7, 0x97, 0x33, 0xdf, 0x0c, 0xc9, 0xde, 0x22, 0x45, 0x71, 0x47, 0x2b, 0x92, 0x6a, - 0x69, 0xad, 0xd5, 0x4a, 0xe6, 0xae, 0x56, 0xb2, 0xb2, 0x92, 0x2c, 0x6b, 0xe7, 0x8f, 0xcb, 0xd1, - 0x92, 0x33, 0x83, 0x9a, 0xe1, 0xae, 0x65, 0x20, 0xee, 0x34, 0xbb, 0x8b, 0xc3, 0xd6, 0xf6, 0x74, - 0x77, 0xba, 0x7b, 0xc8, 0x65, 0x9c, 0x20, 0x7a, 0x8a, 0x03, 0x02, 0x81, 0x13, 0x04, 0x70, 0x1c, - 0x24, 0x44, 0x82, 0xd8, 0x01, 0x02, 0xf8, 0x21, 0x0f, 0x79, 0x08, 0x12, 0xdc, 0x83, 0x0e, 0x38, - 0x1c, 0x7c, 0x4f, 0x67, 0x9f, 0x0f, 0x77, 0x86, 0xef, 0xc0, 0x3b, 0xd3, 0xcf, 0x87, 0xbb, 0x97, - 0xc3, 0xdd, 0xe3, 0xa1, 0xfe, 0xba, 0x7b, 0xb8, 0x43, 0x72, 0xd7, 0xf2, 0xbd, 0x90, 0x5d, 0xdf, - 0x5f, 0x55, 0x7d, 0x55, 0xf5, 0xd5, 0xf7, 0x7d, 0xf5, 0x0d, 0xdc, 0x1c, 0x58, 0xe1, 0xde, 0x68, - 0x67, 0xcd, 0x70, 0x87, 0xb7, 0x4c, 0xd7, 0x78, 0x4c, 0xfc, 0x5b, 0xc1, 0x81, 0xee, 0x0f, 0x1f, - 0x5b, 0xe1, 0x2d, 0xdd, 0xb3, 0x6e, 0x85, 0x87, 0x1e, 0x09, 0xd6, 0x3c, 0xdf, 0x0d, 0x5d, 0x84, - 0x38, 0xc1, 0x9a, 0x24, 0x58, 0xdb, 0x7f, 0xbb, 0xb2, 0x32, 0x70, 0xdd, 0x81, 0x4d, 0x6e, 0x31, - 0x8a, 0x9d, 0xd1, 0xee, 0xad, 0xd0, 0x1a, 0x92, 0x20, 0xd4, 0x87, 0x1e, 0x67, 0xaa, 0x2c, 0x9f, - 0x25, 0x30, 0x47, 0xbe, 0x1e, 0x5a, 0xae, 0x73, 0x1e, 0xfe, 0xc0, 0xd7, 0x3d, 0x8f, 0xf8, 0xa2, - 0xd3, 0xca, 0xc2, 0xc0, 0x1d, 0xb8, 0xec, 0xf3, 0x16, 0xfd, 0xe2, 0x50, 0x75, 0x05, 0xa6, 0x1f, - 0x12, 0x3f, 0xb0, 0x5c, 0x07, 0x2d, 0x40, 0xce, 0x72, 0x4c, 0xf2, 0x64, 0x29, 0xb5, 0x9a, 0xba, - 0x91, 0xc5, 0xbc, 0xa1, 0xde, 0x06, 0x68, 0xd1, 0x8f, 0xa6, 0x13, 0xfa, 0x87, 0x48, 0x81, 0xcc, - 0x63, 0x72, 0xc8, 0x28, 0x8a, 0x98, 0x7e, 0x52, 0xc8, 0xbe, 0x6e, 0x2f, 0xa5, 0x39, 0x64, 0x5f, - 0xb7, 0xd5, 0x5f, 0xa5, 0xa0, 0x54, 0x75, 0x1c, 0x37, 0x64, 0xa3, 0x0b, 0x10, 0x82, 0xac, 0xa3, - 0x0f, 0x89, 0x60, 0x62, 0xdf, 0xa8, 0x0e, 0x79, 0x5b, 0xdf, 0x21, 0x76, 0xb0, 0x94, 0x5e, 0xcd, - 0xdc, 0x28, 0xdd, 0x79, 0x73, 0xed, 0x69, 0x95, 0xac, 0x25, 0x84, 0xac, 0x6d, 0x32, 0x6a, 0x36, - 0x08, 0x2c, 0x58, 0xd1, 0x37, 0x60, 0xda, 0x72, 0x4c, 0xcb, 0x20, 0xc1, 0x52, 0x96, 0x49, 0x59, - 0x9e, 0x24, 0x25, 0x1e, 0x7d, 0x2d, 0xfb, 0x93, 0x93, 0x95, 0x29, 0x2c, 0x99, 0x2a, 0xef, 0x43, - 0x29, 0x21, 0x76, 0xc2, 0xdc, 0x16, 0x20, 0xb7, 0xaf, 0xdb, 0x23, 0x22, 0x66, 0xc7, 0x1b, 0x1f, - 0xa4, 0xef, 0xa6, 0xd4, 0x7b, 0xb0, 0xd0, 0xd6, 0x87, 0xc4, 0xbc, 0x4f, 0x1c, 0xe2, 0x5b, 0x06, - 0x26, 0x81, 0x3b, 0xf2, 0x0d, 0x42, 0xe7, 0xfa, 0xd8, 0x72, 0x4c, 0x39, 0x57, 0xfa, 0x3d, 0x59, - 0x8a, 0x5a, 0x87, 0x17, 0x1b, 0x56, 0x60, 0xf8, 0x24, 0x24, 0xcf, 0x2d, 0x24, 0x23, 0x85, 0x9c, - 0xa4, 0x60, 0xee, 0x2c, 0xf7, 0xb7, 0x60, 0x9e, 0xaa, 0xd8, 0xd4, 0x7c, 0x01, 0xd1, 0x02, 0x8f, - 0x18, 0x4c, 0x58, 0xe9, 0xce, 0x8d, 0x49, 0x1a, 0x9a, 0x34, 0x93, 0x8d, 0x29, 0x7c, 0x85, 0x89, - 0x91, 0x80, 0x9e, 0x47, 0x0c, 0x64, 0xc0, 0xa2, 0x29, 0x06, 0x7d, 0x46, 0x7c, 0x9a, 0x89, 0x9f, - 0xb8, 0x8c, 0xe7, 0x4c, 0x73, 0x63, 0x0a, 0x2f, 0x48, 0x61, 0xc9, 0x4e, 0x6a, 0x00, 0x05, 0x29, - 0x5b, 0xfd, 0x41, 0x0a, 0x8a, 0x12, 0x19, 0xa0, 0x37, 0xa0, 0xe8, 0xe8, 0x8e, 0xab, 0x19, 0xde, - 0x28, 0x60, 0x13, 0xca, 0xd4, 0xca, 0xa7, 0x27, 0x2b, 0x85, 0xb6, 0xee, 0xb8, 0xf5, 0xee, 0x76, - 0x80, 0x0b, 0x14, 0x5d, 0xf7, 0x46, 0x01, 0x7a, 0x05, 0xca, 0x43, 0x32, 0x74, 0xfd, 0x43, 0x6d, - 0xe7, 0x30, 0x24, 0x81, 0x50, 0x5b, 0x89, 0xc3, 0x6a, 0x14, 0x84, 0x3e, 0x82, 0xe9, 0x01, 0x1f, - 0xd2, 0x52, 0x86, 0x6d, 0x9f, 0x57, 0x27, 0x8d, 0xfe, 0xcc, 0xa8, 0xb1, 0xe4, 0x51, 0xbf, 0x9f, - 0x86, 0x85, 0x08, 0x4a, 0xfe, 0xf9, 0xc8, 0xf2, 0xc9, 0x90, 0x38, 0x61, 0x80, 0xbe, 0x06, 0x79, - 0xdb, 0x1a, 0x5a, 0x61, 0x20, 0x74, 0xfe, 0xf2, 0x24, 0xb1, 0xd1, 0xa4, 0xb0, 0x20, 0x46, 0x55, - 0x28, 0xfb, 0x24, 0x20, 0xfe, 0x3e, 0xdf, 0xf1, 0x42, 0xa3, 0x97, 0x30, 0x8f, 0xb1, 0xa0, 0x0f, - 0x00, 0x82, 0x03, 0xdd, 0x13, 0x53, 0xce, 0x30, 0x01, 0x2f, 0xad, 0x71, 0xbb, 0xb0, 0x26, 0xed, - 0xc2, 0x5a, 0xcb, 0x09, 0xdf, 0x7b, 0xf7, 0x21, 0xdd, 0x3f, 0xb8, 0x48, 0xc9, 0xb9, 0x36, 0x36, - 0xe0, 0x8a, 0x50, 0x18, 0x85, 0x79, 0x96, 0x43, 0x02, 0x7a, 0xac, 0x2e, 0x15, 0xa1, 0x70, 0xae, - 0x5e, 0xc4, 0xa4, 0xae, 0x43, 0xa1, 0x6b, 0xeb, 0xe1, 0xae, 0xeb, 0x0f, 0x91, 0x0a, 0x65, 0xdd, - 0x37, 0xf6, 0xac, 0x90, 0x18, 0xe1, 0xc8, 0x97, 0x36, 0x60, 0x0c, 0x86, 0x16, 0x21, 0xed, 0xf2, - 0xe9, 0x16, 0x6b, 0xf9, 0xd3, 0x93, 0x95, 0x74, 0xa7, 0x87, 0xd3, 0x6e, 0xa0, 0x7e, 0x08, 0x57, - 0xba, 0xf6, 0x68, 0x60, 0x39, 0x0d, 0x12, 0x18, 0xbe, 0xe5, 0xd1, 0x39, 0xd2, 0xb3, 0x41, 0x2d, - 0xa9, 0x3c, 0x1b, 0xf4, 0x3b, 0x32, 0x30, 0xe9, 0xd8, 0xc0, 0xa8, 0xdf, 0x4d, 0xc3, 0x95, 0xa6, - 0x33, 0xb0, 0x1c, 0x92, 0xe4, 0xbe, 0x0e, 0xb3, 0x84, 0x01, 0xb5, 0x7d, 0x6e, 0xf4, 0x84, 0x9c, - 0x19, 0x0e, 0x95, 0x96, 0xb0, 0x75, 0xc6, 0x3a, 0xbd, 0x3d, 0x69, 0x11, 0x9e, 0x92, 0x3e, 0xd1, - 0x46, 0x35, 0x61, 0xda, 0x63, 0x93, 0x08, 0xc4, 0x26, 0xbb, 0x3e, 0x49, 0xd6, 0x53, 0xf3, 0x94, - 0xa6, 0x4a, 0xf0, 0x7e, 0x19, 0x53, 0xf5, 0x1f, 0x33, 0x30, 0xd7, 0x76, 0xcd, 0x31, 0x3d, 0x54, - 0xa0, 0xb0, 0xe7, 0x06, 0x61, 0xc2, 0x2c, 0x47, 0x6d, 0x74, 0x17, 0x0a, 0x9e, 0x58, 0x3e, 0xb1, - 0x07, 0xaf, 0x4d, 0x1e, 0x32, 0xa7, 0xc1, 0x11, 0x35, 0xfa, 0x10, 0x8a, 0xf2, 0xe0, 0xca, 0xdd, - 0x77, 0xc9, 0xf6, 0x8d, 0xe9, 0xd1, 0x47, 0x90, 0xe7, 0x8b, 0x20, 0x36, 0xdd, 0xf5, 0x67, 0xd2, - 0x39, 0x16, 0x4c, 0xe8, 0x3e, 0x14, 0x42, 0x3b, 0xd0, 0x2c, 0x67, 0xd7, 0x5d, 0xca, 0x31, 0x01, - 0x2b, 0x13, 0x4d, 0x9d, 0x6b, 0x92, 0xfe, 0x66, 0xaf, 0xe5, 0xec, 0xba, 0xb5, 0xd2, 0xe9, 0xc9, - 0xca, 0xb4, 0x68, 0xe0, 0xe9, 0xd0, 0x0e, 0xe8, 0x07, 0xba, 0x06, 0xd9, 0x5d, 0xcb, 0x0b, 0x96, - 0xf2, 0xab, 0xa9, 0x1b, 0x85, 0x5a, 0xe1, 0xf4, 0x64, 0x25, 0xbb, 0xde, 0xea, 0xf6, 0x30, 0x83, - 0xd2, 0x6e, 0x8c, 0xc0, 0xe2, 0xdd, 0x4c, 0xb3, 0xf5, 0x3c, 0xb7, 0x9b, 0x7a, 0xaf, 0x15, 0x77, - 0x23, 0x1a, 0x78, 0xda, 0x08, 0x2c, 0xfa, 0xa1, 0xfe, 0x87, 0x14, 0x94, 0x12, 0x83, 0x41, 0x2f, - 0x03, 0x84, 0xfe, 0x28, 0x08, 0x35, 0xdf, 0x75, 0x43, 0xb6, 0x26, 0x65, 0x5c, 0x64, 0x10, 0xec, - 0xba, 0x21, 0x5a, 0x83, 0x79, 0x83, 0xf8, 0xa1, 0x66, 0x05, 0xc1, 0x88, 0xf8, 0x5a, 0x30, 0xda, - 0xf9, 0x8c, 0x18, 0x21, 0x5b, 0x9f, 0x32, 0xbe, 0x42, 0x51, 0x2d, 0x86, 0xe9, 0x71, 0x04, 0x7a, - 0x07, 0x16, 0x93, 0xf4, 0xde, 0x68, 0xc7, 0xb6, 0x0c, 0x8d, 0xee, 0x99, 0x0c, 0x63, 0x99, 0x8f, - 0x59, 0xba, 0x0c, 0xf7, 0x80, 0x1c, 0xaa, 0x3f, 0x17, 0x63, 0x12, 0x83, 0x45, 0x2b, 0x50, 0xe2, - 0xfb, 0x4f, 0x4b, 0x6c, 0x14, 0xe0, 0x20, 0x7a, 0x67, 0xa0, 0x57, 0x61, 0xda, 0x71, 0x4d, 0xa2, - 0x59, 0xa6, 0x38, 0xbe, 0x70, 0x7a, 0xb2, 0x92, 0xa7, 0x22, 0x5a, 0x0d, 0x9c, 0xa7, 0xa8, 0x96, - 0x89, 0x6e, 0xc1, 0xc2, 0x50, 0x7f, 0xa2, 0xed, 0xbb, 0xf6, 0x68, 0x48, 0x02, 0xcd, 0x23, 0xbe, - 0x46, 0x31, 0x6c, 0x20, 0x19, 0x7c, 0x65, 0xa8, 0x3f, 0x79, 0xc8, 0x51, 0x5d, 0xe2, 0x53, 0x56, - 0xb4, 0x05, 0xf3, 0xba, 0x61, 0x90, 0x20, 0xb0, 0x76, 0x6c, 0xa2, 0x85, 0xae, 0xe7, 0xda, 0xee, - 0xe0, 0x50, 0x6c, 0x8b, 0x89, 0x7b, 0xb1, 0x2f, 0x68, 0x30, 0x8a, 0x19, 0x25, 0x4c, 0xfd, 0x45, - 0x0a, 0x14, 0xac, 0xef, 0x86, 0x5b, 0x64, 0xb8, 0x43, 0xfc, 0x5e, 0xa8, 0x87, 0xa3, 0x00, 0x2d, - 0x42, 0xde, 0x26, 0xba, 0x49, 0x7c, 0x36, 0xab, 0x02, 0x16, 0x2d, 0xb4, 0x4d, 0x8d, 0xb0, 0x6e, - 0xec, 0xe9, 0x3b, 0x96, 0x6d, 0x85, 0x87, 0x6c, 0x5a, 0xb3, 0x93, 0xcf, 0xff, 0x59, 0x99, 0x6b, - 0x38, 0xc1, 0x88, 0xc7, 0xc4, 0xa0, 0x25, 0x98, 0x1e, 0x92, 0x20, 0xd0, 0x07, 0x7c, 0xda, 0x45, - 0x2c, 0x9b, 0xea, 0x87, 0x50, 0x4e, 0xf2, 0xa1, 0x12, 0x4c, 0x6f, 0xb7, 0x1f, 0xb4, 0x3b, 0x8f, - 0xda, 0xca, 0x14, 0x9a, 0x83, 0xd2, 0x76, 0x1b, 0x37, 0xab, 0xf5, 0x8d, 0x6a, 0x6d, 0xb3, 0xa9, - 0xa4, 0xd0, 0x0c, 0x14, 0xe3, 0x66, 0x5a, 0xfd, 0x3f, 0x29, 0x00, 0xaa, 0x32, 0x31, 0xa9, 0x0f, - 0x20, 0x17, 0x84, 0x7a, 0xc8, 0x57, 0x6a, 0xf6, 0xce, 0x6b, 0xe7, 0xed, 0x4c, 0x31, 0x5e, 0xfa, - 0x8f, 0x60, 0xce, 0x92, 0x1c, 0x61, 0x7a, 0x6c, 0x84, 0xd4, 0xba, 0xea, 0xa6, 0xe9, 0x8b, 0x81, - 0xb3, 0x6f, 0xf5, 0x43, 0xc8, 0x31, 0xee, 0xf1, 0xe1, 0x16, 0x20, 0xdb, 0xa0, 0x5f, 0x29, 0x54, - 0x84, 0x1c, 0x6e, 0x56, 0x1b, 0x9f, 0x2a, 0x69, 0xa4, 0x40, 0xb9, 0xd1, 0xea, 0xd5, 0x3b, 0xed, - 0x76, 0xb3, 0xde, 0x6f, 0x36, 0x94, 0x8c, 0x7a, 0x1d, 0x72, 0xad, 0x21, 0x95, 0x7c, 0x8d, 0xda, - 0x8b, 0x5d, 0xe2, 0x13, 0xc7, 0x90, 0xbb, 0x2b, 0x06, 0xa8, 0xdf, 0x9b, 0x83, 0xdc, 0x96, 0x3b, - 0x72, 0x42, 0x74, 0x27, 0x61, 0xf3, 0x67, 0x27, 0x3b, 0x79, 0x8c, 0x70, 0xad, 0x7f, 0xe8, 0x11, - 0x71, 0x27, 0x2c, 0x42, 0x9e, 0x5b, 0x16, 0x31, 0x1d, 0xd1, 0xa2, 0xf0, 0x50, 0xf7, 0x07, 0x24, - 0x14, 0xf3, 0x11, 0x2d, 0x74, 0x83, 0x3a, 0x1d, 0xba, 0xe9, 0x3a, 0x36, 0xdf, 0x69, 0x05, 0xee, - 0x59, 0x60, 0xa2, 0x9b, 0x1d, 0xc7, 0x3e, 0xc4, 0x11, 0x16, 0xdd, 0x87, 0x92, 0xe1, 0x3a, 0x81, - 0x15, 0x84, 0xc4, 0x31, 0x0e, 0x97, 0x0a, 0x6c, 0x50, 0xd7, 0xcf, 0x1f, 0x54, 0x3d, 0x26, 0xc6, - 0x49, 0x4e, 0xb4, 0x01, 0xe5, 0x1d, 0xcb, 0x31, 0x35, 0xd7, 0xe3, 0x17, 0x7e, 0xee, 0x7c, 0xbb, - 0xc7, 0x25, 0xd5, 0x2c, 0xc7, 0xec, 0x70, 0x62, 0x5c, 0xda, 0x89, 0x1b, 0xa8, 0x0d, 0xb3, 0xfc, - 0x78, 0x45, 0xb2, 0xf2, 0x4c, 0xd6, 0xeb, 0xe7, 0xcb, 0xe2, 0x67, 0x4e, 0x4a, 0x9b, 0xd9, 0x4f, - 0x36, 0xd1, 0x03, 0x98, 0x09, 0x87, 0xde, 0x6e, 0x10, 0x89, 0x9b, 0x66, 0xe2, 0xbe, 0x72, 0x81, - 0xe6, 0x29, 0xb9, 0x94, 0x56, 0x0e, 0x13, 0xad, 0xca, 0x7f, 0xcd, 0x41, 0x29, 0x31, 0x72, 0xd4, - 0x83, 0x92, 0xe7, 0xbb, 0x9e, 0x3e, 0x60, 0x4e, 0x8b, 0x58, 0xd4, 0xb7, 0x9f, 0x69, 0xd6, 0x6b, - 0xdd, 0x98, 0x11, 0x27, 0xa5, 0xa0, 0x77, 0xa1, 0xec, 0xb8, 0x8e, 0x4f, 0x8c, 0x91, 0x1f, 0x58, - 0xfb, 0x7c, 0xd1, 0x0b, 0x35, 0xe5, 0xf4, 0x64, 0xa5, 0xdc, 0x76, 0x1d, 0x2c, 0xe1, 0x78, 0x8c, - 0x0a, 0xdd, 0x03, 0xc5, 0xf0, 0x89, 0x1e, 0x92, 0x21, 0xed, 0xc9, 0x73, 0x2d, 0x87, 0x6f, 0x8b, - 0x42, 0x6d, 0xe1, 0xf4, 0x64, 0x45, 0xa9, 0x33, 0xdc, 0x56, 0x84, 0xc3, 0x4f, 0x51, 0xa3, 0x4d, - 0x58, 0x90, 0x1b, 0x63, 0xac, 0x7f, 0xbe, 0x85, 0x96, 0x4e, 0x4f, 0x56, 0x16, 0xe4, 0x16, 0x1a, - 0x1b, 0xc7, 0x44, 0x2e, 0x84, 0x61, 0x51, 0xc2, 0x77, 0x5d, 0xdf, 0x20, 0xb1, 0xbc, 0x1c, 0x93, - 0x57, 0x39, 0x3d, 0x59, 0x59, 0x94, 0xf2, 0xd6, 0x5d, 0xe6, 0x78, 0x4a, 0x89, 0xe7, 0x70, 0xaa, - 0xc7, 0x69, 0x28, 0x25, 0xd4, 0x86, 0x6e, 0x42, 0x01, 0x77, 0x71, 0xeb, 0x61, 0xb5, 0xdf, 0x54, - 0xa6, 0x2a, 0xd7, 0x8e, 0x8e, 0x57, 0x97, 0xd8, 0x0c, 0x93, 0xaa, 0xed, 0xfa, 0xd6, 0x3e, 0x3d, - 0xdd, 0x37, 0x60, 0x5a, 0x92, 0xa6, 0x2a, 0x2f, 0x1d, 0x1d, 0xaf, 0xbe, 0x78, 0x96, 0x34, 0x41, - 0x89, 0x7b, 0x1b, 0x55, 0xdc, 0x6c, 0x28, 0xe9, 0xc9, 0x94, 0xb8, 0xb7, 0xa7, 0xfb, 0xc4, 0x44, - 0x5f, 0x81, 0xbc, 0x20, 0xcc, 0x54, 0x2a, 0x47, 0xc7, 0xab, 0x8b, 0x67, 0x09, 0x63, 0x3a, 0xdc, - 0xdb, 0xac, 0x3e, 0x6c, 0x2a, 0xd9, 0xc9, 0x74, 0xb8, 0x67, 0xeb, 0xfb, 0x04, 0xbd, 0x06, 0x39, - 0x4e, 0x96, 0xab, 0x5c, 0x3d, 0x3a, 0x5e, 0x7d, 0xe1, 0x29, 0x71, 0x94, 0xaa, 0xb2, 0xf4, 0x6f, - 0x7f, 0xb8, 0x3c, 0xf5, 0xff, 0x7f, 0xb4, 0xac, 0x9c, 0x45, 0x57, 0x7e, 0x98, 0x86, 0x99, 0xb1, - 0xc3, 0x80, 0x54, 0xc8, 0x3b, 0xae, 0xe1, 0x7a, 0xdc, 0xbf, 0x2a, 0xc8, 0x4b, 0xad, 0xee, 0x7a, - 0x87, 0x58, 0x60, 0xd0, 0x83, 0x33, 0x1e, 0xe2, 0x3b, 0xcf, 0x78, 0xd2, 0x26, 0xfa, 0x88, 0x1f, - 0xc3, 0x8c, 0xe9, 0x5b, 0xfb, 0xc4, 0xd7, 0x0c, 0xd7, 0xd9, 0xb5, 0x06, 0xc2, 0x77, 0xaa, 0x4c, - 0x0c, 0xa6, 0x18, 0x21, 0x2e, 0x73, 0x86, 0x3a, 0xa3, 0x47, 0xd7, 0x61, 0x3a, 0x18, 0xed, 0x78, - 0x7a, 0xb8, 0xc7, 0x36, 0x5e, 0x91, 0xfb, 0x1c, 0x3d, 0x0e, 0xc2, 0x12, 0xf7, 0x25, 0x9c, 0xc8, - 0x8a, 0x07, 0xe5, 0xe4, 0x11, 0xa7, 0xee, 0x4a, 0x60, 0xfd, 0x0b, 0x22, 0x22, 0x0d, 0x16, 0x8a, - 0xe1, 0x22, 0x85, 0xf0, 0x60, 0xe2, 0x75, 0xc8, 0x0e, 0xe9, 0x1d, 0x4f, 0xe5, 0xcc, 0xd4, 0xe6, - 0xa9, 0x2f, 0xfb, 0xcb, 0x93, 0x95, 0x92, 0x1b, 0xac, 0xad, 0x5b, 0x36, 0xd9, 0x72, 0x4d, 0x82, - 0x19, 0x01, 0xbd, 0x76, 0xa4, 0x8d, 0x11, 0x17, 0xa3, 0x68, 0xaa, 0xbf, 0x93, 0x82, 0x2c, 0xb5, - 0xe7, 0xe8, 0x25, 0xc8, 0xd6, 0x5a, 0xed, 0x86, 0x32, 0x55, 0xb9, 0x72, 0x74, 0xbc, 0x3a, 0xc3, - 0x94, 0x4a, 0x11, 0xd4, 0x2e, 0xa0, 0x15, 0xc8, 0x3f, 0xec, 0x6c, 0x6e, 0x6f, 0xd1, 0x0d, 0x3a, - 0x7f, 0x74, 0xbc, 0x3a, 0x17, 0xa1, 0xb9, 0xda, 0xd1, 0xcb, 0x90, 0xeb, 0x6f, 0x75, 0xd7, 0x7b, - 0x4a, 0xba, 0x82, 0x8e, 0x8e, 0x57, 0x67, 0x23, 0x3c, 0x9b, 0x0e, 0x7a, 0x05, 0x72, 0xed, 0x6e, - 0xab, 0xdb, 0x54, 0x32, 0x95, 0xc5, 0xa3, 0xe3, 0x55, 0x14, 0xa1, 0x59, 0x4c, 0xdc, 0xb5, 0x3c, - 0x82, 0x5e, 0x81, 0xe9, 0xfa, 0xe6, 0x76, 0xaf, 0xdf, 0xc4, 0x4a, 0xb6, 0xb2, 0x70, 0x74, 0xbc, - 0xaa, 0x44, 0x44, 0x75, 0x7b, 0x14, 0x84, 0xc4, 0xaf, 0x5c, 0x11, 0xbb, 0xab, 0x18, 0x61, 0xd4, - 0x9f, 0xa5, 0xa0, 0x94, 0xb0, 0xfc, 0xf4, 0x80, 0x34, 0x9a, 0xeb, 0xd5, 0xed, 0xcd, 0xbe, 0x32, - 0x95, 0x38, 0x20, 0x09, 0x92, 0x06, 0xd9, 0xd5, 0x47, 0x36, 0xbd, 0x89, 0xa0, 0xde, 0x69, 0xf7, - 0x5a, 0xbd, 0x7e, 0xb3, 0xdd, 0x57, 0x52, 0x95, 0xa5, 0xa3, 0xe3, 0xd5, 0x85, 0xb3, 0xc4, 0xeb, - 0x23, 0xdb, 0xa6, 0x47, 0xa4, 0x5e, 0xad, 0x6f, 0xb0, 0x33, 0x17, 0x1f, 0x91, 0x04, 0x55, 0x5d, - 0x37, 0xf6, 0x88, 0x89, 0xde, 0x82, 0x62, 0xa3, 0xb9, 0xd9, 0xbc, 0x5f, 0x65, 0xf7, 0x6f, 0xe5, - 0xe5, 0xa3, 0xe3, 0xd5, 0xab, 0x4f, 0xf7, 0x6e, 0x93, 0x81, 0x1e, 0x12, 0xf3, 0xcc, 0x51, 0x49, - 0x90, 0xa8, 0x7f, 0x9b, 0x86, 0x19, 0x4c, 0x82, 0x50, 0xf7, 0xc3, 0xae, 0x6b, 0x5b, 0xc6, 0x21, - 0xea, 0x42, 0xd1, 0x70, 0x1d, 0xd3, 0x4a, 0x58, 0xf2, 0x3b, 0xe7, 0x78, 0xfc, 0x31, 0x97, 0x6c, - 0xd5, 0x25, 0x27, 0x8e, 0x85, 0xa0, 0x5b, 0x90, 0x33, 0x89, 0xad, 0x1f, 0x8a, 0xd0, 0xe3, 0xea, - 0x53, 0xa1, 0x67, 0x43, 0x64, 0xbd, 0x30, 0xa7, 0x63, 0x81, 0xbe, 0xfe, 0x44, 0xd3, 0xc3, 0x90, - 0x0c, 0xbd, 0x90, 0x6f, 0xa3, 0x2c, 0x2e, 0x0d, 0xf5, 0x27, 0x55, 0x01, 0x42, 0x6f, 0x43, 0xfe, - 0xc0, 0x72, 0x4c, 0xf7, 0x40, 0xf8, 0x90, 0x17, 0x08, 0x15, 0x84, 0xea, 0x11, 0x75, 0x1a, 0xcf, - 0x0c, 0x93, 0xee, 0xc4, 0x76, 0xa7, 0xdd, 0x94, 0x3b, 0x51, 0xe0, 0x3b, 0x4e, 0xdb, 0x75, 0xa8, - 0x1d, 0x82, 0x4e, 0x5b, 0x5b, 0xaf, 0xb6, 0x36, 0xb7, 0x31, 0xdd, 0x8d, 0x6c, 0xa7, 0x44, 0x24, - 0xeb, 0xba, 0x65, 0xd3, 0x58, 0xf7, 0x2a, 0x64, 0xaa, 0xed, 0x4f, 0x95, 0x74, 0x45, 0x39, 0x3a, - 0x5e, 0x2d, 0x47, 0xe8, 0xaa, 0x73, 0x18, 0xeb, 0xfd, 0x6c, 0xbf, 0xea, 0x1f, 0x66, 0xa0, 0xbc, - 0xed, 0x99, 0x7a, 0x48, 0xc4, 0x79, 0x5f, 0x85, 0x92, 0xa7, 0xfb, 0xba, 0x6d, 0x13, 0xdb, 0x0a, - 0x86, 0x22, 0x5f, 0x97, 0x04, 0xa1, 0xf7, 0x9f, 0x55, 0x8d, 0xb5, 0x02, 0x3d, 0x9c, 0x3f, 0xf8, - 0x8b, 0x95, 0x94, 0x54, 0xe8, 0x36, 0xcc, 0xee, 0xf2, 0xd1, 0x6a, 0xba, 0xc1, 0x16, 0x36, 0xc3, - 0x16, 0x76, 0x6d, 0xd2, 0xc2, 0x26, 0x87, 0xb5, 0x26, 0x26, 0x59, 0x65, 0x5c, 0x78, 0x66, 0x37, - 0xd9, 0x44, 0xef, 0xc0, 0xf4, 0xd0, 0x75, 0xac, 0xd0, 0xf5, 0x2f, 0x5f, 0x05, 0x49, 0x89, 0x6e, - 0x02, 0x8d, 0x0f, 0x34, 0x39, 0x1e, 0x86, 0x66, 0x77, 0x61, 0x1a, 0xcf, 0x0d, 0xf5, 0x27, 0xa2, - 0x43, 0x4c, 0xc1, 0xa8, 0x06, 0x39, 0xd7, 0xa7, 0x1e, 0x7d, 0x9e, 0x0d, 0xf7, 0xad, 0x4b, 0x87, - 0xcb, 0x1b, 0x1d, 0xca, 0x83, 0x39, 0xab, 0xfa, 0x1e, 0xcc, 0x8c, 0x4d, 0x82, 0x3a, 0xb2, 0xdd, - 0xea, 0x76, 0xaf, 0xa9, 0x4c, 0xa1, 0x32, 0x14, 0xea, 0x9d, 0x76, 0xbf, 0xd5, 0xde, 0xa6, 0x9e, - 0x78, 0x19, 0x0a, 0xb8, 0xb3, 0xb9, 0x59, 0xab, 0xd6, 0x1f, 0x28, 0x69, 0x75, 0x0d, 0x4a, 0x09, - 0x69, 0x68, 0x16, 0xa0, 0xd7, 0xef, 0x74, 0xb5, 0xf5, 0x16, 0xee, 0xf5, 0xb9, 0x1f, 0xdf, 0xeb, - 0x57, 0x71, 0x5f, 0x00, 0x52, 0xea, 0x5f, 0xa7, 0xe5, 0x8a, 0x0a, 0xd7, 0xbd, 0x36, 0xee, 0xba, - 0x5f, 0x30, 0x78, 0xe1, 0xbc, 0xc7, 0x8d, 0xc8, 0x85, 0x7f, 0x1f, 0x80, 0x6d, 0x1c, 0x62, 0x6a, - 0x7a, 0x28, 0x16, 0xbe, 0xf2, 0x94, 0x92, 0xfb, 0x32, 0xad, 0x8c, 0x8b, 0x82, 0xba, 0x1a, 0xa2, - 0x8f, 0xa0, 0x6c, 0xb8, 0x43, 0xcf, 0x26, 0x82, 0x39, 0x73, 0x29, 0x73, 0x29, 0xa2, 0xaf, 0x86, - 0xc9, 0xe0, 0x21, 0x3b, 0x1e, 0xde, 0xfc, 0x9b, 0x94, 0xd4, 0xcc, 0x84, 0x78, 0xa1, 0x0c, 0x85, - 0xed, 0x6e, 0xa3, 0xda, 0x6f, 0xb5, 0xef, 0x2b, 0x29, 0x04, 0x90, 0x67, 0xaa, 0x6e, 0x28, 0x69, - 0x1a, 0xe7, 0xd4, 0x3b, 0x5b, 0xdd, 0xcd, 0x26, 0xb3, 0x58, 0x68, 0x01, 0x14, 0xa9, 0x6c, 0x8d, - 0x29, 0xb2, 0xd9, 0x50, 0xb2, 0x68, 0x1e, 0xe6, 0x22, 0xa8, 0xe0, 0xcc, 0xa1, 0x45, 0x40, 0x11, - 0x30, 0x16, 0x91, 0x57, 0xff, 0x15, 0xcc, 0xd5, 0x5d, 0x27, 0xd4, 0x2d, 0x27, 0x8a, 0x01, 0xef, - 0xd0, 0x49, 0x0b, 0x10, 0x0d, 0x61, 0xd9, 0x45, 0x58, 0x9b, 0x3b, 0x3d, 0x59, 0x29, 0x45, 0xa4, - 0xad, 0x06, 0xf3, 0xd9, 0x45, 0xc3, 0xa4, 0xe7, 0xd7, 0x13, 0xd1, 0x6e, 0xae, 0x36, 0x7d, 0x7a, - 0xb2, 0x92, 0xe9, 0xb6, 0x1a, 0x98, 0xc2, 0xd0, 0x4b, 0x50, 0x24, 0x4f, 0xac, 0x50, 0x33, 0x64, - 0x70, 0x9b, 0xc3, 0x05, 0x0a, 0xa8, 0xbb, 0x26, 0x51, 0x6b, 0x00, 0x5d, 0xd7, 0x0f, 0x45, 0xcf, - 0xef, 0x42, 0xce, 0x73, 0x7d, 0x96, 0x20, 0x3c, 0x37, 0x6d, 0x4d, 0xc9, 0xf9, 0x46, 0xc5, 0x9c, - 0x58, 0xfd, 0xcf, 0x19, 0x80, 0xbe, 0x1e, 0x3c, 0x16, 0x42, 0xee, 0x42, 0x31, 0x7a, 0x22, 0x10, - 0x99, 0xc6, 0x0b, 0x57, 0x3b, 0x22, 0x46, 0xef, 0xc8, 0xcd, 0xc6, 0xa3, 0xdb, 0x89, 0x39, 0x1a, - 0xd9, 0xd1, 0xa4, 0x00, 0x71, 0x3c, 0x84, 0xa5, 0x7e, 0x04, 0xf1, 0x7d, 0xb1, 0xf2, 0xf4, 0x13, - 0xd5, 0xd9, 0xb5, 0xc0, 0x95, 0x26, 0xc2, 0x9a, 0x89, 0xb9, 0xd5, 0x33, 0x2b, 0xb2, 0x31, 0x85, - 0x63, 0x3e, 0xf4, 0x31, 0x94, 0xe8, 0xbc, 0xb5, 0x80, 0xe1, 0x44, 0x44, 0x73, 0xae, 0xaa, 0xb8, - 0x04, 0x0c, 0x5e, 0xac, 0xe5, 0x97, 0x01, 0x74, 0xcf, 0xb3, 0x2d, 0x62, 0x6a, 0x3b, 0x87, 0x2c, - 0x84, 0x29, 0xe2, 0xa2, 0x80, 0xd4, 0x0e, 0xe9, 0x71, 0x91, 0x68, 0x3d, 0x64, 0x61, 0xdc, 0x25, - 0x0a, 0x14, 0xd4, 0xd5, 0xb0, 0xa6, 0xc0, 0xac, 0x3f, 0x72, 0xa8, 0x42, 0xc5, 0xe8, 0xd4, 0xff, - 0x9d, 0x86, 0x17, 0xdb, 0x24, 0x3c, 0x70, 0xfd, 0xc7, 0xd5, 0x30, 0xd4, 0x8d, 0xbd, 0x21, 0x71, - 0xc4, 0xf2, 0x25, 0x42, 0xce, 0xd4, 0x58, 0xc8, 0xb9, 0x04, 0xd3, 0xba, 0x6d, 0xe9, 0x01, 0xe1, - 0x4e, 0x64, 0x11, 0xcb, 0x26, 0x0d, 0x8c, 0x69, 0x98, 0x4d, 0x82, 0x80, 0xf0, 0xb4, 0x21, 0x1d, - 0xb8, 0x04, 0xa0, 0xef, 0xc0, 0xa2, 0x70, 0x17, 0xf5, 0xa8, 0x2b, 0x1a, 0xa9, 0xc9, 0x57, 0x90, - 0xe6, 0xc4, 0xb8, 0x7f, 0xf2, 0xe0, 0x84, 0x3f, 0x19, 0x83, 0x3b, 0x5e, 0x28, 0xbc, 0xd3, 0x05, - 0x73, 0x02, 0xaa, 0x72, 0x1f, 0xae, 0x9e, 0xcb, 0xf2, 0x5c, 0x69, 0xc9, 0x9f, 0xa7, 0x01, 0x5a, - 0xdd, 0xea, 0x96, 0x50, 0x52, 0x03, 0xf2, 0xbb, 0xfa, 0xd0, 0xb2, 0x0f, 0x2f, 0xb2, 0x80, 0x31, - 0xfd, 0x5a, 0x95, 0xab, 0x63, 0x9d, 0xf1, 0x60, 0xc1, 0xcb, 0xa2, 0xfe, 0xd1, 0x8e, 0x43, 0xc2, - 0x28, 0xea, 0x67, 0x2d, 0x3a, 0x0c, 0x5f, 0x77, 0xa2, 0xad, 0xcb, 0x1b, 0x74, 0x01, 0xa8, 0xcb, - 0x73, 0xa0, 0x1f, 0x4a, 0xb3, 0x25, 0x9a, 0x68, 0x83, 0x3d, 0x41, 0x10, 0x7f, 0x9f, 0x98, 0x4b, - 0x39, 0xa6, 0xd4, 0xcb, 0xc6, 0x83, 0x05, 0x39, 0xd7, 0x5d, 0xc4, 0x5d, 0xf9, 0x90, 0xb9, 0x4c, - 0x31, 0xea, 0xb9, 0x74, 0x74, 0x1b, 0x66, 0xc6, 0xe6, 0xf9, 0x54, 0xba, 0xa5, 0xd5, 0x7d, 0xf8, - 0xae, 0x92, 0x15, 0x5f, 0xef, 0x29, 0x79, 0xf5, 0xf7, 0x33, 0xdc, 0xd0, 0x08, 0xad, 0x4e, 0x7e, - 0x7a, 0x2b, 0xb0, 0xdd, 0x6d, 0xb8, 0xb6, 0x30, 0x00, 0xaf, 0x5f, 0x6c, 0x7f, 0x68, 0xd4, 0xcd, - 0xc8, 0x71, 0xc4, 0x88, 0x56, 0xa0, 0xc4, 0x77, 0xb1, 0x46, 0x0f, 0x1c, 0x53, 0xeb, 0x0c, 0x06, - 0x0e, 0xa2, 0x9c, 0xe8, 0x3a, 0xcc, 0xb2, 0xa4, 0x63, 0xb0, 0x47, 0x4c, 0x4e, 0x93, 0x65, 0x34, - 0x33, 0x11, 0x94, 0x91, 0x6d, 0x41, 0x59, 0x00, 0x34, 0x16, 0x30, 0xe4, 0xd8, 0x80, 0x6e, 0x5e, - 0x36, 0x20, 0xce, 0xc2, 0xe2, 0x88, 0x92, 0x17, 0x37, 0xd4, 0x7f, 0x06, 0x05, 0x39, 0x58, 0xb4, - 0x04, 0x99, 0x7e, 0xbd, 0xab, 0x4c, 0x55, 0xe6, 0x8e, 0x8e, 0x57, 0x4b, 0x12, 0xdc, 0xaf, 0x77, - 0x29, 0x66, 0xbb, 0xd1, 0x55, 0x52, 0xe3, 0x98, 0xed, 0x46, 0x17, 0x55, 0x20, 0xdb, 0xab, 0xf7, - 0xbb, 0xd2, 0x3f, 0x93, 0x28, 0x0a, 0xab, 0x64, 0xa9, 0x7f, 0xa6, 0xee, 0x42, 0x29, 0xd1, 0x3b, - 0x7a, 0x15, 0xa6, 0x5b, 0xed, 0xfb, 0xb8, 0xd9, 0xeb, 0x29, 0x53, 0x3c, 0x82, 0x48, 0x60, 0x5b, - 0xce, 0x80, 0xae, 0x1d, 0x7a, 0x19, 0xb2, 0x1b, 0x1d, 0x7a, 0xef, 0xf3, 0x10, 0x25, 0x41, 0xb1, - 0xe1, 0x06, 0x61, 0x65, 0x5e, 0x38, 0x7e, 0x49, 0xc1, 0xea, 0x7f, 0x49, 0x41, 0x9e, 0x1f, 0xb4, - 0x89, 0x8b, 0x58, 0x8d, 0xe3, 0x26, 0x1e, 0x80, 0xbe, 0x7e, 0x7e, 0xb0, 0xb8, 0x26, 0x82, 0x36, - 0xbe, 0x35, 0x25, 0x5f, 0xe5, 0x03, 0x28, 0x27, 0x11, 0xcf, 0xb5, 0x31, 0xbf, 0x03, 0x25, 0xba, - 0xf7, 0x65, 0x34, 0x78, 0x07, 0xf2, 0xdc, 0x58, 0x44, 0xf7, 0xd0, 0xf9, 0x91, 0xab, 0xa0, 0x44, - 0x77, 0x61, 0x9a, 0x47, 0xbb, 0xf2, 0x61, 0x64, 0xf9, 0xe2, 0x13, 0x86, 0x25, 0xb9, 0xfa, 0x31, - 0x64, 0xbb, 0x84, 0xf8, 0xc9, 0xec, 0x73, 0xea, 0xdc, 0xec, 0xb3, 0xcc, 0x5e, 0xa6, 0x13, 0xd9, - 0xcb, 0x3e, 0x94, 0x1f, 0x11, 0x6b, 0xb0, 0x17, 0x12, 0x93, 0x09, 0x7a, 0x0b, 0xb2, 0x1e, 0x89, - 0x06, 0xbf, 0x34, 0x71, 0xf3, 0x11, 0xe2, 0x63, 0x46, 0x45, 0x6d, 0xcc, 0x01, 0xe3, 0x16, 0x6f, - 0x8a, 0xa2, 0xa5, 0xfe, 0x51, 0x1a, 0x66, 0x5b, 0x41, 0x30, 0xd2, 0x1d, 0x43, 0x7a, 0x75, 0xdf, - 0x18, 0xf7, 0xea, 0x26, 0x3e, 0xbe, 0x8e, 0xb3, 0x8c, 0x27, 0x65, 0xc5, 0xcd, 0x9a, 0x8e, 0x6e, - 0x56, 0xf5, 0xaf, 0x52, 0x32, 0xf3, 0x7a, 0x3d, 0x61, 0x0a, 0x78, 0x8c, 0x98, 0x94, 0x44, 0xb6, - 0x9d, 0xc7, 0x8e, 0x7b, 0xe0, 0xd0, 0x00, 0x17, 0x37, 0xdb, 0xcd, 0x47, 0x4a, 0x8a, 0x6f, 0xcf, - 0x31, 0x22, 0x4c, 0x1c, 0x72, 0x40, 0x25, 0x75, 0x9b, 0xed, 0x06, 0xf5, 0xc2, 0xd2, 0x13, 0x24, - 0x75, 0x89, 0x63, 0x5a, 0xce, 0x00, 0xbd, 0x0a, 0xf9, 0x56, 0xaf, 0xb7, 0xcd, 0x42, 0xc8, 0x17, - 0x8f, 0x8e, 0x57, 0xe7, 0xc7, 0xa8, 0xd8, 0x5b, 0x82, 0x49, 0x89, 0x68, 0x08, 0x44, 0xfd, 0xb3, - 0x09, 0x44, 0xd4, 0xb7, 0xe6, 0x44, 0xb8, 0xd3, 0xaf, 0xf6, 0x9b, 0x4a, 0x6e, 0x02, 0x11, 0x76, - 0xe9, 0x5f, 0x71, 0xdc, 0xfe, 0x2c, 0x0d, 0x4a, 0xd5, 0x30, 0x88, 0x17, 0x52, 0xbc, 0x88, 0x3a, - 0xfb, 0x50, 0xf0, 0xe8, 0x97, 0x45, 0xa4, 0x07, 0x75, 0x77, 0x62, 0xf9, 0xc0, 0x19, 0xbe, 0x35, - 0xec, 0xda, 0xa4, 0x6a, 0x0e, 0xad, 0x20, 0xb0, 0x5c, 0x87, 0xc3, 0x70, 0x24, 0xa9, 0xf2, 0x37, - 0x29, 0x98, 0x9f, 0x40, 0x81, 0x6e, 0x43, 0xd6, 0x77, 0x6d, 0xb9, 0x86, 0xd7, 0xce, 0x4b, 0xaa, - 0x53, 0x56, 0xcc, 0x28, 0xd1, 0x32, 0x80, 0x3e, 0x0a, 0x5d, 0x9d, 0xf5, 0xcf, 0x53, 0x91, 0x38, - 0x01, 0x41, 0x8f, 0x20, 0x1f, 0x10, 0xc3, 0x27, 0xd2, 0xcf, 0xfe, 0xf8, 0x37, 0x1d, 0xfd, 0x5a, - 0x8f, 0x89, 0xc1, 0x42, 0x5c, 0x65, 0x0d, 0xf2, 0x1c, 0x42, 0xb7, 0xbd, 0xa9, 0x87, 0xba, 0x78, - 0x48, 0x62, 0xdf, 0x74, 0x37, 0xe9, 0xf6, 0x40, 0xee, 0x26, 0xdd, 0x1e, 0xa8, 0xbf, 0x97, 0x06, - 0x68, 0x3e, 0x09, 0x89, 0xef, 0xe8, 0x76, 0xbd, 0x8a, 0x9a, 0x89, 0x9b, 0x81, 0xcf, 0xf6, 0x8d, - 0x89, 0x8f, 0x70, 0x11, 0xc7, 0x5a, 0xbd, 0x3a, 0xe1, 0x6e, 0xb8, 0x0a, 0x99, 0x91, 0x2f, 0x2a, - 0x42, 0xb8, 0x8f, 0xbc, 0x8d, 0x37, 0x31, 0x85, 0xa1, 0x66, 0x32, 0xdd, 0x73, 0x6e, 0xdd, 0x47, - 0xa2, 0x83, 0x89, 0xa6, 0x8b, 0x9e, 0x7c, 0x43, 0xd7, 0x0c, 0x22, 0x6e, 0x95, 0x32, 0x3f, 0xf9, - 0xf5, 0x6a, 0x9d, 0xf8, 0x21, 0xce, 0x1b, 0x3a, 0xfd, 0xff, 0xa5, 0xec, 0xdb, 0x5b, 0x00, 0xf1, - 0xd4, 0xd0, 0x32, 0xe4, 0xea, 0xeb, 0xbd, 0xde, 0xa6, 0x32, 0xc5, 0x0d, 0x78, 0x8c, 0x62, 0x60, - 0xf5, 0xff, 0xa5, 0xa1, 0x50, 0xaf, 0x8a, 0x2b, 0xb7, 0x0e, 0x0a, 0xb3, 0x4a, 0xec, 0xf9, 0x8d, - 0x3c, 0xf1, 0x2c, 0xff, 0x50, 0x18, 0x96, 0x0b, 0x02, 0xde, 0x59, 0xca, 0x42, 0x47, 0xdd, 0x64, - 0x0c, 0x08, 0x43, 0x99, 0x08, 0x25, 0x68, 0x86, 0x2e, 0x6d, 0xfc, 0xf2, 0xc5, 0xca, 0xe2, 0xa1, - 0x4b, 0xdc, 0x0e, 0x70, 0x49, 0x0a, 0xa9, 0xeb, 0x01, 0x7a, 0x1f, 0xe6, 0x02, 0x6b, 0xe0, 0x58, - 0xce, 0x40, 0x93, 0xca, 0x63, 0x6f, 0x81, 0xb5, 0x2b, 0xa7, 0x27, 0x2b, 0x33, 0x3d, 0x8e, 0x12, - 0x3a, 0x9c, 0x11, 0x94, 0x75, 0xa6, 0x4a, 0xf4, 0x1e, 0xcc, 0x26, 0x58, 0xa9, 0x16, 0xb9, 0xda, - 0x59, 0x7e, 0x3d, 0xe2, 0x7c, 0x40, 0x0e, 0x71, 0x39, 0x62, 0x7c, 0x40, 0x58, 0x6e, 0x86, 0x65, - 0xa3, 0x35, 0x9f, 0x9d, 0x69, 0x76, 0xbb, 0x67, 0x71, 0x89, 0xc1, 0xf8, 0x31, 0x57, 0x1f, 0xc2, - 0x7c, 0xc7, 0x37, 0xf6, 0x48, 0x10, 0x72, 0x55, 0x08, 0x2d, 0x7e, 0x0c, 0xd7, 0x42, 0x3d, 0x78, - 0xac, 0xed, 0x59, 0x41, 0xe8, 0xfa, 0x87, 0x9a, 0x4f, 0x42, 0xe2, 0x50, 0xbc, 0xc6, 0xaa, 0x25, - 0x44, 0xc6, 0xf1, 0x2a, 0xa5, 0xd9, 0xe0, 0x24, 0x58, 0x52, 0x6c, 0x52, 0x02, 0xb5, 0x05, 0x65, - 0x1a, 0xc2, 0x88, 0xa4, 0x1a, 0x9d, 0x3d, 0xd8, 0xee, 0x40, 0x7b, 0xe6, 0x6b, 0xaa, 0x68, 0xbb, - 0x03, 0xfe, 0xa9, 0x7e, 0x13, 0x94, 0x86, 0x15, 0x78, 0x7a, 0x68, 0xec, 0x45, 0x19, 0xd7, 0x06, - 0x28, 0x7b, 0x44, 0xf7, 0xc3, 0x1d, 0xa2, 0x87, 0x9a, 0x47, 0x7c, 0xcb, 0x35, 0x2f, 0x5f, 0xe5, - 0xb9, 0x88, 0xa5, 0xcb, 0x38, 0xd4, 0xbf, 0x4b, 0x01, 0x60, 0x7d, 0x57, 0x7a, 0x6b, 0x6f, 0xc2, - 0x95, 0xc0, 0xd1, 0xbd, 0x60, 0xcf, 0x0d, 0x35, 0xcb, 0x09, 0x89, 0xbf, 0xaf, 0xdb, 0x22, 0xb9, - 0xa3, 0x48, 0x44, 0x4b, 0xc0, 0xd1, 0x5b, 0x80, 0x1e, 0x13, 0xe2, 0x69, 0xae, 0x6d, 0x6a, 0x12, - 0xc9, 0xab, 0x28, 0xb2, 0x58, 0xa1, 0x98, 0x8e, 0x6d, 0xf6, 0x24, 0x1c, 0xd5, 0x60, 0x99, 0x4e, - 0x9f, 0x38, 0xa1, 0x6f, 0x91, 0x40, 0xdb, 0x75, 0x7d, 0x2d, 0xb0, 0xdd, 0x03, 0x6d, 0xd7, 0xb5, - 0x6d, 0xf7, 0x80, 0xf8, 0x32, 0x6f, 0x56, 0xb1, 0xdd, 0x41, 0x93, 0x13, 0xad, 0xbb, 0x7e, 0xcf, - 0x76, 0x0f, 0xd6, 0x25, 0x05, 0x75, 0xe9, 0xe2, 0x39, 0x87, 0x96, 0xf1, 0x58, 0xba, 0x74, 0x11, - 0xb4, 0x6f, 0x19, 0x8f, 0xd1, 0xab, 0x30, 0x43, 0x6c, 0xc2, 0xd2, 0x27, 0x9c, 0x2a, 0xc7, 0xa8, - 0xca, 0x12, 0x48, 0x89, 0xd4, 0x7b, 0xa0, 0x34, 0x1d, 0xc3, 0x3f, 0xf4, 0x12, 0x6b, 0xfe, 0x16, - 0x20, 0x6a, 0x24, 0x35, 0xdb, 0x35, 0x1e, 0x6b, 0x43, 0xdd, 0xd1, 0x07, 0x74, 0x5c, 0xfc, 0x7d, - 0x56, 0xa1, 0x98, 0x4d, 0xd7, 0x78, 0xbc, 0x25, 0xe0, 0xea, 0xfb, 0x00, 0x3d, 0xcf, 0x27, 0xba, - 0xd9, 0xa1, 0xde, 0x04, 0x55, 0x1d, 0x6b, 0x69, 0xa6, 0x28, 0x0e, 0x70, 0x7d, 0x71, 0xd4, 0x15, - 0x8e, 0x68, 0x44, 0x70, 0xf5, 0x9f, 0xc2, 0x7c, 0xd7, 0xd6, 0x0d, 0x56, 0xae, 0xd3, 0x8d, 0x1e, - 0x1c, 0xd1, 0x5d, 0xc8, 0x73, 0x52, 0xb1, 0x92, 0x13, 0x8f, 0x5b, 0xdc, 0xe7, 0xc6, 0x14, 0x16, - 0xf4, 0xb5, 0x32, 0x40, 0x2c, 0x47, 0xfd, 0xd3, 0x14, 0x14, 0x23, 0xf9, 0x68, 0x95, 0x3f, 0x17, - 0x86, 0xbe, 0x6e, 0x39, 0x22, 0xe2, 0x2f, 0xe2, 0x24, 0x08, 0xb5, 0xa0, 0xe4, 0x45, 0xdc, 0x17, - 0xfa, 0x73, 0x13, 0x46, 0x8d, 0x93, 0xbc, 0xe8, 0x03, 0x28, 0xca, 0x6a, 0x0c, 0x69, 0x61, 0x2f, - 0x2e, 0xde, 0x88, 0xc9, 0x65, 0x22, 0xd5, 0x27, 0x9e, 0x6d, 0x51, 0x9b, 0x93, 0x8d, 0x12, 0xa9, - 0x58, 0x80, 0xd4, 0x6f, 0x00, 0x7c, 0xe2, 0x5a, 0x4e, 0xdf, 0x7d, 0x4c, 0x1c, 0xf6, 0x86, 0x4e, - 0x43, 0x4a, 0x22, 0x15, 0x2d, 0x5a, 0x2c, 0x53, 0xc0, 0x57, 0x29, 0x7a, 0x4a, 0xe6, 0x4d, 0xf5, - 0x77, 0xd3, 0x90, 0xc7, 0xae, 0x1b, 0xd6, 0xab, 0x68, 0x15, 0xf2, 0xc2, 0x94, 0xb0, 0x2b, 0xaa, - 0x56, 0x3c, 0x3d, 0x59, 0xc9, 0x71, 0x1b, 0x92, 0x33, 0x98, 0xf1, 0x48, 0x18, 0xf9, 0xf4, 0x79, - 0x46, 0x1e, 0xdd, 0x86, 0xb2, 0x20, 0xd2, 0xf6, 0xf4, 0x60, 0x8f, 0xc7, 0x77, 0xb5, 0xd9, 0xd3, - 0x93, 0x15, 0xe0, 0x94, 0x1b, 0x7a, 0xb0, 0x87, 0x81, 0x53, 0xd3, 0x6f, 0xd4, 0x84, 0xd2, 0x67, - 0xae, 0xe5, 0x68, 0x21, 0x9b, 0x84, 0xc8, 0x45, 0x4e, 0x5c, 0xea, 0x78, 0xaa, 0xa2, 0x1a, 0x07, - 0x3e, 0x8b, 0x27, 0xdf, 0x84, 0x19, 0xdf, 0x75, 0x43, 0x6e, 0xd9, 0x2c, 0xd7, 0x11, 0x69, 0x8e, - 0xd5, 0x89, 0xd9, 0x6f, 0xd7, 0x0d, 0xb1, 0xa0, 0xc3, 0x65, 0x3f, 0xd1, 0x42, 0xb7, 0x61, 0xc1, - 0xd6, 0x83, 0x50, 0x63, 0x26, 0xd1, 0x8c, 0xa5, 0xe5, 0x99, 0xf2, 0x11, 0xc5, 0xb1, 0x77, 0x3e, - 0x53, 0x72, 0xa8, 0x7f, 0x92, 0x82, 0x12, 0x9d, 0x8c, 0xb5, 0x6b, 0x19, 0xd4, 0x0f, 0x7c, 0x7e, - 0xf7, 0xe4, 0x2a, 0x64, 0x8c, 0xc0, 0x17, 0x4a, 0x65, 0xf7, 0x73, 0xbd, 0x87, 0x31, 0x85, 0xa1, - 0x7b, 0x90, 0x17, 0xe9, 0x16, 0xee, 0x99, 0xa8, 0x97, 0x7b, 0xac, 0x42, 0x37, 0x82, 0x8f, 0x6d, - 0xf7, 0x78, 0x74, 0xfc, 0x9e, 0xc0, 0x49, 0x10, 0x5a, 0x84, 0xb4, 0xc1, 0xd5, 0x25, 0xca, 0xbd, - 0xea, 0x6d, 0x9c, 0x36, 0x1c, 0xf5, 0x67, 0x29, 0x98, 0x89, 0x6d, 0x02, 0xdd, 0x01, 0xd7, 0xa0, - 0x18, 0x8c, 0x76, 0x82, 0xc3, 0x20, 0x24, 0x43, 0x59, 0x1f, 0x10, 0x01, 0x50, 0x0b, 0x8a, 0xba, - 0x3d, 0x70, 0x7d, 0x2b, 0xdc, 0x1b, 0x8a, 0x40, 0x76, 0xb2, 0x37, 0x91, 0x94, 0xb9, 0x56, 0x95, - 0x2c, 0x38, 0xe6, 0x96, 0xae, 0x01, 0x2f, 0x8d, 0x61, 0xae, 0xc1, 0x2b, 0x50, 0xb6, 0xf5, 0x21, - 0xcb, 0x3f, 0x85, 0xd6, 0x90, 0xc8, 0xc3, 0x20, 0x60, 0x7d, 0x6b, 0x48, 0x54, 0x15, 0x8a, 0x91, - 0x30, 0x34, 0x07, 0xa5, 0x6a, 0xb3, 0xa7, 0xbd, 0x7d, 0xe7, 0xae, 0x76, 0xbf, 0xbe, 0xa5, 0x4c, - 0x09, 0xf7, 0xf5, 0xff, 0xa6, 0x60, 0x46, 0x58, 0x2c, 0x11, 0x12, 0xbc, 0x0a, 0xd3, 0xbe, 0xbe, - 0x1b, 0xca, 0xa0, 0x25, 0xcb, 0x77, 0x35, 0xbd, 0x04, 0x68, 0xd0, 0x42, 0x51, 0x93, 0x83, 0x96, - 0x44, 0xc5, 0x4a, 0xe6, 0xc2, 0x8a, 0x95, 0xec, 0x6f, 0xa5, 0x62, 0x45, 0xfd, 0xd7, 0x00, 0xeb, - 0x96, 0x4d, 0xfa, 0x3c, 0x55, 0x35, 0x29, 0x04, 0xa5, 0x6e, 0x5e, 0x54, 0xf8, 0xc3, 0xdd, 0xbc, - 0x56, 0x03, 0x53, 0x18, 0x45, 0x0d, 0x2c, 0x53, 0x1c, 0x46, 0x86, 0xba, 0x4f, 0x51, 0x03, 0xcb, - 0x8c, 0x5e, 0x06, 0xb3, 0x97, 0xbc, 0x0c, 0xaa, 0x73, 0x30, 0x83, 0x79, 0x8e, 0x8d, 0x8f, 0x41, - 0x3d, 0x4e, 0xc1, 0x9c, 0xf0, 0x77, 0x23, 0x93, 0xfd, 0x06, 0x14, 0xb9, 0xeb, 0x1b, 0x07, 0x81, - 0xac, 0x6c, 0x83, 0xd3, 0xb5, 0x1a, 0xb8, 0xc0, 0xd1, 0x2d, 0x13, 0xad, 0x40, 0x49, 0x90, 0x26, - 0x6a, 0x05, 0x81, 0x83, 0x58, 0x31, 0xd3, 0xbb, 0x90, 0xdd, 0xb5, 0x6c, 0x22, 0x76, 0xfe, 0x44, - 0x8b, 0x10, 0x6b, 0x64, 0x63, 0x0a, 0x33, 0xea, 0x5a, 0x41, 0x26, 0xf7, 0xd4, 0x3f, 0x4f, 0xb1, - 0x14, 0x33, 0x0d, 0x55, 0x93, 0xe3, 0xe3, 0x51, 0xeb, 0x99, 0xf1, 0x71, 0x3a, 0x3a, 0x3e, 0x8e, - 0xe6, 0xe3, 0x13, 0xa4, 0xc9, 0xf1, 0x71, 0xd0, 0x6f, 0x3e, 0x3e, 0xf4, 0x11, 0x4c, 0x8b, 0x54, - 0xa5, 0x30, 0x75, 0xaf, 0x4c, 0xdc, 0x19, 0x49, 0x4d, 0x6f, 0x4c, 0x61, 0xc9, 0x93, 0x98, 0xde, - 0x26, 0x2c, 0xd6, 0x6c, 0xdd, 0x78, 0x6c, 0x5b, 0x41, 0x48, 0xcc, 0xa4, 0x05, 0xba, 0x03, 0xf9, - 0x31, 0x3f, 0xf7, 0xa2, 0x24, 0xaa, 0xa0, 0x54, 0xff, 0x57, 0x1a, 0xca, 0x1b, 0x44, 0xb7, 0xc3, - 0xbd, 0x38, 0x53, 0x15, 0x92, 0x20, 0x14, 0xf7, 0x23, 0xfb, 0x46, 0x5f, 0x83, 0x42, 0xe4, 0x06, - 0x5d, 0xfa, 0x1c, 0x18, 0x91, 0xa2, 0x77, 0x60, 0x9a, 0x8e, 0xdd, 0x1d, 0xc9, 0xf8, 0xea, 0xa2, - 0x97, 0x26, 0x41, 0x49, 0x2f, 0x2d, 0x9f, 0x30, 0xbf, 0x87, 0xe9, 0x29, 0x87, 0x65, 0x13, 0x7d, - 0x1d, 0xca, 0xec, 0xa1, 0x44, 0xba, 0x79, 0xb9, 0xcb, 0x64, 0x96, 0xf8, 0x5b, 0x27, 0xa3, 0x46, - 0xf7, 0x60, 0x96, 0x73, 0x47, 0x33, 0xc9, 0x5f, 0xc6, 0x3f, 0xc3, 0x18, 0xa4, 0xa3, 0xa7, 0xfe, - 0x38, 0x0d, 0x0b, 0x5b, 0xfa, 0xe1, 0x0e, 0x11, 0x86, 0x8c, 0x98, 0x98, 0x18, 0xae, 0x6f, 0xa2, - 0x6e, 0xd2, 0x00, 0x5e, 0xf0, 0xf8, 0x3a, 0x89, 0x79, 0xb2, 0x1d, 0x94, 0x51, 0x63, 0x3a, 0x11, - 0x35, 0x2e, 0x40, 0xce, 0x71, 0x1d, 0x83, 0x08, 0xeb, 0xc8, 0x1b, 0xea, 0xf7, 0x53, 0x49, 0xeb, - 0x57, 0x89, 0x1e, 0x46, 0x59, 0xda, 0xac, 0xed, 0x86, 0x51, 0x77, 0xe8, 0x1e, 0x54, 0x7a, 0xcd, - 0x3a, 0x6e, 0xf6, 0x6b, 0x9d, 0x6f, 0x6a, 0xbd, 0xea, 0x66, 0xaf, 0x7a, 0xe7, 0xb6, 0xd6, 0xed, - 0x6c, 0x7e, 0xfa, 0xf6, 0x3b, 0xb7, 0xbf, 0xa6, 0xa4, 0x2a, 0xab, 0x47, 0xc7, 0xab, 0xd7, 0xda, - 0xd5, 0xfa, 0x26, 0x3f, 0xb3, 0x3b, 0xee, 0x93, 0x9e, 0x6e, 0x07, 0xfa, 0x9d, 0xdb, 0x5d, 0xd7, - 0x3e, 0xa4, 0x34, 0xe8, 0x4d, 0x40, 0xeb, 0x4d, 0xdc, 0x6e, 0xf6, 0x35, 0x69, 0x62, 0xeb, 0xb5, - 0xba, 0x92, 0xe6, 0xb1, 0xd8, 0x3a, 0xf1, 0x1d, 0x12, 0x56, 0x9b, 0xbd, 0xb7, 0xef, 0xdc, 0xad, - 0xd7, 0xea, 0xd4, 0x4a, 0x94, 0x93, 0xf7, 0x6d, 0xd2, 0x8d, 0x48, 0x9d, 0xeb, 0x46, 0xc4, 0xde, - 0x48, 0xfa, 0x1c, 0x6f, 0x64, 0x1d, 0x16, 0x0c, 0xdf, 0x0d, 0x02, 0x8d, 0x06, 0x38, 0xc4, 0x3c, - 0x13, 0x42, 0xbd, 0x70, 0x7a, 0xb2, 0x72, 0xa5, 0x4e, 0xf1, 0x3d, 0x86, 0x16, 0xe2, 0xaf, 0x18, - 0x09, 0x10, 0xeb, 0x49, 0xfd, 0xf1, 0x34, 0xf5, 0x15, 0xad, 0x7d, 0xcb, 0x26, 0x03, 0x12, 0xa0, - 0x87, 0x30, 0x67, 0xf8, 0xc4, 0xa4, 0x91, 0x8b, 0x6e, 0x27, 0x0b, 0xf5, 0xbf, 0x3a, 0xd1, 0x6d, - 0x8b, 0x18, 0xd7, 0xea, 0x11, 0x57, 0xcf, 0x23, 0x06, 0x9e, 0x35, 0xc6, 0xda, 0xe8, 0x33, 0x98, - 0x0b, 0x88, 0x6d, 0x39, 0xa3, 0x27, 0x9a, 0xe1, 0x3a, 0x21, 0x79, 0x22, 0x1f, 0x04, 0x2f, 0x93, - 0xdb, 0x6b, 0x6e, 0x52, 0xae, 0x3a, 0x67, 0xaa, 0xa1, 0xd3, 0x93, 0x95, 0xd9, 0x71, 0x18, 0x9e, - 0x15, 0x92, 0x45, 0x1b, 0x35, 0x60, 0x3a, 0x20, 0x86, 0xe1, 0x0e, 0x3d, 0x71, 0xde, 0x6e, 0x5e, - 0xd6, 0x07, 0xa7, 0xee, 0x78, 0x61, 0x80, 0x25, 0x2b, 0xba, 0x0f, 0x05, 0xdd, 0xf3, 0x74, 0x7f, - 0x18, 0x3d, 0x10, 0xbf, 0x79, 0x89, 0x98, 0xaa, 0xe7, 0x55, 0x29, 0x39, 0x93, 0x13, 0x31, 0xa3, - 0x9b, 0x70, 0xc5, 0x71, 0x35, 0x87, 0x1c, 0x68, 0x5e, 0x44, 0xcb, 0xeb, 0xa7, 0xf0, 0x9c, 0xe3, - 0xb6, 0xc9, 0x41, 0x2c, 0xa2, 0xb2, 0x07, 0xb3, 0xe3, 0x8a, 0x44, 0x0b, 0xc2, 0xca, 0x32, 0x63, - 0x1d, 0x59, 0xd1, 0x6b, 0x50, 0xf0, 0xc9, 0xc0, 0x0a, 0x42, 0x9f, 0xef, 0x10, 0x8a, 0x89, 0x20, - 0x68, 0x09, 0xf2, 0x89, 0xc2, 0x1d, 0x8a, 0x13, 0x6d, 0x6a, 0x3e, 0x79, 0xdd, 0x61, 0xe5, 0x5f, - 0xc2, 0x19, 0x35, 0x52, 0x8b, 0x63, 0x5a, 0x81, 0xbe, 0x23, 0x3a, 0x2b, 0x60, 0xd9, 0xa4, 0xc7, - 0x70, 0x14, 0x44, 0xde, 0x33, 0xfb, 0xa6, 0x30, 0xe6, 0xe6, 0x89, 0x2a, 0x4c, 0xe6, 0xc8, 0xc9, - 0x5a, 0xf8, 0x6c, 0xa2, 0x16, 0x7e, 0x01, 0x72, 0x36, 0xd9, 0x27, 0x36, 0x77, 0xb0, 0x30, 0x6f, - 0x54, 0x7e, 0x9c, 0x82, 0x52, 0x42, 0xeb, 0xe8, 0x13, 0x71, 0x0b, 0x73, 0xab, 0xf1, 0xde, 0xb3, - 0xaf, 0x97, 0xfc, 0x1e, 0x2f, 0xe1, 0xf1, 0x7c, 0x97, 0x29, 0x8d, 0xdb, 0x0d, 0xd9, 0x54, 0xdf, - 0x8b, 0x3a, 0x65, 0xb9, 0xf2, 0x52, 0xa2, 0x04, 0x06, 0xcd, 0x02, 0x6c, 0xb7, 0xeb, 0x9d, 0xf6, - 0x7a, 0xab, 0xdd, 0x6c, 0xf0, 0xd7, 0xdf, 0xfa, 0x76, 0xaf, 0xdf, 0xd9, 0x52, 0xd2, 0x95, 0xef, - 0xa6, 0xa0, 0x9c, 0x5c, 0x5c, 0xb4, 0x39, 0x36, 0xdc, 0xbb, 0xcf, 0xb1, 0x2f, 0xa2, 0x46, 0xc2, - 0xb3, 0x78, 0x23, 0x96, 0xfe, 0xf4, 0xb8, 0xca, 0x50, 0x68, 0xb4, 0x7a, 0xd5, 0xda, 0x26, 0x1d, - 0x15, 0x33, 0x73, 0x9f, 0xb8, 0x3b, 0xc2, 0x77, 0x5b, 0x87, 0x99, 0xcf, 0xdc, 0x1d, 0xcd, 0x0a, - 0x89, 0x1f, 0xd7, 0x2e, 0x96, 0xee, 0xbc, 0x34, 0x69, 0x3c, 0xe2, 0xa7, 0x04, 0xc2, 0x3b, 0x2e, - 0x7f, 0xe6, 0xee, 0xb4, 0x24, 0x1b, 0xaa, 0xc2, 0x2c, 0x73, 0xfa, 0xc9, 0x13, 0x62, 0x8c, 0x98, - 0xa0, 0xcb, 0x1f, 0xeb, 0x67, 0x28, 0x47, 0x53, 0x32, 0xa8, 0x3f, 0xca, 0x81, 0xc2, 0x2b, 0x9c, - 0xaa, 0xac, 0xe2, 0x99, 0x4d, 0xe4, 0x1e, 0xe4, 0x02, 0xc3, 0x8d, 0x0a, 0x65, 0x27, 0x1e, 0xc3, - 0xb3, 0x4c, 0x6b, 0x3d, 0xca, 0x81, 0x39, 0x23, 0x5a, 0x87, 0xe9, 0x60, 0x4f, 0xf7, 0x2d, 0x67, - 0x20, 0x3c, 0xea, 0xb7, 0x9e, 0x4d, 0x06, 0xe7, 0xc1, 0x92, 0x19, 0x6d, 0x40, 0x6e, 0x87, 0x86, - 0xf1, 0xc2, 0x20, 0xdc, 0x7e, 0x26, 0x29, 0x35, 0xca, 0xc1, 0xa1, 0x1b, 0x53, 0x98, 0x0b, 0xa0, - 0x92, 0x58, 0xb9, 0xa5, 0xb0, 0x09, 0xcf, 0x26, 0x89, 0x55, 0x2e, 0xc5, 0x92, 0x98, 0x80, 0xca, - 0x0c, 0x94, 0x12, 0x3d, 0x54, 0xee, 0x43, 0x29, 0x41, 0x86, 0x5e, 0x84, 0xe9, 0xdd, 0x40, 0x4b, - 0xfc, 0xb4, 0x24, 0xbf, 0x1b, 0xb0, 0xf2, 0xb3, 0x15, 0x28, 0x31, 0x7e, 0x6d, 0xd7, 0xd6, 0x07, - 0xf2, 0xa5, 0x16, 0x18, 0x68, 0x9d, 0x42, 0x54, 0x03, 0x72, 0x4c, 0x87, 0xe8, 0x26, 0x94, 0x7a, - 0xad, 0xf6, 0xfd, 0xcd, 0xa6, 0xd6, 0xee, 0x34, 0xe8, 0x65, 0xc8, 0xea, 0x11, 0xb9, 0x7c, 0x46, - 0xd1, 0xb3, 0x9c, 0x81, 0x4d, 0x58, 0x8d, 0xfb, 0x0d, 0x80, 0xad, 0xed, 0xcd, 0x7e, 0x8b, 0x93, - 0x8a, 0x22, 0xaf, 0x04, 0xe9, 0xd6, 0xc8, 0x0e, 0x2d, 0x4a, 0x29, 0x02, 0x89, 0xff, 0x99, 0x82, - 0x69, 0xa1, 0x65, 0xb4, 0x12, 0xdd, 0xb6, 0x2f, 0x1c, 0x1d, 0xaf, 0x5e, 0x11, 0x5c, 0x1c, 0xc9, - 0x4a, 0x91, 0x6e, 0xb0, 0x2a, 0xf1, 0x86, 0xd6, 0x69, 0x6f, 0x7e, 0xaa, 0xa4, 0xc6, 0x86, 0x21, - 0x16, 0x4a, 0x94, 0x90, 0xa2, 0x9b, 0x00, 0x9d, 0x76, 0x53, 0x7b, 0x84, 0x5b, 0xfd, 0x26, 0x96, - 0x55, 0x64, 0x63, 0xa4, 0x1d, 0x87, 0x3c, 0xf2, 0xe9, 0x8e, 0x47, 0x2f, 0x43, 0xa6, 0xba, 0xb9, - 0xa9, 0x64, 0x78, 0x65, 0xd3, 0x18, 0x51, 0xd5, 0xb6, 0xf9, 0x38, 0x6b, 0x33, 0x50, 0xe2, 0x25, - 0xf8, 0x4c, 0x95, 0xea, 0x5d, 0x28, 0x0b, 0x42, 0x9e, 0x96, 0x7e, 0x3a, 0x07, 0xbb, 0x18, 0xe5, - 0xc2, 0xe5, 0x8b, 0x2d, 0x6b, 0xa9, 0xff, 0x23, 0x03, 0xf3, 0x9c, 0x55, 0xbc, 0x8a, 0xc5, 0xf1, - 0xd3, 0xe5, 0x8f, 0x3e, 0xf5, 0xf1, 0x02, 0x87, 0xaf, 0x9e, 0xbf, 0x69, 0xc6, 0x84, 0x8f, 0x3f, - 0xbe, 0x98, 0x30, 0x27, 0x9f, 0x26, 0xe5, 0x15, 0xca, 0x33, 0x2a, 0x1f, 0x3e, 0xab, 0x38, 0xd1, - 0x12, 0x06, 0x9f, 0xe7, 0xb0, 0xe5, 0xab, 0x68, 0xe2, 0x16, 0x90, 0x65, 0x15, 0xb9, 0xb1, 0xb2, - 0x8a, 0x4a, 0x15, 0xe6, 0x27, 0x08, 0x78, 0xae, 0x34, 0xf6, 0xb7, 0xe5, 0x63, 0xd1, 0x3c, 0xcc, - 0x89, 0x27, 0x1e, 0xad, 0xbb, 0x5d, 0xdb, 0x6c, 0xf5, 0x36, 0x94, 0x29, 0x34, 0x03, 0x45, 0xd1, - 0x60, 0x16, 0xb8, 0x02, 0x8b, 0x92, 0x86, 0x6e, 0x4a, 0x6d, 0xbb, 0x2d, 0x49, 0xd3, 0xe8, 0x05, - 0xb8, 0x22, 0x71, 0x31, 0x38, 0xa3, 0xfe, 0x41, 0x1a, 0x80, 0x4f, 0x9c, 0xfd, 0x5e, 0xe4, 0x3a, - 0xcc, 0x1a, 0xba, 0xa7, 0x1b, 0x56, 0x78, 0x38, 0x56, 0x18, 0x3a, 0x23, 0xa1, 0xbc, 0x38, 0xf4, - 0x9b, 0x51, 0xb5, 0x7a, 0xec, 0x9a, 0x9c, 0xfb, 0x2b, 0xab, 0x58, 0xbc, 0xf8, 0x1c, 0xd3, 0xa6, - 0xa8, 0x5b, 0x97, 0xca, 0x7c, 0x03, 0x8a, 0x42, 0x72, 0x14, 0x7d, 0xb2, 0x70, 0x4b, 0x08, 0x69, - 0xe0, 0x02, 0x47, 0xb7, 0xcc, 0xf3, 0x7f, 0x64, 0x92, 0xf9, 0x4d, 0x7e, 0x64, 0x52, 0xb9, 0x07, - 0xe8, 0xe9, 0xe1, 0x3d, 0xd7, 0x5a, 0x3d, 0x82, 0x99, 0xba, 0x50, 0x13, 0x66, 0xd5, 0x09, 0xd7, - 0x61, 0xd6, 0xe7, 0x3f, 0x2b, 0x34, 0xc7, 0xb5, 0x29, 0xa1, 0x5c, 0x9b, 0x2b, 0x50, 0x62, 0x29, - 0xf1, 0xb1, 0xdf, 0x39, 0x02, 0x03, 0x31, 0x02, 0xf5, 0x8f, 0xb3, 0xd1, 0x55, 0x11, 0x50, 0xe7, - 0x95, 0x65, 0x25, 0x17, 0x21, 0x1d, 0x9d, 0x20, 0x96, 0x84, 0x69, 0x35, 0x70, 0xda, 0x32, 0xc7, - 0x35, 0x98, 0xbe, 0x50, 0x83, 0xf1, 0xa3, 0x6f, 0xe6, 0x99, 0x1f, 0x7d, 0xbf, 0xfd, 0xd4, 0xd2, - 0x73, 0x85, 0xff, 0x93, 0x0b, 0xcc, 0x7a, 0x34, 0xe8, 0x67, 0xd8, 0x00, 0xfa, 0xd3, 0x67, 0x36, - 0x77, 0xfe, 0x03, 0xe1, 0x53, 0x1d, 0x3c, 0xcb, 0x81, 0x6d, 0x46, 0x16, 0x8e, 0xb9, 0x24, 0x3c, - 0x9a, 0x7b, 0xed, 0x59, 0xae, 0x25, 0x0c, 0x7a, 0x7c, 0x57, 0x7f, 0xc0, 0x9c, 0x66, 0x9f, 0x84, - 0x81, 0xf8, 0x1d, 0xd9, 0xea, 0xf9, 0x22, 0x44, 0xd6, 0x43, 0x32, 0x7c, 0xf9, 0xcd, 0xf6, 0xdb, - 0xb0, 0x2d, 0xdf, 0x8a, 0x76, 0x55, 0x54, 0x08, 0x74, 0xee, 0xae, 0x7a, 0xce, 0x1f, 0xe3, 0xa8, - 0xff, 0x2e, 0x05, 0xf3, 0xd1, 0x71, 0x8b, 0x7f, 0x5a, 0x8b, 0x3e, 0x80, 0x22, 0xdb, 0xfc, 0x81, - 0xc5, 0xde, 0xd4, 0x2f, 0x3f, 0xaa, 0x31, 0x39, 0x4b, 0x8d, 0xb3, 0x4c, 0xb9, 0x4f, 0x4c, 0x61, - 0x70, 0x2e, 0xe1, 0x8d, 0xc8, 0xd5, 0xef, 0xa5, 0xa0, 0x20, 0xe1, 0x68, 0x1d, 0x0a, 0x01, 0x19, - 0xb0, 0x9f, 0xfa, 0x8a, 0x31, 0xdc, 0xbc, 0x48, 0xce, 0x5a, 0x4f, 0x10, 0x8b, 0xca, 0x20, 0xc9, - 0x5b, 0xf9, 0x10, 0x66, 0xc6, 0x50, 0xcf, 0xa5, 0xfd, 0x5f, 0x46, 0x87, 0x9a, 0x1a, 0x0d, 0xf1, - 0xdb, 0xb1, 0xc8, 0xeb, 0x4a, 0x5d, 0xe6, 0x2b, 0xc5, 0x4c, 0x97, 0x78, 0x5d, 0xe9, 0xe7, 0x90, - 0x34, 0xc9, 0xeb, 0x42, 0xdd, 0xf1, 0xe3, 0xc2, 0x4d, 0xc5, 0xad, 0x67, 0x92, 0x37, 0xf9, 0xe4, - 0xfc, 0x63, 0xf9, 0x71, 0x95, 0xbf, 0x4f, 0x01, 0x24, 0x9c, 0xe9, 0x8d, 0xb1, 0x98, 0xe3, 0xdd, - 0xe7, 0x1c, 0xf1, 0x5a, 0x22, 0xde, 0xf8, 0x6f, 0x29, 0xc8, 0xca, 0x40, 0x23, 0xae, 0xde, 0x5a, - 0x04, 0x94, 0xf0, 0x16, 0xa5, 0x0b, 0x96, 0x42, 0x2f, 0xc1, 0x8b, 0x49, 0x38, 0x75, 0xe4, 0x9a, - 0x98, 0xbb, 0x72, 0x69, 0x7a, 0x47, 0xc7, 0x6e, 0xe3, 0x18, 0x2e, 0x83, 0xae, 0xc1, 0x52, 0x02, - 0x27, 0x64, 0x08, 0xb1, 0x59, 0x2a, 0x36, 0x81, 0xe5, 0x9f, 0x02, 0x99, 0x3b, 0xe3, 0xb5, 0xdd, - 0xfc, 0x3a, 0x94, 0xe5, 0x4f, 0x74, 0x99, 0xea, 0x0a, 0x90, 0xed, 0x57, 0x7b, 0x0f, 0x94, 0x29, - 0x1a, 0xa5, 0xf1, 0x64, 0x8e, 0x88, 0xd8, 0x68, 0xfc, 0x76, 0x5f, 0x49, 0xd3, 0x6f, 0xf1, 0x33, - 0x8c, 0xcc, 0xcd, 0xff, 0x94, 0x85, 0x62, 0x54, 0x3d, 0x8a, 0xae, 0x42, 0xa6, 0xdd, 0x7c, 0x24, - 0x33, 0x43, 0x11, 0xbc, 0x4d, 0x0e, 0xd0, 0x2b, 0x71, 0xdd, 0xc9, 0x3d, 0xee, 0x54, 0x46, 0x68, - 0x59, 0x73, 0xf2, 0x1a, 0x14, 0xaa, 0xbd, 0x5e, 0xeb, 0x3e, 0x8d, 0x11, 0xbf, 0x48, 0x71, 0x7f, - 0x37, 0x22, 0xe2, 0x86, 0x9b, 0x98, 0x8c, 0xaa, 0x5e, 0x6f, 0x76, 0xfb, 0xcd, 0x86, 0xf2, 0x79, - 0xfa, 0x2c, 0x15, 0xab, 0xa3, 0x60, 0x3f, 0x28, 0x2a, 0x76, 0x71, 0xb3, 0x5b, 0xc5, 0xb4, 0xc3, - 0x2f, 0xd2, 0xbc, 0x1c, 0x26, 0xee, 0xd1, 0x27, 0x1e, 0x77, 0xaf, 0x97, 0xe5, 0x6f, 0x17, 0x3f, - 0xcf, 0xf0, 0x9f, 0x8c, 0xc4, 0xa5, 0xb0, 0x44, 0x37, 0x0f, 0x69, 0x6f, 0xac, 0x06, 0x99, 0x89, - 0xc9, 0x9c, 0xe9, 0xad, 0x17, 0xea, 0x7e, 0x48, 0xa5, 0xa8, 0x30, 0x8d, 0xb7, 0xdb, 0x6d, 0x4a, - 0xf4, 0x79, 0xf6, 0xcc, 0xec, 0xf0, 0xc8, 0x71, 0x28, 0xcd, 0x75, 0x28, 0xc8, 0x12, 0x65, 0xe5, - 0x8b, 0xec, 0x99, 0x01, 0xd5, 0x65, 0x7d, 0x35, 0xeb, 0x70, 0x63, 0xbb, 0xcf, 0x7e, 0x5a, 0xf9, - 0x79, 0xee, 0x6c, 0x87, 0x7b, 0xa3, 0xd0, 0x74, 0x0f, 0x1c, 0xb4, 0x1a, 0x55, 0xde, 0x7c, 0x91, - 0xe3, 0xa9, 0xb1, 0x88, 0x46, 0x94, 0xdd, 0xbc, 0x06, 0x05, 0xdc, 0xfc, 0x84, 0xff, 0x0a, 0xf3, - 0xf3, 0xfc, 0x19, 0x39, 0x98, 0x7c, 0x46, 0x0c, 0xda, 0xdb, 0x2a, 0xe4, 0x71, 0x73, 0xab, 0xf3, - 0xb0, 0xa9, 0xfc, 0xf7, 0xfc, 0x19, 0x39, 0x98, 0x0c, 0x5d, 0xf6, 0x8b, 0xab, 0x42, 0x07, 0x77, - 0x37, 0xaa, 0x6c, 0x51, 0xce, 0xca, 0xe9, 0xf8, 0xde, 0x9e, 0xee, 0x10, 0x33, 0xfe, 0x4d, 0x4c, - 0x84, 0xba, 0xf9, 0x6d, 0x28, 0xc8, 0xa7, 0x28, 0xb4, 0x0c, 0xf9, 0x47, 0x1d, 0xfc, 0xa0, 0x89, - 0x95, 0x29, 0xae, 0x65, 0x89, 0x79, 0xc4, 0x1f, 0x11, 0x57, 0x61, 0x7a, 0xab, 0xda, 0xae, 0xde, - 0xa7, 0x67, 0x82, 0x0f, 0x43, 0x12, 0x88, 0xf7, 0x94, 0x8a, 0x22, 0x3a, 0x88, 0x64, 0xd6, 0x5e, - 0xfb, 0xc9, 0xaf, 0x96, 0xa7, 0x7e, 0xf1, 0xab, 0xe5, 0xa9, 0xcf, 0x4f, 0x97, 0x53, 0x3f, 0x39, - 0x5d, 0x4e, 0xfd, 0xf4, 0x74, 0x39, 0xf5, 0x97, 0xa7, 0xcb, 0xa9, 0x7f, 0xff, 0xeb, 0xe5, 0xa9, - 0x9f, 0xfe, 0x7a, 0x79, 0xea, 0x17, 0xbf, 0x5e, 0x9e, 0xda, 0xc9, 0xb3, 0xe8, 0xfa, 0x9d, 0x7f, - 0x08, 0x00, 0x00, 0xff, 0xff, 0x17, 0xf6, 0x52, 0x33, 0xb1, 0x45, 0x00, 0x00, -} - -func (m *Version) Copy() *Version { - if m == nil { - return nil - } - o := &Version{} - o.CopyFrom(m) - return o -} - -func (m *Version) CopyFrom(src interface{}) { - - o := src.(*Version) - *m = *o -} - -func (m *IndexEntry) Copy() *IndexEntry { - if m == nil { - return nil - } - o := &IndexEntry{} - o.CopyFrom(m) - return o -} - -func (m *IndexEntry) CopyFrom(src interface{}) { - - o := src.(*IndexEntry) - *m = *o -} - -func (m *Annotations) Copy() *Annotations { - if m == nil { - return nil - } - o := &Annotations{} - o.CopyFrom(m) - return o -} - -func (m *Annotations) CopyFrom(src interface{}) { - - o := src.(*Annotations) - *m = *o - if o.Labels != nil { - m.Labels = make(map[string]string, len(o.Labels)) - for k, v := range o.Labels { - m.Labels[k] = v - } - } - - if o.Indices != nil { - m.Indices = make([]IndexEntry, len(o.Indices)) - for i := range m.Indices { - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Indices[i], &o.Indices[i]) - } - } - -} - -func (m *NamedGenericResource) Copy() *NamedGenericResource { - if m == nil { - return nil - } - o := &NamedGenericResource{} - o.CopyFrom(m) - return o -} - -func (m *NamedGenericResource) CopyFrom(src interface{}) { - - o := src.(*NamedGenericResource) - *m = *o -} - -func (m *DiscreteGenericResource) Copy() *DiscreteGenericResource { - if m == nil { - return nil - } - o := &DiscreteGenericResource{} - o.CopyFrom(m) - return o -} - -func (m *DiscreteGenericResource) CopyFrom(src interface{}) { - - o := src.(*DiscreteGenericResource) - *m = *o -} - -func (m *GenericResource) Copy() *GenericResource { - if m == nil { - return nil - } - o := &GenericResource{} - o.CopyFrom(m) - return o -} - -func (m *GenericResource) CopyFrom(src interface{}) { - - o := src.(*GenericResource) - *m = *o - if o.Resource != nil { - switch o.Resource.(type) { - case *GenericResource_NamedResourceSpec: - v := GenericResource_NamedResourceSpec{ - NamedResourceSpec: &NamedGenericResource{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.NamedResourceSpec, o.GetNamedResourceSpec()) - m.Resource = &v - case *GenericResource_DiscreteResourceSpec: - v := GenericResource_DiscreteResourceSpec{ - DiscreteResourceSpec: &DiscreteGenericResource{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.DiscreteResourceSpec, o.GetDiscreteResourceSpec()) - m.Resource = &v - } - } - -} - -func (m *Resources) Copy() *Resources { - if m == nil { - return nil - } - o := &Resources{} - o.CopyFrom(m) - return o -} - -func (m *Resources) CopyFrom(src interface{}) { - - o := src.(*Resources) - *m = *o - if o.Generic != nil { - m.Generic = make([]*GenericResource, len(o.Generic)) - for i := range m.Generic { - m.Generic[i] = &GenericResource{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Generic[i], o.Generic[i]) - } - } - -} - -func (m *ResourceRequirements) Copy() *ResourceRequirements { - if m == nil { - return nil - } - o := &ResourceRequirements{} - o.CopyFrom(m) - return o -} - -func (m *ResourceRequirements) CopyFrom(src interface{}) { - - o := src.(*ResourceRequirements) - *m = *o - if o.Limits != nil { - m.Limits = &Resources{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Limits, o.Limits) - } - if o.Reservations != nil { - m.Reservations = &Resources{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Reservations, o.Reservations) - } - if o.SwapBytes != nil { - m.SwapBytes = &types.Int64Value{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.SwapBytes, o.SwapBytes) - } - if o.MemorySwappiness != nil { - m.MemorySwappiness = &types.Int64Value{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.MemorySwappiness, o.MemorySwappiness) - } -} - -func (m *Platform) Copy() *Platform { - if m == nil { - return nil - } - o := &Platform{} - o.CopyFrom(m) - return o -} - -func (m *Platform) CopyFrom(src interface{}) { - - o := src.(*Platform) - *m = *o -} - -func (m *PluginDescription) Copy() *PluginDescription { - if m == nil { - return nil - } - o := &PluginDescription{} - o.CopyFrom(m) - return o -} - -func (m *PluginDescription) CopyFrom(src interface{}) { - - o := src.(*PluginDescription) - *m = *o -} - -func (m *EngineDescription) Copy() *EngineDescription { - if m == nil { - return nil - } - o := &EngineDescription{} - o.CopyFrom(m) - return o -} - -func (m *EngineDescription) CopyFrom(src interface{}) { - - o := src.(*EngineDescription) - *m = *o - if o.Labels != nil { - m.Labels = make(map[string]string, len(o.Labels)) - for k, v := range o.Labels { - m.Labels[k] = v - } - } - - if o.Plugins != nil { - m.Plugins = make([]PluginDescription, len(o.Plugins)) - for i := range m.Plugins { - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Plugins[i], &o.Plugins[i]) - } - } - -} - -func (m *NodeDescription) Copy() *NodeDescription { - if m == nil { - return nil - } - o := &NodeDescription{} - o.CopyFrom(m) - return o -} - -func (m *NodeDescription) CopyFrom(src interface{}) { - - o := src.(*NodeDescription) - *m = *o - if o.Platform != nil { - m.Platform = &Platform{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Platform, o.Platform) - } - if o.Resources != nil { - m.Resources = &Resources{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Resources, o.Resources) - } - if o.Engine != nil { - m.Engine = &EngineDescription{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Engine, o.Engine) - } - if o.TLSInfo != nil { - m.TLSInfo = &NodeTLSInfo{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.TLSInfo, o.TLSInfo) - } - if o.CSIInfo != nil { - m.CSIInfo = make([]*NodeCSIInfo, len(o.CSIInfo)) - for i := range m.CSIInfo { - m.CSIInfo[i] = &NodeCSIInfo{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.CSIInfo[i], o.CSIInfo[i]) - } - } - -} - -func (m *NodeTLSInfo) Copy() *NodeTLSInfo { - if m == nil { - return nil - } - o := &NodeTLSInfo{} - o.CopyFrom(m) - return o -} - -func (m *NodeTLSInfo) CopyFrom(src interface{}) { - - o := src.(*NodeTLSInfo) - *m = *o - if o.TrustRoot != nil { - m.TrustRoot = make([]byte, len(o.TrustRoot)) - copy(m.TrustRoot, o.TrustRoot) - } - if o.CertIssuerSubject != nil { - m.CertIssuerSubject = make([]byte, len(o.CertIssuerSubject)) - copy(m.CertIssuerSubject, o.CertIssuerSubject) - } - if o.CertIssuerPublicKey != nil { - m.CertIssuerPublicKey = make([]byte, len(o.CertIssuerPublicKey)) - copy(m.CertIssuerPublicKey, o.CertIssuerPublicKey) - } -} - -func (m *NodeCSIInfo) Copy() *NodeCSIInfo { - if m == nil { - return nil - } - o := &NodeCSIInfo{} - o.CopyFrom(m) - return o -} - -func (m *NodeCSIInfo) CopyFrom(src interface{}) { - - o := src.(*NodeCSIInfo) - *m = *o - if o.AccessibleTopology != nil { - m.AccessibleTopology = &Topology{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.AccessibleTopology, o.AccessibleTopology) - } -} - -func (m *RaftMemberStatus) Copy() *RaftMemberStatus { - if m == nil { - return nil - } - o := &RaftMemberStatus{} - o.CopyFrom(m) - return o -} - -func (m *RaftMemberStatus) CopyFrom(src interface{}) { - - o := src.(*RaftMemberStatus) - *m = *o -} - -func (m *NodeStatus) Copy() *NodeStatus { - if m == nil { - return nil - } - o := &NodeStatus{} - o.CopyFrom(m) - return o -} - -func (m *NodeStatus) CopyFrom(src interface{}) { - - o := src.(*NodeStatus) - *m = *o -} - -func (m *Image) Copy() *Image { - if m == nil { - return nil - } - o := &Image{} - o.CopyFrom(m) - return o -} - -func (m *Image) CopyFrom(src interface{}) { - - o := src.(*Image) - *m = *o -} - -func (m *Mount) Copy() *Mount { - if m == nil { - return nil - } - o := &Mount{} - o.CopyFrom(m) - return o -} - -func (m *Mount) CopyFrom(src interface{}) { - - o := src.(*Mount) - *m = *o - if o.BindOptions != nil { - m.BindOptions = &Mount_BindOptions{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.BindOptions, o.BindOptions) - } - if o.VolumeOptions != nil { - m.VolumeOptions = &Mount_VolumeOptions{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.VolumeOptions, o.VolumeOptions) - } - if o.TmpfsOptions != nil { - m.TmpfsOptions = &Mount_TmpfsOptions{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.TmpfsOptions, o.TmpfsOptions) - } -} - -func (m *Mount_BindOptions) Copy() *Mount_BindOptions { - if m == nil { - return nil - } - o := &Mount_BindOptions{} - o.CopyFrom(m) - return o -} - -func (m *Mount_BindOptions) CopyFrom(src interface{}) { - - o := src.(*Mount_BindOptions) - *m = *o -} - -func (m *Mount_VolumeOptions) Copy() *Mount_VolumeOptions { - if m == nil { - return nil - } - o := &Mount_VolumeOptions{} - o.CopyFrom(m) - return o -} - -func (m *Mount_VolumeOptions) CopyFrom(src interface{}) { - - o := src.(*Mount_VolumeOptions) - *m = *o - if o.Labels != nil { - m.Labels = make(map[string]string, len(o.Labels)) - for k, v := range o.Labels { - m.Labels[k] = v - } - } - - if o.DriverConfig != nil { - m.DriverConfig = &Driver{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.DriverConfig, o.DriverConfig) - } -} - -func (m *Mount_TmpfsOptions) Copy() *Mount_TmpfsOptions { - if m == nil { - return nil - } - o := &Mount_TmpfsOptions{} - o.CopyFrom(m) - return o -} - -func (m *Mount_TmpfsOptions) CopyFrom(src interface{}) { - - o := src.(*Mount_TmpfsOptions) - *m = *o -} - -func (m *RestartPolicy) Copy() *RestartPolicy { - if m == nil { - return nil - } - o := &RestartPolicy{} - o.CopyFrom(m) - return o -} - -func (m *RestartPolicy) CopyFrom(src interface{}) { - - o := src.(*RestartPolicy) - *m = *o - if o.Delay != nil { - m.Delay = &types.Duration{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Delay, o.Delay) - } - if o.Window != nil { - m.Window = &types.Duration{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Window, o.Window) - } -} - -func (m *UpdateConfig) Copy() *UpdateConfig { - if m == nil { - return nil - } - o := &UpdateConfig{} - o.CopyFrom(m) - return o -} - -func (m *UpdateConfig) CopyFrom(src interface{}) { - - o := src.(*UpdateConfig) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Delay, &o.Delay) - if o.Monitor != nil { - m.Monitor = &types.Duration{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Monitor, o.Monitor) - } -} - -func (m *UpdateStatus) Copy() *UpdateStatus { - if m == nil { - return nil - } - o := &UpdateStatus{} - o.CopyFrom(m) - return o -} - -func (m *UpdateStatus) CopyFrom(src interface{}) { - - o := src.(*UpdateStatus) - *m = *o - if o.StartedAt != nil { - m.StartedAt = &types.Timestamp{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.StartedAt, o.StartedAt) - } - if o.CompletedAt != nil { - m.CompletedAt = &types.Timestamp{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.CompletedAt, o.CompletedAt) - } -} - -func (m *ContainerStatus) Copy() *ContainerStatus { - if m == nil { - return nil - } - o := &ContainerStatus{} - o.CopyFrom(m) - return o -} - -func (m *ContainerStatus) CopyFrom(src interface{}) { - - o := src.(*ContainerStatus) - *m = *o -} - -func (m *PortStatus) Copy() *PortStatus { - if m == nil { - return nil - } - o := &PortStatus{} - o.CopyFrom(m) - return o -} - -func (m *PortStatus) CopyFrom(src interface{}) { - - o := src.(*PortStatus) - *m = *o - if o.Ports != nil { - m.Ports = make([]*PortConfig, len(o.Ports)) - for i := range m.Ports { - m.Ports[i] = &PortConfig{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Ports[i], o.Ports[i]) - } - } - -} - -func (m *TaskStatus) Copy() *TaskStatus { - if m == nil { - return nil - } - o := &TaskStatus{} - o.CopyFrom(m) - return o -} - -func (m *TaskStatus) CopyFrom(src interface{}) { - - o := src.(*TaskStatus) - *m = *o - if o.Timestamp != nil { - m.Timestamp = &types.Timestamp{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Timestamp, o.Timestamp) - } - if o.PortStatus != nil { - m.PortStatus = &PortStatus{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.PortStatus, o.PortStatus) - } - if o.AppliedAt != nil { - m.AppliedAt = &types.Timestamp{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.AppliedAt, o.AppliedAt) - } - if o.RuntimeStatus != nil { - switch o.RuntimeStatus.(type) { - case *TaskStatus_Container: - v := TaskStatus_Container{ - Container: &ContainerStatus{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Container, o.GetContainer()) - m.RuntimeStatus = &v - } - } - -} - -func (m *NetworkAttachmentConfig) Copy() *NetworkAttachmentConfig { - if m == nil { - return nil - } - o := &NetworkAttachmentConfig{} - o.CopyFrom(m) - return o -} - -func (m *NetworkAttachmentConfig) CopyFrom(src interface{}) { - - o := src.(*NetworkAttachmentConfig) - *m = *o - if o.Aliases != nil { - m.Aliases = make([]string, len(o.Aliases)) - copy(m.Aliases, o.Aliases) - } - - if o.Addresses != nil { - m.Addresses = make([]string, len(o.Addresses)) - copy(m.Addresses, o.Addresses) - } - - if o.DriverAttachmentOpts != nil { - m.DriverAttachmentOpts = make(map[string]string, len(o.DriverAttachmentOpts)) - for k, v := range o.DriverAttachmentOpts { - m.DriverAttachmentOpts[k] = v - } - } - -} - -func (m *IPAMConfig) Copy() *IPAMConfig { - if m == nil { - return nil - } - o := &IPAMConfig{} - o.CopyFrom(m) - return o -} - -func (m *IPAMConfig) CopyFrom(src interface{}) { - - o := src.(*IPAMConfig) - *m = *o - if o.Reserved != nil { - m.Reserved = make(map[string]string, len(o.Reserved)) - for k, v := range o.Reserved { - m.Reserved[k] = v - } - } - -} - -func (m *PortConfig) Copy() *PortConfig { - if m == nil { - return nil - } - o := &PortConfig{} - o.CopyFrom(m) - return o -} - -func (m *PortConfig) CopyFrom(src interface{}) { - - o := src.(*PortConfig) - *m = *o -} - -func (m *Driver) Copy() *Driver { - if m == nil { - return nil - } - o := &Driver{} - o.CopyFrom(m) - return o -} - -func (m *Driver) CopyFrom(src interface{}) { - - o := src.(*Driver) - *m = *o - if o.Options != nil { - m.Options = make(map[string]string, len(o.Options)) - for k, v := range o.Options { - m.Options[k] = v - } - } - -} - -func (m *IPAMOptions) Copy() *IPAMOptions { - if m == nil { - return nil - } - o := &IPAMOptions{} - o.CopyFrom(m) - return o -} - -func (m *IPAMOptions) CopyFrom(src interface{}) { - - o := src.(*IPAMOptions) - *m = *o - if o.Driver != nil { - m.Driver = &Driver{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Driver, o.Driver) - } - if o.Configs != nil { - m.Configs = make([]*IPAMConfig, len(o.Configs)) - for i := range m.Configs { - m.Configs[i] = &IPAMConfig{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Configs[i], o.Configs[i]) - } - } - -} - -func (m *Peer) Copy() *Peer { - if m == nil { - return nil - } - o := &Peer{} - o.CopyFrom(m) - return o -} - -func (m *Peer) CopyFrom(src interface{}) { - - o := src.(*Peer) - *m = *o -} - -func (m *WeightedPeer) Copy() *WeightedPeer { - if m == nil { - return nil - } - o := &WeightedPeer{} - o.CopyFrom(m) - return o -} - -func (m *WeightedPeer) CopyFrom(src interface{}) { - - o := src.(*WeightedPeer) - *m = *o - if o.Peer != nil { - m.Peer = &Peer{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Peer, o.Peer) - } -} - -func (m *IssuanceStatus) Copy() *IssuanceStatus { - if m == nil { - return nil - } - o := &IssuanceStatus{} - o.CopyFrom(m) - return o -} - -func (m *IssuanceStatus) CopyFrom(src interface{}) { - - o := src.(*IssuanceStatus) - *m = *o -} - -func (m *AcceptancePolicy) Copy() *AcceptancePolicy { - if m == nil { - return nil - } - o := &AcceptancePolicy{} - o.CopyFrom(m) - return o -} - -func (m *AcceptancePolicy) CopyFrom(src interface{}) { - - o := src.(*AcceptancePolicy) - *m = *o - if o.Policies != nil { - m.Policies = make([]*AcceptancePolicy_RoleAdmissionPolicy, len(o.Policies)) - for i := range m.Policies { - m.Policies[i] = &AcceptancePolicy_RoleAdmissionPolicy{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Policies[i], o.Policies[i]) - } - } - -} - -func (m *AcceptancePolicy_RoleAdmissionPolicy) Copy() *AcceptancePolicy_RoleAdmissionPolicy { - if m == nil { - return nil - } - o := &AcceptancePolicy_RoleAdmissionPolicy{} - o.CopyFrom(m) - return o -} - -func (m *AcceptancePolicy_RoleAdmissionPolicy) CopyFrom(src interface{}) { - - o := src.(*AcceptancePolicy_RoleAdmissionPolicy) - *m = *o - if o.Secret != nil { - m.Secret = &AcceptancePolicy_RoleAdmissionPolicy_Secret{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Secret, o.Secret) - } -} - -func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) Copy() *AcceptancePolicy_RoleAdmissionPolicy_Secret { - if m == nil { - return nil - } - o := &AcceptancePolicy_RoleAdmissionPolicy_Secret{} - o.CopyFrom(m) - return o -} - -func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) CopyFrom(src interface{}) { - - o := src.(*AcceptancePolicy_RoleAdmissionPolicy_Secret) - *m = *o - if o.Data != nil { - m.Data = make([]byte, len(o.Data)) - copy(m.Data, o.Data) - } -} - -func (m *ExternalCA) Copy() *ExternalCA { - if m == nil { - return nil - } - o := &ExternalCA{} - o.CopyFrom(m) - return o -} - -func (m *ExternalCA) CopyFrom(src interface{}) { - - o := src.(*ExternalCA) - *m = *o - if o.Options != nil { - m.Options = make(map[string]string, len(o.Options)) - for k, v := range o.Options { - m.Options[k] = v - } - } - - if o.CACert != nil { - m.CACert = make([]byte, len(o.CACert)) - copy(m.CACert, o.CACert) - } -} - -func (m *CAConfig) Copy() *CAConfig { - if m == nil { - return nil - } - o := &CAConfig{} - o.CopyFrom(m) - return o -} - -func (m *CAConfig) CopyFrom(src interface{}) { - - o := src.(*CAConfig) - *m = *o - if o.NodeCertExpiry != nil { - m.NodeCertExpiry = &types.Duration{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.NodeCertExpiry, o.NodeCertExpiry) - } - if o.ExternalCAs != nil { - m.ExternalCAs = make([]*ExternalCA, len(o.ExternalCAs)) - for i := range m.ExternalCAs { - m.ExternalCAs[i] = &ExternalCA{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.ExternalCAs[i], o.ExternalCAs[i]) - } - } - - if o.SigningCACert != nil { - m.SigningCACert = make([]byte, len(o.SigningCACert)) - copy(m.SigningCACert, o.SigningCACert) - } - if o.SigningCAKey != nil { - m.SigningCAKey = make([]byte, len(o.SigningCAKey)) - copy(m.SigningCAKey, o.SigningCAKey) - } -} - -func (m *OrchestrationConfig) Copy() *OrchestrationConfig { - if m == nil { - return nil - } - o := &OrchestrationConfig{} - o.CopyFrom(m) - return o -} - -func (m *OrchestrationConfig) CopyFrom(src interface{}) { - - o := src.(*OrchestrationConfig) - *m = *o -} - -func (m *TaskDefaults) Copy() *TaskDefaults { - if m == nil { - return nil - } - o := &TaskDefaults{} - o.CopyFrom(m) - return o -} - -func (m *TaskDefaults) CopyFrom(src interface{}) { - - o := src.(*TaskDefaults) - *m = *o - if o.LogDriver != nil { - m.LogDriver = &Driver{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.LogDriver, o.LogDriver) - } -} - -func (m *DispatcherConfig) Copy() *DispatcherConfig { - if m == nil { - return nil - } - o := &DispatcherConfig{} - o.CopyFrom(m) - return o -} - -func (m *DispatcherConfig) CopyFrom(src interface{}) { - - o := src.(*DispatcherConfig) - *m = *o - if o.HeartbeatPeriod != nil { - m.HeartbeatPeriod = &types.Duration{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.HeartbeatPeriod, o.HeartbeatPeriod) - } -} - -func (m *RaftConfig) Copy() *RaftConfig { - if m == nil { - return nil - } - o := &RaftConfig{} - o.CopyFrom(m) - return o -} - -func (m *RaftConfig) CopyFrom(src interface{}) { - - o := src.(*RaftConfig) - *m = *o -} - -func (m *EncryptionConfig) Copy() *EncryptionConfig { - if m == nil { - return nil - } - o := &EncryptionConfig{} - o.CopyFrom(m) - return o -} - -func (m *EncryptionConfig) CopyFrom(src interface{}) { - - o := src.(*EncryptionConfig) - *m = *o -} - -func (m *SpreadOver) Copy() *SpreadOver { - if m == nil { - return nil - } - o := &SpreadOver{} - o.CopyFrom(m) - return o -} - -func (m *SpreadOver) CopyFrom(src interface{}) { - - o := src.(*SpreadOver) - *m = *o -} - -func (m *PlacementPreference) Copy() *PlacementPreference { - if m == nil { - return nil - } - o := &PlacementPreference{} - o.CopyFrom(m) - return o -} - -func (m *PlacementPreference) CopyFrom(src interface{}) { - - o := src.(*PlacementPreference) - *m = *o - if o.Preference != nil { - switch o.Preference.(type) { - case *PlacementPreference_Spread: - v := PlacementPreference_Spread{ - Spread: &SpreadOver{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Spread, o.GetSpread()) - m.Preference = &v - } - } - -} - -func (m *Placement) Copy() *Placement { - if m == nil { - return nil - } - o := &Placement{} - o.CopyFrom(m) - return o -} - -func (m *Placement) CopyFrom(src interface{}) { - - o := src.(*Placement) - *m = *o - if o.Constraints != nil { - m.Constraints = make([]string, len(o.Constraints)) - copy(m.Constraints, o.Constraints) - } - - if o.Preferences != nil { - m.Preferences = make([]*PlacementPreference, len(o.Preferences)) - for i := range m.Preferences { - m.Preferences[i] = &PlacementPreference{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Preferences[i], o.Preferences[i]) - } - } - - if o.Platforms != nil { - m.Platforms = make([]*Platform, len(o.Platforms)) - for i := range m.Platforms { - m.Platforms[i] = &Platform{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Platforms[i], o.Platforms[i]) - } - } - -} - -func (m *JoinTokens) Copy() *JoinTokens { - if m == nil { - return nil - } - o := &JoinTokens{} - o.CopyFrom(m) - return o -} - -func (m *JoinTokens) CopyFrom(src interface{}) { - - o := src.(*JoinTokens) - *m = *o -} - -func (m *RootCA) Copy() *RootCA { - if m == nil { - return nil - } - o := &RootCA{} - o.CopyFrom(m) - return o -} - -func (m *RootCA) CopyFrom(src interface{}) { - - o := src.(*RootCA) - *m = *o - if o.CAKey != nil { - m.CAKey = make([]byte, len(o.CAKey)) - copy(m.CAKey, o.CAKey) - } - if o.CACert != nil { - m.CACert = make([]byte, len(o.CACert)) - copy(m.CACert, o.CACert) - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.JoinTokens, &o.JoinTokens) - if o.RootRotation != nil { - m.RootRotation = &RootRotation{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.RootRotation, o.RootRotation) - } -} - -func (m *Certificate) Copy() *Certificate { - if m == nil { - return nil - } - o := &Certificate{} - o.CopyFrom(m) - return o -} - -func (m *Certificate) CopyFrom(src interface{}) { - - o := src.(*Certificate) - *m = *o - if o.CSR != nil { - m.CSR = make([]byte, len(o.CSR)) - copy(m.CSR, o.CSR) - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.Status, &o.Status) - if o.Certificate != nil { - m.Certificate = make([]byte, len(o.Certificate)) - copy(m.Certificate, o.Certificate) - } -} - -func (m *EncryptionKey) Copy() *EncryptionKey { - if m == nil { - return nil - } - o := &EncryptionKey{} - o.CopyFrom(m) - return o -} - -func (m *EncryptionKey) CopyFrom(src interface{}) { - - o := src.(*EncryptionKey) - *m = *o - if o.Key != nil { - m.Key = make([]byte, len(o.Key)) - copy(m.Key, o.Key) - } -} - -func (m *ManagerStatus) Copy() *ManagerStatus { - if m == nil { - return nil - } - o := &ManagerStatus{} - o.CopyFrom(m) - return o -} - -func (m *ManagerStatus) CopyFrom(src interface{}) { - - o := src.(*ManagerStatus) - *m = *o -} - -func (m *FileTarget) Copy() *FileTarget { - if m == nil { - return nil - } - o := &FileTarget{} - o.CopyFrom(m) - return o -} - -func (m *FileTarget) CopyFrom(src interface{}) { - - o := src.(*FileTarget) - *m = *o -} - -func (m *RuntimeTarget) Copy() *RuntimeTarget { - if m == nil { - return nil - } - o := &RuntimeTarget{} - o.CopyFrom(m) - return o -} - -func (m *RuntimeTarget) CopyFrom(src interface{}) {} -func (m *SecretReference) Copy() *SecretReference { - if m == nil { - return nil - } - o := &SecretReference{} - o.CopyFrom(m) - return o -} - -func (m *SecretReference) CopyFrom(src interface{}) { - - o := src.(*SecretReference) - *m = *o - if o.Target != nil { - switch o.Target.(type) { - case *SecretReference_File: - v := SecretReference_File{ - File: &FileTarget{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.File, o.GetFile()) - m.Target = &v - } - } - -} - -func (m *ConfigReference) Copy() *ConfigReference { - if m == nil { - return nil - } - o := &ConfigReference{} - o.CopyFrom(m) - return o -} - -func (m *ConfigReference) CopyFrom(src interface{}) { - - o := src.(*ConfigReference) - *m = *o - if o.Target != nil { - switch o.Target.(type) { - case *ConfigReference_File: - v := ConfigReference_File{ - File: &FileTarget{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.File, o.GetFile()) - m.Target = &v - case *ConfigReference_Runtime: - v := ConfigReference_Runtime{ - Runtime: &RuntimeTarget{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Runtime, o.GetRuntime()) - m.Target = &v - } - } - -} - -func (m *BlacklistedCertificate) Copy() *BlacklistedCertificate { - if m == nil { - return nil - } - o := &BlacklistedCertificate{} - o.CopyFrom(m) - return o -} - -func (m *BlacklistedCertificate) CopyFrom(src interface{}) { - - o := src.(*BlacklistedCertificate) - *m = *o - if o.Expiry != nil { - m.Expiry = &types.Timestamp{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Expiry, o.Expiry) - } -} - -func (m *HealthConfig) Copy() *HealthConfig { - if m == nil { - return nil - } - o := &HealthConfig{} - o.CopyFrom(m) - return o -} - -func (m *HealthConfig) CopyFrom(src interface{}) { - - o := src.(*HealthConfig) - *m = *o - if o.Test != nil { - m.Test = make([]string, len(o.Test)) - copy(m.Test, o.Test) - } - - if o.Interval != nil { - m.Interval = &types.Duration{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Interval, o.Interval) - } - if o.Timeout != nil { - m.Timeout = &types.Duration{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Timeout, o.Timeout) - } - if o.StartPeriod != nil { - m.StartPeriod = &types.Duration{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.StartPeriod, o.StartPeriod) - } - if o.StartInterval != nil { - m.StartInterval = &types.Duration{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.StartInterval, o.StartInterval) - } -} - -func (m *MaybeEncryptedRecord) Copy() *MaybeEncryptedRecord { - if m == nil { - return nil - } - o := &MaybeEncryptedRecord{} - o.CopyFrom(m) - return o -} - -func (m *MaybeEncryptedRecord) CopyFrom(src interface{}) { - - o := src.(*MaybeEncryptedRecord) - *m = *o - if o.Data != nil { - m.Data = make([]byte, len(o.Data)) - copy(m.Data, o.Data) - } - if o.Nonce != nil { - m.Nonce = make([]byte, len(o.Nonce)) - copy(m.Nonce, o.Nonce) - } -} - -func (m *RootRotation) Copy() *RootRotation { - if m == nil { - return nil - } - o := &RootRotation{} - o.CopyFrom(m) - return o -} - -func (m *RootRotation) CopyFrom(src interface{}) { - - o := src.(*RootRotation) - *m = *o - if o.CACert != nil { - m.CACert = make([]byte, len(o.CACert)) - copy(m.CACert, o.CACert) - } - if o.CAKey != nil { - m.CAKey = make([]byte, len(o.CAKey)) - copy(m.CAKey, o.CAKey) - } - if o.CrossSignedCACert != nil { - m.CrossSignedCACert = make([]byte, len(o.CrossSignedCACert)) - copy(m.CrossSignedCACert, o.CrossSignedCACert) - } -} - -func (m *Privileges) Copy() *Privileges { - if m == nil { - return nil - } - o := &Privileges{} - o.CopyFrom(m) - return o -} - -func (m *Privileges) CopyFrom(src interface{}) { - - o := src.(*Privileges) - *m = *o - if o.CredentialSpec != nil { - m.CredentialSpec = &Privileges_CredentialSpec{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.CredentialSpec, o.CredentialSpec) - } - if o.SELinuxContext != nil { - m.SELinuxContext = &Privileges_SELinuxContext{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.SELinuxContext, o.SELinuxContext) - } - if o.Seccomp != nil { - m.Seccomp = &Privileges_SeccompOpts{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Seccomp, o.Seccomp) - } - if o.Apparmor != nil { - m.Apparmor = &Privileges_AppArmorOpts{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Apparmor, o.Apparmor) - } -} - -func (m *Privileges_CredentialSpec) Copy() *Privileges_CredentialSpec { - if m == nil { - return nil - } - o := &Privileges_CredentialSpec{} - o.CopyFrom(m) - return o -} - -func (m *Privileges_CredentialSpec) CopyFrom(src interface{}) { - - o := src.(*Privileges_CredentialSpec) - *m = *o - if o.Source != nil { - switch o.Source.(type) { - case *Privileges_CredentialSpec_File: - v := Privileges_CredentialSpec_File{ - File: o.GetFile(), - } - m.Source = &v - case *Privileges_CredentialSpec_Registry: - v := Privileges_CredentialSpec_Registry{ - Registry: o.GetRegistry(), - } - m.Source = &v - case *Privileges_CredentialSpec_Config: - v := Privileges_CredentialSpec_Config{ - Config: o.GetConfig(), - } - m.Source = &v - } - } - -} - -func (m *Privileges_SELinuxContext) Copy() *Privileges_SELinuxContext { - if m == nil { - return nil - } - o := &Privileges_SELinuxContext{} - o.CopyFrom(m) - return o -} - -func (m *Privileges_SELinuxContext) CopyFrom(src interface{}) { - - o := src.(*Privileges_SELinuxContext) - *m = *o -} - -func (m *Privileges_SeccompOpts) Copy() *Privileges_SeccompOpts { - if m == nil { - return nil - } - o := &Privileges_SeccompOpts{} - o.CopyFrom(m) - return o -} - -func (m *Privileges_SeccompOpts) CopyFrom(src interface{}) { - - o := src.(*Privileges_SeccompOpts) - *m = *o - if o.Profile != nil { - m.Profile = make([]byte, len(o.Profile)) - copy(m.Profile, o.Profile) - } -} - -func (m *Privileges_AppArmorOpts) Copy() *Privileges_AppArmorOpts { - if m == nil { - return nil - } - o := &Privileges_AppArmorOpts{} - o.CopyFrom(m) - return o -} - -func (m *Privileges_AppArmorOpts) CopyFrom(src interface{}) { - - o := src.(*Privileges_AppArmorOpts) - *m = *o -} - -func (m *JobStatus) Copy() *JobStatus { - if m == nil { - return nil - } - o := &JobStatus{} - o.CopyFrom(m) - return o -} - -func (m *JobStatus) CopyFrom(src interface{}) { - - o := src.(*JobStatus) - *m = *o - github_com_moby_swarmkit_v2_api_deepcopy.Copy(&m.JobIteration, &o.JobIteration) - if o.LastExecution != nil { - m.LastExecution = &types.Timestamp{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.LastExecution, o.LastExecution) - } -} - -func (m *VolumeAccessMode) Copy() *VolumeAccessMode { - if m == nil { - return nil - } - o := &VolumeAccessMode{} - o.CopyFrom(m) - return o -} - -func (m *VolumeAccessMode) CopyFrom(src interface{}) { - - o := src.(*VolumeAccessMode) - *m = *o - if o.AccessType != nil { - switch o.AccessType.(type) { - case *VolumeAccessMode_Block: - v := VolumeAccessMode_Block{ - Block: &VolumeAccessMode_BlockVolume{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Block, o.GetBlock()) - m.AccessType = &v - case *VolumeAccessMode_Mount: - v := VolumeAccessMode_Mount{ - Mount: &VolumeAccessMode_MountVolume{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Mount, o.GetMount()) - m.AccessType = &v - } - } - -} - -func (m *VolumeAccessMode_BlockVolume) Copy() *VolumeAccessMode_BlockVolume { - if m == nil { - return nil - } - o := &VolumeAccessMode_BlockVolume{} - o.CopyFrom(m) - return o -} - -func (m *VolumeAccessMode_BlockVolume) CopyFrom(src interface{}) {} -func (m *VolumeAccessMode_MountVolume) Copy() *VolumeAccessMode_MountVolume { - if m == nil { - return nil - } - o := &VolumeAccessMode_MountVolume{} - o.CopyFrom(m) - return o -} - -func (m *VolumeAccessMode_MountVolume) CopyFrom(src interface{}) { - - o := src.(*VolumeAccessMode_MountVolume) - *m = *o - if o.MountFlags != nil { - m.MountFlags = make([]string, len(o.MountFlags)) - copy(m.MountFlags, o.MountFlags) - } - -} - -func (m *VolumeSecret) Copy() *VolumeSecret { - if m == nil { - return nil - } - o := &VolumeSecret{} - o.CopyFrom(m) - return o -} - -func (m *VolumeSecret) CopyFrom(src interface{}) { - - o := src.(*VolumeSecret) - *m = *o -} - -func (m *VolumePublishStatus) Copy() *VolumePublishStatus { - if m == nil { - return nil - } - o := &VolumePublishStatus{} - o.CopyFrom(m) - return o -} - -func (m *VolumePublishStatus) CopyFrom(src interface{}) { - - o := src.(*VolumePublishStatus) - *m = *o - if o.PublishContext != nil { - m.PublishContext = make(map[string]string, len(o.PublishContext)) - for k, v := range o.PublishContext { - m.PublishContext[k] = v - } - } - -} - -func (m *VolumeInfo) Copy() *VolumeInfo { - if m == nil { - return nil - } - o := &VolumeInfo{} - o.CopyFrom(m) - return o -} - -func (m *VolumeInfo) CopyFrom(src interface{}) { - - o := src.(*VolumeInfo) - *m = *o - if o.VolumeContext != nil { - m.VolumeContext = make(map[string]string, len(o.VolumeContext)) - for k, v := range o.VolumeContext { - m.VolumeContext[k] = v - } - } - - if o.AccessibleTopology != nil { - m.AccessibleTopology = make([]*Topology, len(o.AccessibleTopology)) - for i := range m.AccessibleTopology { - m.AccessibleTopology[i] = &Topology{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.AccessibleTopology[i], o.AccessibleTopology[i]) - } - } - -} - -func (m *CapacityRange) Copy() *CapacityRange { - if m == nil { - return nil - } - o := &CapacityRange{} - o.CopyFrom(m) - return o -} - -func (m *CapacityRange) CopyFrom(src interface{}) { - - o := src.(*CapacityRange) - *m = *o -} - -func (m *VolumeAssignment) Copy() *VolumeAssignment { - if m == nil { - return nil - } - o := &VolumeAssignment{} - o.CopyFrom(m) - return o -} - -func (m *VolumeAssignment) CopyFrom(src interface{}) { - - o := src.(*VolumeAssignment) - *m = *o - if o.Driver != nil { - m.Driver = &Driver{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Driver, o.Driver) - } - if o.VolumeContext != nil { - m.VolumeContext = make(map[string]string, len(o.VolumeContext)) - for k, v := range o.VolumeContext { - m.VolumeContext[k] = v - } - } - - if o.PublishContext != nil { - m.PublishContext = make(map[string]string, len(o.PublishContext)) - for k, v := range o.PublishContext { - m.PublishContext[k] = v - } - } - - if o.AccessMode != nil { - m.AccessMode = &VolumeAccessMode{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.AccessMode, o.AccessMode) - } - if o.Secrets != nil { - m.Secrets = make([]*VolumeSecret, len(o.Secrets)) - for i := range m.Secrets { - m.Secrets[i] = &VolumeSecret{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Secrets[i], o.Secrets[i]) - } - } - -} - -func (m *VolumeAttachment) Copy() *VolumeAttachment { - if m == nil { - return nil - } - o := &VolumeAttachment{} - o.CopyFrom(m) - return o -} - -func (m *VolumeAttachment) CopyFrom(src interface{}) { - - o := src.(*VolumeAttachment) - *m = *o -} - -func (m *TopologyRequirement) Copy() *TopologyRequirement { - if m == nil { - return nil - } - o := &TopologyRequirement{} - o.CopyFrom(m) - return o -} - -func (m *TopologyRequirement) CopyFrom(src interface{}) { - - o := src.(*TopologyRequirement) - *m = *o - if o.Requisite != nil { - m.Requisite = make([]*Topology, len(o.Requisite)) - for i := range m.Requisite { - m.Requisite[i] = &Topology{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Requisite[i], o.Requisite[i]) - } - } - - if o.Preferred != nil { - m.Preferred = make([]*Topology, len(o.Preferred)) - for i := range m.Preferred { - m.Preferred[i] = &Topology{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Preferred[i], o.Preferred[i]) - } - } - -} - -func (m *Topology) Copy() *Topology { - if m == nil { - return nil - } - o := &Topology{} - o.CopyFrom(m) - return o -} - -func (m *Topology) CopyFrom(src interface{}) { - - o := src.(*Topology) - *m = *o - if o.Segments != nil { - m.Segments = make(map[string]string, len(o.Segments)) - for k, v := range o.Segments { - m.Segments[k] = v - } - } - -} - -func (m *VolumeCapability) Copy() *VolumeCapability { - if m == nil { - return nil - } - o := &VolumeCapability{} - o.CopyFrom(m) - return o -} - -func (m *VolumeCapability) CopyFrom(src interface{}) { - - o := src.(*VolumeCapability) - *m = *o - if o.AccessMode != nil { - m.AccessMode = &VolumeCapability_AccessMode{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.AccessMode, o.AccessMode) - } - if o.AccessType != nil { - switch o.AccessType.(type) { - case *VolumeCapability_Block: - v := VolumeCapability_Block{ - Block: &VolumeCapability_BlockVolume{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Block, o.GetBlock()) - m.AccessType = &v - case *VolumeCapability_Mount: - v := VolumeCapability_Mount{ - Mount: &VolumeCapability_MountVolume{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Mount, o.GetMount()) - m.AccessType = &v - } - } - -} - -func (m *VolumeCapability_BlockVolume) Copy() *VolumeCapability_BlockVolume { - if m == nil { - return nil - } - o := &VolumeCapability_BlockVolume{} - o.CopyFrom(m) - return o -} - -func (m *VolumeCapability_BlockVolume) CopyFrom(src interface{}) {} -func (m *VolumeCapability_MountVolume) Copy() *VolumeCapability_MountVolume { - if m == nil { - return nil - } - o := &VolumeCapability_MountVolume{} - o.CopyFrom(m) - return o -} - -func (m *VolumeCapability_MountVolume) CopyFrom(src interface{}) { - - o := src.(*VolumeCapability_MountVolume) - *m = *o - if o.MountFlags != nil { - m.MountFlags = make([]string, len(o.MountFlags)) - copy(m.MountFlags, o.MountFlags) - } - -} - -func (m *VolumeCapability_AccessMode) Copy() *VolumeCapability_AccessMode { - if m == nil { - return nil - } - o := &VolumeCapability_AccessMode{} - o.CopyFrom(m) - return o -} - -func (m *VolumeCapability_AccessMode) CopyFrom(src interface{}) { - - o := src.(*VolumeCapability_AccessMode) - *m = *o -} - -func (m *Version) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Version) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Version) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Index != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *IndexEntry) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *IndexEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *IndexEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Val) > 0 { - i -= len(m.Val) - copy(dAtA[i:], m.Val) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Val))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Annotations) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Annotations) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Annotations) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Indices) > 0 { - for iNdEx := len(m.Indices) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Indices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *NamedGenericResource) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NamedGenericResource) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NamedGenericResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Kind) > 0 { - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DiscreteGenericResource) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DiscreteGenericResource) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DiscreteGenericResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Value != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Value)) - i-- - dAtA[i] = 0x10 - } - if len(m.Kind) > 0 { - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GenericResource) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GenericResource) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenericResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Resource != nil { - { - size := m.Resource.Size() - i -= size - if _, err := m.Resource.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *GenericResource_NamedResourceSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenericResource_NamedResourceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.NamedResourceSpec != nil { - { - size, err := m.NamedResourceSpec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *GenericResource_DiscreteResourceSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenericResource_DiscreteResourceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.DiscreteResourceSpec != nil { - { - size, err := m.DiscreteResourceSpec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *Resources) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Resources) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Resources) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Generic) > 0 { - for iNdEx := len(m.Generic) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Generic[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.MemoryBytes != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MemoryBytes)) - i-- - dAtA[i] = 0x10 - } - if m.NanoCPUs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.NanoCPUs)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ResourceRequirements) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResourceRequirements) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResourceRequirements) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MemorySwappiness != nil { - { - size, err := m.MemorySwappiness.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.SwapBytes != nil { - { - size, err := m.SwapBytes.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Reservations != nil { - { - size, err := m.Reservations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Limits != nil { - { - size, err := m.Limits.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Platform) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Platform) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Platform) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.OS) > 0 { - i -= len(m.OS) - copy(dAtA[i:], m.OS) - i = encodeVarintTypes(dAtA, i, uint64(len(m.OS))) - i-- - dAtA[i] = 0x12 - } - if len(m.Architecture) > 0 { - i -= len(m.Architecture) - copy(dAtA[i:], m.Architecture) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Architecture))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PluginDescription) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PluginDescription) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PluginDescription) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EngineDescription) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EngineDescription) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EngineDescription) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Plugins) > 0 { - for iNdEx := len(m.Plugins) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Plugins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if len(m.EngineVersion) > 0 { - i -= len(m.EngineVersion) - copy(dAtA[i:], m.EngineVersion) - i = encodeVarintTypes(dAtA, i, uint64(len(m.EngineVersion))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *NodeDescription) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NodeDescription) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodeDescription) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.CSIInfo) > 0 { - for iNdEx := len(m.CSIInfo) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.CSIInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if m.FIPS { - i-- - if m.FIPS { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if m.TLSInfo != nil { - { - size, err := m.TLSInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.Engine != nil { - { - size, err := m.Engine.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Resources != nil { - { - size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Platform != nil { - { - size, err := m.Platform.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Hostname) > 0 { - i -= len(m.Hostname) - copy(dAtA[i:], m.Hostname) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Hostname))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *NodeTLSInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NodeTLSInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodeTLSInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.CertIssuerPublicKey) > 0 { - i -= len(m.CertIssuerPublicKey) - copy(dAtA[i:], m.CertIssuerPublicKey) - i = encodeVarintTypes(dAtA, i, uint64(len(m.CertIssuerPublicKey))) - i-- - dAtA[i] = 0x1a - } - if len(m.CertIssuerSubject) > 0 { - i -= len(m.CertIssuerSubject) - copy(dAtA[i:], m.CertIssuerSubject) - i = encodeVarintTypes(dAtA, i, uint64(len(m.CertIssuerSubject))) - i-- - dAtA[i] = 0x12 - } - if len(m.TrustRoot) > 0 { - i -= len(m.TrustRoot) - copy(dAtA[i:], m.TrustRoot) - i = encodeVarintTypes(dAtA, i, uint64(len(m.TrustRoot))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *NodeCSIInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NodeCSIInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodeCSIInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AccessibleTopology != nil { - { - size, err := m.AccessibleTopology.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.MaxVolumesPerNode != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MaxVolumesPerNode)) - i-- - dAtA[i] = 0x18 - } - if len(m.NodeID) > 0 { - i -= len(m.NodeID) - copy(dAtA[i:], m.NodeID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.NodeID))) - i-- - dAtA[i] = 0x12 - } - if len(m.PluginName) > 0 { - i -= len(m.PluginName) - copy(dAtA[i:], m.PluginName) - i = encodeVarintTypes(dAtA, i, uint64(len(m.PluginName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RaftMemberStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RaftMemberStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RaftMemberStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0x1a - } - if m.Reachability != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Reachability)) - i-- - dAtA[i] = 0x10 - } - if m.Leader { - i-- - if m.Leader { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *NodeStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NodeStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Addr) > 0 { - i -= len(m.Addr) - copy(dAtA[i:], m.Addr) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Addr))) - i-- - dAtA[i] = 0x1a - } - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0x12 - } - if m.State != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.State)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Image) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Image) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Image) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Reference) > 0 { - i -= len(m.Reference) - copy(dAtA[i:], m.Reference) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Reference))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Mount) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Mount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Mount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Consistency != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Consistency)) - i-- - dAtA[i] = 0x40 - } - if m.TmpfsOptions != nil { - { - size, err := m.TmpfsOptions.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if m.VolumeOptions != nil { - { - size, err := m.VolumeOptions.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.BindOptions != nil { - { - size, err := m.BindOptions.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.ReadOnly { - i-- - if m.ReadOnly { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if len(m.Target) > 0 { - i -= len(m.Target) - copy(dAtA[i:], m.Target) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Target))) - i-- - dAtA[i] = 0x1a - } - if len(m.Source) > 0 { - i -= len(m.Source) - copy(dAtA[i:], m.Source) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Source))) - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Mount_BindOptions) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Mount_BindOptions) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Mount_BindOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ReadOnlyForceRecursive { - i-- - if m.ReadOnlyForceRecursive { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.ReadOnlyNonRecursive { - i-- - if m.ReadOnlyNonRecursive { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.CreateMountpoint { - i-- - if m.CreateMountpoint { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.NonRecursive { - i-- - if m.NonRecursive { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.Propagation != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Propagation)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Mount_VolumeOptions) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Mount_VolumeOptions) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Mount_VolumeOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Subpath) > 0 { - i -= len(m.Subpath) - copy(dAtA[i:], m.Subpath) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Subpath))) - i-- - dAtA[i] = 0x22 - } - if m.DriverConfig != nil { - { - size, err := m.DriverConfig.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if m.NoCopy { - i-- - if m.NoCopy { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Mount_TmpfsOptions) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Mount_TmpfsOptions) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Mount_TmpfsOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Options) > 0 { - i -= len(m.Options) - copy(dAtA[i:], m.Options) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Options))) - i-- - dAtA[i] = 0x1a - } - if m.Mode != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Mode)) - i-- - dAtA[i] = 0x10 - } - if m.SizeBytes != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.SizeBytes)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *RestartPolicy) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RestartPolicy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RestartPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Window != nil { - { - size, err := m.Window.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.MaxAttempts != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MaxAttempts)) - i-- - dAtA[i] = 0x18 - } - if m.Delay != nil { - { - size, err := m.Delay.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Condition != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Condition)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *UpdateConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Order != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Order)) - i-- - dAtA[i] = 0x30 - } - if m.MaxFailureRatio != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.MaxFailureRatio)))) - i-- - dAtA[i] = 0x2d - } - if m.Monitor != nil { - { - size, err := m.Monitor.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.FailureAction != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.FailureAction)) - i-- - dAtA[i] = 0x18 - } - n19, err19 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Delay, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Delay):]) - if err19 != nil { - return 0, err19 - } - i -= n19 - i = encodeVarintTypes(dAtA, i, uint64(n19)) - i-- - dAtA[i] = 0x12 - if m.Parallelism != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Parallelism)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *UpdateStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0x22 - } - if m.CompletedAt != nil { - { - size, err := m.CompletedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.StartedAt != nil { - { - size, err := m.StartedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.State != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.State)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ContainerStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ContainerStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ContainerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ExitCode != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.ExitCode)) - i-- - dAtA[i] = 0x18 - } - if m.PID != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.PID)) - i-- - dAtA[i] = 0x10 - } - if len(m.ContainerID) > 0 { - i -= len(m.ContainerID) - copy(dAtA[i:], m.ContainerID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ContainerID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PortStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PortStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PortStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Ports) > 0 { - for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *TaskStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TaskStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TaskStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AppliedAt != nil { - { - size, err := m.AppliedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if len(m.AppliedBy) > 0 { - i -= len(m.AppliedBy) - copy(dAtA[i:], m.AppliedBy) - i = encodeVarintTypes(dAtA, i, uint64(len(m.AppliedBy))) - i-- - dAtA[i] = 0x3a - } - if m.PortStatus != nil { - { - size, err := m.PortStatus.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.RuntimeStatus != nil { - { - size := m.RuntimeStatus.Size() - i -= size - if _, err := m.RuntimeStatus.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.Err) > 0 { - i -= len(m.Err) - copy(dAtA[i:], m.Err) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Err))) - i-- - dAtA[i] = 0x22 - } - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0x1a - } - if m.State != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.State)) - i-- - dAtA[i] = 0x10 - } - if m.Timestamp != nil { - { - size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TaskStatus_Container) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TaskStatus_Container) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Container != nil { - { - size, err := m.Container.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func (m *NetworkAttachmentConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NetworkAttachmentConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NetworkAttachmentConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.DriverAttachmentOpts) > 0 { - for k := range m.DriverAttachmentOpts { - v := m.DriverAttachmentOpts[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Addresses) > 0 { - for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Addresses[iNdEx]) - copy(dAtA[i:], m.Addresses[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Addresses[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.Aliases) > 0 { - for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Aliases[iNdEx]) - copy(dAtA[i:], m.Aliases[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Aliases[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Target) > 0 { - i -= len(m.Target) - copy(dAtA[i:], m.Target) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Target))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *IPAMConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *IPAMConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *IPAMConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Reserved) > 0 { - for k := range m.Reserved { - v := m.Reserved[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x2a - } - } - if len(m.Gateway) > 0 { - i -= len(m.Gateway) - copy(dAtA[i:], m.Gateway) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Gateway))) - i-- - dAtA[i] = 0x22 - } - if len(m.Range) > 0 { - i -= len(m.Range) - copy(dAtA[i:], m.Range) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Range))) - i-- - dAtA[i] = 0x1a - } - if len(m.Subnet) > 0 { - i -= len(m.Subnet) - copy(dAtA[i:], m.Subnet) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Subnet))) - i-- - dAtA[i] = 0x12 - } - if m.Family != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Family)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *PortConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PortConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PortConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PublishMode != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.PublishMode)) - i-- - dAtA[i] = 0x28 - } - if m.PublishedPort != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.PublishedPort)) - i-- - dAtA[i] = 0x20 - } - if m.TargetPort != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.TargetPort)) - i-- - dAtA[i] = 0x18 - } - if m.Protocol != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Protocol)) - i-- - dAtA[i] = 0x10 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Driver) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Driver) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Driver) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Options) > 0 { - for k := range m.Options { - v := m.Options[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *IPAMOptions) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *IPAMOptions) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *IPAMOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Configs) > 0 { - for iNdEx := len(m.Configs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Configs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.Driver != nil { - { - size, err := m.Driver.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Peer) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Peer) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Peer) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Addr) > 0 { - i -= len(m.Addr) - copy(dAtA[i:], m.Addr) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Addr))) - i-- - dAtA[i] = 0x12 - } - if len(m.NodeID) > 0 { - i -= len(m.NodeID) - copy(dAtA[i:], m.NodeID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.NodeID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *WeightedPeer) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WeightedPeer) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WeightedPeer) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Weight != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Weight)) - i-- - dAtA[i] = 0x10 - } - if m.Peer != nil { - { - size, err := m.Peer.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *IssuanceStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *IssuanceStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *IssuanceStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Err) > 0 { - i -= len(m.Err) - copy(dAtA[i:], m.Err) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Err))) - i-- - dAtA[i] = 0x12 - } - if m.State != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.State)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *AcceptancePolicy) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AcceptancePolicy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AcceptancePolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Policies) > 0 { - for iNdEx := len(m.Policies) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Policies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *AcceptancePolicy_RoleAdmissionPolicy) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AcceptancePolicy_RoleAdmissionPolicy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AcceptancePolicy_RoleAdmissionPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Secret != nil { - { - size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Autoaccept { - i-- - if m.Autoaccept { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.Role != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Role)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Alg) > 0 { - i -= len(m.Alg) - copy(dAtA[i:], m.Alg) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Alg))) - i-- - dAtA[i] = 0x12 - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ExternalCA) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ExternalCA) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ExternalCA) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.CACert) > 0 { - i -= len(m.CACert) - copy(dAtA[i:], m.CACert) - i = encodeVarintTypes(dAtA, i, uint64(len(m.CACert))) - i-- - dAtA[i] = 0x22 - } - if len(m.Options) > 0 { - for k := range m.Options { - v := m.Options[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.URL) > 0 { - i -= len(m.URL) - copy(dAtA[i:], m.URL) - i = encodeVarintTypes(dAtA, i, uint64(len(m.URL))) - i-- - dAtA[i] = 0x12 - } - if m.Protocol != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Protocol)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *CAConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CAConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CAConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ForceRotate != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.ForceRotate)) - i-- - dAtA[i] = 0x28 - } - if len(m.SigningCAKey) > 0 { - i -= len(m.SigningCAKey) - copy(dAtA[i:], m.SigningCAKey) - i = encodeVarintTypes(dAtA, i, uint64(len(m.SigningCAKey))) - i-- - dAtA[i] = 0x22 - } - if len(m.SigningCACert) > 0 { - i -= len(m.SigningCACert) - copy(dAtA[i:], m.SigningCACert) - i = encodeVarintTypes(dAtA, i, uint64(len(m.SigningCACert))) - i-- - dAtA[i] = 0x1a - } - if len(m.ExternalCAs) > 0 { - for iNdEx := len(m.ExternalCAs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ExternalCAs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.NodeCertExpiry != nil { - { - size, err := m.NodeCertExpiry.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *OrchestrationConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *OrchestrationConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *OrchestrationConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TaskHistoryRetentionLimit != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.TaskHistoryRetentionLimit)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TaskDefaults) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TaskDefaults) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TaskDefaults) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LogDriver != nil { - { - size, err := m.LogDriver.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DispatcherConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DispatcherConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DispatcherConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.HeartbeatPeriod != nil { - { - size, err := m.HeartbeatPeriod.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RaftConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RaftConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RaftConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ElectionTick != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.ElectionTick)) - i-- - dAtA[i] = 0x28 - } - if m.HeartbeatTick != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.HeartbeatTick)) - i-- - dAtA[i] = 0x20 - } - if m.LogEntriesForSlowFollowers != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.LogEntriesForSlowFollowers)) - i-- - dAtA[i] = 0x18 - } - if m.KeepOldSnapshots != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.KeepOldSnapshots)) - i-- - dAtA[i] = 0x10 - } - if m.SnapshotInterval != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.SnapshotInterval)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *EncryptionConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EncryptionConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EncryptionConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AutoLockManagers { - i-- - if m.AutoLockManagers { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *SpreadOver) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SpreadOver) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SpreadOver) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SpreadDescriptor) > 0 { - i -= len(m.SpreadDescriptor) - copy(dAtA[i:], m.SpreadDescriptor) - i = encodeVarintTypes(dAtA, i, uint64(len(m.SpreadDescriptor))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PlacementPreference) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PlacementPreference) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PlacementPreference) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Preference != nil { - { - size := m.Preference.Size() - i -= size - if _, err := m.Preference.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *PlacementPreference_Spread) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PlacementPreference_Spread) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Spread != nil { - { - size, err := m.Spread.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *Placement) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Placement) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Placement) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxReplicas != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MaxReplicas)) - i-- - dAtA[i] = 0x20 - } - if len(m.Platforms) > 0 { - for iNdEx := len(m.Platforms) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Platforms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Preferences) > 0 { - for iNdEx := len(m.Preferences) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Preferences[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Constraints) > 0 { - for iNdEx := len(m.Constraints) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Constraints[iNdEx]) - copy(dAtA[i:], m.Constraints[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Constraints[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *JoinTokens) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JoinTokens) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JoinTokens) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Manager) > 0 { - i -= len(m.Manager) - copy(dAtA[i:], m.Manager) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Manager))) - i-- - dAtA[i] = 0x12 - } - if len(m.Worker) > 0 { - i -= len(m.Worker) - copy(dAtA[i:], m.Worker) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Worker))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RootCA) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RootCA) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RootCA) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastForcedRotation != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.LastForcedRotation)) - i-- - dAtA[i] = 0x30 - } - if m.RootRotation != nil { - { - size, err := m.RootRotation.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - { - size, err := m.JoinTokens.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.CACertHash) > 0 { - i -= len(m.CACertHash) - copy(dAtA[i:], m.CACertHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.CACertHash))) - i-- - dAtA[i] = 0x1a - } - if len(m.CACert) > 0 { - i -= len(m.CACert) - copy(dAtA[i:], m.CACert) - i = encodeVarintTypes(dAtA, i, uint64(len(m.CACert))) - i-- - dAtA[i] = 0x12 - } - if len(m.CAKey) > 0 { - i -= len(m.CAKey) - copy(dAtA[i:], m.CAKey) - i = encodeVarintTypes(dAtA, i, uint64(len(m.CAKey))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Certificate) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Certificate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Certificate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.CN) > 0 { - i -= len(m.CN) - copy(dAtA[i:], m.CN) - i = encodeVarintTypes(dAtA, i, uint64(len(m.CN))) - i-- - dAtA[i] = 0x2a - } - if len(m.Certificate) > 0 { - i -= len(m.Certificate) - copy(dAtA[i:], m.Certificate) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Certificate))) - i-- - dAtA[i] = 0x22 - } - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.CSR) > 0 { - i -= len(m.CSR) - copy(dAtA[i:], m.CSR) - i = encodeVarintTypes(dAtA, i, uint64(len(m.CSR))) - i-- - dAtA[i] = 0x12 - } - if m.Role != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Role)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *EncryptionKey) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EncryptionKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EncryptionKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LamportTime != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.LamportTime)) - i-- - dAtA[i] = 0x20 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x1a - } - if m.Algorithm != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Algorithm)) - i-- - dAtA[i] = 0x10 - } - if len(m.Subsystem) > 0 { - i -= len(m.Subsystem) - copy(dAtA[i:], m.Subsystem) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Subsystem))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ManagerStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ManagerStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ManagerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Reachability != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Reachability)) - i-- - dAtA[i] = 0x20 - } - if m.Leader { - i-- - if m.Leader { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.Addr) > 0 { - i -= len(m.Addr) - copy(dAtA[i:], m.Addr) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Addr))) - i-- - dAtA[i] = 0x12 - } - if m.RaftID != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.RaftID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *FileTarget) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *FileTarget) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FileTarget) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Mode != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Mode)) - i-- - dAtA[i] = 0x20 - } - if len(m.GID) > 0 { - i -= len(m.GID) - copy(dAtA[i:], m.GID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.GID))) - i-- - dAtA[i] = 0x1a - } - if len(m.UID) > 0 { - i -= len(m.UID) - copy(dAtA[i:], m.UID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.UID))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RuntimeTarget) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RuntimeTarget) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RuntimeTarget) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *SecretReference) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SecretReference) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SecretReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Target != nil { - { - size := m.Target.Size() - i -= size - if _, err := m.Target.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.SecretName) > 0 { - i -= len(m.SecretName) - copy(dAtA[i:], m.SecretName) - i = encodeVarintTypes(dAtA, i, uint64(len(m.SecretName))) - i-- - dAtA[i] = 0x12 - } - if len(m.SecretID) > 0 { - i -= len(m.SecretID) - copy(dAtA[i:], m.SecretID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.SecretID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SecretReference_File) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SecretReference_File) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.File != nil { - { - size, err := m.File.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *ConfigReference) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConfigReference) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConfigReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Target != nil { - { - size := m.Target.Size() - i -= size - if _, err := m.Target.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.ConfigName) > 0 { - i -= len(m.ConfigName) - copy(dAtA[i:], m.ConfigName) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ConfigName))) - i-- - dAtA[i] = 0x12 - } - if len(m.ConfigID) > 0 { - i -= len(m.ConfigID) - copy(dAtA[i:], m.ConfigID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ConfigID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ConfigReference_File) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConfigReference_File) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.File != nil { - { - size, err := m.File.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *ConfigReference_Runtime) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConfigReference_Runtime) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Runtime != nil { - { - size, err := m.Runtime.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *BlacklistedCertificate) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BlacklistedCertificate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlacklistedCertificate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Expiry != nil { - { - size, err := m.Expiry.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *HealthConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HealthConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HealthConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.StartInterval != nil { - { - size, err := m.StartInterval.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.StartPeriod != nil { - { - size, err := m.StartPeriod.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.Retries != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Retries)) - i-- - dAtA[i] = 0x20 - } - if m.Timeout != nil { - { - size, err := m.Timeout.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Interval != nil { - { - size, err := m.Interval.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Test) > 0 { - for iNdEx := len(m.Test) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Test[iNdEx]) - copy(dAtA[i:], m.Test[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Test[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *MaybeEncryptedRecord) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MaybeEncryptedRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MaybeEncryptedRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Nonce) > 0 { - i -= len(m.Nonce) - copy(dAtA[i:], m.Nonce) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Nonce))) - i-- - dAtA[i] = 0x1a - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } - if m.Algorithm != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Algorithm)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *RootRotation) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RootRotation) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RootRotation) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.CrossSignedCACert) > 0 { - i -= len(m.CrossSignedCACert) - copy(dAtA[i:], m.CrossSignedCACert) - i = encodeVarintTypes(dAtA, i, uint64(len(m.CrossSignedCACert))) - i-- - dAtA[i] = 0x1a - } - if len(m.CAKey) > 0 { - i -= len(m.CAKey) - copy(dAtA[i:], m.CAKey) - i = encodeVarintTypes(dAtA, i, uint64(len(m.CAKey))) - i-- - dAtA[i] = 0x12 - } - if len(m.CACert) > 0 { - i -= len(m.CACert) - copy(dAtA[i:], m.CACert) - i = encodeVarintTypes(dAtA, i, uint64(len(m.CACert))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Privileges) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Privileges) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Privileges) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NoNewPrivileges { - i-- - if m.NoNewPrivileges { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.Apparmor != nil { - { - size, err := m.Apparmor.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Seccomp != nil { - { - size, err := m.Seccomp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.SELinuxContext != nil { - { - size, err := m.SELinuxContext.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.CredentialSpec != nil { - { - size, err := m.CredentialSpec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Privileges_CredentialSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Privileges_CredentialSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Privileges_CredentialSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Source != nil { - { - size := m.Source.Size() - i -= size - if _, err := m.Source.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Privileges_CredentialSpec_File) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Privileges_CredentialSpec_File) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.File) - copy(dAtA[i:], m.File) - i = encodeVarintTypes(dAtA, i, uint64(len(m.File))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} -func (m *Privileges_CredentialSpec_Registry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Privileges_CredentialSpec_Registry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.Registry) - copy(dAtA[i:], m.Registry) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Registry))) - i-- - dAtA[i] = 0x12 - return len(dAtA) - i, nil -} -func (m *Privileges_CredentialSpec_Config) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Privileges_CredentialSpec_Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.Config) - copy(dAtA[i:], m.Config) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Config))) - i-- - dAtA[i] = 0x1a - return len(dAtA) - i, nil -} -func (m *Privileges_SELinuxContext) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Privileges_SELinuxContext) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Privileges_SELinuxContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Level) > 0 { - i -= len(m.Level) - copy(dAtA[i:], m.Level) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Level))) - i-- - dAtA[i] = 0x2a - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x22 - } - if len(m.Role) > 0 { - i -= len(m.Role) - copy(dAtA[i:], m.Role) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Role))) - i-- - dAtA[i] = 0x1a - } - if len(m.User) > 0 { - i -= len(m.User) - copy(dAtA[i:], m.User) - i = encodeVarintTypes(dAtA, i, uint64(len(m.User))) - i-- - dAtA[i] = 0x12 - } - if m.Disable { - i-- - if m.Disable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Privileges_SeccompOpts) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Privileges_SeccompOpts) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Privileges_SeccompOpts) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Profile) > 0 { - i -= len(m.Profile) - copy(dAtA[i:], m.Profile) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Profile))) - i-- - dAtA[i] = 0x12 - } - if m.Mode != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Mode)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Privileges_AppArmorOpts) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Privileges_AppArmorOpts) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Privileges_AppArmorOpts) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Mode != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Mode)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *JobStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JobStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JobStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastExecution != nil { - { - size, err := m.LastExecution.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - { - size, err := m.JobIteration.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *VolumeAccessMode) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumeAccessMode) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeAccessMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AccessType != nil { - { - size := m.AccessType.Size() - i -= size - if _, err := m.AccessType.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.Sharing != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Sharing)) - i-- - dAtA[i] = 0x10 - } - if m.Scope != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Scope)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *VolumeAccessMode_Block) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeAccessMode_Block) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Block != nil { - { - size, err := m.Block.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *VolumeAccessMode_Mount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeAccessMode_Mount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Mount != nil { - { - size, err := m.Mount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *VolumeAccessMode_BlockVolume) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumeAccessMode_BlockVolume) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeAccessMode_BlockVolume) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *VolumeAccessMode_MountVolume) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumeAccessMode_MountVolume) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeAccessMode_MountVolume) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.MountFlags) > 0 { - for iNdEx := len(m.MountFlags) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.MountFlags[iNdEx]) - copy(dAtA[i:], m.MountFlags[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.MountFlags[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.FsType) > 0 { - i -= len(m.FsType) - copy(dAtA[i:], m.FsType) - i = encodeVarintTypes(dAtA, i, uint64(len(m.FsType))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *VolumeSecret) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumeSecret) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeSecret) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Secret) > 0 { - i -= len(m.Secret) - copy(dAtA[i:], m.Secret) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Secret))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *VolumePublishStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumePublishStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumePublishStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0x2a - } - if len(m.PublishContext) > 0 { - for k := range m.PublishContext { - v := m.PublishContext[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if m.State != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.State)) - i-- - dAtA[i] = 0x10 - } - if len(m.NodeID) > 0 { - i -= len(m.NodeID) - copy(dAtA[i:], m.NodeID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.NodeID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *VolumeInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumeInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AccessibleTopology) > 0 { - for iNdEx := len(m.AccessibleTopology) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.AccessibleTopology[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.VolumeID) > 0 { - i -= len(m.VolumeID) - copy(dAtA[i:], m.VolumeID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.VolumeID))) - i-- - dAtA[i] = 0x1a - } - if len(m.VolumeContext) > 0 { - for k := range m.VolumeContext { - v := m.VolumeContext[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if m.CapacityBytes != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.CapacityBytes)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *CapacityRange) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CapacityRange) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CapacityRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LimitBytes != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.LimitBytes)) - i-- - dAtA[i] = 0x10 - } - if m.RequiredBytes != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.RequiredBytes)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *VolumeAssignment) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumeAssignment) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeAssignment) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Secrets) > 0 { - for iNdEx := len(m.Secrets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Secrets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if m.AccessMode != nil { - { - size, err := m.AccessMode.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if len(m.PublishContext) > 0 { - for k := range m.PublishContext { - v := m.PublishContext[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x2a - } - } - if len(m.VolumeContext) > 0 { - for k := range m.VolumeContext { - v := m.VolumeContext[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x22 - } - } - if m.Driver != nil { - { - size, err := m.Driver.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.VolumeID) > 0 { - i -= len(m.VolumeID) - copy(dAtA[i:], m.VolumeID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.VolumeID))) - i-- - dAtA[i] = 0x12 - } - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *VolumeAttachment) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumeAttachment) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeAttachment) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Target) > 0 { - i -= len(m.Target) - copy(dAtA[i:], m.Target) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Target))) - i-- - dAtA[i] = 0x1a - } - if len(m.Source) > 0 { - i -= len(m.Source) - copy(dAtA[i:], m.Source) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Source))) - i-- - dAtA[i] = 0x12 - } - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TopologyRequirement) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TopologyRequirement) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TopologyRequirement) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Preferred) > 0 { - for iNdEx := len(m.Preferred) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Preferred[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Requisite) > 0 { - for iNdEx := len(m.Requisite) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Requisite[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Topology) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Topology) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Topology) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Segments) > 0 { - for k := range m.Segments { - v := m.Segments[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *VolumeCapability) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumeCapability) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeCapability) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AccessMode != nil { - { - size, err := m.AccessMode.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.AccessType != nil { - { - size := m.AccessType.Size() - i -= size - if _, err := m.AccessType.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *VolumeCapability_Block) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeCapability_Block) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Block != nil { - { - size, err := m.Block.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *VolumeCapability_Mount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeCapability_Mount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Mount != nil { - { - size, err := m.Mount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *VolumeCapability_BlockVolume) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumeCapability_BlockVolume) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeCapability_BlockVolume) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *VolumeCapability_MountVolume) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumeCapability_MountVolume) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeCapability_MountVolume) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.MountFlags) > 0 { - for iNdEx := len(m.MountFlags) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.MountFlags[iNdEx]) - copy(dAtA[i:], m.MountFlags[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.MountFlags[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.FsType) > 0 { - i -= len(m.FsType) - copy(dAtA[i:], m.FsType) - i = encodeVarintTypes(dAtA, i, uint64(len(m.FsType))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *VolumeCapability_AccessMode) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumeCapability_AccessMode) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeCapability_AccessMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Mode != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Mode)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Version) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Index != 0 { - n += 1 + sovTypes(uint64(m.Index)) - } - return n -} - -func (m *IndexEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Val) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Annotations) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - n += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize)) - } - } - if len(m.Indices) > 0 { - for _, e := range m.Indices { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *NamedGenericResource) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Kind) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *DiscreteGenericResource) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Kind) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Value != 0 { - n += 1 + sovTypes(uint64(m.Value)) - } - return n -} - -func (m *GenericResource) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Resource != nil { - n += m.Resource.Size() - } - return n -} - -func (m *GenericResource_NamedResourceSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NamedResourceSpec != nil { - l = m.NamedResourceSpec.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *GenericResource_DiscreteResourceSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.DiscreteResourceSpec != nil { - l = m.DiscreteResourceSpec.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Resources) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NanoCPUs != 0 { - n += 1 + sovTypes(uint64(m.NanoCPUs)) - } - if m.MemoryBytes != 0 { - n += 1 + sovTypes(uint64(m.MemoryBytes)) - } - if len(m.Generic) > 0 { - for _, e := range m.Generic { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *ResourceRequirements) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Limits != nil { - l = m.Limits.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Reservations != nil { - l = m.Reservations.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.SwapBytes != nil { - l = m.SwapBytes.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.MemorySwappiness != nil { - l = m.MemorySwappiness.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Platform) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Architecture) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.OS) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *PluginDescription) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Type) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *EngineDescription) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.EngineVersion) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - n += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize)) - } - } - if len(m.Plugins) > 0 { - for _, e := range m.Plugins { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *NodeDescription) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Hostname) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Platform != nil { - l = m.Platform.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Resources != nil { - l = m.Resources.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Engine != nil { - l = m.Engine.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.TLSInfo != nil { - l = m.TLSInfo.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.FIPS { - n += 2 - } - if len(m.CSIInfo) > 0 { - for _, e := range m.CSIInfo { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *NodeTLSInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TrustRoot) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.CertIssuerSubject) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.CertIssuerPublicKey) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *NodeCSIInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PluginName) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.NodeID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.MaxVolumesPerNode != 0 { - n += 1 + sovTypes(uint64(m.MaxVolumesPerNode)) - } - if m.AccessibleTopology != nil { - l = m.AccessibleTopology.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *RaftMemberStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Leader { - n += 2 - } - if m.Reachability != 0 { - n += 1 + sovTypes(uint64(m.Reachability)) - } - l = len(m.Message) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *NodeStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.State != 0 { - n += 1 + sovTypes(uint64(m.State)) - } - l = len(m.Message) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Addr) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Image) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Reference) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Mount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = len(m.Source) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Target) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.ReadOnly { - n += 2 - } - if m.BindOptions != nil { - l = m.BindOptions.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.VolumeOptions != nil { - l = m.VolumeOptions.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.TmpfsOptions != nil { - l = m.TmpfsOptions.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Consistency != 0 { - n += 1 + sovTypes(uint64(m.Consistency)) - } - return n -} - -func (m *Mount_BindOptions) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Propagation != 0 { - n += 1 + sovTypes(uint64(m.Propagation)) - } - if m.NonRecursive { - n += 2 - } - if m.CreateMountpoint { - n += 2 - } - if m.ReadOnlyNonRecursive { - n += 2 - } - if m.ReadOnlyForceRecursive { - n += 2 - } - return n -} - -func (m *Mount_VolumeOptions) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NoCopy { - n += 2 - } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - n += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize)) - } - } - if m.DriverConfig != nil { - l = m.DriverConfig.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Subpath) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Mount_TmpfsOptions) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SizeBytes != 0 { - n += 1 + sovTypes(uint64(m.SizeBytes)) - } - if m.Mode != 0 { - n += 1 + sovTypes(uint64(m.Mode)) - } - l = len(m.Options) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *RestartPolicy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Condition != 0 { - n += 1 + sovTypes(uint64(m.Condition)) - } - if m.Delay != nil { - l = m.Delay.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.MaxAttempts != 0 { - n += 1 + sovTypes(uint64(m.MaxAttempts)) - } - if m.Window != nil { - l = m.Window.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *UpdateConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Parallelism != 0 { - n += 1 + sovTypes(uint64(m.Parallelism)) - } - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Delay) - n += 1 + l + sovTypes(uint64(l)) - if m.FailureAction != 0 { - n += 1 + sovTypes(uint64(m.FailureAction)) - } - if m.Monitor != nil { - l = m.Monitor.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.MaxFailureRatio != 0 { - n += 5 - } - if m.Order != 0 { - n += 1 + sovTypes(uint64(m.Order)) - } - return n -} - -func (m *UpdateStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.State != 0 { - n += 1 + sovTypes(uint64(m.State)) - } - if m.StartedAt != nil { - l = m.StartedAt.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.CompletedAt != nil { - l = m.CompletedAt.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Message) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ContainerStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContainerID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.PID != 0 { - n += 1 + sovTypes(uint64(m.PID)) - } - if m.ExitCode != 0 { - n += 1 + sovTypes(uint64(m.ExitCode)) - } - return n -} - -func (m *PortStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Ports) > 0 { - for _, e := range m.Ports { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *TaskStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Timestamp != nil { - l = m.Timestamp.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.State != 0 { - n += 1 + sovTypes(uint64(m.State)) - } - l = len(m.Message) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Err) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.RuntimeStatus != nil { - n += m.RuntimeStatus.Size() - } - if m.PortStatus != nil { - l = m.PortStatus.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.AppliedBy) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.AppliedAt != nil { - l = m.AppliedAt.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *TaskStatus_Container) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Container != nil { - l = m.Container.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *NetworkAttachmentConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Target) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Aliases) > 0 { - for _, s := range m.Aliases { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.Addresses) > 0 { - for _, s := range m.Addresses { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.DriverAttachmentOpts) > 0 { - for k, v := range m.DriverAttachmentOpts { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - n += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize)) - } - } - return n -} - -func (m *IPAMConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Family != 0 { - n += 1 + sovTypes(uint64(m.Family)) - } - l = len(m.Subnet) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Range) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Gateway) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Reserved) > 0 { - for k, v := range m.Reserved { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - n += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize)) - } - } - return n -} - -func (m *PortConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Protocol != 0 { - n += 1 + sovTypes(uint64(m.Protocol)) - } - if m.TargetPort != 0 { - n += 1 + sovTypes(uint64(m.TargetPort)) - } - if m.PublishedPort != 0 { - n += 1 + sovTypes(uint64(m.PublishedPort)) - } - if m.PublishMode != 0 { - n += 1 + sovTypes(uint64(m.PublishMode)) - } - return n -} - -func (m *Driver) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Options) > 0 { - for k, v := range m.Options { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - n += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize)) - } - } - return n -} - -func (m *IPAMOptions) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Driver != nil { - l = m.Driver.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Configs) > 0 { - for _, e := range m.Configs { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *Peer) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.NodeID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Addr) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *WeightedPeer) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Peer != nil { - l = m.Peer.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Weight != 0 { - n += 1 + sovTypes(uint64(m.Weight)) - } - return n -} - -func (m *IssuanceStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.State != 0 { - n += 1 + sovTypes(uint64(m.State)) - } - l = len(m.Err) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *AcceptancePolicy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Policies) > 0 { - for _, e := range m.Policies { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *AcceptancePolicy_RoleAdmissionPolicy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Role != 0 { - n += 1 + sovTypes(uint64(m.Role)) - } - if m.Autoaccept { - n += 2 - } - if m.Secret != nil { - l = m.Secret.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Alg) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ExternalCA) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Protocol != 0 { - n += 1 + sovTypes(uint64(m.Protocol)) - } - l = len(m.URL) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Options) > 0 { - for k, v := range m.Options { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - n += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize)) - } - } - l = len(m.CACert) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *CAConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NodeCertExpiry != nil { - l = m.NodeCertExpiry.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.ExternalCAs) > 0 { - for _, e := range m.ExternalCAs { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - l = len(m.SigningCACert) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.SigningCAKey) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.ForceRotate != 0 { - n += 1 + sovTypes(uint64(m.ForceRotate)) - } - return n -} - -func (m *OrchestrationConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TaskHistoryRetentionLimit != 0 { - n += 1 + sovTypes(uint64(m.TaskHistoryRetentionLimit)) - } - return n -} - -func (m *TaskDefaults) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.LogDriver != nil { - l = m.LogDriver.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *DispatcherConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.HeartbeatPeriod != nil { - l = m.HeartbeatPeriod.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *RaftConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SnapshotInterval != 0 { - n += 1 + sovTypes(uint64(m.SnapshotInterval)) - } - if m.KeepOldSnapshots != 0 { - n += 1 + sovTypes(uint64(m.KeepOldSnapshots)) - } - if m.LogEntriesForSlowFollowers != 0 { - n += 1 + sovTypes(uint64(m.LogEntriesForSlowFollowers)) - } - if m.HeartbeatTick != 0 { - n += 1 + sovTypes(uint64(m.HeartbeatTick)) - } - if m.ElectionTick != 0 { - n += 1 + sovTypes(uint64(m.ElectionTick)) - } - return n -} - -func (m *EncryptionConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AutoLockManagers { - n += 2 - } - return n -} - -func (m *SpreadOver) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SpreadDescriptor) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *PlacementPreference) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Preference != nil { - n += m.Preference.Size() - } - return n -} - -func (m *PlacementPreference_Spread) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Spread != nil { - l = m.Spread.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Placement) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Constraints) > 0 { - for _, s := range m.Constraints { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.Preferences) > 0 { - for _, e := range m.Preferences { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.Platforms) > 0 { - for _, e := range m.Platforms { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if m.MaxReplicas != 0 { - n += 1 + sovTypes(uint64(m.MaxReplicas)) - } - return n -} - -func (m *JoinTokens) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Worker) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Manager) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *RootCA) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.CAKey) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.CACert) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.CACertHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = m.JoinTokens.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.RootRotation != nil { - l = m.RootRotation.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.LastForcedRotation != 0 { - n += 1 + sovTypes(uint64(m.LastForcedRotation)) - } - return n -} - -func (m *Certificate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Role != 0 { - n += 1 + sovTypes(uint64(m.Role)) - } - l = len(m.CSR) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = m.Status.Size() - n += 1 + l + sovTypes(uint64(l)) - l = len(m.Certificate) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.CN) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *EncryptionKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Subsystem) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Algorithm != 0 { - n += 1 + sovTypes(uint64(m.Algorithm)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.LamportTime != 0 { - n += 1 + sovTypes(uint64(m.LamportTime)) - } - return n -} - -func (m *ManagerStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RaftID != 0 { - n += 1 + sovTypes(uint64(m.RaftID)) - } - l = len(m.Addr) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Leader { - n += 2 - } - if m.Reachability != 0 { - n += 1 + sovTypes(uint64(m.Reachability)) - } - return n -} - -func (m *FileTarget) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.UID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.GID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Mode != 0 { - n += 1 + sovTypes(uint64(m.Mode)) - } - return n -} - -func (m *RuntimeTarget) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *SecretReference) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SecretID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.SecretName) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Target != nil { - n += m.Target.Size() - } - return n -} - -func (m *SecretReference_File) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.File != nil { - l = m.File.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *ConfigReference) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ConfigID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ConfigName) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Target != nil { - n += m.Target.Size() - } - return n -} - -func (m *ConfigReference_File) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.File != nil { - l = m.File.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *ConfigReference_Runtime) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Runtime != nil { - l = m.Runtime.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *BlacklistedCertificate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Expiry != nil { - l = m.Expiry.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *HealthConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Test) > 0 { - for _, s := range m.Test { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) - } - } - if m.Interval != nil { - l = m.Interval.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Timeout != nil { - l = m.Timeout.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Retries != 0 { - n += 1 + sovTypes(uint64(m.Retries)) - } - if m.StartPeriod != nil { - l = m.StartPeriod.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.StartInterval != nil { - l = m.StartInterval.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *MaybeEncryptedRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Algorithm != 0 { - n += 1 + sovTypes(uint64(m.Algorithm)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Nonce) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *RootRotation) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.CACert) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.CAKey) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.CrossSignedCACert) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Privileges) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CredentialSpec != nil { - l = m.CredentialSpec.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.SELinuxContext != nil { - l = m.SELinuxContext.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Seccomp != nil { - l = m.Seccomp.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Apparmor != nil { - l = m.Apparmor.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.NoNewPrivileges { - n += 2 - } - return n -} - -func (m *Privileges_CredentialSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Source != nil { - n += m.Source.Size() - } - return n -} - -func (m *Privileges_CredentialSpec_File) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.File) - n += 1 + l + sovTypes(uint64(l)) - return n -} -func (m *Privileges_CredentialSpec_Registry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Registry) - n += 1 + l + sovTypes(uint64(l)) - return n -} -func (m *Privileges_CredentialSpec_Config) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Config) - n += 1 + l + sovTypes(uint64(l)) - return n -} -func (m *Privileges_SELinuxContext) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Disable { - n += 2 - } - l = len(m.User) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Role) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Type) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Level) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Privileges_SeccompOpts) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Mode != 0 { - n += 1 + sovTypes(uint64(m.Mode)) - } - l = len(m.Profile) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Privileges_AppArmorOpts) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Mode != 0 { - n += 1 + sovTypes(uint64(m.Mode)) - } - return n -} - -func (m *JobStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.JobIteration.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.LastExecution != nil { - l = m.LastExecution.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *VolumeAccessMode) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Scope != 0 { - n += 1 + sovTypes(uint64(m.Scope)) - } - if m.Sharing != 0 { - n += 1 + sovTypes(uint64(m.Sharing)) - } - if m.AccessType != nil { - n += m.AccessType.Size() - } - return n -} - -func (m *VolumeAccessMode_Block) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Block != nil { - l = m.Block.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *VolumeAccessMode_Mount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Mount != nil { - l = m.Mount.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *VolumeAccessMode_BlockVolume) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *VolumeAccessMode_MountVolume) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.FsType) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.MountFlags) > 0 { - for _, s := range m.MountFlags { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *VolumeSecret) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Secret) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *VolumePublishStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.NodeID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.State != 0 { - n += 1 + sovTypes(uint64(m.State)) - } - if len(m.PublishContext) > 0 { - for k, v := range m.PublishContext { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - n += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize)) - } - } - l = len(m.Message) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *VolumeInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CapacityBytes != 0 { - n += 1 + sovTypes(uint64(m.CapacityBytes)) - } - if len(m.VolumeContext) > 0 { - for k, v := range m.VolumeContext { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - n += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize)) - } - } - l = len(m.VolumeID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.AccessibleTopology) > 0 { - for _, e := range m.AccessibleTopology { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *CapacityRange) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RequiredBytes != 0 { - n += 1 + sovTypes(uint64(m.RequiredBytes)) - } - if m.LimitBytes != 0 { - n += 1 + sovTypes(uint64(m.LimitBytes)) - } - return n -} - -func (m *VolumeAssignment) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.VolumeID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Driver != nil { - l = m.Driver.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.VolumeContext) > 0 { - for k, v := range m.VolumeContext { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - n += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize)) - } - } - if len(m.PublishContext) > 0 { - for k, v := range m.PublishContext { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - n += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize)) - } - } - if m.AccessMode != nil { - l = m.AccessMode.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Secrets) > 0 { - for _, e := range m.Secrets { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *VolumeAttachment) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Source) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Target) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *TopologyRequirement) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Requisite) > 0 { - for _, e := range m.Requisite { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.Preferred) > 0 { - for _, e := range m.Preferred { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *Topology) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Segments) > 0 { - for k, v := range m.Segments { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - n += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize)) - } - } - return n -} - -func (m *VolumeCapability) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AccessType != nil { - n += m.AccessType.Size() - } - if m.AccessMode != nil { - l = m.AccessMode.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *VolumeCapability_Block) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Block != nil { - l = m.Block.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *VolumeCapability_Mount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Mount != nil { - l = m.Mount.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *VolumeCapability_BlockVolume) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *VolumeCapability_MountVolume) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.FsType) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.MountFlags) > 0 { - for _, s := range m.MountFlags { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *VolumeCapability_AccessMode) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Mode != 0 { - n += 1 + sovTypes(uint64(m.Mode)) - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Version) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Version{`, - `Index:` + fmt.Sprintf("%v", this.Index) + `,`, - `}`, - }, "") - return s -} -func (this *IndexEntry) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&IndexEntry{`, - `Key:` + fmt.Sprintf("%v", this.Key) + `,`, - `Val:` + fmt.Sprintf("%v", this.Val) + `,`, - `}`, - }, "") - return s -} -func (this *Annotations) String() string { - if this == nil { - return "nil" - } - repeatedStringForIndices := "[]IndexEntry{" - for _, f := range this.Indices { - repeatedStringForIndices += strings.Replace(strings.Replace(f.String(), "IndexEntry", "IndexEntry", 1), `&`, ``, 1) + "," - } - repeatedStringForIndices += "}" - keysForLabels := make([]string, 0, len(this.Labels)) - for k, _ := range this.Labels { - keysForLabels = append(keysForLabels, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]string{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) - } - mapStringForLabels += "}" - s := strings.Join([]string{`&Annotations{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Labels:` + mapStringForLabels + `,`, - `Indices:` + repeatedStringForIndices + `,`, - `}`, - }, "") - return s -} -func (this *NamedGenericResource) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NamedGenericResource{`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `}`, - }, "") - return s -} -func (this *DiscreteGenericResource) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DiscreteGenericResource{`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `}`, - }, "") - return s -} -func (this *GenericResource) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GenericResource{`, - `Resource:` + fmt.Sprintf("%v", this.Resource) + `,`, - `}`, - }, "") - return s -} -func (this *GenericResource_NamedResourceSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GenericResource_NamedResourceSpec{`, - `NamedResourceSpec:` + strings.Replace(fmt.Sprintf("%v", this.NamedResourceSpec), "NamedGenericResource", "NamedGenericResource", 1) + `,`, - `}`, - }, "") - return s -} -func (this *GenericResource_DiscreteResourceSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GenericResource_DiscreteResourceSpec{`, - `DiscreteResourceSpec:` + strings.Replace(fmt.Sprintf("%v", this.DiscreteResourceSpec), "DiscreteGenericResource", "DiscreteGenericResource", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Resources) String() string { - if this == nil { - return "nil" - } - repeatedStringForGeneric := "[]*GenericResource{" - for _, f := range this.Generic { - repeatedStringForGeneric += strings.Replace(f.String(), "GenericResource", "GenericResource", 1) + "," - } - repeatedStringForGeneric += "}" - s := strings.Join([]string{`&Resources{`, - `NanoCPUs:` + fmt.Sprintf("%v", this.NanoCPUs) + `,`, - `MemoryBytes:` + fmt.Sprintf("%v", this.MemoryBytes) + `,`, - `Generic:` + repeatedStringForGeneric + `,`, - `}`, - }, "") - return s -} -func (this *ResourceRequirements) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceRequirements{`, - `Limits:` + strings.Replace(this.Limits.String(), "Resources", "Resources", 1) + `,`, - `Reservations:` + strings.Replace(this.Reservations.String(), "Resources", "Resources", 1) + `,`, - `SwapBytes:` + strings.Replace(fmt.Sprintf("%v", this.SwapBytes), "Int64Value", "types.Int64Value", 1) + `,`, - `MemorySwappiness:` + strings.Replace(fmt.Sprintf("%v", this.MemorySwappiness), "Int64Value", "types.Int64Value", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Platform) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Platform{`, - `Architecture:` + fmt.Sprintf("%v", this.Architecture) + `,`, - `OS:` + fmt.Sprintf("%v", this.OS) + `,`, - `}`, - }, "") - return s -} -func (this *PluginDescription) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PluginDescription{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `}`, - }, "") - return s -} -func (this *EngineDescription) String() string { - if this == nil { - return "nil" - } - repeatedStringForPlugins := "[]PluginDescription{" - for _, f := range this.Plugins { - repeatedStringForPlugins += strings.Replace(strings.Replace(f.String(), "PluginDescription", "PluginDescription", 1), `&`, ``, 1) + "," - } - repeatedStringForPlugins += "}" - keysForLabels := make([]string, 0, len(this.Labels)) - for k, _ := range this.Labels { - keysForLabels = append(keysForLabels, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]string{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) - } - mapStringForLabels += "}" - s := strings.Join([]string{`&EngineDescription{`, - `EngineVersion:` + fmt.Sprintf("%v", this.EngineVersion) + `,`, - `Labels:` + mapStringForLabels + `,`, - `Plugins:` + repeatedStringForPlugins + `,`, - `}`, - }, "") - return s -} -func (this *NodeDescription) String() string { - if this == nil { - return "nil" - } - repeatedStringForCSIInfo := "[]*NodeCSIInfo{" - for _, f := range this.CSIInfo { - repeatedStringForCSIInfo += strings.Replace(f.String(), "NodeCSIInfo", "NodeCSIInfo", 1) + "," - } - repeatedStringForCSIInfo += "}" - s := strings.Join([]string{`&NodeDescription{`, - `Hostname:` + fmt.Sprintf("%v", this.Hostname) + `,`, - `Platform:` + strings.Replace(this.Platform.String(), "Platform", "Platform", 1) + `,`, - `Resources:` + strings.Replace(this.Resources.String(), "Resources", "Resources", 1) + `,`, - `Engine:` + strings.Replace(this.Engine.String(), "EngineDescription", "EngineDescription", 1) + `,`, - `TLSInfo:` + strings.Replace(this.TLSInfo.String(), "NodeTLSInfo", "NodeTLSInfo", 1) + `,`, - `FIPS:` + fmt.Sprintf("%v", this.FIPS) + `,`, - `CSIInfo:` + repeatedStringForCSIInfo + `,`, - `}`, - }, "") - return s -} -func (this *NodeTLSInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NodeTLSInfo{`, - `TrustRoot:` + fmt.Sprintf("%v", this.TrustRoot) + `,`, - `CertIssuerSubject:` + fmt.Sprintf("%v", this.CertIssuerSubject) + `,`, - `CertIssuerPublicKey:` + fmt.Sprintf("%v", this.CertIssuerPublicKey) + `,`, - `}`, - }, "") - return s -} -func (this *NodeCSIInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NodeCSIInfo{`, - `PluginName:` + fmt.Sprintf("%v", this.PluginName) + `,`, - `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, - `MaxVolumesPerNode:` + fmt.Sprintf("%v", this.MaxVolumesPerNode) + `,`, - `AccessibleTopology:` + strings.Replace(this.AccessibleTopology.String(), "Topology", "Topology", 1) + `,`, - `}`, - }, "") - return s -} -func (this *RaftMemberStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RaftMemberStatus{`, - `Leader:` + fmt.Sprintf("%v", this.Leader) + `,`, - `Reachability:` + fmt.Sprintf("%v", this.Reachability) + `,`, - `Message:` + fmt.Sprintf("%v", this.Message) + `,`, - `}`, - }, "") - return s -} -func (this *NodeStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NodeStatus{`, - `State:` + fmt.Sprintf("%v", this.State) + `,`, - `Message:` + fmt.Sprintf("%v", this.Message) + `,`, - `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`, - `}`, - }, "") - return s -} -func (this *Image) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Image{`, - `Reference:` + fmt.Sprintf("%v", this.Reference) + `,`, - `}`, - }, "") - return s -} -func (this *Mount) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Mount{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Source:` + fmt.Sprintf("%v", this.Source) + `,`, - `Target:` + fmt.Sprintf("%v", this.Target) + `,`, - `ReadOnly:` + fmt.Sprintf("%v", this.ReadOnly) + `,`, - `BindOptions:` + strings.Replace(fmt.Sprintf("%v", this.BindOptions), "Mount_BindOptions", "Mount_BindOptions", 1) + `,`, - `VolumeOptions:` + strings.Replace(fmt.Sprintf("%v", this.VolumeOptions), "Mount_VolumeOptions", "Mount_VolumeOptions", 1) + `,`, - `TmpfsOptions:` + strings.Replace(fmt.Sprintf("%v", this.TmpfsOptions), "Mount_TmpfsOptions", "Mount_TmpfsOptions", 1) + `,`, - `Consistency:` + fmt.Sprintf("%v", this.Consistency) + `,`, - `}`, - }, "") - return s -} -func (this *Mount_BindOptions) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Mount_BindOptions{`, - `Propagation:` + fmt.Sprintf("%v", this.Propagation) + `,`, - `NonRecursive:` + fmt.Sprintf("%v", this.NonRecursive) + `,`, - `CreateMountpoint:` + fmt.Sprintf("%v", this.CreateMountpoint) + `,`, - `ReadOnlyNonRecursive:` + fmt.Sprintf("%v", this.ReadOnlyNonRecursive) + `,`, - `ReadOnlyForceRecursive:` + fmt.Sprintf("%v", this.ReadOnlyForceRecursive) + `,`, - `}`, - }, "") - return s -} -func (this *Mount_VolumeOptions) String() string { - if this == nil { - return "nil" - } - keysForLabels := make([]string, 0, len(this.Labels)) - for k, _ := range this.Labels { - keysForLabels = append(keysForLabels, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]string{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) - } - mapStringForLabels += "}" - s := strings.Join([]string{`&Mount_VolumeOptions{`, - `NoCopy:` + fmt.Sprintf("%v", this.NoCopy) + `,`, - `Labels:` + mapStringForLabels + `,`, - `DriverConfig:` + strings.Replace(this.DriverConfig.String(), "Driver", "Driver", 1) + `,`, - `Subpath:` + fmt.Sprintf("%v", this.Subpath) + `,`, - `}`, - }, "") - return s -} -func (this *Mount_TmpfsOptions) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Mount_TmpfsOptions{`, - `SizeBytes:` + fmt.Sprintf("%v", this.SizeBytes) + `,`, - `Mode:` + fmt.Sprintf("%v", this.Mode) + `,`, - `Options:` + fmt.Sprintf("%v", this.Options) + `,`, - `}`, - }, "") - return s -} -func (this *RestartPolicy) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RestartPolicy{`, - `Condition:` + fmt.Sprintf("%v", this.Condition) + `,`, - `Delay:` + strings.Replace(fmt.Sprintf("%v", this.Delay), "Duration", "types.Duration", 1) + `,`, - `MaxAttempts:` + fmt.Sprintf("%v", this.MaxAttempts) + `,`, - `Window:` + strings.Replace(fmt.Sprintf("%v", this.Window), "Duration", "types.Duration", 1) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateConfig) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateConfig{`, - `Parallelism:` + fmt.Sprintf("%v", this.Parallelism) + `,`, - `Delay:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Delay), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, - `FailureAction:` + fmt.Sprintf("%v", this.FailureAction) + `,`, - `Monitor:` + strings.Replace(fmt.Sprintf("%v", this.Monitor), "Duration", "types.Duration", 1) + `,`, - `MaxFailureRatio:` + fmt.Sprintf("%v", this.MaxFailureRatio) + `,`, - `Order:` + fmt.Sprintf("%v", this.Order) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateStatus{`, - `State:` + fmt.Sprintf("%v", this.State) + `,`, - `StartedAt:` + strings.Replace(fmt.Sprintf("%v", this.StartedAt), "Timestamp", "types.Timestamp", 1) + `,`, - `CompletedAt:` + strings.Replace(fmt.Sprintf("%v", this.CompletedAt), "Timestamp", "types.Timestamp", 1) + `,`, - `Message:` + fmt.Sprintf("%v", this.Message) + `,`, - `}`, - }, "") - return s -} -func (this *ContainerStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ContainerStatus{`, - `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, - `PID:` + fmt.Sprintf("%v", this.PID) + `,`, - `ExitCode:` + fmt.Sprintf("%v", this.ExitCode) + `,`, - `}`, - }, "") - return s -} -func (this *PortStatus) String() string { - if this == nil { - return "nil" - } - repeatedStringForPorts := "[]*PortConfig{" - for _, f := range this.Ports { - repeatedStringForPorts += strings.Replace(f.String(), "PortConfig", "PortConfig", 1) + "," - } - repeatedStringForPorts += "}" - s := strings.Join([]string{`&PortStatus{`, - `Ports:` + repeatedStringForPorts + `,`, - `}`, - }, "") - return s -} -func (this *TaskStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskStatus{`, - `Timestamp:` + strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1) + `,`, - `State:` + fmt.Sprintf("%v", this.State) + `,`, - `Message:` + fmt.Sprintf("%v", this.Message) + `,`, - `Err:` + fmt.Sprintf("%v", this.Err) + `,`, - `RuntimeStatus:` + fmt.Sprintf("%v", this.RuntimeStatus) + `,`, - `PortStatus:` + strings.Replace(this.PortStatus.String(), "PortStatus", "PortStatus", 1) + `,`, - `AppliedBy:` + fmt.Sprintf("%v", this.AppliedBy) + `,`, - `AppliedAt:` + strings.Replace(fmt.Sprintf("%v", this.AppliedAt), "Timestamp", "types.Timestamp", 1) + `,`, - `}`, - }, "") - return s -} -func (this *TaskStatus_Container) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskStatus_Container{`, - `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "ContainerStatus", "ContainerStatus", 1) + `,`, - `}`, - }, "") - return s -} -func (this *NetworkAttachmentConfig) String() string { - if this == nil { - return "nil" - } - keysForDriverAttachmentOpts := make([]string, 0, len(this.DriverAttachmentOpts)) - for k, _ := range this.DriverAttachmentOpts { - keysForDriverAttachmentOpts = append(keysForDriverAttachmentOpts, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForDriverAttachmentOpts) - mapStringForDriverAttachmentOpts := "map[string]string{" - for _, k := range keysForDriverAttachmentOpts { - mapStringForDriverAttachmentOpts += fmt.Sprintf("%v: %v,", k, this.DriverAttachmentOpts[k]) - } - mapStringForDriverAttachmentOpts += "}" - s := strings.Join([]string{`&NetworkAttachmentConfig{`, - `Target:` + fmt.Sprintf("%v", this.Target) + `,`, - `Aliases:` + fmt.Sprintf("%v", this.Aliases) + `,`, - `Addresses:` + fmt.Sprintf("%v", this.Addresses) + `,`, - `DriverAttachmentOpts:` + mapStringForDriverAttachmentOpts + `,`, - `}`, - }, "") - return s -} -func (this *IPAMConfig) String() string { - if this == nil { - return "nil" - } - keysForReserved := make([]string, 0, len(this.Reserved)) - for k, _ := range this.Reserved { - keysForReserved = append(keysForReserved, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForReserved) - mapStringForReserved := "map[string]string{" - for _, k := range keysForReserved { - mapStringForReserved += fmt.Sprintf("%v: %v,", k, this.Reserved[k]) - } - mapStringForReserved += "}" - s := strings.Join([]string{`&IPAMConfig{`, - `Family:` + fmt.Sprintf("%v", this.Family) + `,`, - `Subnet:` + fmt.Sprintf("%v", this.Subnet) + `,`, - `Range:` + fmt.Sprintf("%v", this.Range) + `,`, - `Gateway:` + fmt.Sprintf("%v", this.Gateway) + `,`, - `Reserved:` + mapStringForReserved + `,`, - `}`, - }, "") - return s -} -func (this *PortConfig) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PortConfig{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Protocol:` + fmt.Sprintf("%v", this.Protocol) + `,`, - `TargetPort:` + fmt.Sprintf("%v", this.TargetPort) + `,`, - `PublishedPort:` + fmt.Sprintf("%v", this.PublishedPort) + `,`, - `PublishMode:` + fmt.Sprintf("%v", this.PublishMode) + `,`, - `}`, - }, "") - return s -} -func (this *Driver) String() string { - if this == nil { - return "nil" - } - keysForOptions := make([]string, 0, len(this.Options)) - for k, _ := range this.Options { - keysForOptions = append(keysForOptions, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForOptions) - mapStringForOptions := "map[string]string{" - for _, k := range keysForOptions { - mapStringForOptions += fmt.Sprintf("%v: %v,", k, this.Options[k]) - } - mapStringForOptions += "}" - s := strings.Join([]string{`&Driver{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Options:` + mapStringForOptions + `,`, - `}`, - }, "") - return s -} -func (this *IPAMOptions) String() string { - if this == nil { - return "nil" - } - repeatedStringForConfigs := "[]*IPAMConfig{" - for _, f := range this.Configs { - repeatedStringForConfigs += strings.Replace(f.String(), "IPAMConfig", "IPAMConfig", 1) + "," - } - repeatedStringForConfigs += "}" - s := strings.Join([]string{`&IPAMOptions{`, - `Driver:` + strings.Replace(this.Driver.String(), "Driver", "Driver", 1) + `,`, - `Configs:` + repeatedStringForConfigs + `,`, - `}`, - }, "") - return s -} -func (this *Peer) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Peer{`, - `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, - `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`, - `}`, - }, "") - return s -} -func (this *WeightedPeer) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&WeightedPeer{`, - `Peer:` + strings.Replace(this.Peer.String(), "Peer", "Peer", 1) + `,`, - `Weight:` + fmt.Sprintf("%v", this.Weight) + `,`, - `}`, - }, "") - return s -} -func (this *IssuanceStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&IssuanceStatus{`, - `State:` + fmt.Sprintf("%v", this.State) + `,`, - `Err:` + fmt.Sprintf("%v", this.Err) + `,`, - `}`, - }, "") - return s -} -func (this *AcceptancePolicy) String() string { - if this == nil { - return "nil" - } - repeatedStringForPolicies := "[]*AcceptancePolicy_RoleAdmissionPolicy{" - for _, f := range this.Policies { - repeatedStringForPolicies += strings.Replace(fmt.Sprintf("%v", f), "AcceptancePolicy_RoleAdmissionPolicy", "AcceptancePolicy_RoleAdmissionPolicy", 1) + "," - } - repeatedStringForPolicies += "}" - s := strings.Join([]string{`&AcceptancePolicy{`, - `Policies:` + repeatedStringForPolicies + `,`, - `}`, - }, "") - return s -} -func (this *AcceptancePolicy_RoleAdmissionPolicy) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AcceptancePolicy_RoleAdmissionPolicy{`, - `Role:` + fmt.Sprintf("%v", this.Role) + `,`, - `Autoaccept:` + fmt.Sprintf("%v", this.Autoaccept) + `,`, - `Secret:` + strings.Replace(fmt.Sprintf("%v", this.Secret), "AcceptancePolicy_RoleAdmissionPolicy_Secret", "AcceptancePolicy_RoleAdmissionPolicy_Secret", 1) + `,`, - `}`, - }, "") - return s -} -func (this *AcceptancePolicy_RoleAdmissionPolicy_Secret) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AcceptancePolicy_RoleAdmissionPolicy_Secret{`, - `Data:` + fmt.Sprintf("%v", this.Data) + `,`, - `Alg:` + fmt.Sprintf("%v", this.Alg) + `,`, - `}`, - }, "") - return s -} -func (this *ExternalCA) String() string { - if this == nil { - return "nil" - } - keysForOptions := make([]string, 0, len(this.Options)) - for k, _ := range this.Options { - keysForOptions = append(keysForOptions, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForOptions) - mapStringForOptions := "map[string]string{" - for _, k := range keysForOptions { - mapStringForOptions += fmt.Sprintf("%v: %v,", k, this.Options[k]) - } - mapStringForOptions += "}" - s := strings.Join([]string{`&ExternalCA{`, - `Protocol:` + fmt.Sprintf("%v", this.Protocol) + `,`, - `URL:` + fmt.Sprintf("%v", this.URL) + `,`, - `Options:` + mapStringForOptions + `,`, - `CACert:` + fmt.Sprintf("%v", this.CACert) + `,`, - `}`, - }, "") - return s -} -func (this *CAConfig) String() string { - if this == nil { - return "nil" - } - repeatedStringForExternalCAs := "[]*ExternalCA{" - for _, f := range this.ExternalCAs { - repeatedStringForExternalCAs += strings.Replace(f.String(), "ExternalCA", "ExternalCA", 1) + "," - } - repeatedStringForExternalCAs += "}" - s := strings.Join([]string{`&CAConfig{`, - `NodeCertExpiry:` + strings.Replace(fmt.Sprintf("%v", this.NodeCertExpiry), "Duration", "types.Duration", 1) + `,`, - `ExternalCAs:` + repeatedStringForExternalCAs + `,`, - `SigningCACert:` + fmt.Sprintf("%v", this.SigningCACert) + `,`, - `SigningCAKey:` + fmt.Sprintf("%v", this.SigningCAKey) + `,`, - `ForceRotate:` + fmt.Sprintf("%v", this.ForceRotate) + `,`, - `}`, - }, "") - return s -} -func (this *OrchestrationConfig) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&OrchestrationConfig{`, - `TaskHistoryRetentionLimit:` + fmt.Sprintf("%v", this.TaskHistoryRetentionLimit) + `,`, - `}`, - }, "") - return s -} -func (this *TaskDefaults) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskDefaults{`, - `LogDriver:` + strings.Replace(this.LogDriver.String(), "Driver", "Driver", 1) + `,`, - `}`, - }, "") - return s -} -func (this *DispatcherConfig) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DispatcherConfig{`, - `HeartbeatPeriod:` + strings.Replace(fmt.Sprintf("%v", this.HeartbeatPeriod), "Duration", "types.Duration", 1) + `,`, - `}`, - }, "") - return s -} -func (this *RaftConfig) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RaftConfig{`, - `SnapshotInterval:` + fmt.Sprintf("%v", this.SnapshotInterval) + `,`, - `KeepOldSnapshots:` + fmt.Sprintf("%v", this.KeepOldSnapshots) + `,`, - `LogEntriesForSlowFollowers:` + fmt.Sprintf("%v", this.LogEntriesForSlowFollowers) + `,`, - `HeartbeatTick:` + fmt.Sprintf("%v", this.HeartbeatTick) + `,`, - `ElectionTick:` + fmt.Sprintf("%v", this.ElectionTick) + `,`, - `}`, - }, "") - return s -} -func (this *EncryptionConfig) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&EncryptionConfig{`, - `AutoLockManagers:` + fmt.Sprintf("%v", this.AutoLockManagers) + `,`, - `}`, - }, "") - return s -} -func (this *SpreadOver) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SpreadOver{`, - `SpreadDescriptor:` + fmt.Sprintf("%v", this.SpreadDescriptor) + `,`, - `}`, - }, "") - return s -} -func (this *PlacementPreference) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PlacementPreference{`, - `Preference:` + fmt.Sprintf("%v", this.Preference) + `,`, - `}`, - }, "") - return s -} -func (this *PlacementPreference_Spread) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PlacementPreference_Spread{`, - `Spread:` + strings.Replace(fmt.Sprintf("%v", this.Spread), "SpreadOver", "SpreadOver", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Placement) String() string { - if this == nil { - return "nil" - } - repeatedStringForPreferences := "[]*PlacementPreference{" - for _, f := range this.Preferences { - repeatedStringForPreferences += strings.Replace(f.String(), "PlacementPreference", "PlacementPreference", 1) + "," - } - repeatedStringForPreferences += "}" - repeatedStringForPlatforms := "[]*Platform{" - for _, f := range this.Platforms { - repeatedStringForPlatforms += strings.Replace(f.String(), "Platform", "Platform", 1) + "," - } - repeatedStringForPlatforms += "}" - s := strings.Join([]string{`&Placement{`, - `Constraints:` + fmt.Sprintf("%v", this.Constraints) + `,`, - `Preferences:` + repeatedStringForPreferences + `,`, - `Platforms:` + repeatedStringForPlatforms + `,`, - `MaxReplicas:` + fmt.Sprintf("%v", this.MaxReplicas) + `,`, - `}`, - }, "") - return s -} -func (this *JoinTokens) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&JoinTokens{`, - `Worker:` + fmt.Sprintf("%v", this.Worker) + `,`, - `Manager:` + fmt.Sprintf("%v", this.Manager) + `,`, - `}`, - }, "") - return s -} -func (this *RootCA) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RootCA{`, - `CAKey:` + fmt.Sprintf("%v", this.CAKey) + `,`, - `CACert:` + fmt.Sprintf("%v", this.CACert) + `,`, - `CACertHash:` + fmt.Sprintf("%v", this.CACertHash) + `,`, - `JoinTokens:` + strings.Replace(strings.Replace(this.JoinTokens.String(), "JoinTokens", "JoinTokens", 1), `&`, ``, 1) + `,`, - `RootRotation:` + strings.Replace(this.RootRotation.String(), "RootRotation", "RootRotation", 1) + `,`, - `LastForcedRotation:` + fmt.Sprintf("%v", this.LastForcedRotation) + `,`, - `}`, - }, "") - return s -} -func (this *Certificate) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Certificate{`, - `Role:` + fmt.Sprintf("%v", this.Role) + `,`, - `CSR:` + fmt.Sprintf("%v", this.CSR) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "IssuanceStatus", "IssuanceStatus", 1), `&`, ``, 1) + `,`, - `Certificate:` + fmt.Sprintf("%v", this.Certificate) + `,`, - `CN:` + fmt.Sprintf("%v", this.CN) + `,`, - `}`, - }, "") - return s -} -func (this *EncryptionKey) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&EncryptionKey{`, - `Subsystem:` + fmt.Sprintf("%v", this.Subsystem) + `,`, - `Algorithm:` + fmt.Sprintf("%v", this.Algorithm) + `,`, - `Key:` + fmt.Sprintf("%v", this.Key) + `,`, - `LamportTime:` + fmt.Sprintf("%v", this.LamportTime) + `,`, - `}`, - }, "") - return s -} -func (this *ManagerStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ManagerStatus{`, - `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`, - `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`, - `Leader:` + fmt.Sprintf("%v", this.Leader) + `,`, - `Reachability:` + fmt.Sprintf("%v", this.Reachability) + `,`, - `}`, - }, "") - return s -} -func (this *FileTarget) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FileTarget{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `UID:` + fmt.Sprintf("%v", this.UID) + `,`, - `GID:` + fmt.Sprintf("%v", this.GID) + `,`, - `Mode:` + fmt.Sprintf("%v", this.Mode) + `,`, - `}`, - }, "") - return s -} -func (this *RuntimeTarget) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RuntimeTarget{`, - `}`, - }, "") - return s -} -func (this *SecretReference) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SecretReference{`, - `SecretID:` + fmt.Sprintf("%v", this.SecretID) + `,`, - `SecretName:` + fmt.Sprintf("%v", this.SecretName) + `,`, - `Target:` + fmt.Sprintf("%v", this.Target) + `,`, - `}`, - }, "") - return s -} -func (this *SecretReference_File) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SecretReference_File{`, - `File:` + strings.Replace(fmt.Sprintf("%v", this.File), "FileTarget", "FileTarget", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ConfigReference) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ConfigReference{`, - `ConfigID:` + fmt.Sprintf("%v", this.ConfigID) + `,`, - `ConfigName:` + fmt.Sprintf("%v", this.ConfigName) + `,`, - `Target:` + fmt.Sprintf("%v", this.Target) + `,`, - `}`, - }, "") - return s -} -func (this *ConfigReference_File) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ConfigReference_File{`, - `File:` + strings.Replace(fmt.Sprintf("%v", this.File), "FileTarget", "FileTarget", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ConfigReference_Runtime) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ConfigReference_Runtime{`, - `Runtime:` + strings.Replace(fmt.Sprintf("%v", this.Runtime), "RuntimeTarget", "RuntimeTarget", 1) + `,`, - `}`, - }, "") - return s -} -func (this *BlacklistedCertificate) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&BlacklistedCertificate{`, - `Expiry:` + strings.Replace(fmt.Sprintf("%v", this.Expiry), "Timestamp", "types.Timestamp", 1) + `,`, - `}`, - }, "") - return s -} -func (this *HealthConfig) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&HealthConfig{`, - `Test:` + fmt.Sprintf("%v", this.Test) + `,`, - `Interval:` + strings.Replace(fmt.Sprintf("%v", this.Interval), "Duration", "types.Duration", 1) + `,`, - `Timeout:` + strings.Replace(fmt.Sprintf("%v", this.Timeout), "Duration", "types.Duration", 1) + `,`, - `Retries:` + fmt.Sprintf("%v", this.Retries) + `,`, - `StartPeriod:` + strings.Replace(fmt.Sprintf("%v", this.StartPeriod), "Duration", "types.Duration", 1) + `,`, - `StartInterval:` + strings.Replace(fmt.Sprintf("%v", this.StartInterval), "Duration", "types.Duration", 1) + `,`, - `}`, - }, "") - return s -} -func (this *MaybeEncryptedRecord) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&MaybeEncryptedRecord{`, - `Algorithm:` + fmt.Sprintf("%v", this.Algorithm) + `,`, - `Data:` + fmt.Sprintf("%v", this.Data) + `,`, - `Nonce:` + fmt.Sprintf("%v", this.Nonce) + `,`, - `}`, - }, "") - return s -} -func (this *RootRotation) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RootRotation{`, - `CACert:` + fmt.Sprintf("%v", this.CACert) + `,`, - `CAKey:` + fmt.Sprintf("%v", this.CAKey) + `,`, - `CrossSignedCACert:` + fmt.Sprintf("%v", this.CrossSignedCACert) + `,`, - `}`, - }, "") - return s -} -func (this *Privileges) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Privileges{`, - `CredentialSpec:` + strings.Replace(fmt.Sprintf("%v", this.CredentialSpec), "Privileges_CredentialSpec", "Privileges_CredentialSpec", 1) + `,`, - `SELinuxContext:` + strings.Replace(fmt.Sprintf("%v", this.SELinuxContext), "Privileges_SELinuxContext", "Privileges_SELinuxContext", 1) + `,`, - `Seccomp:` + strings.Replace(fmt.Sprintf("%v", this.Seccomp), "Privileges_SeccompOpts", "Privileges_SeccompOpts", 1) + `,`, - `Apparmor:` + strings.Replace(fmt.Sprintf("%v", this.Apparmor), "Privileges_AppArmorOpts", "Privileges_AppArmorOpts", 1) + `,`, - `NoNewPrivileges:` + fmt.Sprintf("%v", this.NoNewPrivileges) + `,`, - `}`, - }, "") - return s -} -func (this *Privileges_CredentialSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Privileges_CredentialSpec{`, - `Source:` + fmt.Sprintf("%v", this.Source) + `,`, - `}`, - }, "") - return s -} -func (this *Privileges_CredentialSpec_File) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Privileges_CredentialSpec_File{`, - `File:` + fmt.Sprintf("%v", this.File) + `,`, - `}`, - }, "") - return s -} -func (this *Privileges_CredentialSpec_Registry) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Privileges_CredentialSpec_Registry{`, - `Registry:` + fmt.Sprintf("%v", this.Registry) + `,`, - `}`, - }, "") - return s -} -func (this *Privileges_CredentialSpec_Config) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Privileges_CredentialSpec_Config{`, - `Config:` + fmt.Sprintf("%v", this.Config) + `,`, - `}`, - }, "") - return s -} -func (this *Privileges_SELinuxContext) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Privileges_SELinuxContext{`, - `Disable:` + fmt.Sprintf("%v", this.Disable) + `,`, - `User:` + fmt.Sprintf("%v", this.User) + `,`, - `Role:` + fmt.Sprintf("%v", this.Role) + `,`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Level:` + fmt.Sprintf("%v", this.Level) + `,`, - `}`, - }, "") - return s -} -func (this *Privileges_SeccompOpts) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Privileges_SeccompOpts{`, - `Mode:` + fmt.Sprintf("%v", this.Mode) + `,`, - `Profile:` + fmt.Sprintf("%v", this.Profile) + `,`, - `}`, - }, "") - return s -} -func (this *Privileges_AppArmorOpts) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Privileges_AppArmorOpts{`, - `Mode:` + fmt.Sprintf("%v", this.Mode) + `,`, - `}`, - }, "") - return s -} -func (this *JobStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&JobStatus{`, - `JobIteration:` + strings.Replace(strings.Replace(this.JobIteration.String(), "Version", "Version", 1), `&`, ``, 1) + `,`, - `LastExecution:` + strings.Replace(fmt.Sprintf("%v", this.LastExecution), "Timestamp", "types.Timestamp", 1) + `,`, - `}`, - }, "") - return s -} -func (this *VolumeAccessMode) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VolumeAccessMode{`, - `Scope:` + fmt.Sprintf("%v", this.Scope) + `,`, - `Sharing:` + fmt.Sprintf("%v", this.Sharing) + `,`, - `AccessType:` + fmt.Sprintf("%v", this.AccessType) + `,`, - `}`, - }, "") - return s -} -func (this *VolumeAccessMode_Block) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VolumeAccessMode_Block{`, - `Block:` + strings.Replace(fmt.Sprintf("%v", this.Block), "VolumeAccessMode_BlockVolume", "VolumeAccessMode_BlockVolume", 1) + `,`, - `}`, - }, "") - return s -} -func (this *VolumeAccessMode_Mount) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VolumeAccessMode_Mount{`, - `Mount:` + strings.Replace(fmt.Sprintf("%v", this.Mount), "VolumeAccessMode_MountVolume", "VolumeAccessMode_MountVolume", 1) + `,`, - `}`, - }, "") - return s -} -func (this *VolumeAccessMode_BlockVolume) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VolumeAccessMode_BlockVolume{`, - `}`, - }, "") - return s -} -func (this *VolumeAccessMode_MountVolume) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VolumeAccessMode_MountVolume{`, - `FsType:` + fmt.Sprintf("%v", this.FsType) + `,`, - `MountFlags:` + fmt.Sprintf("%v", this.MountFlags) + `,`, - `}`, - }, "") - return s -} -func (this *VolumeSecret) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VolumeSecret{`, - `Key:` + fmt.Sprintf("%v", this.Key) + `,`, - `Secret:` + fmt.Sprintf("%v", this.Secret) + `,`, - `}`, - }, "") - return s -} -func (this *VolumePublishStatus) String() string { - if this == nil { - return "nil" - } - keysForPublishContext := make([]string, 0, len(this.PublishContext)) - for k, _ := range this.PublishContext { - keysForPublishContext = append(keysForPublishContext, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForPublishContext) - mapStringForPublishContext := "map[string]string{" - for _, k := range keysForPublishContext { - mapStringForPublishContext += fmt.Sprintf("%v: %v,", k, this.PublishContext[k]) - } - mapStringForPublishContext += "}" - s := strings.Join([]string{`&VolumePublishStatus{`, - `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, - `State:` + fmt.Sprintf("%v", this.State) + `,`, - `PublishContext:` + mapStringForPublishContext + `,`, - `Message:` + fmt.Sprintf("%v", this.Message) + `,`, - `}`, - }, "") - return s -} -func (this *VolumeInfo) String() string { - if this == nil { - return "nil" - } - repeatedStringForAccessibleTopology := "[]*Topology{" - for _, f := range this.AccessibleTopology { - repeatedStringForAccessibleTopology += strings.Replace(f.String(), "Topology", "Topology", 1) + "," - } - repeatedStringForAccessibleTopology += "}" - keysForVolumeContext := make([]string, 0, len(this.VolumeContext)) - for k, _ := range this.VolumeContext { - keysForVolumeContext = append(keysForVolumeContext, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForVolumeContext) - mapStringForVolumeContext := "map[string]string{" - for _, k := range keysForVolumeContext { - mapStringForVolumeContext += fmt.Sprintf("%v: %v,", k, this.VolumeContext[k]) - } - mapStringForVolumeContext += "}" - s := strings.Join([]string{`&VolumeInfo{`, - `CapacityBytes:` + fmt.Sprintf("%v", this.CapacityBytes) + `,`, - `VolumeContext:` + mapStringForVolumeContext + `,`, - `VolumeID:` + fmt.Sprintf("%v", this.VolumeID) + `,`, - `AccessibleTopology:` + repeatedStringForAccessibleTopology + `,`, - `}`, - }, "") - return s -} -func (this *CapacityRange) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CapacityRange{`, - `RequiredBytes:` + fmt.Sprintf("%v", this.RequiredBytes) + `,`, - `LimitBytes:` + fmt.Sprintf("%v", this.LimitBytes) + `,`, - `}`, - }, "") - return s -} -func (this *VolumeAssignment) String() string { - if this == nil { - return "nil" - } - repeatedStringForSecrets := "[]*VolumeSecret{" - for _, f := range this.Secrets { - repeatedStringForSecrets += strings.Replace(f.String(), "VolumeSecret", "VolumeSecret", 1) + "," - } - repeatedStringForSecrets += "}" - keysForVolumeContext := make([]string, 0, len(this.VolumeContext)) - for k, _ := range this.VolumeContext { - keysForVolumeContext = append(keysForVolumeContext, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForVolumeContext) - mapStringForVolumeContext := "map[string]string{" - for _, k := range keysForVolumeContext { - mapStringForVolumeContext += fmt.Sprintf("%v: %v,", k, this.VolumeContext[k]) - } - mapStringForVolumeContext += "}" - keysForPublishContext := make([]string, 0, len(this.PublishContext)) - for k, _ := range this.PublishContext { - keysForPublishContext = append(keysForPublishContext, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForPublishContext) - mapStringForPublishContext := "map[string]string{" - for _, k := range keysForPublishContext { - mapStringForPublishContext += fmt.Sprintf("%v: %v,", k, this.PublishContext[k]) - } - mapStringForPublishContext += "}" - s := strings.Join([]string{`&VolumeAssignment{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `VolumeID:` + fmt.Sprintf("%v", this.VolumeID) + `,`, - `Driver:` + strings.Replace(this.Driver.String(), "Driver", "Driver", 1) + `,`, - `VolumeContext:` + mapStringForVolumeContext + `,`, - `PublishContext:` + mapStringForPublishContext + `,`, - `AccessMode:` + strings.Replace(this.AccessMode.String(), "VolumeAccessMode", "VolumeAccessMode", 1) + `,`, - `Secrets:` + repeatedStringForSecrets + `,`, - `}`, - }, "") - return s -} -func (this *VolumeAttachment) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VolumeAttachment{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Source:` + fmt.Sprintf("%v", this.Source) + `,`, - `Target:` + fmt.Sprintf("%v", this.Target) + `,`, - `}`, - }, "") - return s -} -func (this *TopologyRequirement) String() string { - if this == nil { - return "nil" - } - repeatedStringForRequisite := "[]*Topology{" - for _, f := range this.Requisite { - repeatedStringForRequisite += strings.Replace(f.String(), "Topology", "Topology", 1) + "," - } - repeatedStringForRequisite += "}" - repeatedStringForPreferred := "[]*Topology{" - for _, f := range this.Preferred { - repeatedStringForPreferred += strings.Replace(f.String(), "Topology", "Topology", 1) + "," - } - repeatedStringForPreferred += "}" - s := strings.Join([]string{`&TopologyRequirement{`, - `Requisite:` + repeatedStringForRequisite + `,`, - `Preferred:` + repeatedStringForPreferred + `,`, - `}`, - }, "") - return s -} -func (this *Topology) String() string { - if this == nil { - return "nil" - } - keysForSegments := make([]string, 0, len(this.Segments)) - for k, _ := range this.Segments { - keysForSegments = append(keysForSegments, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForSegments) - mapStringForSegments := "map[string]string{" - for _, k := range keysForSegments { - mapStringForSegments += fmt.Sprintf("%v: %v,", k, this.Segments[k]) - } - mapStringForSegments += "}" - s := strings.Join([]string{`&Topology{`, - `Segments:` + mapStringForSegments + `,`, - `}`, - }, "") - return s -} -func (this *VolumeCapability) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VolumeCapability{`, - `AccessType:` + fmt.Sprintf("%v", this.AccessType) + `,`, - `AccessMode:` + strings.Replace(fmt.Sprintf("%v", this.AccessMode), "VolumeCapability_AccessMode", "VolumeCapability_AccessMode", 1) + `,`, - `}`, - }, "") - return s -} -func (this *VolumeCapability_Block) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VolumeCapability_Block{`, - `Block:` + strings.Replace(fmt.Sprintf("%v", this.Block), "VolumeCapability_BlockVolume", "VolumeCapability_BlockVolume", 1) + `,`, - `}`, - }, "") - return s -} -func (this *VolumeCapability_Mount) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VolumeCapability_Mount{`, - `Mount:` + strings.Replace(fmt.Sprintf("%v", this.Mount), "VolumeCapability_MountVolume", "VolumeCapability_MountVolume", 1) + `,`, - `}`, - }, "") - return s -} -func (this *VolumeCapability_BlockVolume) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VolumeCapability_BlockVolume{`, - `}`, - }, "") - return s -} -func (this *VolumeCapability_MountVolume) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VolumeCapability_MountVolume{`, - `FsType:` + fmt.Sprintf("%v", this.FsType) + `,`, - `MountFlags:` + fmt.Sprintf("%v", this.MountFlags) + `,`, - `}`, - }, "") - return s -} -func (this *VolumeCapability_AccessMode) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VolumeCapability_AccessMode{`, - `Mode:` + fmt.Sprintf("%v", this.Mode) + `,`, - `}`, - }, "") - return s -} -func valueToStringTypes(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Version) Unmarshal(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 ErrIntOverflowTypes - } - 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: Version: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Version: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IndexEntry) Unmarshal(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 ErrIntOverflowTypes - } - 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: IndexEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IndexEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Val", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Val = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Annotations) Unmarshal(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 ErrIntOverflowTypes - } - 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: Annotations: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Annotations: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthTypes - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Labels[mapkey] = mapvalue - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Indices", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Indices = append(m.Indices, IndexEntry{}) - if err := m.Indices[len(m.Indices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NamedGenericResource) Unmarshal(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 ErrIntOverflowTypes - } - 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: NamedGenericResource: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NamedGenericResource: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DiscreteGenericResource) Unmarshal(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 ErrIntOverflowTypes - } - 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: DiscreteGenericResource: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DiscreteGenericResource: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - m.Value = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Value |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GenericResource) Unmarshal(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 ErrIntOverflowTypes - } - 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: GenericResource: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenericResource: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamedResourceSpec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &NamedGenericResource{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Resource = &GenericResource_NamedResourceSpec{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DiscreteResourceSpec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &DiscreteGenericResource{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Resource = &GenericResource_DiscreteResourceSpec{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Resources) Unmarshal(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 ErrIntOverflowTypes - } - 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: Resources: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Resources: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NanoCPUs", wireType) - } - m.NanoCPUs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NanoCPUs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemoryBytes", wireType) - } - m.MemoryBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MemoryBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Generic", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Generic = append(m.Generic, &GenericResource{}) - if err := m.Generic[len(m.Generic)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResourceRequirements) Unmarshal(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 ErrIntOverflowTypes - } - 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: ResourceRequirements: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceRequirements: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Limits", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Limits == nil { - m.Limits = &Resources{} - } - if err := m.Limits.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reservations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Reservations == nil { - m.Reservations = &Resources{} - } - if err := m.Reservations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SwapBytes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SwapBytes == nil { - m.SwapBytes = &types.Int64Value{} - } - if err := m.SwapBytes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MemorySwappiness", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MemorySwappiness == nil { - m.MemorySwappiness = &types.Int64Value{} - } - if err := m.MemorySwappiness.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Platform) Unmarshal(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 ErrIntOverflowTypes - } - 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: Platform: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Platform: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Architecture", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Architecture = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OS", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OS = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PluginDescription) Unmarshal(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 ErrIntOverflowTypes - } - 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: PluginDescription: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PluginDescription: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EngineDescription) Unmarshal(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 ErrIntOverflowTypes - } - 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: EngineDescription: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EngineDescription: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EngineVersion", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EngineVersion = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthTypes - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Labels[mapkey] = mapvalue - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Plugins", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Plugins = append(m.Plugins, PluginDescription{}) - if err := m.Plugins[len(m.Plugins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NodeDescription) Unmarshal(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 ErrIntOverflowTypes - } - 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: NodeDescription: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodeDescription: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hostname = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Platform", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Platform == nil { - m.Platform = &Platform{} - } - if err := m.Platform.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Resources == nil { - m.Resources = &Resources{} - } - if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Engine", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Engine == nil { - m.Engine = &EngineDescription{} - } - if err := m.Engine.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TLSInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TLSInfo == nil { - m.TLSInfo = &NodeTLSInfo{} - } - if err := m.TLSInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FIPS", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.FIPS = bool(v != 0) - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CSIInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CSIInfo = append(m.CSIInfo, &NodeCSIInfo{}) - if err := m.CSIInfo[len(m.CSIInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NodeTLSInfo) Unmarshal(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 ErrIntOverflowTypes - } - 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: NodeTLSInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodeTLSInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TrustRoot", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TrustRoot = append(m.TrustRoot[:0], dAtA[iNdEx:postIndex]...) - if m.TrustRoot == nil { - m.TrustRoot = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CertIssuerSubject", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CertIssuerSubject = append(m.CertIssuerSubject[:0], dAtA[iNdEx:postIndex]...) - if m.CertIssuerSubject == nil { - m.CertIssuerSubject = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CertIssuerPublicKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CertIssuerPublicKey = append(m.CertIssuerPublicKey[:0], dAtA[iNdEx:postIndex]...) - if m.CertIssuerPublicKey == nil { - m.CertIssuerPublicKey = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NodeCSIInfo) Unmarshal(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 ErrIntOverflowTypes - } - 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: NodeCSIInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodeCSIInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PluginName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PluginName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NodeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxVolumesPerNode", wireType) - } - m.MaxVolumesPerNode = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxVolumesPerNode |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AccessibleTopology", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AccessibleTopology == nil { - m.AccessibleTopology = &Topology{} - } - if err := m.AccessibleTopology.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RaftMemberStatus) Unmarshal(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 ErrIntOverflowTypes - } - 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: RaftMemberStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RaftMemberStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Leader = bool(v != 0) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Reachability", wireType) - } - m.Reachability = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Reachability |= RaftMemberStatus_Reachability(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NodeStatus) Unmarshal(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 ErrIntOverflowTypes - } - 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: NodeStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodeStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - m.State = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.State |= NodeStatus_State(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Addr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Image) Unmarshal(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 ErrIntOverflowTypes - } - 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: Image: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Image: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reference", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Reference = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Mount) Unmarshal(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 ErrIntOverflowTypes - } - 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: Mount: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Mount: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= Mount_MountType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Source = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Target = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ReadOnly", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ReadOnly = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BindOptions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BindOptions == nil { - m.BindOptions = &Mount_BindOptions{} - } - if err := m.BindOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeOptions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VolumeOptions == nil { - m.VolumeOptions = &Mount_VolumeOptions{} - } - if err := m.VolumeOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TmpfsOptions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TmpfsOptions == nil { - m.TmpfsOptions = &Mount_TmpfsOptions{} - } - if err := m.TmpfsOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Consistency", wireType) - } - m.Consistency = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Consistency |= Mount_MountConsistency(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Mount_BindOptions) Unmarshal(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 ErrIntOverflowTypes - } - 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: BindOptions: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BindOptions: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Propagation", wireType) - } - m.Propagation = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Propagation |= Mount_BindOptions_MountPropagation(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NonRecursive", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.NonRecursive = bool(v != 0) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreateMountpoint", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.CreateMountpoint = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ReadOnlyNonRecursive", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ReadOnlyNonRecursive = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ReadOnlyForceRecursive", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ReadOnlyForceRecursive = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Mount_VolumeOptions) Unmarshal(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 ErrIntOverflowTypes - } - 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: VolumeOptions: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VolumeOptions: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NoCopy", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.NoCopy = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthTypes - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Labels[mapkey] = mapvalue - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DriverConfig", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DriverConfig == nil { - m.DriverConfig = &Driver{} - } - if err := m.DriverConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subpath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subpath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Mount_TmpfsOptions) Unmarshal(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 ErrIntOverflowTypes - } - 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: TmpfsOptions: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TmpfsOptions: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SizeBytes", wireType) - } - m.SizeBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SizeBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) - } - m.Mode = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Mode |= os.FileMode(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Options = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RestartPolicy) Unmarshal(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 ErrIntOverflowTypes - } - 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: RestartPolicy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RestartPolicy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Condition", wireType) - } - m.Condition = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Condition |= RestartPolicy_RestartCondition(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Delay", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Delay == nil { - m.Delay = &types.Duration{} - } - if err := m.Delay.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxAttempts", wireType) - } - m.MaxAttempts = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxAttempts |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Window", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Window == nil { - m.Window = &types.Duration{} - } - if err := m.Window.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateConfig) Unmarshal(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 ErrIntOverflowTypes - } - 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: UpdateConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Parallelism", wireType) - } - m.Parallelism = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Parallelism |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Delay", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Delay, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FailureAction", wireType) - } - m.FailureAction = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FailureAction |= UpdateConfig_FailureAction(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Monitor", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Monitor == nil { - m.Monitor = &types.Duration{} - } - if err := m.Monitor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxFailureRatio", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.MaxFailureRatio = float32(math.Float32frombits(v)) - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) - } - m.Order = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Order |= UpdateConfig_UpdateOrder(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateStatus) Unmarshal(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 ErrIntOverflowTypes - } - 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: UpdateStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - m.State = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.State |= UpdateStatus_UpdateState(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.StartedAt == nil { - m.StartedAt = &types.Timestamp{} - } - if err := m.StartedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CompletedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CompletedAt == nil { - m.CompletedAt = &types.Timestamp{} - } - if err := m.CompletedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ContainerStatus) Unmarshal(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 ErrIntOverflowTypes - } - 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: ContainerStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ContainerStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContainerID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PID", wireType) - } - m.PID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PID |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExitCode", wireType) - } - m.ExitCode = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ExitCode |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PortStatus) Unmarshal(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 ErrIntOverflowTypes - } - 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: PortStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PortStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Ports = append(m.Ports, &PortConfig{}) - if err := m.Ports[len(m.Ports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TaskStatus) Unmarshal(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 ErrIntOverflowTypes - } - 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: TaskStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TaskStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Timestamp == nil { - m.Timestamp = &types.Timestamp{} - } - if err := m.Timestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - m.State = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.State |= TaskState(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Err", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Err = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ContainerStatus{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.RuntimeStatus = &TaskStatus_Container{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PortStatus", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PortStatus == nil { - m.PortStatus = &PortStatus{} - } - if err := m.PortStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppliedBy", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppliedBy = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppliedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AppliedAt == nil { - m.AppliedAt = &types.Timestamp{} - } - if err := m.AppliedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NetworkAttachmentConfig) Unmarshal(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 ErrIntOverflowTypes - } - 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: NetworkAttachmentConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NetworkAttachmentConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Target = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Aliases = append(m.Aliases, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DriverAttachmentOpts", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DriverAttachmentOpts == nil { - m.DriverAttachmentOpts = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthTypes - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.DriverAttachmentOpts[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IPAMConfig) Unmarshal(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 ErrIntOverflowTypes - } - 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: IPAMConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IPAMConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Family", wireType) - } - m.Family = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Family |= IPAMConfig_AddressFamily(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subnet", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subnet = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Range = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Gateway", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Gateway = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reserved", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Reserved == nil { - m.Reserved = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthTypes - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Reserved[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PortConfig) Unmarshal(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 ErrIntOverflowTypes - } - 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: PortConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PortConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) - } - m.Protocol = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Protocol |= PortConfig_Protocol(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TargetPort", wireType) - } - m.TargetPort = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TargetPort |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PublishedPort", wireType) - } - m.PublishedPort = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PublishedPort |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PublishMode", wireType) - } - m.PublishMode = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PublishMode |= PortConfig_PublishMode(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Driver) Unmarshal(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 ErrIntOverflowTypes - } - 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: Driver: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Driver: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Options == nil { - m.Options = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthTypes - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Options[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IPAMOptions) Unmarshal(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 ErrIntOverflowTypes - } - 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: IPAMOptions: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IPAMOptions: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Driver == nil { - m.Driver = &Driver{} - } - if err := m.Driver.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Configs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Configs = append(m.Configs, &IPAMConfig{}) - if err := m.Configs[len(m.Configs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Peer) Unmarshal(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 ErrIntOverflowTypes - } - 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: Peer: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Peer: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NodeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Addr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WeightedPeer) Unmarshal(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 ErrIntOverflowTypes - } - 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: WeightedPeer: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WeightedPeer: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Peer", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Peer == nil { - m.Peer = &Peer{} - } - if err := m.Peer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) - } - m.Weight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Weight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IssuanceStatus) Unmarshal(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 ErrIntOverflowTypes - } - 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: IssuanceStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IssuanceStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - m.State = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.State |= IssuanceStatus_State(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Err", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Err = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AcceptancePolicy) Unmarshal(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 ErrIntOverflowTypes - } - 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: AcceptancePolicy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AcceptancePolicy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Policies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Policies = append(m.Policies, &AcceptancePolicy_RoleAdmissionPolicy{}) - if err := m.Policies[len(m.Policies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AcceptancePolicy_RoleAdmissionPolicy) Unmarshal(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 ErrIntOverflowTypes - } - 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: RoleAdmissionPolicy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RoleAdmissionPolicy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - m.Role = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Role |= NodeRole(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Autoaccept", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Autoaccept = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Secret == nil { - m.Secret = &AcceptancePolicy_RoleAdmissionPolicy_Secret{} - } - if err := m.Secret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) Unmarshal(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 ErrIntOverflowTypes - } - 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: Secret: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Secret: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Alg", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Alg = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ExternalCA) Unmarshal(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 ErrIntOverflowTypes - } - 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: ExternalCA: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ExternalCA: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) - } - m.Protocol = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Protocol |= ExternalCA_CAProtocol(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.URL = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Options == nil { - m.Options = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthTypes - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Options[mapkey] = mapvalue - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CACert", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CACert = append(m.CACert[:0], dAtA[iNdEx:postIndex]...) - if m.CACert == nil { - m.CACert = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CAConfig) Unmarshal(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 ErrIntOverflowTypes - } - 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: CAConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CAConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeCertExpiry", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.NodeCertExpiry == nil { - m.NodeCertExpiry = &types.Duration{} - } - if err := m.NodeCertExpiry.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExternalCAs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExternalCAs = append(m.ExternalCAs, &ExternalCA{}) - if err := m.ExternalCAs[len(m.ExternalCAs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SigningCACert", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SigningCACert = append(m.SigningCACert[:0], dAtA[iNdEx:postIndex]...) - if m.SigningCACert == nil { - m.SigningCACert = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SigningCAKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SigningCAKey = append(m.SigningCAKey[:0], dAtA[iNdEx:postIndex]...) - if m.SigningCAKey == nil { - m.SigningCAKey = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ForceRotate", wireType) - } - m.ForceRotate = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ForceRotate |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *OrchestrationConfig) Unmarshal(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 ErrIntOverflowTypes - } - 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: OrchestrationConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: OrchestrationConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskHistoryRetentionLimit", wireType) - } - m.TaskHistoryRetentionLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TaskHistoryRetentionLimit |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TaskDefaults) Unmarshal(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 ErrIntOverflowTypes - } - 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: TaskDefaults: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TaskDefaults: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogDriver", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LogDriver == nil { - m.LogDriver = &Driver{} - } - if err := m.LogDriver.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DispatcherConfig) Unmarshal(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 ErrIntOverflowTypes - } - 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: DispatcherConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DispatcherConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HeartbeatPeriod", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.HeartbeatPeriod == nil { - m.HeartbeatPeriod = &types.Duration{} - } - if err := m.HeartbeatPeriod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RaftConfig) Unmarshal(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 ErrIntOverflowTypes - } - 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: RaftConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RaftConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SnapshotInterval", wireType) - } - m.SnapshotInterval = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SnapshotInterval |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field KeepOldSnapshots", wireType) - } - m.KeepOldSnapshots = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.KeepOldSnapshots |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LogEntriesForSlowFollowers", wireType) - } - m.LogEntriesForSlowFollowers = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LogEntriesForSlowFollowers |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HeartbeatTick", wireType) - } - m.HeartbeatTick = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HeartbeatTick |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ElectionTick", wireType) - } - m.ElectionTick = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ElectionTick |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EncryptionConfig) Unmarshal(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 ErrIntOverflowTypes - } - 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: EncryptionConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EncryptionConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AutoLockManagers", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AutoLockManagers = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SpreadOver) Unmarshal(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 ErrIntOverflowTypes - } - 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: SpreadOver: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SpreadOver: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpreadDescriptor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SpreadDescriptor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PlacementPreference) Unmarshal(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 ErrIntOverflowTypes - } - 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: PlacementPreference: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PlacementPreference: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spread", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SpreadOver{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Preference = &PlacementPreference_Spread{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Placement) Unmarshal(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 ErrIntOverflowTypes - } - 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: Placement: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Placement: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Constraints", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Constraints = append(m.Constraints, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Preferences", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Preferences = append(m.Preferences, &PlacementPreference{}) - if err := m.Preferences[len(m.Preferences)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Platforms", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Platforms = append(m.Platforms, &Platform{}) - if err := m.Platforms[len(m.Platforms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxReplicas", wireType) - } - m.MaxReplicas = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxReplicas |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JoinTokens) Unmarshal(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 ErrIntOverflowTypes - } - 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: JoinTokens: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JoinTokens: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Worker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Worker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Manager", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Manager = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RootCA) Unmarshal(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 ErrIntOverflowTypes - } - 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: RootCA: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RootCA: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CAKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CAKey = append(m.CAKey[:0], dAtA[iNdEx:postIndex]...) - if m.CAKey == nil { - m.CAKey = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CACert", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CACert = append(m.CACert[:0], dAtA[iNdEx:postIndex]...) - if m.CACert == nil { - m.CACert = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CACertHash", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CACertHash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field JoinTokens", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.JoinTokens.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RootRotation", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.RootRotation == nil { - m.RootRotation = &RootRotation{} - } - if err := m.RootRotation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastForcedRotation", wireType) - } - m.LastForcedRotation = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastForcedRotation |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Certificate) Unmarshal(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 ErrIntOverflowTypes - } - 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: Certificate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Certificate: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - m.Role = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Role |= NodeRole(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CSR", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CSR = append(m.CSR[:0], dAtA[iNdEx:postIndex]...) - if m.CSR == nil { - m.CSR = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Certificate", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Certificate = append(m.Certificate[:0], dAtA[iNdEx:postIndex]...) - if m.Certificate == nil { - m.Certificate = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CN", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CN = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EncryptionKey) Unmarshal(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 ErrIntOverflowTypes - } - 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: EncryptionKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EncryptionKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subsystem", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subsystem = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Algorithm", wireType) - } - m.Algorithm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Algorithm |= EncryptionKey_Algorithm(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LamportTime", wireType) - } - m.LamportTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LamportTime |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ManagerStatus) Unmarshal(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 ErrIntOverflowTypes - } - 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: ManagerStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ManagerStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftID", wireType) - } - m.RaftID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RaftID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Addr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Leader = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Reachability", wireType) - } - m.Reachability = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Reachability |= RaftMemberStatus_Reachability(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FileTarget) Unmarshal(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 ErrIntOverflowTypes - } - 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: FileTarget: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FileTarget: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.UID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) - } - m.Mode = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Mode |= os.FileMode(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RuntimeTarget) Unmarshal(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 ErrIntOverflowTypes - } - 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: RuntimeTarget: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RuntimeTarget: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SecretReference) Unmarshal(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 ErrIntOverflowTypes - } - 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: SecretReference: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SecretReference: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SecretID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SecretID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SecretName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SecretName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field File", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &FileTarget{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Target = &SecretReference_File{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConfigReference) Unmarshal(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 ErrIntOverflowTypes - } - 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: ConfigReference: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConfigReference: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConfigID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConfigID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConfigName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConfigName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field File", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &FileTarget{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Target = &ConfigReference_File{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Runtime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RuntimeTarget{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Target = &ConfigReference_Runtime{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BlacklistedCertificate) Unmarshal(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 ErrIntOverflowTypes - } - 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: BlacklistedCertificate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlacklistedCertificate: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Expiry", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Expiry == nil { - m.Expiry = &types.Timestamp{} - } - if err := m.Expiry.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HealthConfig) Unmarshal(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 ErrIntOverflowTypes - } - 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: HealthConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HealthConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Test", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Test = append(m.Test, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Interval == nil { - m.Interval = &types.Duration{} - } - if err := m.Interval.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Timeout == nil { - m.Timeout = &types.Duration{} - } - if err := m.Timeout.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Retries", wireType) - } - m.Retries = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Retries |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartPeriod", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.StartPeriod == nil { - m.StartPeriod = &types.Duration{} - } - if err := m.StartPeriod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartInterval", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.StartInterval == nil { - m.StartInterval = &types.Duration{} - } - if err := m.StartInterval.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MaybeEncryptedRecord) Unmarshal(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 ErrIntOverflowTypes - } - 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: MaybeEncryptedRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MaybeEncryptedRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Algorithm", wireType) - } - m.Algorithm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Algorithm |= MaybeEncryptedRecord_Algorithm(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Nonce = append(m.Nonce[:0], dAtA[iNdEx:postIndex]...) - if m.Nonce == nil { - m.Nonce = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RootRotation) Unmarshal(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 ErrIntOverflowTypes - } - 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: RootRotation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RootRotation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CACert", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CACert = append(m.CACert[:0], dAtA[iNdEx:postIndex]...) - if m.CACert == nil { - m.CACert = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CAKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CAKey = append(m.CAKey[:0], dAtA[iNdEx:postIndex]...) - if m.CAKey == nil { - m.CAKey = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CrossSignedCACert", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CrossSignedCACert = append(m.CrossSignedCACert[:0], dAtA[iNdEx:postIndex]...) - if m.CrossSignedCACert == nil { - m.CrossSignedCACert = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Privileges) Unmarshal(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 ErrIntOverflowTypes - } - 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: Privileges: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Privileges: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CredentialSpec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CredentialSpec == nil { - m.CredentialSpec = &Privileges_CredentialSpec{} - } - if err := m.CredentialSpec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SELinuxContext", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SELinuxContext == nil { - m.SELinuxContext = &Privileges_SELinuxContext{} - } - if err := m.SELinuxContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Seccomp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Seccomp == nil { - m.Seccomp = &Privileges_SeccompOpts{} - } - if err := m.Seccomp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Apparmor", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Apparmor == nil { - m.Apparmor = &Privileges_AppArmorOpts{} - } - if err := m.Apparmor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NoNewPrivileges", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.NoNewPrivileges = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Privileges_CredentialSpec) Unmarshal(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 ErrIntOverflowTypes - } - 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: CredentialSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CredentialSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field File", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Source = &Privileges_CredentialSpec_File{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Registry", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Source = &Privileges_CredentialSpec_Registry{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Source = &Privileges_CredentialSpec_Config{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Privileges_SELinuxContext) Unmarshal(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 ErrIntOverflowTypes - } - 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: SELinuxContext: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SELinuxContext: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Disable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Disable = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.User = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Role = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Level", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Level = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Privileges_SeccompOpts) Unmarshal(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 ErrIntOverflowTypes - } - 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: SeccompOpts: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SeccompOpts: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) - } - m.Mode = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Mode |= Privileges_SeccompOpts_SeccompMode(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Profile", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Profile = append(m.Profile[:0], dAtA[iNdEx:postIndex]...) - if m.Profile == nil { - m.Profile = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Privileges_AppArmorOpts) Unmarshal(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 ErrIntOverflowTypes - } - 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: AppArmorOpts: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AppArmorOpts: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) - } - m.Mode = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Mode |= Privileges_AppArmorOpts_AppArmorMode(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JobStatus) Unmarshal(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 ErrIntOverflowTypes - } - 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: JobStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JobStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field JobIteration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.JobIteration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastExecution", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LastExecution == nil { - m.LastExecution = &types.Timestamp{} - } - if err := m.LastExecution.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumeAccessMode) Unmarshal(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 ErrIntOverflowTypes - } - 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: VolumeAccessMode: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VolumeAccessMode: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) - } - m.Scope = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Scope |= VolumeAccessMode_Scope(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Sharing", wireType) - } - m.Sharing = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Sharing |= VolumeAccessMode_Sharing(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &VolumeAccessMode_BlockVolume{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.AccessType = &VolumeAccessMode_Block{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &VolumeAccessMode_MountVolume{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.AccessType = &VolumeAccessMode_Mount{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumeAccessMode_BlockVolume) Unmarshal(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 ErrIntOverflowTypes - } - 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: BlockVolume: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockVolume: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumeAccessMode_MountVolume) Unmarshal(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 ErrIntOverflowTypes - } - 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: MountVolume: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MountVolume: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FsType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FsType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MountFlags", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MountFlags = append(m.MountFlags, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumeSecret) Unmarshal(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 ErrIntOverflowTypes - } - 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: VolumeSecret: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VolumeSecret: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Secret = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumePublishStatus) Unmarshal(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 ErrIntOverflowTypes - } - 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: VolumePublishStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VolumePublishStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NodeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - m.State = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.State |= VolumePublishStatus_State(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublishContext", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PublishContext == nil { - m.PublishContext = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthTypes - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.PublishContext[mapkey] = mapvalue - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumeInfo) Unmarshal(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 ErrIntOverflowTypes - } - 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: VolumeInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VolumeInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CapacityBytes", wireType) - } - m.CapacityBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CapacityBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeContext", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VolumeContext == nil { - m.VolumeContext = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthTypes - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.VolumeContext[mapkey] = mapvalue - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VolumeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AccessibleTopology", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AccessibleTopology = append(m.AccessibleTopology, &Topology{}) - if err := m.AccessibleTopology[len(m.AccessibleTopology)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CapacityRange) Unmarshal(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 ErrIntOverflowTypes - } - 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: CapacityRange: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CapacityRange: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RequiredBytes", wireType) - } - m.RequiredBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RequiredBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LimitBytes", wireType) - } - m.LimitBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LimitBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumeAssignment) Unmarshal(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 ErrIntOverflowTypes - } - 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: VolumeAssignment: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VolumeAssignment: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VolumeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Driver == nil { - m.Driver = &Driver{} - } - if err := m.Driver.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeContext", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VolumeContext == nil { - m.VolumeContext = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthTypes - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.VolumeContext[mapkey] = mapvalue - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublishContext", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PublishContext == nil { - m.PublishContext = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthTypes - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.PublishContext[mapkey] = mapvalue - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AccessMode", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AccessMode == nil { - m.AccessMode = &VolumeAccessMode{} - } - if err := m.AccessMode.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secrets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Secrets = append(m.Secrets, &VolumeSecret{}) - if err := m.Secrets[len(m.Secrets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumeAttachment) Unmarshal(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 ErrIntOverflowTypes - } - 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: VolumeAttachment: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VolumeAttachment: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Source = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Target = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TopologyRequirement) Unmarshal(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 ErrIntOverflowTypes - } - 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: TopologyRequirement: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TopologyRequirement: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Requisite", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Requisite = append(m.Requisite, &Topology{}) - if err := m.Requisite[len(m.Requisite)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Preferred", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Preferred = append(m.Preferred, &Topology{}) - if err := m.Preferred[len(m.Preferred)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Topology) Unmarshal(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 ErrIntOverflowTypes - } - 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: Topology: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Topology: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Segments", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Segments == nil { - m.Segments = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthTypes - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthTypes - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Segments[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumeCapability) Unmarshal(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 ErrIntOverflowTypes - } - 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: VolumeCapability: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VolumeCapability: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &VolumeCapability_BlockVolume{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.AccessType = &VolumeCapability_Block{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &VolumeCapability_MountVolume{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.AccessType = &VolumeCapability_Mount{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AccessMode", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AccessMode == nil { - m.AccessMode = &VolumeCapability_AccessMode{} - } - if err := m.AccessMode.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumeCapability_BlockVolume) Unmarshal(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 ErrIntOverflowTypes - } - 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: BlockVolume: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockVolume: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumeCapability_MountVolume) Unmarshal(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 ErrIntOverflowTypes - } - 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: MountVolume: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MountVolume: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FsType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FsType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MountFlags", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MountFlags = append(m.MountFlags, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumeCapability_AccessMode) Unmarshal(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 ErrIntOverflowTypes - } - 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: AccessMode: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AccessMode: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) - } - m.Mode = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Mode |= VolumeCapability_AccessMode_Mode(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/moby/swarmkit/v2/api/types.proto b/vendor/github.com/moby/swarmkit/v2/api/types.proto deleted file mode 100644 index 74f5c7135f..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/types.proto +++ /dev/null @@ -1,1691 +0,0 @@ -syntax = "proto3"; - -package docker.swarmkit.v1; - -import "google/protobuf/timestamp.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/wrappers.proto"; -import "gogoproto/gogo.proto"; - -// This file contains types that are common to objects and spec or that are not -// considered first-class within the cluster object-model. - -// Version tracks the last time an object in the store was updated. -message Version { - uint64 index = 1; -} - -message IndexEntry { - string key = 1; - string val = 2; -} - -// Annotations provide useful information to identify API objects. They are -// common to all API specs. -message Annotations { - string name = 1; - map labels = 2; - - // Indices provides keys and values for indexing this object. - // A single key may have multiple values. - repeated IndexEntry indices = 4 [(gogoproto.nullable) = false]; -} - -// NamedGenericResource represents a "user defined" resource which is defined -// as a string. -// "Kind" is used to describe the Kind of a resource (e.g: "GPU", "FPGA", "SSD", ...) -// Value is used to identify the resource (GPU="UUID-1", FPGA="/dev/sdb5", ...) -message NamedGenericResource { - string kind = 1; - string value = 2; -} - -// DiscreteGenericResource represents a "user defined" resource which is defined -// as an integer -// "Kind" is used to describe the Kind of a resource (e.g: "GPU", "FPGA", "SSD", ...) -// Value is used to count the resource (SSD=5, HDD=3, ...) -message DiscreteGenericResource { - string kind = 1; - int64 value = 2; -} - -// GenericResource represents a "user defined" resource which can -// be either an integer (e.g: SSD=3) or a string (e.g: SSD=sda1) -message GenericResource { - oneof resource { - NamedGenericResource named_resource_spec = 1; - DiscreteGenericResource discrete_resource_spec = 2; - } -} - -enum ResourceType { - TASK = 0; - SECRET = 1; - CONFIG = 2; - VOLUME = 3; -} - -message Resources { - // Amount of CPUs (e.g. 2000000000 = 2 CPU cores) - int64 nano_cpus = 1 [(gogoproto.customname) = "NanoCPUs"]; - - // Amount of memory in bytes. - int64 memory_bytes = 2; - - // User specified resource (e.g: bananas=2;apple={red,yellow,green}) - repeated GenericResource generic = 3; -} - -message ResourceRequirements { - Resources limits = 1; - Resources reservations = 2; - - // Amount of swap in bytes - can only be used together with a memory limit - // -1 means unlimited - // a null pointer indicates that the default behaviour of granting twice - // the memory is maintained - google.protobuf.Int64Value swap_bytes = 3; - - // Tune container memory swappiness (0 to 100) - if not specified, defaults - // to the container OS's default - generally 60, or the value predefined in - // the image; set to -1 to unset a previously set value - google.protobuf.Int64Value memory_swappiness = 4; - - -} - -message Platform { - // Architecture (e.g. x86_64) - string architecture = 1; - - // Operating System (e.g. linux) - string os = 2 [(gogoproto.customname) = "OS"]; -} - -// PluginDescription describes an engine plugin. -message PluginDescription { - // Type of plugin. Canonical values for existing types are - // Volume, Network, and Authorization. More types could be - // supported in the future. - string type = 1; - - // Name of the plugin - string name = 2; -} - -message EngineDescription { - // Docker daemon version running on the node. - string engine_version = 1; - - // Labels attached to the engine. - map labels = 2; - - // Volume, Network, and Auth plugins - repeated PluginDescription plugins = 3 [(gogoproto.nullable) = false]; -} - -message NodeDescription { - // Hostname of the node as reported by the agent. - // This is different from spec.meta.name which is user-defined. - string hostname = 1; - - // Platform of the node. - Platform platform = 2; - - // Total resources on the node. - Resources resources = 3; - - // Information about the Docker Engine on the node. - EngineDescription engine = 4; - - // Information on the node's TLS setup - NodeTLSInfo tls_info = 5 [(gogoproto.customname) = "TLSInfo"]; - - // FIPS indicates whether the node has FIPS-enabled - bool fips = 6 [(gogoproto.customname) = "FIPS"]; - - repeated NodeCSIInfo csi_info = 7 [(gogoproto.customname) = "CSIInfo"]; -} - -message NodeTLSInfo { - // Information about which root certs the node trusts - bytes trust_root = 1; - - // Information about the node's current TLS certificate - bytes cert_issuer_subject = 2; - bytes cert_issuer_public_key = 3; -} - -// NodeCSIInfo represents information about a Node returned by calling the -// NodeGetInfo RPC on the CSI plugin present on the node. There is a separate -// NodeCSIInfo object for each CSI plugin present. -message NodeCSIInfo { - - // PluginName is the name of the CSI plugin. - string plugin_name = 1; - - // NodeID is the ID of the node as reported by the CSI plugin. This will be - // different from the swarmkit node ID. - string node_id = 2; - - // MaxVolumesPerNode is the maximum number of volumes that may be published - // to this node. - int64 max_volumes_per_node = 3; - - // AccessibleTopology indicates the location of this node in the CSI plugin's - // topology - Topology accessible_topology = 4; -} - -message RaftMemberStatus { - bool leader = 1; - - enum Reachability { - // Unknown indicates that the manager state cannot be resolved - UNKNOWN = 0; - - // Unreachable indicates that the node cannot be contacted by other - // raft cluster members. - UNREACHABLE = 1; - - // Reachable indicates that the node is healthy and reachable - // by other members. - REACHABLE = 2; - } - - Reachability reachability = 2; - string message = 3; -} - -message NodeStatus { - // TODO(aluzzardi) These should be using `gogoproto.enumvalue_customname`. - enum State { - // Unknown indicates the node state cannot be resolved. - UNKNOWN = 0; - - // Down indicates the node is down. - DOWN = 1; - - // Ready indicates the node is ready to accept tasks. - READY = 2; - - // Disconnected indicates the node is currently trying to find new manager. - DISCONNECTED = 3; - } - - State state = 1; - string message = 2; - // Addr is the node's IP address as observed by the manager - string addr = 3; -} - -message Image { - // reference is a docker image reference. This can include a rpository, tag - // or be fully qualified witha digest. The format is specified in the - // distribution/reference package. - string reference = 1; -} - -// Mount describes volume mounts for a container. -// -// The Mount type follows the structure of the mount syscall, including a type, -// source, target. Top-level flags, such as writable, are common to all kinds -// of mounts, where we also provide options that are specific to a type of -// mount. This corresponds to flags and data, respectively, in the syscall. -message Mount { - enum Type { - option (gogoproto.goproto_enum_prefix) = false; - option (gogoproto.enum_customname) = "MountType"; - - BIND = 0 [(gogoproto.enumvalue_customname) = "MountTypeBind"]; // Bind mount host dir - VOLUME = 1 [(gogoproto.enumvalue_customname) = "MountTypeVolume"]; // Remote storage volumes - TMPFS = 2 [(gogoproto.enumvalue_customname) = "MountTypeTmpfs"]; // Mount a tmpfs - NPIPE = 3 [(gogoproto.enumvalue_customname) = "MountTypeNamedPipe"]; // Windows named pipes - CLUSTER = 4 [(gogoproto.enumvalue_customname) = "MountTypeCluster"]; // CSI volume - } - - // Type defines the nature of the mount. - Type type = 1; - - // Source specifies the name of the mount. Depending on mount type, this - // may be a volume name or a host path, or even ignored. - // - // For CSI type mounts, the source is either the name of the volume or the - // name of the volume group. To specify a volume group, the source should be - // prefixed with "group:", as in "group:groupname" - string source = 2; - - // Target path in container - string target = 3; - - // ReadOnly should be set to true if the mount should not be writable. - bool readonly = 4 [(gogoproto.customname) = "ReadOnly"]; - - // Consistency indicates the tolerable level of file system consistency - enum Consistency { - option (gogoproto.goproto_enum_prefix) = false; - option (gogoproto.enum_customname) = "MountConsistency"; - - DEFAULT = 0 [(gogoproto.enumvalue_customname) = "MountConsistencyDefault"]; - CONSISTENT = 1 [(gogoproto.enumvalue_customname) = "MountConsistencyFull"]; - CACHED = 2 [(gogoproto.enumvalue_customname) = "MountConsistencyCached"]; - DELEGATED = 3 [(gogoproto.enumvalue_customname) = "MountConsistencyDelegated"]; - } - Consistency consistency = 8; - - // BindOptions specifies options that are specific to a bind mount. - message BindOptions { - enum Propagation { - option (gogoproto.goproto_enum_prefix) = false; - option (gogoproto.enum_customname) = "MountPropagation"; - - RPRIVATE = 0 [(gogoproto.enumvalue_customname) = "MountPropagationRPrivate"]; - PRIVATE = 1 [(gogoproto.enumvalue_customname) = "MountPropagationPrivate"]; - RSHARED = 2 [(gogoproto.enumvalue_customname) = "MountPropagationRShared"]; - SHARED = 3 [(gogoproto.enumvalue_customname) = "MountPropagationShared"]; - RSLAVE = 4 [(gogoproto.enumvalue_customname) = "MountPropagationRSlave"]; - SLAVE = 5 [(gogoproto.enumvalue_customname) = "MountPropagationSlave"]; - } - - // Propagation mode of mount. - Propagation propagation = 1; - // allows non-recursive bind-mount, i.e. mount(2) with "bind" rather than "rbind". - bool nonrecursive = 2 [(gogoproto.customname) = "NonRecursive"]; - // Create the mount point - bool createmountpoint = 3 [(gogoproto.customname) = "CreateMountpoint"]; - // ReadOnlyNonRecursive makes the mount non-recursively read-only, but still leaves the mount recursive - // (unless NonRecursive is set to true in conjunction). - bool readonlynonrecursive = 4 [(gogoproto.customname) = "ReadOnlyNonRecursive"]; - // ReadOnlyForceRecursive raises an error if the mount cannot be made recursively read-only. - bool readonlyforcerecursive = 5 [(gogoproto.customname) = "ReadOnlyForceRecursive"]; - } - - // VolumeOptions contains parameters for mounting the volume. - message VolumeOptions { - // nocopy prevents automatic copying of data to the volume with data from target - bool nocopy = 1 [(gogoproto.customname) = "NoCopy"]; - - // labels to apply to the volume if creating - map labels = 2; - - // DriverConfig specifies the options that may be passed to the driver - // if the volume is created. - // - // If this is empty, no volume will be created if the volume is missing. - Driver driver_config = 3; - - // subpath inside the volume to mount. - string subpath = 4 [(gogoproto.customname) = "Subpath"]; - } - - message TmpfsOptions { - // Size sets the size of the tmpfs, in bytes. - // - // This will be converted to an operating system specific value - // depending on the host. For example, on linux, it will be convered to - // use a 'k', 'm' or 'g' syntax. BSD, though not widely supported with - // docker, uses a straight byte value. - // - // Percentages are not supported. - int64 size_bytes = 1; - - // Mode of the tmpfs upon creation - uint32 mode = 2 [(gogoproto.customtype) = "os.FileMode", (gogoproto.nullable) = false]; - - // Options passed to tmpfs mount - string options = 3; - // TODO(stevvooe): There are several more tmpfs flags, specified in the - // daemon, that are accepted. Only the most basic are added for now. - // - // From docker/docker/pkg/mount/flags.go: - // - // var validFlags = map[string]bool{ - // "": true, - // "size": true, X - // "mode": true, X - // "uid": true, - // "gid": true, - // "nr_inodes": true, - // "nr_blocks": true, - // "mpol": true, - // } - // - // Some of these may be straightforward to add, but others, such as - // uid/gid have implications in a clustered system. - } - - // Depending on type, one of bind_options or volumes_options will be set. - - // BindOptions configures properties of a bind mount type. - // - // For mounts of type bind, the source must be an absolute host path. - BindOptions bind_options = 5; - - // VolumeOptions configures the properties specific to a volume mount type. - // - // For mounts of type volume, the source will be used as the volume name. - VolumeOptions volume_options = 6; - - // TmpfsOptions allows one to set options for mounting a temporary - // filesystem. - // - // The source field will be ignored when using mounts of type tmpfs. - TmpfsOptions tmpfs_options = 7; - - // TODO(stevvooe): It be better to use a oneof field above, although the - // type is enough to make the decision, while being primary to the - // datastructure. -} - -message RestartPolicy { - enum RestartCondition { - option (gogoproto.goproto_enum_prefix) = false; - option (gogoproto.enum_customname) = "RestartCondition"; - NONE = 0 [(gogoproto.enumvalue_customname) = "RestartOnNone"]; - ON_FAILURE = 1 [(gogoproto.enumvalue_customname) = "RestartOnFailure"]; - ANY = 2 [(gogoproto.enumvalue_customname) = "RestartOnAny"]; - } - - RestartCondition condition = 1; - - // Delay between restart attempts - // Note: can't use stdduration because this field needs to be nullable. - google.protobuf.Duration delay = 2; - - // MaxAttempts is the maximum number of restarts to attempt on an - // instance before giving up. Ignored if 0. - uint64 max_attempts = 3; - - // Window is the time window used to evaluate the restart policy. - // The time window is unbounded if this is 0. - // Note: can't use stdduration because this field needs to be nullable. - google.protobuf.Duration window = 4; -} - -// UpdateConfig specifies the rate and policy of updates. -// TODO(aluzzardi): Consider making this a oneof with RollingStrategy and LockstepStrategy. -message UpdateConfig { - // Maximum number of tasks to be updated in one iteration. - // 0 means unlimited parallelism. - uint64 parallelism = 1; - - // Amount of time between updates. - google.protobuf.Duration delay = 2 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; - - enum FailureAction { - PAUSE = 0; - CONTINUE = 1; - ROLLBACK = 2; - } - - // FailureAction is the action to take when an update failures. - FailureAction failure_action = 3; - - // Monitor indicates how long to monitor a task for failure after it is - // created. If the task fails by ending up in one of the states - // REJECTED, COMPLETED, or FAILED, within Monitor from its creation, - // this counts as a failure. If it fails after Monitor, it does not - // count as a failure. If Monitor is unspecified, a default value will - // be used. - // Note: can't use stdduration because this field needs to be nullable. - google.protobuf.Duration monitor = 4; - - // MaxFailureRatio is the fraction of tasks that may fail during - // an update before the failure action is invoked. Any task created by - // the current update which ends up in one of the states REJECTED, - // COMPLETED or FAILED within Monitor from its creation counts as a - // failure. The number of failures is divided by the number of tasks - // being updated, and if this fraction is greater than - // MaxFailureRatio, the failure action is invoked. - // - // If the failure action is CONTINUE, there is no effect. - // If the failure action is PAUSE, no more tasks will be updated until - // another update is started. - // If the failure action is ROLLBACK, the orchestrator will attempt to - // roll back to the previous service spec. If the MaxFailureRatio - // threshold is hit during the rollback, the rollback will pause. - float max_failure_ratio = 5; - - // UpdateOrder controls the order of operations when rolling out an - // updated task. Either the old task is shut down before the new task - // is started, or the new task is started before the old task is shut - // down. - enum UpdateOrder { - STOP_FIRST = 0; - START_FIRST = 1; - } - - UpdateOrder order = 6; -} - -// UpdateStatus is the status of an update in progress. -message UpdateStatus { - enum UpdateState { - UNKNOWN = 0; - UPDATING = 1; - PAUSED = 2; - COMPLETED = 3; - ROLLBACK_STARTED = 4; - ROLLBACK_PAUSED = 5; // if a rollback fails - ROLLBACK_COMPLETED = 6; - } - - // State is the state of this update. It indicates whether the - // update is in progress, completed, paused, rolling back, or - // finished rolling back. - UpdateState state = 1; - - // StartedAt is the time at which the update was started. - // Note: can't use stdtime because this field is nullable. - google.protobuf.Timestamp started_at = 2; - - // CompletedAt is the time at which the update completed successfully, - // paused, or finished rolling back. - // Note: can't use stdtime because this field is nullable. - google.protobuf.Timestamp completed_at = 3; - - // TODO(aaronl): Consider adding a timestamp showing when the most - // recent task update took place. Currently, this is nontrivial - // because each service update kicks off a replacement update, so - // updating the service object with a timestamp at every step along - // the rolling update would cause the rolling update to be constantly - // restarted. - - // Message explains how the update got into its current state. For - // example, if the update is paused, it will explain what is preventing - // the update from proceeding (typically the failure of a task to start up - // when OnFailure is PAUSE). - string message = 4; -} - -// TaskState enumerates the states that a task progresses through within an -// agent. States are designed to be monotonically increasing, such that if two -// states are seen by a task, the greater of the new represents the true state. - -// Only the manager create a NEW task, and move the task to PENDING and ASSIGNED. -// Afterward, the manager must rely on the agent to update the task status -// (pre-run: preparing, ready, starting; -// running; -// end-state: complete, shutdown, failed, rejected) -enum TaskState { - // TODO(aluzzardi): Move it back into `TaskStatus` because of the naming - // collisions of enums. - - option (gogoproto.goproto_enum_prefix) = false; - option (gogoproto.enum_customname) = "TaskState"; - NEW = 0 [(gogoproto.enumvalue_customname)="TaskStateNew"]; - PENDING = 64 [(gogoproto.enumvalue_customname)="TaskStatePending"]; // waiting for scheduling decision - ASSIGNED = 192 [(gogoproto.enumvalue_customname)="TaskStateAssigned"]; - ACCEPTED = 256 [(gogoproto.enumvalue_customname)="TaskStateAccepted"]; // task has been accepted by an agent. - PREPARING = 320 [(gogoproto.enumvalue_customname)="TaskStatePreparing"]; - READY = 384 [(gogoproto.enumvalue_customname)="TaskStateReady"]; - STARTING = 448 [(gogoproto.enumvalue_customname)="TaskStateStarting"]; - RUNNING = 512 [(gogoproto.enumvalue_customname)="TaskStateRunning"]; - COMPLETE = 576 [(gogoproto.enumvalue_customname)="TaskStateCompleted"]; // successful completion of task (not error code, just ran) - SHUTDOWN = 640 [(gogoproto.enumvalue_customname)="TaskStateShutdown"]; // orchestrator requested shutdown - FAILED = 704 [(gogoproto.enumvalue_customname)="TaskStateFailed"]; // task execution failed with error - // TaskStateRejected means a task never ran, for instance if something about - // the environment failed (e.g. setting up a port on that node failed). - REJECTED = 768 [(gogoproto.enumvalue_customname)="TaskStateRejected"]; // task could not be executed here. - // TaskStateRemove is used to correctly handle service deletions and scale - // downs. This allows us to keep track of tasks that have been marked for - // deletion, but can't yet be removed because the agent is in the process of - // shutting them down. Once the agent has shut down tasks with desired state - // REMOVE, the task reaper is responsible for removing them. - REMOVE = 800 [(gogoproto.enumvalue_customname)="TaskStateRemove"]; - // TaskStateOrphaned is used to free up resources associated with service - // tasks on unresponsive nodes without having to delete those tasks. This - // state is directly assigned to the task by the orchestrator. - ORPHANED = 832 [(gogoproto.enumvalue_customname)="TaskStateOrphaned"]; - - // NOTE(stevvooe): The state of a task is actually a lamport clock, in that - // given two observations, the greater of the two can be considered - // correct. To enforce this, we only allow tasks to proceed to a greater - // state. - // - // A byproduct of this design decision is that we must also maintain this - // invariant in the protobuf enum values, such that when comparing two - // values, the one with the greater value is also the greater state. - // - // Because we may want to add intervening states a later date, we've left - // 64 spaces between each one. This should allow us to make 5 or 6 - // insertions between each state if we find that we made a mistake and need - // another state. - // - // Remove this message when the states are deemed perfect. -} - -// Container specific status. -message ContainerStatus { - string container_id = 1; - - int32 pid = 2 [(gogoproto.customname) = "PID"]; - int32 exit_code = 3; -} - -// PortStatus specifies the actual allocated runtime state of a list -// of port configs. -message PortStatus { - repeated PortConfig ports = 1; -} - -message TaskStatus { - // Note: can't use stdtime because this field is nullable. - google.protobuf.Timestamp timestamp = 1; - - // State expresses the current state of the task. - TaskState state = 2; - - // Message reports a message for the task status. This should provide a - // human readable message that can point to how the task actually arrived - // at a current state. - // - // As a convention, we place the a small message here that led to the - // current state. For example, if the task is in ready, because it was - // prepared, we'd place "prepared" in this field. If we skipped preparation - // because the task is prepared, we would put "already prepared" in this - // field. - string message = 3; - - // Err is set if the task is in an error state, or is unable to - // progress from an earlier state because a precondition is - // unsatisfied. - // - // The following states should report a companion error: - // - // FAILED, REJECTED - // - // In general, messages that should be surfaced to users belong in the - // Err field, and notes on routine state transitions belong in Message. - // - // TODO(stevvooe) Integrate this field with the error interface. - string err = 4; - - // Container status contains container specific status information. - oneof runtime_status { - ContainerStatus container = 5; - } - - // HostPorts provides a list of ports allocated at the host - // level. - PortStatus port_status = 6; - - // AppliedBy gives the node ID of the manager that applied this task - // status update to the Task object. - string applied_by = 7; - - // AppliedAt gives a timestamp of when this status update was applied to - // the Task object. - // Note: can't use stdtime because this field is nullable. - google.protobuf.Timestamp applied_at = 8; -} - -// NetworkAttachmentConfig specifies how a service should be attached to a particular network. -// -// For now, this is a simple struct, but this can include future information -// instructing Swarm on how this service should work on the particular -// network. -message NetworkAttachmentConfig { - // Target specifies the target network for attachment. This value must be a - // network ID. - string target = 1; - // Aliases specifies a list of discoverable alternate names for the service on this Target. - repeated string aliases = 2; - // Addresses specifies a list of ipv4 and ipv6 addresses - // preferred. If these addresses are not available then the - // attachment might fail. - repeated string addresses = 3; - // DriverAttachmentOpts is a map of driver attachment options for the network target - map driver_attachment_opts = 4; -} - -// IPAMConfig specifies parameters for IP Address Management. -message IPAMConfig { - // TODO(stevvooe): It may make more sense to manage IPAM and network - // definitions separately. This will allow multiple networks to share IPAM - // instances. For now, we will follow the conventions of libnetwork and - // specify this as part of the network specification. - - // AddressFamily specifies the network address family that - // this IPAMConfig belongs to. - enum AddressFamily { - UNKNOWN = 0; // satisfy proto3 - IPV4 = 4; - IPV6 = 6; - } - - AddressFamily family = 1; - - // Subnet defines a network as a CIDR address (ie network and mask - // 192.168.0.1/24). - string subnet = 2; - - // Range defines the portion of the subnet to allocate to tasks. This is - // defined as a subnet within the primary subnet. - string range = 3; - - // Gateway address within the subnet. - string gateway = 4; - - // Reserved is a list of address from the master pool that should *not* be - // allocated. These addresses may have already been allocated or may be - // reserved for another allocation manager. - map reserved = 5; -} - -// PortConfig specifies an exposed port which can be -// addressed using the given name. This can be later queried -// using a service discovery api or a DNS SRV query. The node -// port specifies a port that can be used to address this -// service external to the cluster by sending a connection -// request to this port to any node on the cluster. -message PortConfig { - enum Protocol { - option (gogoproto.goproto_enum_prefix) = false; - - TCP = 0 [(gogoproto.enumvalue_customname) = "ProtocolTCP"]; - UDP = 1 [(gogoproto.enumvalue_customname) = "ProtocolUDP"]; - SCTP = 2 [(gogoproto.enumvalue_customname) = "ProtocolSCTP"]; - } - - // PublishMode controls how ports are published on the swarm. - enum PublishMode { - option (gogoproto.enum_customname) = "PublishMode"; - option (gogoproto.goproto_enum_prefix) = false; - - // PublishModeIngress exposes the port across the cluster on all nodes. - INGRESS = 0 [(gogoproto.enumvalue_customname) = "PublishModeIngress"]; - - // PublishModeHost exposes the port on just the target host. If the - // published port is undefined, an ephemeral port will be allocated. If - // the published port is defined, the node will attempt to allocate it, - // erroring the task if it fails. - HOST = 1 [(gogoproto.enumvalue_customname) = "PublishModeHost"]; - } - - // Name for the port. If provided the port information can - // be queried using the name as in a DNS SRV query. - string name = 1; - - // Protocol for the port which is exposed. - Protocol protocol = 2; - - // The port which the application is exposing and is bound to. - uint32 target_port = 3; - - // PublishedPort specifies the port on which the service is exposed. If - // specified, the port must be within the available range. If not specified - // (value is zero), an available port is automatically assigned. - uint32 published_port = 4; - - // PublishMode controls how the port is published. - PublishMode publish_mode = 5; -} - -// Driver is a generic driver type to be used throughout the API. For now, a -// driver is simply a name and set of options. The field contents depend on the -// target use case and driver application. For example, a network driver may -// have different rules than a volume driver. -message Driver { - string name = 1; - map options = 2; -} - -message IPAMOptions { - Driver driver = 1; - repeated IPAMConfig configs = 3; -} - -// Peer should be used anywhere where we are describing a remote peer. -message Peer { - string node_id = 1; - string addr = 2; -} - -// WeightedPeer should be used anywhere where we are describing a remote peer -// with a weight. -message WeightedPeer { - Peer peer = 1; - int64 weight = 2; -} - - -message IssuanceStatus { - enum State { - option (gogoproto.goproto_enum_prefix) = false; - - UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "IssuanceStateUnknown"]; - // A new certificate should be issued - RENEW = 1 [(gogoproto.enumvalue_customname)="IssuanceStateRenew"]; - // Certificate is pending acceptance - PENDING = 2 [(gogoproto.enumvalue_customname)="IssuanceStatePending"]; - // successful completion certificate issuance - ISSUED = 3 [(gogoproto.enumvalue_customname)="IssuanceStateIssued"]; - // Certificate issuance failed - FAILED = 4 [(gogoproto.enumvalue_customname)="IssuanceStateFailed"]; - // Signals workers to renew their certificate. From the CA's perspective - // this is equivalent to IssuanceStateIssued: a noop. - ROTATE = 5 [(gogoproto.enumvalue_customname)="IssuanceStateRotate"]; - } - State state = 1; - - // Err is set if the Certificate Issuance is in an error state. - // The following states should report a companion error: - // FAILED - string err = 2; -} - -message AcceptancePolicy { - message RoleAdmissionPolicy { - message Secret { - // The actual content (possibly hashed) - bytes data = 1; - // The type of hash we are using, or "plaintext" - string alg = 2; - } - - NodeRole role = 1; - // Autoaccept controls which roles' certificates are automatically - // issued without administrator intervention. - bool autoaccept = 2; - // Secret represents a user-provided string that is necessary for new - // nodes to join the cluster - Secret secret = 3; - } - - repeated RoleAdmissionPolicy policies = 1; -} - -message ExternalCA { - enum CAProtocol { - CFSSL = 0 [(gogoproto.enumvalue_customname) = "CAProtocolCFSSL"]; - } - - // Protocol is the protocol used by this external CA. - CAProtocol protocol = 1; - - // URL is the URL where the external CA can be reached. - string url = 2 [(gogoproto.customname) = "URL"]; - - // Options is a set of additional key/value pairs whose interpretation - // depends on the specified CA type. - map options = 3; - - // CACert specifies which root CA is used by this external CA - bytes ca_cert = 4 [(gogoproto.customname) = "CACert"]; -} - -message CAConfig { - // NodeCertExpiry is the duration certificates should be issued for - // Note: can't use stdduration because this field needs to be nullable. - google.protobuf.Duration node_cert_expiry = 1; - - // ExternalCAs is a list of CAs to which a manager node will make - // certificate signing requests for node certificates. - repeated ExternalCA external_cas = 2 [(gogoproto.customname) = "ExternalCAs"]; - - // SigningCACert is the desired CA certificate to be used as the root and - // signing CA for the swarm. If not provided, indicates that we are either happy - // with the current configuration, or (together with a bump in the ForceRotate value) - // that we want a certificate and key generated for us. - bytes signing_ca_cert = 3 [(gogoproto.customname) = "SigningCACert"]; - - // SigningCAKey is the desired private key, matching the signing CA cert, to be used - // to sign certificates for the swarm - bytes signing_ca_key = 4 [(gogoproto.customname) = "SigningCAKey"]; - - // ForceRotate is a counter that triggers a root CA rotation even if no relevant - // parameters have been in the spec. This will force the manager to generate a new - // certificate and key, if none have been provided. - uint64 force_rotate = 5; -} - -// OrchestrationConfig defines cluster-level orchestration settings. -message OrchestrationConfig { - // TaskHistoryRetentionLimit is the number of historic tasks to keep per instance or - // node. If negative, never remove completed or failed tasks. - int64 task_history_retention_limit = 1; - -} - -// TaskDefaults specifies default values for task creation. -message TaskDefaults { - // LogDriver specifies the log driver to use for the cluster if not - // specified for each task. - // - // If this is changed, only new tasks will pick up the new log driver. - // Existing tasks will continue to use the previous default until rescheduled. - Driver log_driver = 1; -} - -// DispatcherConfig defines cluster-level dispatcher settings. -message DispatcherConfig { - // HeartbeatPeriod defines how often agent should send heartbeats to - // dispatcher. - // Note: can't use stdduration because this field needs to be nullable. - google.protobuf.Duration heartbeat_period = 1; -} - -// RaftConfig defines raft settings for the cluster. -message RaftConfig { - // SnapshotInterval is the number of log entries between snapshots. - uint64 snapshot_interval = 1; - // KeepOldSnapshots is the number of snapshots to keep beyond the - // current snapshot. - uint64 keep_old_snapshots = 2; - // LogEntriesForSlowFollowers is the number of log entries to keep - // around to sync up slow followers after a snapshot is created. - uint64 log_entries_for_slow_followers = 3; - // HeartbeatTick defines the amount of ticks (in seconds) between - // each heartbeat message sent to other members for health-check. - uint32 heartbeat_tick = 4; - // ElectionTick defines the amount of ticks (in seconds) needed - // without a leader to trigger a new election. - uint32 election_tick = 5; -} - -message EncryptionConfig { - // AutoLockManagers specifies whether or not managers TLS keys and raft data - // should be encrypted at rest in such a way that they must be unlocked - // before the manager node starts up again. - bool auto_lock_managers = 1; -} - -message SpreadOver { - string spread_descriptor = 1; // label descriptor, such as engine.labels.az - // TODO: support node information beyond engine and node labels - - // TODO: in the future, add a map that provides weights for weighted - // spreading. -} - -message PlacementPreference { - oneof Preference { - SpreadOver spread = 1; - } -} - -// Placement specifies task distribution constraints. -message Placement { - // Constraints specifies a set of requirements a node should meet for a task. - repeated string constraints = 1; - - // Preferences provide a way to make the scheduler aware of factors - // such as topology. They are provided in order from highest to lowest - // precedence. - repeated PlacementPreference preferences = 2; - - // Platforms stores all the platforms that the image can run on. - // This field is used in the platform filter for scheduling. If empty, - // then the platform filter is off, meaning there are no scheduling restrictions. - repeated Platform platforms = 3; - - // MaxReplicas specifies the limit for maximum number of replicas running on one node. - uint64 max_replicas = 4; -} - -// JoinToken contains the join tokens for workers and managers. -message JoinTokens { - // Worker is the join token workers may use to join the swarm. - string worker = 1; - - // Manager is the join token workers may use to join the swarm. - string manager = 2; -} - -message RootCA { - // CAKey is the root CA private key. - bytes ca_key = 1 [(gogoproto.customname) = "CAKey"]; - - // CACert is the root CA certificate. - bytes ca_cert = 2 [(gogoproto.customname) = "CACert"]; - - // CACertHash is the digest of the CA Certificate. - string ca_cert_hash = 3 [(gogoproto.customname) = "CACertHash"]; - - // JoinTokens contains the join tokens for workers and managers. - JoinTokens join_tokens = 4 [(gogoproto.nullable) = false]; - - // RootRotation contains the new root cert and key we want to rotate to - if this is nil, we are not in the - // middle of a root rotation - RootRotation root_rotation = 5; - - // LastForcedRotation matches the Cluster Spec's CAConfig's ForceRotation counter. - // It indicates when the current CA cert and key were generated (or updated). - uint64 last_forced_rotation = 6; -} - - -enum NodeRole { - option (gogoproto.enum_customname) = "NodeRole"; - option (gogoproto.goproto_enum_prefix) = false; - - WORKER = 0 [(gogoproto.enumvalue_customname) = "NodeRoleWorker"]; - MANAGER = 1 [(gogoproto.enumvalue_customname) = "NodeRoleManager"]; -} - -message Certificate { - NodeRole role = 1; - - bytes csr = 2 [(gogoproto.customname) = "CSR"]; - - IssuanceStatus status = 3 [(gogoproto.nullable) = false]; - - bytes certificate = 4; - - // CN represents the node ID. - string cn = 5 [(gogoproto.customname) = "CN"]; -} - - -// Symmetric keys to encrypt inter-agent communication. -message EncryptionKey { - // Agent subsystem the key is intended for. Example: - // networking:gossip - string subsystem = 1; - - // Encryption algorithm that can implemented using this key - enum Algorithm { - option (gogoproto.goproto_enum_prefix) = false; - - AES_128_GCM = 0; - } - - Algorithm algorithm = 2; - - bytes key = 3; - - // Time stamp from the lamport clock of the key allocator to - // identify the relative age of the key. - uint64 lamport_time = 4; -} - -// ManagerStatus provides informations about the state of a manager in the cluster. -message ManagerStatus { - // RaftID specifies the internal ID used by the manager in a raft context, it can never be modified - // and is used only for information purposes - uint64 raft_id = 1; - - // Addr is the address advertised to raft. - string addr = 2; - - // Leader is set to true if this node is the raft leader. - bool leader = 3; - - // Reachability specifies whether this node is reachable. - RaftMemberStatus.Reachability reachability = 4; -} - -// FileTarget represents a specific target that is backed by a file -message FileTarget { - // Name represents the final filename in the filesystem - string name = 1; - - // UID represents the file UID - string uid = 2 [(gogoproto.customname) = "UID"]; - - // GID represents the file GID - string gid = 3 [(gogoproto.customname) = "GID"]; - - // Mode represents the FileMode of the file - uint32 mode = 4 [(gogoproto.customtype) = "os.FileMode", (gogoproto.nullable) = false]; -} - -// RuntimeTarget represents that this secret is _not_ mounted into the -// container, but is used for some other purpose by the container runtime. -// -// Currently, RuntimeTarget has no fields; it's just a placeholder. -message RuntimeTarget {} - -// SecretReference is the linkage between a service and a secret that it uses. -message SecretReference { - // SecretID represents the ID of the specific Secret that we're - // referencing. This identifier exists so that SecretReferences don't leak - // any information about the secret contents. - string secret_id = 1; - - // SecretName is the name of the secret that this references, but this is just provided for - // lookup/display purposes. The secret in the reference will be identified by its ID. - string secret_name = 2; - - // Target specifies how this secret should be exposed to the task. - oneof target { - FileTarget file = 3; - } -} - -// ConfigReference is the linkage between a service and a config that it uses. -message ConfigReference { - // ConfigID represents the ID of the specific Config that we're - // referencing. - string config_id = 1; - - // ConfigName is the name of the config that this references, but this is just provided for - // lookup/display purposes. The config in the reference will be identified by its ID. - string config_name = 2; - - // Target specifies how this config should be exposed to the task. - oneof target { - FileTarget file = 3; - RuntimeTarget runtime = 4; - } -} - -// BlacklistedCertificate is a record for a blacklisted certificate. It does not -// contain the certificate's CN, because these records are indexed by CN. -message BlacklistedCertificate { - // Expiry is the latest known expiration time of a certificate that - // was issued for the given CN. - // Note: can't use stdtime because this field is nullable. - google.protobuf.Timestamp expiry = 1; -} - -// HealthConfig holds configuration settings for the HEALTHCHECK feature. -message HealthConfig { - // Test is the test to perform to check that the container is healthy. - // An empty slice means to inherit the default. - // The options are: - // {} : inherit healthcheck - // {"NONE"} : disable healthcheck - // {"CMD", args...} : exec arguments directly - // {"CMD-SHELL", command} : run command with system's default shell - repeated string test = 1; - - // Interval is the time to wait between checks. Zero means inherit. - // Note: can't use stdduration because this field needs to be nullable. - google.protobuf.Duration interval = 2; - - // Timeout is the time to wait before considering the check to have hung. - // Zero means inherit. - // Note: can't use stdduration because this field needs to be nullable. - google.protobuf.Duration timeout = 3; - - // Retries is the number of consecutive failures needed to consider a - // container as unhealthy. Zero means inherit. - int32 retries = 4; - - // Start period is the period for container initialization during - // which health check failures will note count towards the maximum - // number of retries. - google.protobuf.Duration start_period = 5; - - // StartInterval is the time to wait between checks during the start period. - // Zero means inherit. - // Note: can't use stdduration because this field needs to be nullable. - google.protobuf.Duration start_interval = 6; - -} - -message MaybeEncryptedRecord { - enum Algorithm { - NONE = 0 [(gogoproto.enumvalue_customname) = "NotEncrypted"]; - SECRETBOX_SALSA20_POLY1305 = 1 [(gogoproto.enumvalue_customname) = "NACLSecretboxSalsa20Poly1305"]; - FERNET_AES_128_CBC = 2 [(gogoproto.enumvalue_customname) = "FernetAES128CBC"]; - } - - Algorithm algorithm = 1; - bytes data = 2; - bytes nonce = 3; -} - - -message RootRotation { - bytes ca_cert = 1 [(gogoproto.customname) = "CACert"]; - bytes ca_key = 2 [(gogoproto.customname) = "CAKey"]; - // cross-signed CA cert is the CACert that has been cross-signed by the previous root - bytes cross_signed_ca_cert = 3 [(gogoproto.customname) = "CrossSignedCACert"]; -} - -// Privileges specifies security configuration/permissions. -message Privileges { - // CredentialSpec for managed service account (Windows only). - message CredentialSpec { - oneof source { - string file = 1; - string registry = 2; - - // Config represents a Config ID from which to get the CredentialSpec. - // The Config MUST be included in the SecretReferences with a RuntimeTarget - string config = 3; - } - } - CredentialSpec credential_spec = 1; - - // SELinuxContext contains the SELinux labels for the container. - message SELinuxContext { - bool disable = 1; - - string user = 2; - string role = 3; - string type = 4; - string level = 5; - } - SELinuxContext selinux_context = 2 [(gogoproto.customname) = "SELinuxContext"]; - - // SeccompOpts contains options for configuring seccomp profiles on the - // container. See https://docs.docker.com/engine/security/seccomp/ for more - // information. - message SeccompOpts { - enum SeccompMode { - DEFAULT = 0; - UNCONFINED = 1; - CUSTOM = 2; - } - SeccompMode mode = 1; - // Profile contains the json definition of the seccomp profile to use, - // if Mode is set to custom. - bytes profile = 2; - } - SeccompOpts seccomp = 3; - - // AppArmorOpts contains options for configuring AppArmor profiles on the - // container. Currently, custom profiles are not supported. See - // https://docs.docker.com/engine/security/apparmor/ for more information. - message AppArmorOpts { - enum AppArmorMode { - DEFAULT = 0; - DISABLED = 1; - } - AppArmorMode mode = 1; - } - AppArmorOpts apparmor = 4; - - // NoNewPrivileges, if set to true, disables the container from gaining new - // privileges. See https://docs.kernel.org/userspace-api/no_new_privs.html - // for details. - bool no_new_privileges = 5; -} - -// JobStatus indicates the status of a Service that is in one of the Job modes. -message JobStatus { - // JobIteration is the count of how many times the Job has been excecuted, - // successfully or otherwise. "Executed" refers to the job as a whole being - // started, not to the individual Tasks being launched. This is used to - // disambiguate which Tasks belong to which iteration of a Job. - Version job_iteration = 1 [(gogoproto.nullable) = false]; - - // LastExecution is the time that the job was last executed. This is set by - // the orchestrator in the same transaction that JobIteration is incremented. - // While time is a fungible concept in distributed systems like Swarmkit, - // this value gives us a best-effort attempt to prevent weird behavior like - // newly added nodes executing long-forgotten jobs. - google.protobuf.Timestamp last_execution = 2; -} - -// VolumeAccessMode is the access mode of the volume, and is used to determine -// the CSI AccessMode value, as well as the volume access type (block vs -// mount). In this way, it is more similar to the CSI VolumeCapability message. -// -// This defines how and where a volume can be accessed by more than -// one Task, but does not imply anything about the accessible topology of the -// volume. -// -// For analogy, a flash drive can be used on many computers, but only one of -// them at a time, and so would have a scope of "Single". But, it can be used -// by any number of programs simultaneously, so would have a sharing of "All". -message VolumeAccessMode { - // Scope enumerates the possible volume access scopes. - enum Scope { - option (gogoproto.goproto_enum_prefix) = false; - // VolumeScopeSingleNode indicates that only one node at a time may have - // access to the volume. - SINGLE_NODE = 0 [(gogoproto.enumvalue_customname) = "VolumeScopeSingleNode"]; - // VolumeScopeMultiNode indicates that multiple nodes may access the volume - // at the same time. - MULTI_NODE = 1 [(gogoproto.enumvalue_customname) = "VolumeScopeMultiNode"]; - } - - // Sharing enumerates the possible volume sharing modes. - enum Sharing { - option (gogoproto.goproto_enum_prefix) = false; - // VolumeSharingNone indicates that the volume may only be used by a single - // Task at any given time. - NONE = 0 [(gogoproto.enumvalue_customname) = "VolumeSharingNone"]; - // VolumeSharingReadOnly indicates that the volume may be accessed by - // multiple Tasks, but all Tasks only have have read access. - READ_ONLY = 1 [(gogoproto.enumvalue_customname) = "VolumeSharingReadOnly"]; - // VolumeSharingOneWriter indicates that the Volume may be accessed by - // multiple Tasks, but only the one Task may have write permission for the - // Volume. - ONE_WRITER = 2 [(gogoproto.enumvalue_customname) = "VolumeSharingOneWriter"]; - // VolumeSharingAll indicates that any number of Tasks may have read and - // write access to the volume. - ALL = 3 [(gogoproto.enumvalue_customname) = "VolumeSharingAll"]; - } - - // BlockVolume indicates the volume will be accessed with the block device - // API. - message BlockVolume { - // intentionally empty - } - - // MountVolume indicates the volume will be access with the filesystem API. - message MountVolume { - // FsType is the filesystem type. This field is optional, and an empty - // string is equal to an unspecified value. - string fs_type = 1; - - // MountFlags indicates mount options to be used for the volume. This - // field is optional, and may contain sensitive data. - repeated string mount_flags = 2; - } - - // Scope defines on how many nodes this volume can be accessed - // simultaneously. If unset, will default to the zero-value of SINGLE_NODE. - Scope scope = 1; - - // Sharing defines how many tasks can use this volume at the same time, and - // in what way. If unset, will default to the zero-value of NONE. - Sharing sharing = 2; - - // AccessType defines the access type of the volume. Unlike Sharing and - // Scope, Swarmkit itself doesn't define either of these as a default, but - // but the upstream is free to do so. However, one of these MUST be set. - oneof access_type { - BlockVolume block = 3; - MountVolume mount = 4; - } -} - -// VolumeSecret indicates a secret value that must be passed to CSI plugin -// operations. -message VolumeSecret { - // Key represents the key that will be passed as a controller secret to the - // CSI plugin. - string key = 1; - - // Secret represents the swarmkit Secret object from which to read data to - // use as the value to pass to the CSI plugin. This can be either a secret - // name or ID. - // - // TODO(dperny): should this be a SecretReference instead? - string secret = 2; -} - -// VolumePublishStatus contains information about the volume's publishing to a -// specific node. -// -// Publishing or unpublishing a volume to a node is a two-step process. -// -// When a Volume is needed on a Node, a VolumePublishStatus with state -// PendingPublish is added. This indicates that the volume should be published, -// but the RPCs have not been executed. -// -// Then, afterward, ControllerPublishVolume is called for the Volume, and the -// State is changed to Published, indicating that the call was a success. -// -// When a Volume is no longer needed, the process is similar, with the State -// being changed to PendingUnpublish. When ControllerUnpublishVolume succeeds, -// the PublishStatus for that Node is simply removed. -// -// Without this two-step process, the following could happen: -// -// 1. ControllerPublishVolume is called and the Volume is successfully -// published. -// 2. A crash or leadership change disrupts the cluster before -// the Volume with the updated VolumePublishStatus can be added to the -// store. -// 3. The Task that required the Volume to be published is deleted. -// -// In this case, the Volume would be published to the Node, but Swarm would be -// unaware of this, and would additionally be unaware that the Volume _should_ -// be published to the Node. -// -// By first committing our intention to publish a Volume, we guarantee that the -// Volume itself is sufficient to know which Nodes it may have been published -// to. -message VolumePublishStatus { - // State is the state of the volume in the publish/unpublish - // lifecycle, on a particular node. - enum State { - // PendingPublish indicates that the volume should be published on this - // node, but the call to ControllerPublishVolume has not been - // successfully completed yet and the result recorded by swarmkit. - PENDING_PUBLISH = 0; - - // Published means the volume is published successfully to the node. - PUBLISHED = 1; - - // PendingNodeUnpublish indicates that the Volume should be unpublished - // on the Node, and we're waiting for confirmation that it has done so. - // After the Node has confirmed that the Volume has been unpublished, - // the state will move to PendingUnpublish. - PENDING_NODE_UNPUBLISH = 2; - - // PendingUnpublish means the volume is published to the node, and - // needs to not be, but the call to ControllerUnpublishVolume has not - // verifiably succeeded yet. There is no Unpublished state, because - // after the volume has been verifiably unpublished, the - // VolumePublishStatus for the node is removed. - PENDING_UNPUBLISH = 3; - } - - // NodeID is the swarm (not CSI plugin) node ID that this volume is - // published to. - string node_id = 1; - - // State is the publish state of the volume. - State state = 2; - - // PublishContext is the same PublishContext returned by a call to - // ControllerPublishVolume. - map publish_context = 3; - - // Message is a human-readable message explaining the state of the volume. - // It exists to convey the current situation with the volume to the user, - // allowing, for example, the user to see error messages why a volume might - // not be published yet. - string message = 5; -} - -// VolumeInfo contains information about the volume originating from the CSI -// plugin. -message VolumeInfo { - // CapacityBytes is the capacity of this volume in bytes. A value of 0 - // indicates that the capcity is unknown. - int64 capacity_bytes = 1; - - // VolumeContext includes fields that are opaque to Swarmkit. - map volume_context = 2; - - // VolumeID is the ID of the volume as reported by the CSI plugin. - // Information about the volume is not cached in swarmkit's object store; - // instead, it is retrieved on-demand as needed. If the VolumeID field is an - // empty string, and the plugin advertises CREATE_DELETE_VOLUME capability, - // then Swarmkit has not yet called CreateVolume. - string volume_id = 3; - - // AccessibleTopology is the topology this volume is actually accessible - // from. - repeated Topology accessible_topology = 4; -} - -// CapacityRange describes the minimum and maximum capacity a volume should be -// created with. -message CapacityRange { - // RequiredBytes specifies that a volume must be at least this big. The value - // of 0 indicates an unspecified minimum. Must not be negative. - int64 required_bytes = 1; - - // LimitBytes specifies that a volume must not be bigger than this. The value - // of 0 indicates an unspecified maximum. Must not be negative. - int64 limit_bytes = 2; -} - -// VolumeAssignment contains the information needed by a Node to use a CSI -// volume. This includes the information need to Stage and Publish the volume -// on the node, but never the full Volume object. -message VolumeAssignment { - // ID is the swarmkit ID for the volume. This is used by swarmkit components - // to identify the volume. - string id = 1; - - // VolumeID is the CSI volume ID as returned from CreateVolume. This is used - // by the CSI driver to identify the volume. - string volume_id = 2; - - // Driver is the CSI Driver that this volume is managed by. - Driver driver = 3; - - // VolumeContext is a map returned from the CSI Controller service when a - // Volume is created. It is optional for the driver to provide, but if it is - // provided, it must be passed to subsequent calls. - map volume_context = 4; - - // PublishContext is a map returned from the Controller service when - // ControllerPublishVolume is called. Again, it is optional, but if provided, - // must be passed. - map publish_context = 5; - - // AccessMode specifies the access mode of the volume. - VolumeAccessMode access_mode = 6; - - // Secrets is the set of secrets required by the CSI plugin. These refer to - // swarmkit Secrets that will be distributed separately to the node. - repeated VolumeSecret secrets = 7; -} - -// VolumeAttachment is the information associating a Volume with a Task. -message VolumeAttachment { - // ID is the swarmkit ID of the volume assigned to this task, not the CSI - // volume ID. - string id = 1; - - // Source indicates the Mount source that this volume is assigned for. - string source = 2; - - // Target indicates the Mount target that this volume is assigned for. - string target = 3; -} - - -// These types are copied from the CSI spec. They are copied because there is -// difficulty in compatibility between the CSI protos and the swarmkit protos, -// and straight importing them is difficult. - -// TopologyRequirement expresses the user's requirements for a volume's -// accessible topology. -message TopologyRequirement { - // Specifies the list of topologies the provisioned volume MUST be - // accessible from. - // This field is OPTIONAL. If TopologyRequirement is specified either - // requisite or preferred or both MUST be specified. - // - // If requisite is specified, the provisioned volume MUST be - // accessible from at least one of the requisite topologies. - // - // Given - // x = number of topologies provisioned volume is accessible from - // n = number of requisite topologies - // The CO MUST ensure n >= 1. The SP MUST ensure x >= 1 - // If x==n, then the SP MUST make the provisioned volume available to - // all topologies from the list of requisite topologies. If it is - // unable to do so, the SP MUST fail the CreateVolume call. - // For example, if a volume should be accessible from a single zone, - // and requisite = - // {"region": "R1", "zone": "Z2"} - // then the provisioned volume MUST be accessible from the "region" - // "R1" and the "zone" "Z2". - // Similarly, if a volume should be accessible from two zones, and - // requisite = - // {"region": "R1", "zone": "Z2"}, - // {"region": "R1", "zone": "Z3"} - // then the provisioned volume MUST be accessible from the "region" - // "R1" and both "zone" "Z2" and "zone" "Z3". - // - // If xn, then the SP MUST make the provisioned volume available from - // all topologies from the list of requisite topologies and MAY choose - // the remaining x-n unique topologies from the list of all possible - // topologies. If it is unable to do so, the SP MUST fail the - // CreateVolume call. - // For example, if a volume should be accessible from two zones, and - // requisite = - // {"region": "R1", "zone": "Z2"} - // then the provisioned volume MUST be accessible from the "region" - // "R1" and the "zone" "Z2" and the SP may select the second zone - // independently, e.g. "R1/Z4". - repeated Topology requisite = 1; - - // Specifies the list of topologies the CO would prefer the volume to - // be provisioned in. - // - // This field is OPTIONAL. If TopologyRequirement is specified either - // requisite or preferred or both MUST be specified. - // - // An SP MUST attempt to make the provisioned volume available using - // the preferred topologies in order from first to last. - // - // If requisite is specified, all topologies in preferred list MUST - // also be present in the list of requisite topologies. - // - // If the SP is unable to to make the provisioned volume available - // from any of the preferred topologies, the SP MAY choose a topology - // from the list of requisite topologies. - // If the list of requisite topologies is not specified, then the SP - // MAY choose from the list of all possible topologies. - // If the list of requisite topologies is specified and the SP is - // unable to to make the provisioned volume available from any of the - // requisite topologies it MUST fail the CreateVolume call. - // - // Example 1: - // Given a volume should be accessible from a single zone, and - // requisite = - // {"region": "R1", "zone": "Z2"}, - // {"region": "R1", "zone": "Z3"} - // preferred = - // {"region": "R1", "zone": "Z3"} - // then the the SP SHOULD first attempt to make the provisioned volume - // available from "zone" "Z3" in the "region" "R1" and fall back to - // "zone" "Z2" in the "region" "R1" if that is not possible. - // - // Example 2: - // Given a volume should be accessible from a single zone, and - // requisite = - // {"region": "R1", "zone": "Z2"}, - // {"region": "R1", "zone": "Z3"}, - // {"region": "R1", "zone": "Z4"}, - // {"region": "R1", "zone": "Z5"} - // preferred = - // {"region": "R1", "zone": "Z4"}, - // {"region": "R1", "zone": "Z2"} - // then the the SP SHOULD first attempt to make the provisioned volume - // accessible from "zone" "Z4" in the "region" "R1" and fall back to - // "zone" "Z2" in the "region" "R1" if that is not possible. If that - // is not possible, the SP may choose between either the "zone" - // "Z3" or "Z5" in the "region" "R1". - // - // Example 3: - // Given a volume should be accessible from TWO zones (because an - // opaque parameter in CreateVolumeRequest, for example, specifies - // the volume is accessible from two zones, aka synchronously - // replicated), and - // requisite = - // {"region": "R1", "zone": "Z2"}, - // {"region": "R1", "zone": "Z3"}, - // {"region": "R1", "zone": "Z4"}, - // {"region": "R1", "zone": "Z5"} - // preferred = - // {"region": "R1", "zone": "Z5"}, - // {"region": "R1", "zone": "Z3"} - // then the the SP SHOULD first attempt to make the provisioned volume - // accessible from the combination of the two "zones" "Z5" and "Z3" in - // the "region" "R1". If that's not possible, it should fall back to - // a combination of "Z5" and other possibilities from the list of - // requisite. If that's not possible, it should fall back to a - // combination of "Z3" and other possibilities from the list of - // requisite. If that's not possible, it should fall back to a - // combination of other possibilities from the list of requisite. - repeated Topology preferred = 2; -} - -// Topology is a map of topological domains to topological segments. -// A topological domain is a sub-division of a cluster, like "region", -// "zone", "rack", etc. -// A topological segment is a specific instance of a topological domain, -// like "zone3", "rack3", etc. -// For example {"com.company/zone": "Z1", "com.company/rack": "R3"} -// Valid keys have two segments: an OPTIONAL prefix and name, separated -// by a slash (/), for example: "com.company.example/zone". -// The key name segment is REQUIRED. The prefix is OPTIONAL. -// The key name MUST be 63 characters or less, begin and end with an -// alphanumeric character ([a-z0-9A-Z]), and contain only dashes (-), -// underscores (_), dots (.), or alphanumerics in between, for example -// "zone". -// The key prefix MUST be 63 characters or less, begin and end with a -// lower-case alphanumeric character ([a-z0-9]), contain only -// dashes (-), dots (.), or lower-case alphanumerics in between, and -// follow domain name notation format -// (https://tools.ietf.org/html/rfc1035#section-2.3.1). -// The key prefix SHOULD include the plugin's host company name and/or -// the plugin name, to minimize the possibility of collisions with keys -// from other plugins. -// If a key prefix is specified, it MUST be identical across all -// topology keys returned by the SP (across all RPCs). -// Keys MUST be case-insensitive. Meaning the keys "Zone" and "zone" -// MUST not both exist. -// Each value (topological segment) MUST contain 1 or more strings. -// Each string MUST be 63 characters or less and begin and end with an -// alphanumeric character with '-', '_', '.', or alphanumerics in -// between. -message Topology { - map segments = 1; -} - -// VolumeCapability specifies a capability of a volume. -message VolumeCapability { - // Indicate that the volume will be accessed via the block device API. - message BlockVolume { - // Intentionally empty, for now. - } - - // Indicate that the volume will be accessed via the filesystem API. - message MountVolume { - // The filesystem type. This field is OPTIONAL. - // An empty string is equal to an unspecified field value. - string fs_type = 1; - - // The mount options that can be used for the volume. This field is - // OPTIONAL. `mount_flags` MAY contain sensitive information. - // Therefore, the CO and the Plugin MUST NOT leak this information - // to untrusted entities. The total size of this repeated field - // SHALL NOT exceed 4 KiB. - repeated string mount_flags = 2; - } - - // Specify how a volume can be accessed. - message AccessMode { - enum Mode { - UNKNOWN = 0; - - // Can only be published once as read/write on a single node, at - // any given time. - SINGLE_NODE_WRITER = 1; - - // Can only be published once as readonly on a single node, at - // any given time. - SINGLE_NODE_READER_ONLY = 2; - - // Can be published as readonly at multiple nodes simultaneously. - MULTI_NODE_READER_ONLY = 3; - - // Can be published at multiple nodes simultaneously. Only one of - // the node can be used as read/write. The rest will be readonly. - MULTI_NODE_SINGLE_WRITER = 4; - - // Can be published as read/write at multiple nodes - // simultaneously. - MULTI_NODE_MULTI_WRITER = 5; - } - - // This field is REQUIRED. - Mode mode = 1; - } - - // Specifies what API the volume will be accessed using. One of the - // following fields MUST be specified. - oneof access_type { - BlockVolume block = 1; - MountVolume mount = 2; - } - - // This is a REQUIRED field. - AccessMode access_mode = 3; -} diff --git a/vendor/github.com/moby/swarmkit/v2/api/watch.pb.go b/vendor/github.com/moby/swarmkit/v2/api/watch.pb.go deleted file mode 100644 index 9203d58db1..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/watch.pb.go +++ /dev/null @@ -1,4879 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/docker/swarmkit/api/watch.proto - -package api - -import ( - context "context" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_moby_swarmkit_v2_api_deepcopy "github.com/moby/swarmkit/v2/api/deepcopy" - raftselector "github.com/moby/swarmkit/v2/manager/raftselector" - _ "github.com/moby/swarmkit/v2/protobuf/plugin" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - metadata "google.golang.org/grpc/metadata" - peer "google.golang.org/grpc/peer" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" - rafttime "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// WatchActionKind distinguishes between creations, updates, and removals. It -// is structured as a bitmap so multiple kinds of events can be requested with -// a mask. -type WatchActionKind int32 - -const ( - WatchActionKindUnknown WatchActionKind = 0 - WatchActionKindCreate WatchActionKind = 1 - WatchActionKindUpdate WatchActionKind = 2 - WatchActionKindRemove WatchActionKind = 4 -) - -var WatchActionKind_name = map[int32]string{ - 0: "WATCH_ACTION_UNKNOWN", - 1: "WATCH_ACTION_CREATE", - 2: "WATCH_ACTION_UPDATE", - 4: "WATCH_ACTION_REMOVE", -} - -var WatchActionKind_value = map[string]int32{ - "WATCH_ACTION_UNKNOWN": 0, - "WATCH_ACTION_CREATE": 1, - "WATCH_ACTION_UPDATE": 2, - "WATCH_ACTION_REMOVE": 4, -} - -func (x WatchActionKind) String() string { - return proto.EnumName(WatchActionKind_name, int32(x)) -} - -func (WatchActionKind) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_da25266013800cd9, []int{0} -} - -type Object struct { - // Types that are valid to be assigned to Object: - // *Object_Node - // *Object_Service - // *Object_Network - // *Object_Task - // *Object_Cluster - // *Object_Secret - // *Object_Resource - // *Object_Extension - // *Object_Config - // *Object_Volume - Object isObject_Object `protobuf_oneof:"Object"` -} - -func (m *Object) Reset() { *m = Object{} } -func (*Object) ProtoMessage() {} -func (*Object) Descriptor() ([]byte, []int) { - return fileDescriptor_da25266013800cd9, []int{0} -} -func (m *Object) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Object.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Object) XXX_Merge(src proto.Message) { - xxx_messageInfo_Object.Merge(m, src) -} -func (m *Object) XXX_Size() int { - return m.Size() -} -func (m *Object) XXX_DiscardUnknown() { - xxx_messageInfo_Object.DiscardUnknown(m) -} - -var xxx_messageInfo_Object proto.InternalMessageInfo - -type isObject_Object interface { - isObject_Object() - MarshalTo([]byte) (int, error) - Size() int -} - -type Object_Node struct { - Node *Node `protobuf:"bytes,1,opt,name=node,proto3,oneof" json:"node,omitempty"` -} -type Object_Service struct { - Service *Service `protobuf:"bytes,2,opt,name=service,proto3,oneof" json:"service,omitempty"` -} -type Object_Network struct { - Network *Network `protobuf:"bytes,3,opt,name=network,proto3,oneof" json:"network,omitempty"` -} -type Object_Task struct { - Task *Task `protobuf:"bytes,4,opt,name=task,proto3,oneof" json:"task,omitempty"` -} -type Object_Cluster struct { - Cluster *Cluster `protobuf:"bytes,5,opt,name=cluster,proto3,oneof" json:"cluster,omitempty"` -} -type Object_Secret struct { - Secret *Secret `protobuf:"bytes,6,opt,name=secret,proto3,oneof" json:"secret,omitempty"` -} -type Object_Resource struct { - Resource *Resource `protobuf:"bytes,7,opt,name=resource,proto3,oneof" json:"resource,omitempty"` -} -type Object_Extension struct { - Extension *Extension `protobuf:"bytes,8,opt,name=extension,proto3,oneof" json:"extension,omitempty"` -} -type Object_Config struct { - Config *Config `protobuf:"bytes,9,opt,name=config,proto3,oneof" json:"config,omitempty"` -} -type Object_Volume struct { - Volume *Volume `protobuf:"bytes,10,opt,name=volume,proto3,oneof" json:"volume,omitempty"` -} - -func (*Object_Node) isObject_Object() {} -func (*Object_Service) isObject_Object() {} -func (*Object_Network) isObject_Object() {} -func (*Object_Task) isObject_Object() {} -func (*Object_Cluster) isObject_Object() {} -func (*Object_Secret) isObject_Object() {} -func (*Object_Resource) isObject_Object() {} -func (*Object_Extension) isObject_Object() {} -func (*Object_Config) isObject_Object() {} -func (*Object_Volume) isObject_Object() {} - -func (m *Object) GetObject() isObject_Object { - if m != nil { - return m.Object - } - return nil -} - -func (m *Object) GetNode() *Node { - if x, ok := m.GetObject().(*Object_Node); ok { - return x.Node - } - return nil -} - -func (m *Object) GetService() *Service { - if x, ok := m.GetObject().(*Object_Service); ok { - return x.Service - } - return nil -} - -func (m *Object) GetNetwork() *Network { - if x, ok := m.GetObject().(*Object_Network); ok { - return x.Network - } - return nil -} - -func (m *Object) GetTask() *Task { - if x, ok := m.GetObject().(*Object_Task); ok { - return x.Task - } - return nil -} - -func (m *Object) GetCluster() *Cluster { - if x, ok := m.GetObject().(*Object_Cluster); ok { - return x.Cluster - } - return nil -} - -func (m *Object) GetSecret() *Secret { - if x, ok := m.GetObject().(*Object_Secret); ok { - return x.Secret - } - return nil -} - -func (m *Object) GetResource() *Resource { - if x, ok := m.GetObject().(*Object_Resource); ok { - return x.Resource - } - return nil -} - -func (m *Object) GetExtension() *Extension { - if x, ok := m.GetObject().(*Object_Extension); ok { - return x.Extension - } - return nil -} - -func (m *Object) GetConfig() *Config { - if x, ok := m.GetObject().(*Object_Config); ok { - return x.Config - } - return nil -} - -func (m *Object) GetVolume() *Volume { - if x, ok := m.GetObject().(*Object_Volume); ok { - return x.Volume - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Object) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Object_Node)(nil), - (*Object_Service)(nil), - (*Object_Network)(nil), - (*Object_Task)(nil), - (*Object_Cluster)(nil), - (*Object_Secret)(nil), - (*Object_Resource)(nil), - (*Object_Extension)(nil), - (*Object_Config)(nil), - (*Object_Volume)(nil), - } -} - -// FIXME(aaronl): These messages should ideally be embedded in SelectBy, but -// protoc generates bad code for that. -type SelectBySlot struct { - ServiceID string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - Slot uint64 `protobuf:"varint,2,opt,name=slot,proto3" json:"slot,omitempty"` -} - -func (m *SelectBySlot) Reset() { *m = SelectBySlot{} } -func (*SelectBySlot) ProtoMessage() {} -func (*SelectBySlot) Descriptor() ([]byte, []int) { - return fileDescriptor_da25266013800cd9, []int{1} -} -func (m *SelectBySlot) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SelectBySlot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SelectBySlot.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SelectBySlot) XXX_Merge(src proto.Message) { - xxx_messageInfo_SelectBySlot.Merge(m, src) -} -func (m *SelectBySlot) XXX_Size() int { - return m.Size() -} -func (m *SelectBySlot) XXX_DiscardUnknown() { - xxx_messageInfo_SelectBySlot.DiscardUnknown(m) -} - -var xxx_messageInfo_SelectBySlot proto.InternalMessageInfo - -type SelectByCustom struct { - Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` - Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *SelectByCustom) Reset() { *m = SelectByCustom{} } -func (*SelectByCustom) ProtoMessage() {} -func (*SelectByCustom) Descriptor() ([]byte, []int) { - return fileDescriptor_da25266013800cd9, []int{2} -} -func (m *SelectByCustom) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SelectByCustom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SelectByCustom.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SelectByCustom) XXX_Merge(src proto.Message) { - xxx_messageInfo_SelectByCustom.Merge(m, src) -} -func (m *SelectByCustom) XXX_Size() int { - return m.Size() -} -func (m *SelectByCustom) XXX_DiscardUnknown() { - xxx_messageInfo_SelectByCustom.DiscardUnknown(m) -} - -var xxx_messageInfo_SelectByCustom proto.InternalMessageInfo - -type SelectBy struct { - // TODO(aaronl): Are all of these things we want to expose in - // the API? Exposing them may commit us to maintaining those - // internal indices going forward. - // - // Types that are valid to be assigned to By: - // *SelectBy_ID - // *SelectBy_IDPrefix - // *SelectBy_Name - // *SelectBy_NamePrefix - // *SelectBy_Custom - // *SelectBy_CustomPrefix - // *SelectBy_ServiceID - // *SelectBy_NodeID - // *SelectBy_Slot - // *SelectBy_DesiredState - // *SelectBy_Role - // *SelectBy_Membership - // *SelectBy_ReferencedNetworkID - // *SelectBy_ReferencedSecretID - // *SelectBy_ReferencedConfigID - // *SelectBy_Kind - By isSelectBy_By `protobuf_oneof:"By"` -} - -func (m *SelectBy) Reset() { *m = SelectBy{} } -func (*SelectBy) ProtoMessage() {} -func (*SelectBy) Descriptor() ([]byte, []int) { - return fileDescriptor_da25266013800cd9, []int{3} -} -func (m *SelectBy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SelectBy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SelectBy.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SelectBy) XXX_Merge(src proto.Message) { - xxx_messageInfo_SelectBy.Merge(m, src) -} -func (m *SelectBy) XXX_Size() int { - return m.Size() -} -func (m *SelectBy) XXX_DiscardUnknown() { - xxx_messageInfo_SelectBy.DiscardUnknown(m) -} - -var xxx_messageInfo_SelectBy proto.InternalMessageInfo - -type isSelectBy_By interface { - isSelectBy_By() - MarshalTo([]byte) (int, error) - Size() int -} - -type SelectBy_ID struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"` -} -type SelectBy_IDPrefix struct { - IDPrefix string `protobuf:"bytes,2,opt,name=id_prefix,json=idPrefix,proto3,oneof" json:"id_prefix,omitempty"` -} -type SelectBy_Name struct { - Name string `protobuf:"bytes,3,opt,name=name,proto3,oneof" json:"name,omitempty"` -} -type SelectBy_NamePrefix struct { - NamePrefix string `protobuf:"bytes,4,opt,name=name_prefix,json=namePrefix,proto3,oneof" json:"name_prefix,omitempty"` -} -type SelectBy_Custom struct { - Custom *SelectByCustom `protobuf:"bytes,5,opt,name=custom,proto3,oneof" json:"custom,omitempty"` -} -type SelectBy_CustomPrefix struct { - CustomPrefix *SelectByCustom `protobuf:"bytes,6,opt,name=custom_prefix,json=customPrefix,proto3,oneof" json:"custom_prefix,omitempty"` -} -type SelectBy_ServiceID struct { - ServiceID string `protobuf:"bytes,7,opt,name=service_id,json=serviceId,proto3,oneof" json:"service_id,omitempty"` -} -type SelectBy_NodeID struct { - NodeID string `protobuf:"bytes,8,opt,name=node_id,json=nodeId,proto3,oneof" json:"node_id,omitempty"` -} -type SelectBy_Slot struct { - Slot *SelectBySlot `protobuf:"bytes,9,opt,name=slot,proto3,oneof" json:"slot,omitempty"` -} -type SelectBy_DesiredState struct { - DesiredState TaskState `protobuf:"varint,10,opt,name=desired_state,json=desiredState,proto3,enum=docker.swarmkit.v1.TaskState,oneof" json:"desired_state,omitempty"` -} -type SelectBy_Role struct { - Role NodeRole `protobuf:"varint,11,opt,name=role,proto3,enum=docker.swarmkit.v1.NodeRole,oneof" json:"role,omitempty"` -} -type SelectBy_Membership struct { - Membership NodeSpec_Membership `protobuf:"varint,12,opt,name=membership,proto3,enum=docker.swarmkit.v1.NodeSpec_Membership,oneof" json:"membership,omitempty"` -} -type SelectBy_ReferencedNetworkID struct { - ReferencedNetworkID string `protobuf:"bytes,13,opt,name=referenced_network_id,json=referencedNetworkId,proto3,oneof" json:"referenced_network_id,omitempty"` -} -type SelectBy_ReferencedSecretID struct { - ReferencedSecretID string `protobuf:"bytes,14,opt,name=referenced_secret_id,json=referencedSecretId,proto3,oneof" json:"referenced_secret_id,omitempty"` -} -type SelectBy_ReferencedConfigID struct { - ReferencedConfigID string `protobuf:"bytes,16,opt,name=referenced_config_id,json=referencedConfigId,proto3,oneof" json:"referenced_config_id,omitempty"` -} -type SelectBy_Kind struct { - Kind string `protobuf:"bytes,15,opt,name=kind,proto3,oneof" json:"kind,omitempty"` -} - -func (*SelectBy_ID) isSelectBy_By() {} -func (*SelectBy_IDPrefix) isSelectBy_By() {} -func (*SelectBy_Name) isSelectBy_By() {} -func (*SelectBy_NamePrefix) isSelectBy_By() {} -func (*SelectBy_Custom) isSelectBy_By() {} -func (*SelectBy_CustomPrefix) isSelectBy_By() {} -func (*SelectBy_ServiceID) isSelectBy_By() {} -func (*SelectBy_NodeID) isSelectBy_By() {} -func (*SelectBy_Slot) isSelectBy_By() {} -func (*SelectBy_DesiredState) isSelectBy_By() {} -func (*SelectBy_Role) isSelectBy_By() {} -func (*SelectBy_Membership) isSelectBy_By() {} -func (*SelectBy_ReferencedNetworkID) isSelectBy_By() {} -func (*SelectBy_ReferencedSecretID) isSelectBy_By() {} -func (*SelectBy_ReferencedConfigID) isSelectBy_By() {} -func (*SelectBy_Kind) isSelectBy_By() {} - -func (m *SelectBy) GetBy() isSelectBy_By { - if m != nil { - return m.By - } - return nil -} - -func (m *SelectBy) GetID() string { - if x, ok := m.GetBy().(*SelectBy_ID); ok { - return x.ID - } - return "" -} - -func (m *SelectBy) GetIDPrefix() string { - if x, ok := m.GetBy().(*SelectBy_IDPrefix); ok { - return x.IDPrefix - } - return "" -} - -func (m *SelectBy) GetName() string { - if x, ok := m.GetBy().(*SelectBy_Name); ok { - return x.Name - } - return "" -} - -func (m *SelectBy) GetNamePrefix() string { - if x, ok := m.GetBy().(*SelectBy_NamePrefix); ok { - return x.NamePrefix - } - return "" -} - -func (m *SelectBy) GetCustom() *SelectByCustom { - if x, ok := m.GetBy().(*SelectBy_Custom); ok { - return x.Custom - } - return nil -} - -func (m *SelectBy) GetCustomPrefix() *SelectByCustom { - if x, ok := m.GetBy().(*SelectBy_CustomPrefix); ok { - return x.CustomPrefix - } - return nil -} - -func (m *SelectBy) GetServiceID() string { - if x, ok := m.GetBy().(*SelectBy_ServiceID); ok { - return x.ServiceID - } - return "" -} - -func (m *SelectBy) GetNodeID() string { - if x, ok := m.GetBy().(*SelectBy_NodeID); ok { - return x.NodeID - } - return "" -} - -func (m *SelectBy) GetSlot() *SelectBySlot { - if x, ok := m.GetBy().(*SelectBy_Slot); ok { - return x.Slot - } - return nil -} - -func (m *SelectBy) GetDesiredState() TaskState { - if x, ok := m.GetBy().(*SelectBy_DesiredState); ok { - return x.DesiredState - } - return TaskStateNew -} - -func (m *SelectBy) GetRole() NodeRole { - if x, ok := m.GetBy().(*SelectBy_Role); ok { - return x.Role - } - return NodeRoleWorker -} - -func (m *SelectBy) GetMembership() NodeSpec_Membership { - if x, ok := m.GetBy().(*SelectBy_Membership); ok { - return x.Membership - } - return NodeMembershipPending -} - -func (m *SelectBy) GetReferencedNetworkID() string { - if x, ok := m.GetBy().(*SelectBy_ReferencedNetworkID); ok { - return x.ReferencedNetworkID - } - return "" -} - -func (m *SelectBy) GetReferencedSecretID() string { - if x, ok := m.GetBy().(*SelectBy_ReferencedSecretID); ok { - return x.ReferencedSecretID - } - return "" -} - -func (m *SelectBy) GetReferencedConfigID() string { - if x, ok := m.GetBy().(*SelectBy_ReferencedConfigID); ok { - return x.ReferencedConfigID - } - return "" -} - -func (m *SelectBy) GetKind() string { - if x, ok := m.GetBy().(*SelectBy_Kind); ok { - return x.Kind - } - return "" -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*SelectBy) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*SelectBy_ID)(nil), - (*SelectBy_IDPrefix)(nil), - (*SelectBy_Name)(nil), - (*SelectBy_NamePrefix)(nil), - (*SelectBy_Custom)(nil), - (*SelectBy_CustomPrefix)(nil), - (*SelectBy_ServiceID)(nil), - (*SelectBy_NodeID)(nil), - (*SelectBy_Slot)(nil), - (*SelectBy_DesiredState)(nil), - (*SelectBy_Role)(nil), - (*SelectBy_Membership)(nil), - (*SelectBy_ReferencedNetworkID)(nil), - (*SelectBy_ReferencedSecretID)(nil), - (*SelectBy_ReferencedConfigID)(nil), - (*SelectBy_Kind)(nil), - } -} - -type WatchRequest struct { - // Multiple entries are combined using OR logic - i.e. if an event - // matches all of the selectors specified in any single watch entry, - // the event will be sent to the client. - Entries []*WatchRequest_WatchEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` - // ResumeFrom provides an version to resume the watch from, if non-nil. - // The watch will return changes since this version, and continue to - // return new changes afterwards. Watch will return an error if the - // server has compacted its log and no longer has complete history to - // this point. - ResumeFrom *Version `protobuf:"bytes,2,opt,name=resume_from,json=resumeFrom,proto3" json:"resume_from,omitempty"` - // IncludeOldObject causes WatchMessages to include a copy of the - // previous version of the object on updates. Note that only live - // changes will include the old object (not historical changes - // retrieved using ResumeFrom). - IncludeOldObject bool `protobuf:"varint,3,opt,name=include_old_object,json=includeOldObject,proto3" json:"include_old_object,omitempty"` -} - -func (m *WatchRequest) Reset() { *m = WatchRequest{} } -func (*WatchRequest) ProtoMessage() {} -func (*WatchRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_da25266013800cd9, []int{4} -} -func (m *WatchRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WatchRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *WatchRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WatchRequest.Merge(m, src) -} -func (m *WatchRequest) XXX_Size() int { - return m.Size() -} -func (m *WatchRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WatchRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_WatchRequest proto.InternalMessageInfo - -type WatchRequest_WatchEntry struct { - // Kind can contain a builtin type such as "node", "secret", etc. or - // the kind specified by a custom-defined object. - Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` - // Action (create/update/delete) - // This is a bitmask, so multiple actions may be OR'd together - Action WatchActionKind `protobuf:"varint,2,opt,name=action,proto3,enum=docker.swarmkit.v1.WatchActionKind" json:"action,omitempty"` - // Filters are combined using AND logic - an event must match - // all of them to pass the filter. - Filters []*SelectBy `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters,omitempty"` -} - -func (m *WatchRequest_WatchEntry) Reset() { *m = WatchRequest_WatchEntry{} } -func (*WatchRequest_WatchEntry) ProtoMessage() {} -func (*WatchRequest_WatchEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_da25266013800cd9, []int{4, 0} -} -func (m *WatchRequest_WatchEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WatchRequest_WatchEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WatchRequest_WatchEntry.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *WatchRequest_WatchEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_WatchRequest_WatchEntry.Merge(m, src) -} -func (m *WatchRequest_WatchEntry) XXX_Size() int { - return m.Size() -} -func (m *WatchRequest_WatchEntry) XXX_DiscardUnknown() { - xxx_messageInfo_WatchRequest_WatchEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_WatchRequest_WatchEntry proto.InternalMessageInfo - -// WatchMessage is the type of the stream that's returned to the client by -// Watch. Note that the first item of this stream will always be a WatchMessage -// with a nil Object, to signal that the stream has started. -type WatchMessage struct { - Events []*WatchMessage_Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` - // Index versions this change to the data store. It can be used to - // resume the watch from this point. - Version *Version `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` -} - -func (m *WatchMessage) Reset() { *m = WatchMessage{} } -func (*WatchMessage) ProtoMessage() {} -func (*WatchMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_da25266013800cd9, []int{5} -} -func (m *WatchMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WatchMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WatchMessage.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *WatchMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_WatchMessage.Merge(m, src) -} -func (m *WatchMessage) XXX_Size() int { - return m.Size() -} -func (m *WatchMessage) XXX_DiscardUnknown() { - xxx_messageInfo_WatchMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_WatchMessage proto.InternalMessageInfo - -type WatchMessage_Event struct { - // Action (create/update/delete) - // Note that WatchMessage does not expose "commit" events that - // mark transaction boundaries. - Action WatchActionKind `protobuf:"varint,1,opt,name=action,proto3,enum=docker.swarmkit.v1.WatchActionKind" json:"action,omitempty"` - // Matched object - Object *Object `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"` - // For updates, OldObject will optionally be included in the - // watch message, containing the previous version of the - // object, if IncludeOldObject was set in WatchRequest. - OldObject *Object `protobuf:"bytes,3,opt,name=old_object,json=oldObject,proto3" json:"old_object,omitempty"` -} - -func (m *WatchMessage_Event) Reset() { *m = WatchMessage_Event{} } -func (*WatchMessage_Event) ProtoMessage() {} -func (*WatchMessage_Event) Descriptor() ([]byte, []int) { - return fileDescriptor_da25266013800cd9, []int{5, 0} -} -func (m *WatchMessage_Event) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WatchMessage_Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WatchMessage_Event.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *WatchMessage_Event) XXX_Merge(src proto.Message) { - xxx_messageInfo_WatchMessage_Event.Merge(m, src) -} -func (m *WatchMessage_Event) XXX_Size() int { - return m.Size() -} -func (m *WatchMessage_Event) XXX_DiscardUnknown() { - xxx_messageInfo_WatchMessage_Event.DiscardUnknown(m) -} - -var xxx_messageInfo_WatchMessage_Event proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("docker.swarmkit.v1.WatchActionKind", WatchActionKind_name, WatchActionKind_value) - proto.RegisterType((*Object)(nil), "docker.swarmkit.v1.Object") - proto.RegisterType((*SelectBySlot)(nil), "docker.swarmkit.v1.SelectBySlot") - proto.RegisterType((*SelectByCustom)(nil), "docker.swarmkit.v1.SelectByCustom") - proto.RegisterType((*SelectBy)(nil), "docker.swarmkit.v1.SelectBy") - proto.RegisterType((*WatchRequest)(nil), "docker.swarmkit.v1.WatchRequest") - proto.RegisterType((*WatchRequest_WatchEntry)(nil), "docker.swarmkit.v1.WatchRequest.WatchEntry") - proto.RegisterType((*WatchMessage)(nil), "docker.swarmkit.v1.WatchMessage") - proto.RegisterType((*WatchMessage_Event)(nil), "docker.swarmkit.v1.WatchMessage.Event") -} - -func init() { - proto.RegisterFile("github.com/docker/swarmkit/api/watch.proto", fileDescriptor_da25266013800cd9) -} - -var fileDescriptor_da25266013800cd9 = []byte{ - // 1210 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x96, 0xcd, 0x73, 0xdb, 0xc4, - 0x1b, 0xc7, 0x25, 0xd7, 0x51, 0xec, 0x27, 0x49, 0x9b, 0xd9, 0xa6, 0xad, 0x7e, 0xfe, 0x15, 0xc7, - 0x98, 0xb7, 0x4e, 0x5b, 0x1c, 0x08, 0xa5, 0x1d, 0xa0, 0x30, 0x13, 0x3b, 0x66, 0x6c, 0x3a, 0x79, - 0x99, 0x4d, 0xd2, 0x1e, 0x3d, 0x8a, 0xf4, 0xc4, 0x15, 0x91, 0xb4, 0x66, 0x25, 0x3b, 0xcd, 0x8d, - 0x23, 0xd3, 0x13, 0x17, 0x66, 0xb8, 0xf4, 0x04, 0x67, 0x2e, 0xdc, 0xca, 0x3f, 0xd0, 0xe1, 0xd4, - 0x63, 0xb9, 0x64, 0xa8, 0x7b, 0xe3, 0xc0, 0x5f, 0xc0, 0x81, 0xd9, 0x17, 0x25, 0xa9, 0x2b, 0x27, - 0xf4, 0xe4, 0xd5, 0xea, 0xf3, 0x7d, 0xf6, 0xd9, 0xe7, 0x4d, 0x86, 0xab, 0x5d, 0x3f, 0xb9, 0xdf, - 0xdf, 0xae, 0xb9, 0x2c, 0x5c, 0xf0, 0x98, 0xbb, 0x8b, 0x7c, 0x21, 0xde, 0x73, 0x78, 0xb8, 0xeb, - 0x27, 0x0b, 0x4e, 0xcf, 0x5f, 0xd8, 0x73, 0x12, 0xf7, 0x7e, 0xad, 0xc7, 0x59, 0xc2, 0x08, 0x51, - 0x40, 0x2d, 0x05, 0x6a, 0x83, 0x0f, 0x4b, 0xa7, 0xe9, 0xe3, 0x1e, 0xba, 0xb1, 0xd2, 0x97, 0xae, - 0x9f, 0xc2, 0xb2, 0xed, 0xaf, 0xd1, 0x4d, 0x52, 0xfa, 0x34, 0xcb, 0xc9, 0x7e, 0x0f, 0x53, 0x76, - 0xae, 0xcb, 0xba, 0x4c, 0x2e, 0x17, 0xc4, 0x4a, 0xef, 0xde, 0x3a, 0xc1, 0x82, 0x24, 0xb6, 0xfb, - 0x3b, 0x0b, 0xbd, 0xa0, 0xdf, 0xf5, 0x23, 0xfd, 0xa3, 0x84, 0xd5, 0xc7, 0x79, 0xb0, 0xd6, 0xa4, - 0x33, 0xa4, 0x06, 0xf9, 0x88, 0x79, 0x68, 0x9b, 0x15, 0xf3, 0xca, 0xd4, 0xa2, 0x5d, 0x7b, 0x35, - 0x04, 0xb5, 0x55, 0xe6, 0x61, 0xcb, 0xa0, 0x92, 0x23, 0xb7, 0x60, 0x32, 0x46, 0x3e, 0xf0, 0x5d, - 0xb4, 0x73, 0x52, 0xf2, 0xff, 0x2c, 0xc9, 0x86, 0x42, 0x5a, 0x06, 0x4d, 0x69, 0x21, 0x8c, 0x30, - 0xd9, 0x63, 0x7c, 0xd7, 0x3e, 0x33, 0x5e, 0xb8, 0xaa, 0x10, 0x21, 0xd4, 0xb4, 0xf0, 0x30, 0x71, - 0xe2, 0x5d, 0x3b, 0x3f, 0xde, 0xc3, 0x4d, 0x27, 0x16, 0x12, 0xc9, 0x89, 0x83, 0xdc, 0xa0, 0x1f, - 0x27, 0xc8, 0xed, 0x89, 0xf1, 0x07, 0x35, 0x14, 0x22, 0x0e, 0xd2, 0x34, 0xb9, 0x01, 0x56, 0x8c, - 0x2e, 0xc7, 0xc4, 0xb6, 0xa4, 0xae, 0x94, 0x7d, 0x33, 0x41, 0xb4, 0x0c, 0xaa, 0x59, 0xf2, 0x29, - 0x14, 0x38, 0xc6, 0xac, 0xcf, 0x5d, 0xb4, 0x27, 0xa5, 0xee, 0x72, 0x96, 0x8e, 0x6a, 0xa6, 0x65, - 0xd0, 0x43, 0x9e, 0x7c, 0x0e, 0x45, 0x7c, 0x90, 0x60, 0x14, 0xfb, 0x2c, 0xb2, 0x0b, 0x52, 0xfc, - 0x46, 0x96, 0xb8, 0x99, 0x42, 0x2d, 0x83, 0x1e, 0x29, 0x84, 0xc3, 0x2e, 0x8b, 0x76, 0xfc, 0xae, - 0x5d, 0x1c, 0xef, 0x70, 0x43, 0x12, 0xc2, 0x61, 0xc5, 0x0a, 0xd5, 0x80, 0x05, 0xfd, 0x10, 0x6d, - 0x18, 0xaf, 0xba, 0x2b, 0x09, 0xa1, 0x52, 0x6c, 0xbd, 0x90, 0x56, 0x4c, 0x75, 0x1d, 0xa6, 0x37, - 0x30, 0x40, 0x37, 0xa9, 0xef, 0x6f, 0x04, 0x2c, 0x21, 0xd7, 0x01, 0x74, 0x8e, 0x3b, 0xbe, 0x27, - 0xeb, 0xa8, 0x58, 0x9f, 0x19, 0x1e, 0xcc, 0x17, 0x75, 0x11, 0xb4, 0x97, 0x69, 0x51, 0x03, 0x6d, - 0x8f, 0x10, 0xc8, 0xc7, 0x01, 0x4b, 0x64, 0xf1, 0xe4, 0xa9, 0x5c, 0x57, 0xd7, 0xe1, 0x6c, 0x6a, - 0xb1, 0xd1, 0x8f, 0x13, 0x16, 0x0a, 0x6a, 0xd7, 0x8f, 0xb4, 0x35, 0x2a, 0xd7, 0x64, 0x0e, 0x26, - 0xfc, 0xc8, 0xc3, 0x07, 0x52, 0x5a, 0xa4, 0xea, 0x41, 0xec, 0x0e, 0x9c, 0xa0, 0x8f, 0xb2, 0xa8, - 0x8a, 0x54, 0x3d, 0x54, 0xff, 0xb2, 0xa0, 0x90, 0x9a, 0x24, 0x36, 0xe4, 0x0e, 0x1d, 0xb3, 0x86, - 0x07, 0xf3, 0xb9, 0xf6, 0x72, 0xcb, 0xa0, 0x39, 0xdf, 0x23, 0xd7, 0xa0, 0xe8, 0x7b, 0x9d, 0x1e, - 0xc7, 0x1d, 0x5f, 0x9b, 0xad, 0x4f, 0x0f, 0x0f, 0xe6, 0x0b, 0xed, 0xe5, 0x75, 0xb9, 0x27, 0x92, - 0xe5, 0x7b, 0x6a, 0x4d, 0xe6, 0x20, 0x1f, 0x39, 0xa1, 0x3e, 0x48, 0xf6, 0x83, 0x13, 0x22, 0x79, - 0x13, 0xa6, 0xc4, 0x6f, 0x6a, 0x24, 0xaf, 0x5f, 0x82, 0xd8, 0xd4, 0xc2, 0xdb, 0x60, 0xb9, 0xf2, - 0x5a, 0xba, 0x1e, 0xab, 0xd9, 0x75, 0x75, 0x3c, 0x00, 0x32, 0x5d, 0x2a, 0x14, 0x6d, 0x98, 0x51, - 0xab, 0xf4, 0x08, 0xeb, 0x35, 0x8c, 0x4c, 0x2b, 0xa9, 0x76, 0xa4, 0xf6, 0x52, 0xa6, 0x26, 0x33, - 0x32, 0x25, 0xea, 0xeb, 0x28, 0x57, 0xef, 0xc0, 0xa4, 0xe8, 0x79, 0x01, 0x17, 0x24, 0x0c, 0xc3, - 0x83, 0x79, 0x4b, 0x8c, 0x03, 0x49, 0x5a, 0xe2, 0x65, 0xdb, 0x23, 0x37, 0x75, 0x4a, 0x55, 0x11, - 0x56, 0x4e, 0x72, 0x4c, 0x14, 0x8c, 0x08, 0x9d, 0xe0, 0xc9, 0x32, 0xcc, 0x78, 0x18, 0xfb, 0x1c, - 0xbd, 0x4e, 0x9c, 0x38, 0x89, 0xaa, 0xc7, 0xb3, 0xd9, 0x1d, 0x20, 0x3a, 0x7c, 0x43, 0x40, 0xe2, - 0x52, 0x5a, 0x25, 0x9f, 0xc9, 0x22, 0xe4, 0x39, 0x0b, 0xd0, 0x9e, 0x92, 0xe2, 0xcb, 0xe3, 0x06, - 0x18, 0x65, 0x81, 0x1c, 0x62, 0x82, 0x25, 0x6d, 0x80, 0x10, 0xc3, 0x6d, 0xe4, 0xf1, 0x7d, 0xbf, - 0x67, 0x4f, 0x4b, 0xe5, 0x7b, 0xe3, 0x94, 0x1b, 0x3d, 0x74, 0x6b, 0x2b, 0x87, 0xb8, 0x48, 0xee, - 0x91, 0x98, 0xac, 0xc0, 0x05, 0x8e, 0x3b, 0xc8, 0x31, 0x72, 0xd1, 0xeb, 0xe8, 0x99, 0x25, 0x22, - 0x36, 0x23, 0x23, 0x76, 0x69, 0x78, 0x30, 0x7f, 0x9e, 0x1e, 0x02, 0x7a, 0xbc, 0xc9, 0xf0, 0x9d, - 0xe7, 0xaf, 0x6c, 0x7b, 0xe4, 0x2b, 0x98, 0x3b, 0x66, 0x4e, 0x8d, 0x18, 0x61, 0xed, 0xac, 0xb4, - 0x76, 0x71, 0x78, 0x30, 0x4f, 0x8e, 0xac, 0xa9, 0x59, 0x24, 0x8d, 0x11, 0x3e, 0xba, 0x3b, 0x6a, - 0x4b, 0x75, 0xbf, 0xb0, 0x35, 0x9b, 0x65, 0x4b, 0x8d, 0x89, 0x51, 0x5b, 0x7a, 0x57, 0x34, 0x9f, - 0x6a, 0xc8, 0x73, 0x69, 0xf1, 0x8b, 0xa7, 0x7a, 0x1e, 0x72, 0xf5, 0xfd, 0xea, 0x1f, 0x39, 0x98, - 0xbe, 0x27, 0x3e, 0xa3, 0x14, 0xbf, 0xe9, 0x63, 0x9c, 0x90, 0x26, 0x4c, 0x62, 0x94, 0x70, 0x1f, - 0x63, 0xdb, 0xac, 0x9c, 0xb9, 0x32, 0xb5, 0x78, 0x2d, 0x2b, 0xb6, 0xc7, 0x25, 0xea, 0xa1, 0x19, - 0x25, 0x7c, 0x9f, 0xa6, 0x5a, 0x72, 0x1b, 0xa6, 0x38, 0xc6, 0xfd, 0x10, 0x3b, 0x3b, 0x9c, 0x85, - 0x27, 0x7d, 0x6e, 0xee, 0x22, 0x17, 0x03, 0x91, 0x82, 0xe2, 0xbf, 0xe4, 0x2c, 0x24, 0xd7, 0x81, - 0xf8, 0x91, 0x1b, 0xf4, 0x3d, 0xec, 0xb0, 0xc0, 0xeb, 0xa8, 0x6f, 0xaf, 0x6c, 0xde, 0x02, 0x9d, - 0xd5, 0x6f, 0xd6, 0x02, 0x4f, 0x0d, 0xb5, 0xd2, 0x0f, 0x26, 0xc0, 0x91, 0x0f, 0x99, 0xf3, 0xe7, - 0x33, 0xb0, 0x1c, 0x37, 0x11, 0x93, 0x3a, 0x27, 0x0b, 0xe6, 0xad, 0xb1, 0x97, 0x5a, 0x92, 0xd8, - 0x1d, 0x3f, 0xf2, 0xa8, 0x96, 0x90, 0x9b, 0x30, 0xb9, 0xe3, 0x07, 0x09, 0xf2, 0xd8, 0x3e, 0x23, - 0x43, 0x72, 0xf9, 0xa4, 0x36, 0xa1, 0x29, 0x5c, 0xfd, 0x2d, 0x8d, 0xed, 0x0a, 0xc6, 0xb1, 0xd3, - 0x45, 0xf2, 0x05, 0x58, 0x38, 0xc0, 0x28, 0x49, 0x43, 0xfb, 0xee, 0x58, 0x2f, 0xb4, 0xa2, 0xd6, - 0x14, 0x38, 0xd5, 0x2a, 0xf2, 0x31, 0x4c, 0x0e, 0x54, 0xb4, 0xfe, 0x4b, 0x40, 0x53, 0xb6, 0xf4, - 0xab, 0x09, 0x13, 0xd2, 0xd0, 0xb1, 0x30, 0x98, 0xaf, 0x1f, 0x86, 0x45, 0xb0, 0x74, 0x22, 0x72, - 0xe3, 0xbf, 0x3d, 0x2a, 0x25, 0x54, 0x93, 0xe4, 0x13, 0x80, 0x91, 0x04, 0x9e, 0xac, 0x2b, 0xb2, - 0x34, 0xab, 0x57, 0xff, 0x31, 0xe1, 0xdc, 0x88, 0x2b, 0xe4, 0x06, 0xcc, 0xdd, 0x5b, 0xda, 0x6c, - 0xb4, 0x3a, 0x4b, 0x8d, 0xcd, 0xf6, 0xda, 0x6a, 0x67, 0x6b, 0xf5, 0xce, 0xea, 0xda, 0xbd, 0xd5, - 0x59, 0xa3, 0x54, 0x7a, 0xf8, 0xa8, 0x72, 0x71, 0x04, 0xdf, 0x8a, 0x76, 0x23, 0xb6, 0x27, 0x1c, - 0x3f, 0xff, 0x92, 0xaa, 0x41, 0x9b, 0x4b, 0x9b, 0xcd, 0x59, 0xb3, 0xf4, 0xbf, 0x87, 0x8f, 0x2a, - 0x17, 0x46, 0x44, 0x0d, 0x8e, 0x6a, 0x32, 0xbd, 0xac, 0xd9, 0x5a, 0x5f, 0x16, 0x9a, 0x5c, 0xa6, - 0x66, 0xab, 0xe7, 0x65, 0x69, 0x68, 0x73, 0x65, 0xed, 0x6e, 0x73, 0x36, 0x9f, 0xa9, 0xa1, 0x18, - 0xb2, 0x01, 0x96, 0x2e, 0x7d, 0xf7, 0x53, 0xd9, 0x78, 0xfc, 0x73, 0x79, 0xf4, 0xaa, 0x8b, 0x21, - 0x4c, 0xc8, 0x2d, 0xe2, 0xa5, 0x8b, 0xca, 0x69, 0x8d, 0x58, 0xaa, 0x9c, 0x56, 0x4f, 0xd5, 0x0b, - 0xbf, 0xff, 0xf2, 0xf7, 0x8f, 0xb9, 0x73, 0x30, 0x23, 0x89, 0xf7, 0x43, 0x27, 0x72, 0xba, 0xc8, - 0x3f, 0x30, 0xeb, 0x6f, 0x3f, 0x79, 0x5e, 0x36, 0x9e, 0x3d, 0x2f, 0x1b, 0xdf, 0x0e, 0xcb, 0xe6, - 0x93, 0x61, 0xd9, 0x7c, 0x3a, 0x2c, 0x9b, 0x7f, 0x0e, 0xcb, 0xe6, 0xf7, 0x2f, 0xca, 0xc6, 0xd3, - 0x17, 0x65, 0xe3, 0xd9, 0x8b, 0xb2, 0xb1, 0x6d, 0xc9, 0xbf, 0xa0, 0x1f, 0xfd, 0x1b, 0x00, 0x00, - 0xff, 0xff, 0x36, 0x4b, 0xa7, 0x78, 0x99, 0x0b, 0x00, 0x00, -} - -type authenticatedWrapperWatchServer struct { - local WatchServer - authorize func(context.Context, []string) error -} - -func NewAuthenticatedWrapperWatchServer(local WatchServer, authorize func(context.Context, []string) error) WatchServer { - return &authenticatedWrapperWatchServer{ - local: local, - authorize: authorize, - } -} - -func (p *authenticatedWrapperWatchServer) Watch(r *WatchRequest, stream Watch_WatchServer) error { - - if err := p.authorize(stream.Context(), []string{"swarm-manager"}); err != nil { - return err - } - return p.local.Watch(r, stream) -} - -func (m *Object) Copy() *Object { - if m == nil { - return nil - } - o := &Object{} - o.CopyFrom(m) - return o -} - -func (m *Object) CopyFrom(src interface{}) { - - o := src.(*Object) - *m = *o - if o.Object != nil { - switch o.Object.(type) { - case *Object_Node: - v := Object_Node{ - Node: &Node{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Node, o.GetNode()) - m.Object = &v - case *Object_Service: - v := Object_Service{ - Service: &Service{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Service, o.GetService()) - m.Object = &v - case *Object_Network: - v := Object_Network{ - Network: &Network{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Network, o.GetNetwork()) - m.Object = &v - case *Object_Task: - v := Object_Task{ - Task: &Task{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Task, o.GetTask()) - m.Object = &v - case *Object_Cluster: - v := Object_Cluster{ - Cluster: &Cluster{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Cluster, o.GetCluster()) - m.Object = &v - case *Object_Secret: - v := Object_Secret{ - Secret: &Secret{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Secret, o.GetSecret()) - m.Object = &v - case *Object_Resource: - v := Object_Resource{ - Resource: &Resource{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Resource, o.GetResource()) - m.Object = &v - case *Object_Extension: - v := Object_Extension{ - Extension: &Extension{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Extension, o.GetExtension()) - m.Object = &v - case *Object_Config: - v := Object_Config{ - Config: &Config{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Config, o.GetConfig()) - m.Object = &v - case *Object_Volume: - v := Object_Volume{ - Volume: &Volume{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Volume, o.GetVolume()) - m.Object = &v - } - } - -} - -func (m *SelectBySlot) Copy() *SelectBySlot { - if m == nil { - return nil - } - o := &SelectBySlot{} - o.CopyFrom(m) - return o -} - -func (m *SelectBySlot) CopyFrom(src interface{}) { - - o := src.(*SelectBySlot) - *m = *o -} - -func (m *SelectByCustom) Copy() *SelectByCustom { - if m == nil { - return nil - } - o := &SelectByCustom{} - o.CopyFrom(m) - return o -} - -func (m *SelectByCustom) CopyFrom(src interface{}) { - - o := src.(*SelectByCustom) - *m = *o -} - -func (m *SelectBy) Copy() *SelectBy { - if m == nil { - return nil - } - o := &SelectBy{} - o.CopyFrom(m) - return o -} - -func (m *SelectBy) CopyFrom(src interface{}) { - - o := src.(*SelectBy) - *m = *o - if o.By != nil { - switch o.By.(type) { - case *SelectBy_ID: - v := SelectBy_ID{ - ID: o.GetID(), - } - m.By = &v - case *SelectBy_IDPrefix: - v := SelectBy_IDPrefix{ - IDPrefix: o.GetIDPrefix(), - } - m.By = &v - case *SelectBy_Name: - v := SelectBy_Name{ - Name: o.GetName(), - } - m.By = &v - case *SelectBy_NamePrefix: - v := SelectBy_NamePrefix{ - NamePrefix: o.GetNamePrefix(), - } - m.By = &v - case *SelectBy_Custom: - v := SelectBy_Custom{ - Custom: &SelectByCustom{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Custom, o.GetCustom()) - m.By = &v - case *SelectBy_CustomPrefix: - v := SelectBy_CustomPrefix{ - CustomPrefix: &SelectByCustom{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.CustomPrefix, o.GetCustomPrefix()) - m.By = &v - case *SelectBy_ServiceID: - v := SelectBy_ServiceID{ - ServiceID: o.GetServiceID(), - } - m.By = &v - case *SelectBy_NodeID: - v := SelectBy_NodeID{ - NodeID: o.GetNodeID(), - } - m.By = &v - case *SelectBy_Slot: - v := SelectBy_Slot{ - Slot: &SelectBySlot{}, - } - github_com_moby_swarmkit_v2_api_deepcopy.Copy(v.Slot, o.GetSlot()) - m.By = &v - case *SelectBy_DesiredState: - v := SelectBy_DesiredState{ - DesiredState: o.GetDesiredState(), - } - m.By = &v - case *SelectBy_Role: - v := SelectBy_Role{ - Role: o.GetRole(), - } - m.By = &v - case *SelectBy_Membership: - v := SelectBy_Membership{ - Membership: o.GetMembership(), - } - m.By = &v - case *SelectBy_ReferencedNetworkID: - v := SelectBy_ReferencedNetworkID{ - ReferencedNetworkID: o.GetReferencedNetworkID(), - } - m.By = &v - case *SelectBy_ReferencedSecretID: - v := SelectBy_ReferencedSecretID{ - ReferencedSecretID: o.GetReferencedSecretID(), - } - m.By = &v - case *SelectBy_ReferencedConfigID: - v := SelectBy_ReferencedConfigID{ - ReferencedConfigID: o.GetReferencedConfigID(), - } - m.By = &v - case *SelectBy_Kind: - v := SelectBy_Kind{ - Kind: o.GetKind(), - } - m.By = &v - } - } - -} - -func (m *WatchRequest) Copy() *WatchRequest { - if m == nil { - return nil - } - o := &WatchRequest{} - o.CopyFrom(m) - return o -} - -func (m *WatchRequest) CopyFrom(src interface{}) { - - o := src.(*WatchRequest) - *m = *o - if o.Entries != nil { - m.Entries = make([]*WatchRequest_WatchEntry, len(o.Entries)) - for i := range m.Entries { - m.Entries[i] = &WatchRequest_WatchEntry{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Entries[i], o.Entries[i]) - } - } - - if o.ResumeFrom != nil { - m.ResumeFrom = &Version{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.ResumeFrom, o.ResumeFrom) - } -} - -func (m *WatchRequest_WatchEntry) Copy() *WatchRequest_WatchEntry { - if m == nil { - return nil - } - o := &WatchRequest_WatchEntry{} - o.CopyFrom(m) - return o -} - -func (m *WatchRequest_WatchEntry) CopyFrom(src interface{}) { - - o := src.(*WatchRequest_WatchEntry) - *m = *o - if o.Filters != nil { - m.Filters = make([]*SelectBy, len(o.Filters)) - for i := range m.Filters { - m.Filters[i] = &SelectBy{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Filters[i], o.Filters[i]) - } - } - -} - -func (m *WatchMessage) Copy() *WatchMessage { - if m == nil { - return nil - } - o := &WatchMessage{} - o.CopyFrom(m) - return o -} - -func (m *WatchMessage) CopyFrom(src interface{}) { - - o := src.(*WatchMessage) - *m = *o - if o.Events != nil { - m.Events = make([]*WatchMessage_Event, len(o.Events)) - for i := range m.Events { - m.Events[i] = &WatchMessage_Event{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Events[i], o.Events[i]) - } - } - - if o.Version != nil { - m.Version = &Version{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Version, o.Version) - } -} - -func (m *WatchMessage_Event) Copy() *WatchMessage_Event { - if m == nil { - return nil - } - o := &WatchMessage_Event{} - o.CopyFrom(m) - return o -} - -func (m *WatchMessage_Event) CopyFrom(src interface{}) { - - o := src.(*WatchMessage_Event) - *m = *o - if o.Object != nil { - m.Object = &Object{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.Object, o.Object) - } - if o.OldObject != nil { - m.OldObject = &Object{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.OldObject, o.OldObject) - } -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// WatchClient is the client API for Watch service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type WatchClient interface { - // Watch starts a stream that returns any changes to objects that match - // the specified selectors. When the stream begins, it immediately sends - // an empty message back to the client. It is important to wait for - // this message before taking any actions that depend on an established - // stream of changes for consistency. - Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Watch_WatchClient, error) -} - -type watchClient struct { - cc *grpc.ClientConn -} - -func NewWatchClient(cc *grpc.ClientConn) WatchClient { - return &watchClient{cc} -} - -func (c *watchClient) Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Watch_WatchClient, error) { - stream, err := c.cc.NewStream(ctx, &_Watch_serviceDesc.Streams[0], "/docker.swarmkit.v1.Watch/Watch", opts...) - if err != nil { - return nil, err - } - x := &watchWatchClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Watch_WatchClient interface { - Recv() (*WatchMessage, error) - grpc.ClientStream -} - -type watchWatchClient struct { - grpc.ClientStream -} - -func (x *watchWatchClient) Recv() (*WatchMessage, error) { - m := new(WatchMessage) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// WatchServer is the server API for Watch service. -type WatchServer interface { - // Watch starts a stream that returns any changes to objects that match - // the specified selectors. When the stream begins, it immediately sends - // an empty message back to the client. It is important to wait for - // this message before taking any actions that depend on an established - // stream of changes for consistency. - Watch(*WatchRequest, Watch_WatchServer) error -} - -// UnimplementedWatchServer can be embedded to have forward compatible implementations. -type UnimplementedWatchServer struct { -} - -func (*UnimplementedWatchServer) Watch(req *WatchRequest, srv Watch_WatchServer) error { - return status.Errorf(codes.Unimplemented, "method Watch not implemented") -} - -func RegisterWatchServer(s *grpc.Server, srv WatchServer) { - s.RegisterService(&_Watch_serviceDesc, srv) -} - -func _Watch_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(WatchRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(WatchServer).Watch(m, &watchWatchServer{stream}) -} - -type Watch_WatchServer interface { - Send(*WatchMessage) error - grpc.ServerStream -} - -type watchWatchServer struct { - grpc.ServerStream -} - -func (x *watchWatchServer) Send(m *WatchMessage) error { - return x.ServerStream.SendMsg(m) -} - -var _Watch_serviceDesc = grpc.ServiceDesc{ - ServiceName: "docker.swarmkit.v1.Watch", - HandlerType: (*WatchServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Watch", - Handler: _Watch_Watch_Handler, - ServerStreams: true, - }, - }, - Metadata: "github.com/docker/swarmkit/api/watch.proto", -} - -func (m *Object) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Object) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Object) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Object != nil { - { - size := m.Object.Size() - i -= size - if _, err := m.Object.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Object_Node) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Object_Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Node != nil { - { - size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *Object_Service) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Object_Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Service != nil { - { - size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *Object_Network) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Object_Network) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Network != nil { - { - size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *Object_Task) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Object_Task) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Task != nil { - { - size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *Object_Cluster) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Object_Cluster) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Cluster != nil { - { - size, err := m.Cluster.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func (m *Object_Secret) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Object_Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Secret != nil { - { - size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - return len(dAtA) - i, nil -} -func (m *Object_Resource) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Object_Resource) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Resource != nil { - { - size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *Object_Extension) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Object_Extension) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Extension != nil { - { - size, err := m.Extension.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - return len(dAtA) - i, nil -} -func (m *Object_Config) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Object_Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Config != nil { - { - size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - return len(dAtA) - i, nil -} -func (m *Object_Volume) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Object_Volume) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Volume != nil { - { - size, err := m.Volume.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - return len(dAtA) - i, nil -} -func (m *SelectBySlot) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SelectBySlot) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBySlot) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Slot != 0 { - i = encodeVarintWatch(dAtA, i, uint64(m.Slot)) - i-- - dAtA[i] = 0x10 - } - if len(m.ServiceID) > 0 { - i -= len(m.ServiceID) - copy(dAtA[i:], m.ServiceID) - i = encodeVarintWatch(dAtA, i, uint64(len(m.ServiceID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SelectByCustom) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SelectByCustom) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectByCustom) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintWatch(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x1a - } - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintWatch(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0x12 - } - if len(m.Kind) > 0 { - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SelectBy) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SelectBy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.By != nil { - { - size := m.By.Size() - i -= size - if _, err := m.By.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *SelectBy_ID) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy_ID) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintWatch(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} -func (m *SelectBy_IDPrefix) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy_IDPrefix) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.IDPrefix) - copy(dAtA[i:], m.IDPrefix) - i = encodeVarintWatch(dAtA, i, uint64(len(m.IDPrefix))) - i-- - dAtA[i] = 0x12 - return len(dAtA) - i, nil -} -func (m *SelectBy_Name) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy_Name) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintWatch(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x1a - return len(dAtA) - i, nil -} -func (m *SelectBy_NamePrefix) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy_NamePrefix) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.NamePrefix) - copy(dAtA[i:], m.NamePrefix) - i = encodeVarintWatch(dAtA, i, uint64(len(m.NamePrefix))) - i-- - dAtA[i] = 0x22 - return len(dAtA) - i, nil -} -func (m *SelectBy_Custom) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy_Custom) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Custom != nil { - { - size, err := m.Custom.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func (m *SelectBy_CustomPrefix) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy_CustomPrefix) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.CustomPrefix != nil { - { - size, err := m.CustomPrefix.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - return len(dAtA) - i, nil -} -func (m *SelectBy_ServiceID) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy_ServiceID) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.ServiceID) - copy(dAtA[i:], m.ServiceID) - i = encodeVarintWatch(dAtA, i, uint64(len(m.ServiceID))) - i-- - dAtA[i] = 0x3a - return len(dAtA) - i, nil -} -func (m *SelectBy_NodeID) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy_NodeID) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.NodeID) - copy(dAtA[i:], m.NodeID) - i = encodeVarintWatch(dAtA, i, uint64(len(m.NodeID))) - i-- - dAtA[i] = 0x42 - return len(dAtA) - i, nil -} -func (m *SelectBy_Slot) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy_Slot) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Slot != nil { - { - size, err := m.Slot.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - return len(dAtA) - i, nil -} -func (m *SelectBy_DesiredState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy_DesiredState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintWatch(dAtA, i, uint64(m.DesiredState)) - i-- - dAtA[i] = 0x50 - return len(dAtA) - i, nil -} -func (m *SelectBy_Role) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy_Role) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintWatch(dAtA, i, uint64(m.Role)) - i-- - dAtA[i] = 0x58 - return len(dAtA) - i, nil -} -func (m *SelectBy_Membership) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy_Membership) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintWatch(dAtA, i, uint64(m.Membership)) - i-- - dAtA[i] = 0x60 - return len(dAtA) - i, nil -} -func (m *SelectBy_ReferencedNetworkID) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy_ReferencedNetworkID) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.ReferencedNetworkID) - copy(dAtA[i:], m.ReferencedNetworkID) - i = encodeVarintWatch(dAtA, i, uint64(len(m.ReferencedNetworkID))) - i-- - dAtA[i] = 0x6a - return len(dAtA) - i, nil -} -func (m *SelectBy_ReferencedSecretID) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy_ReferencedSecretID) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.ReferencedSecretID) - copy(dAtA[i:], m.ReferencedSecretID) - i = encodeVarintWatch(dAtA, i, uint64(len(m.ReferencedSecretID))) - i-- - dAtA[i] = 0x72 - return len(dAtA) - i, nil -} -func (m *SelectBy_Kind) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy_Kind) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0x7a - return len(dAtA) - i, nil -} -func (m *SelectBy_ReferencedConfigID) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SelectBy_ReferencedConfigID) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.ReferencedConfigID) - copy(dAtA[i:], m.ReferencedConfigID) - i = encodeVarintWatch(dAtA, i, uint64(len(m.ReferencedConfigID))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - return len(dAtA) - i, nil -} -func (m *WatchRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.IncludeOldObject { - i-- - if m.IncludeOldObject { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.ResumeFrom != nil { - { - size, err := m.ResumeFrom.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Entries) > 0 { - for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *WatchRequest_WatchEntry) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchRequest_WatchEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchRequest_WatchEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Filters) > 0 { - for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Filters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.Action != 0 { - i = encodeVarintWatch(dAtA, i, uint64(m.Action)) - i-- - dAtA[i] = 0x10 - } - if len(m.Kind) > 0 { - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *WatchMessage) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Version != nil { - { - size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *WatchMessage_Event) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchMessage_Event) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchMessage_Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.OldObject != nil { - { - size, err := m.OldObject.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Object != nil { - { - size, err := m.Object.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWatch(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Action != 0 { - i = encodeVarintWatch(dAtA, i, uint64(m.Action)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintWatch(dAtA []byte, offset int, v uint64) int { - offset -= sovWatch(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -type raftProxyWatchServer struct { - local WatchServer - connSelector raftselector.ConnProvider - localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error) -} - -func NewRaftProxyWatchServer(local WatchServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) WatchServer { - redirectChecker := func(ctx context.Context) (context.Context, error) { - p, ok := peer.FromContext(ctx) - if !ok { - return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context") - } - addr := p.Addr.String() - md, ok := metadata.FromIncomingContext(ctx) - if ok && len(md["redirect"]) != 0 { - return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"]) - } - if !ok { - md = metadata.New(map[string]string{}) - } - md["redirect"] = append(md["redirect"], addr) - return metadata.NewOutgoingContext(ctx, md), nil - } - remoteMods := []func(context.Context) (context.Context, error){redirectChecker} - remoteMods = append(remoteMods, remoteCtxMod) - - var localMods []func(context.Context) (context.Context, error) - if localCtxMod != nil { - localMods = []func(context.Context) (context.Context, error){localCtxMod} - } - - return &raftProxyWatchServer{ - local: local, - connSelector: connSelector, - localCtxMods: localMods, - remoteCtxMods: remoteMods, - } -} -func (p *raftProxyWatchServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) { - var err error - for _, mod := range ctxMods { - ctx, err = mod(ctx) - if err != nil { - return ctx, err - } - } - return ctx, nil -} -func (p *raftProxyWatchServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) { - ticker := rafttime.NewTicker(500 * rafttime.Millisecond) - defer ticker.Stop() - for { - select { - case <-ticker.C: - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - return nil, err - } - - client := NewHealthClient(conn) - - resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"}) - if err != nil || resp.Status != HealthCheckResponse_SERVING { - continue - } - return conn, nil - case <-ctx.Done(): - return nil, ctx.Err() - } - } -} - -type Watch_WatchServerWrapper struct { - Watch_WatchServer - ctx context.Context -} - -func (s Watch_WatchServerWrapper) Context() context.Context { - return s.ctx -} - -func (p *raftProxyWatchServer) Watch(r *WatchRequest, stream Watch_WatchServer) error { - ctx := stream.Context() - conn, err := p.connSelector.LeaderConn(ctx) - if err != nil { - if err == raftselector.ErrIsLeader { - ctx, err = p.runCtxMods(ctx, p.localCtxMods) - if err != nil { - return err - } - streamWrapper := Watch_WatchServerWrapper{ - Watch_WatchServer: stream, - ctx: ctx, - } - return p.local.Watch(r, streamWrapper) - } - return err - } - ctx, err = p.runCtxMods(ctx, p.remoteCtxMods) - if err != nil { - return err - } - clientStream, err := NewWatchClient(conn).Watch(ctx, r) - - if err != nil { - return err - } - - for { - msg, err := clientStream.Recv() - if err == io.EOF { - break - } - if err != nil { - return err - } - if err := stream.Send(msg); err != nil { - return err - } - } - return nil -} - -func (m *Object) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Object != nil { - n += m.Object.Size() - } - return n -} - -func (m *Object_Node) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Node != nil { - l = m.Node.Size() - n += 1 + l + sovWatch(uint64(l)) - } - return n -} -func (m *Object_Service) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Service != nil { - l = m.Service.Size() - n += 1 + l + sovWatch(uint64(l)) - } - return n -} -func (m *Object_Network) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Network != nil { - l = m.Network.Size() - n += 1 + l + sovWatch(uint64(l)) - } - return n -} -func (m *Object_Task) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Task != nil { - l = m.Task.Size() - n += 1 + l + sovWatch(uint64(l)) - } - return n -} -func (m *Object_Cluster) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Cluster != nil { - l = m.Cluster.Size() - n += 1 + l + sovWatch(uint64(l)) - } - return n -} -func (m *Object_Secret) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Secret != nil { - l = m.Secret.Size() - n += 1 + l + sovWatch(uint64(l)) - } - return n -} -func (m *Object_Resource) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Resource != nil { - l = m.Resource.Size() - n += 1 + l + sovWatch(uint64(l)) - } - return n -} -func (m *Object_Extension) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Extension != nil { - l = m.Extension.Size() - n += 1 + l + sovWatch(uint64(l)) - } - return n -} -func (m *Object_Config) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Config != nil { - l = m.Config.Size() - n += 1 + l + sovWatch(uint64(l)) - } - return n -} -func (m *Object_Volume) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Volume != nil { - l = m.Volume.Size() - n += 1 + l + sovWatch(uint64(l)) - } - return n -} -func (m *SelectBySlot) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ServiceID) - if l > 0 { - n += 1 + l + sovWatch(uint64(l)) - } - if m.Slot != 0 { - n += 1 + sovWatch(uint64(m.Slot)) - } - return n -} - -func (m *SelectByCustom) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Kind) - if l > 0 { - n += 1 + l + sovWatch(uint64(l)) - } - l = len(m.Index) - if l > 0 { - n += 1 + l + sovWatch(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovWatch(uint64(l)) - } - return n -} - -func (m *SelectBy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.By != nil { - n += m.By.Size() - } - return n -} - -func (m *SelectBy_ID) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - n += 1 + l + sovWatch(uint64(l)) - return n -} -func (m *SelectBy_IDPrefix) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.IDPrefix) - n += 1 + l + sovWatch(uint64(l)) - return n -} -func (m *SelectBy_Name) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - n += 1 + l + sovWatch(uint64(l)) - return n -} -func (m *SelectBy_NamePrefix) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.NamePrefix) - n += 1 + l + sovWatch(uint64(l)) - return n -} -func (m *SelectBy_Custom) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Custom != nil { - l = m.Custom.Size() - n += 1 + l + sovWatch(uint64(l)) - } - return n -} -func (m *SelectBy_CustomPrefix) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CustomPrefix != nil { - l = m.CustomPrefix.Size() - n += 1 + l + sovWatch(uint64(l)) - } - return n -} -func (m *SelectBy_ServiceID) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ServiceID) - n += 1 + l + sovWatch(uint64(l)) - return n -} -func (m *SelectBy_NodeID) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.NodeID) - n += 1 + l + sovWatch(uint64(l)) - return n -} -func (m *SelectBy_Slot) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Slot != nil { - l = m.Slot.Size() - n += 1 + l + sovWatch(uint64(l)) - } - return n -} -func (m *SelectBy_DesiredState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovWatch(uint64(m.DesiredState)) - return n -} -func (m *SelectBy_Role) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovWatch(uint64(m.Role)) - return n -} -func (m *SelectBy_Membership) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovWatch(uint64(m.Membership)) - return n -} -func (m *SelectBy_ReferencedNetworkID) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ReferencedNetworkID) - n += 1 + l + sovWatch(uint64(l)) - return n -} -func (m *SelectBy_ReferencedSecretID) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ReferencedSecretID) - n += 1 + l + sovWatch(uint64(l)) - return n -} -func (m *SelectBy_Kind) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Kind) - n += 1 + l + sovWatch(uint64(l)) - return n -} -func (m *SelectBy_ReferencedConfigID) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ReferencedConfigID) - n += 2 + l + sovWatch(uint64(l)) - return n -} -func (m *WatchRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Entries) > 0 { - for _, e := range m.Entries { - l = e.Size() - n += 1 + l + sovWatch(uint64(l)) - } - } - if m.ResumeFrom != nil { - l = m.ResumeFrom.Size() - n += 1 + l + sovWatch(uint64(l)) - } - if m.IncludeOldObject { - n += 2 - } - return n -} - -func (m *WatchRequest_WatchEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Kind) - if l > 0 { - n += 1 + l + sovWatch(uint64(l)) - } - if m.Action != 0 { - n += 1 + sovWatch(uint64(m.Action)) - } - if len(m.Filters) > 0 { - for _, e := range m.Filters { - l = e.Size() - n += 1 + l + sovWatch(uint64(l)) - } - } - return n -} - -func (m *WatchMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovWatch(uint64(l)) - } - } - if m.Version != nil { - l = m.Version.Size() - n += 1 + l + sovWatch(uint64(l)) - } - return n -} - -func (m *WatchMessage_Event) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Action != 0 { - n += 1 + sovWatch(uint64(m.Action)) - } - if m.Object != nil { - l = m.Object.Size() - n += 1 + l + sovWatch(uint64(l)) - } - if m.OldObject != nil { - l = m.OldObject.Size() - n += 1 + l + sovWatch(uint64(l)) - } - return n -} - -func sovWatch(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozWatch(x uint64) (n int) { - return sovWatch(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Object) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Object{`, - `Object:` + fmt.Sprintf("%v", this.Object) + `,`, - `}`, - }, "") - return s -} -func (this *Object_Node) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Object_Node{`, - `Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "Node", "Node", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Object_Service) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Object_Service{`, - `Service:` + strings.Replace(fmt.Sprintf("%v", this.Service), "Service", "Service", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Object_Network) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Object_Network{`, - `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Object_Task) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Object_Task{`, - `Task:` + strings.Replace(fmt.Sprintf("%v", this.Task), "Task", "Task", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Object_Cluster) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Object_Cluster{`, - `Cluster:` + strings.Replace(fmt.Sprintf("%v", this.Cluster), "Cluster", "Cluster", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Object_Secret) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Object_Secret{`, - `Secret:` + strings.Replace(fmt.Sprintf("%v", this.Secret), "Secret", "Secret", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Object_Resource) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Object_Resource{`, - `Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "Resource", "Resource", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Object_Extension) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Object_Extension{`, - `Extension:` + strings.Replace(fmt.Sprintf("%v", this.Extension), "Extension", "Extension", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Object_Config) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Object_Config{`, - `Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "Config", "Config", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Object_Volume) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Object_Volume{`, - `Volume:` + strings.Replace(fmt.Sprintf("%v", this.Volume), "Volume", "Volume", 1) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBySlot) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBySlot{`, - `ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`, - `Slot:` + fmt.Sprintf("%v", this.Slot) + `,`, - `}`, - }, "") - return s -} -func (this *SelectByCustom) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectByCustom{`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `Index:` + fmt.Sprintf("%v", this.Index) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy{`, - `By:` + fmt.Sprintf("%v", this.By) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy_ID) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy_ID{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy_IDPrefix) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy_IDPrefix{`, - `IDPrefix:` + fmt.Sprintf("%v", this.IDPrefix) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy_Name) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy_Name{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy_NamePrefix) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy_NamePrefix{`, - `NamePrefix:` + fmt.Sprintf("%v", this.NamePrefix) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy_Custom) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy_Custom{`, - `Custom:` + strings.Replace(fmt.Sprintf("%v", this.Custom), "SelectByCustom", "SelectByCustom", 1) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy_CustomPrefix) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy_CustomPrefix{`, - `CustomPrefix:` + strings.Replace(fmt.Sprintf("%v", this.CustomPrefix), "SelectByCustom", "SelectByCustom", 1) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy_ServiceID) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy_ServiceID{`, - `ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy_NodeID) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy_NodeID{`, - `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy_Slot) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy_Slot{`, - `Slot:` + strings.Replace(fmt.Sprintf("%v", this.Slot), "SelectBySlot", "SelectBySlot", 1) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy_DesiredState) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy_DesiredState{`, - `DesiredState:` + fmt.Sprintf("%v", this.DesiredState) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy_Role) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy_Role{`, - `Role:` + fmt.Sprintf("%v", this.Role) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy_Membership) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy_Membership{`, - `Membership:` + fmt.Sprintf("%v", this.Membership) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy_ReferencedNetworkID) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy_ReferencedNetworkID{`, - `ReferencedNetworkID:` + fmt.Sprintf("%v", this.ReferencedNetworkID) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy_ReferencedSecretID) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy_ReferencedSecretID{`, - `ReferencedSecretID:` + fmt.Sprintf("%v", this.ReferencedSecretID) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy_Kind) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy_Kind{`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `}`, - }, "") - return s -} -func (this *SelectBy_ReferencedConfigID) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SelectBy_ReferencedConfigID{`, - `ReferencedConfigID:` + fmt.Sprintf("%v", this.ReferencedConfigID) + `,`, - `}`, - }, "") - return s -} -func (this *WatchRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForEntries := "[]*WatchRequest_WatchEntry{" - for _, f := range this.Entries { - repeatedStringForEntries += strings.Replace(fmt.Sprintf("%v", f), "WatchRequest_WatchEntry", "WatchRequest_WatchEntry", 1) + "," - } - repeatedStringForEntries += "}" - s := strings.Join([]string{`&WatchRequest{`, - `Entries:` + repeatedStringForEntries + `,`, - `ResumeFrom:` + strings.Replace(fmt.Sprintf("%v", this.ResumeFrom), "Version", "Version", 1) + `,`, - `IncludeOldObject:` + fmt.Sprintf("%v", this.IncludeOldObject) + `,`, - `}`, - }, "") - return s -} -func (this *WatchRequest_WatchEntry) String() string { - if this == nil { - return "nil" - } - repeatedStringForFilters := "[]*SelectBy{" - for _, f := range this.Filters { - repeatedStringForFilters += strings.Replace(f.String(), "SelectBy", "SelectBy", 1) + "," - } - repeatedStringForFilters += "}" - s := strings.Join([]string{`&WatchRequest_WatchEntry{`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `Action:` + fmt.Sprintf("%v", this.Action) + `,`, - `Filters:` + repeatedStringForFilters + `,`, - `}`, - }, "") - return s -} -func (this *WatchMessage) String() string { - if this == nil { - return "nil" - } - repeatedStringForEvents := "[]*WatchMessage_Event{" - for _, f := range this.Events { - repeatedStringForEvents += strings.Replace(fmt.Sprintf("%v", f), "WatchMessage_Event", "WatchMessage_Event", 1) + "," - } - repeatedStringForEvents += "}" - s := strings.Join([]string{`&WatchMessage{`, - `Events:` + repeatedStringForEvents + `,`, - `Version:` + strings.Replace(fmt.Sprintf("%v", this.Version), "Version", "Version", 1) + `,`, - `}`, - }, "") - return s -} -func (this *WatchMessage_Event) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&WatchMessage_Event{`, - `Action:` + fmt.Sprintf("%v", this.Action) + `,`, - `Object:` + strings.Replace(this.Object.String(), "Object", "Object", 1) + `,`, - `OldObject:` + strings.Replace(this.OldObject.String(), "Object", "Object", 1) + `,`, - `}`, - }, "") - return s -} -func valueToStringWatch(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Object) Unmarshal(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 ErrIntOverflowWatch - } - 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: Object: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Object: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Node{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Object = &Object_Node{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Service{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Object = &Object_Service{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Network{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Object = &Object_Network{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Task", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Task{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Object = &Object_Task{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Cluster{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Object = &Object_Cluster{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Secret{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Object = &Object_Secret{v} - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Resource{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Object = &Object_Resource{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extension", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Extension{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Object = &Object_Extension{v} - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Config{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Object = &Object_Config{v} - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volume", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Volume{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Object = &Object_Volume{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipWatch(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SelectBySlot) Unmarshal(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 ErrIntOverflowWatch - } - 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: SelectBySlot: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SelectBySlot: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) - } - m.Slot = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Slot |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipWatch(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SelectByCustom) Unmarshal(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 ErrIntOverflowWatch - } - 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: SelectByCustom: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SelectByCustom: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipWatch(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SelectBy) Unmarshal(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 ErrIntOverflowWatch - } - 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: SelectBy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SelectBy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.By = &SelectBy_ID{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IDPrefix", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.By = &SelectBy_IDPrefix{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.By = &SelectBy_Name{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamePrefix", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.By = &SelectBy_NamePrefix{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Custom", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SelectByCustom{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.By = &SelectBy_Custom{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CustomPrefix", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SelectByCustom{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.By = &SelectBy_CustomPrefix{v} - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.By = &SelectBy_ServiceID{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.By = &SelectBy_NodeID{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SelectBySlot{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.By = &SelectBy_Slot{v} - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredState", wireType) - } - var v TaskState - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= TaskState(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.By = &SelectBy_DesiredState{v} - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var v NodeRole - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= NodeRole(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.By = &SelectBy_Role{v} - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Membership", wireType) - } - var v NodeSpec_Membership - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= NodeSpec_Membership(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.By = &SelectBy_Membership{v} - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ReferencedNetworkID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.By = &SelectBy_ReferencedNetworkID{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ReferencedSecretID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.By = &SelectBy_ReferencedSecretID{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.By = &SelectBy_Kind{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ReferencedConfigID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.By = &SelectBy_ReferencedConfigID{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipWatch(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchRequest) Unmarshal(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 ErrIntOverflowWatch - } - 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: WatchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Entries = append(m.Entries, &WatchRequest_WatchEntry{}) - if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResumeFrom", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ResumeFrom == nil { - m.ResumeFrom = &Version{} - } - if err := m.ResumeFrom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IncludeOldObject", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IncludeOldObject = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipWatch(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchRequest_WatchEntry) Unmarshal(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 ErrIntOverflowWatch - } - 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: WatchEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - m.Action = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Action |= WatchActionKind(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Filters = append(m.Filters, &SelectBy{}) - if err := m.Filters[len(m.Filters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipWatch(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchMessage) Unmarshal(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 ErrIntOverflowWatch - } - 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: WatchMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Events = append(m.Events, &WatchMessage_Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Version == nil { - m.Version = &Version{} - } - if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipWatch(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchMessage_Event) Unmarshal(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 ErrIntOverflowWatch - } - 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: Event: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - m.Action = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Action |= WatchActionKind(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Object", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Object == nil { - m.Object = &Object{} - } - if err := m.Object.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OldObject", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWatch - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWatch - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWatch - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.OldObject == nil { - m.OldObject = &Object{} - } - if err := m.OldObject.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipWatch(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipWatch(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowWatch - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowWatch - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowWatch - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthWatch - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupWatch - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthWatch - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthWatch = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowWatch = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupWatch = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/moby/swarmkit/v2/api/watch.proto b/vendor/github.com/moby/swarmkit/v2/api/watch.proto deleted file mode 100644 index d7e9e51046..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/api/watch.proto +++ /dev/null @@ -1,155 +0,0 @@ -syntax = "proto3"; - -package docker.swarmkit.v1; - -import "github.com/docker/swarmkit/api/specs.proto"; -import "github.com/docker/swarmkit/api/objects.proto"; -import "github.com/docker/swarmkit/api/types.proto"; -import "gogoproto/gogo.proto"; -import "github.com/docker/swarmkit/protobuf/plugin/plugin.proto"; - -message Object { - oneof Object { - Node node = 1; - Service service = 2; - Network network = 3; - Task task = 4; - Cluster cluster = 5; - Secret secret = 6; - Resource resource = 7; - Extension extension = 8; - Config config = 9; - Volume volume = 10; - } -} - -// FIXME(aaronl): These messages should ideally be embedded in SelectBy, but -// protoc generates bad code for that. -message SelectBySlot { - string service_id = 1 [(gogoproto.customname) = "ServiceID"]; - uint64 slot = 2; -} - -message SelectByCustom { - string kind = 1; - string index = 2; - string value = 3; -} - -message SelectBy { - // TODO(aaronl): Are all of these things we want to expose in - // the API? Exposing them may commit us to maintaining those - // internal indices going forward. - oneof By { - // supported by all object types - string id = 1 [(gogoproto.customname) = "ID"]; // not applicable for FindObjects - use GetObject instead - string id_prefix = 2 [(gogoproto.customname) = "IDPrefix"]; - string name = 3; - string name_prefix = 4; - SelectByCustom custom = 5; - SelectByCustom custom_prefix = 6; - - // supported by tasks only - string service_id = 7 [(gogoproto.customname) = "ServiceID"]; - string node_id = 8 [(gogoproto.customname) = "NodeID"]; - SelectBySlot slot = 9; - TaskState desired_state = 10; - - // supported by nodes only - NodeRole role = 11; - NodeSpec.Membership membership = 12; - - // supported by: service, task - string referenced_network_id = 13 [(gogoproto.customname) = "ReferencedNetworkID"]; - string referenced_secret_id = 14 [(gogoproto.customname) = "ReferencedSecretID"]; - string referenced_config_id = 16 [(gogoproto.customname) = "ReferencedConfigID"]; - - // supported by: resource - string kind = 15; - } -} - - -// Watch defines the RPC methods for monitoring data store change. -service Watch { - // Watch starts a stream that returns any changes to objects that match - // the specified selectors. When the stream begins, it immediately sends - // an empty message back to the client. It is important to wait for - // this message before taking any actions that depend on an established - // stream of changes for consistency. - rpc Watch(WatchRequest) returns (stream WatchMessage) { - option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" }; - }; -} - -message WatchRequest { - message WatchEntry { - // Kind can contain a builtin type such as "node", "secret", etc. or - // the kind specified by a custom-defined object. - string kind = 1; - - // Action (create/update/delete) - // This is a bitmask, so multiple actions may be OR'd together - WatchActionKind action = 2; - - // Filters are combined using AND logic - an event must match - // all of them to pass the filter. - repeated SelectBy filters = 3; - } - - // Multiple entries are combined using OR logic - i.e. if an event - // matches all of the selectors specified in any single watch entry, - // the event will be sent to the client. - repeated WatchEntry entries = 1; - - // ResumeFrom provides an version to resume the watch from, if non-nil. - // The watch will return changes since this version, and continue to - // return new changes afterwards. Watch will return an error if the - // server has compacted its log and no longer has complete history to - // this point. - Version resume_from = 2; - - // IncludeOldObject causes WatchMessages to include a copy of the - // previous version of the object on updates. Note that only live - // changes will include the old object (not historical changes - // retrieved using ResumeFrom). - bool include_old_object = 3; -} - -// WatchMessage is the type of the stream that's returned to the client by -// Watch. Note that the first item of this stream will always be a WatchMessage -// with a nil Object, to signal that the stream has started. -message WatchMessage { - message Event { - // Action (create/update/delete) - // Note that WatchMessage does not expose "commit" events that - // mark transaction boundaries. - WatchActionKind action = 1; - - // Matched object - Object object = 2; - - // For updates, OldObject will optionally be included in the - // watch message, containing the previous version of the - // object, if IncludeOldObject was set in WatchRequest. - Object old_object = 3; - } - - repeated Event events = 1; - - // Index versions this change to the data store. It can be used to - // resume the watch from this point. - Version version = 2; -} - -// WatchActionKind distinguishes between creations, updates, and removals. It -// is structured as a bitmap so multiple kinds of events can be requested with -// a mask. -enum WatchActionKind { - option (gogoproto.goproto_enum_prefix) = false; - option (gogoproto.enum_customname) = "WatchActionKind"; - WATCH_ACTION_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "WatchActionKindUnknown"]; // default value, invalid - WATCH_ACTION_CREATE = 1 [(gogoproto.enumvalue_customname) = "WatchActionKindCreate"]; - WATCH_ACTION_UPDATE = 2 [(gogoproto.enumvalue_customname) = "WatchActionKindUpdate"]; - WATCH_ACTION_REMOVE = 4 [(gogoproto.enumvalue_customname) = "WatchActionKindRemove"]; -} diff --git a/vendor/github.com/moby/swarmkit/v2/log/context.go b/vendor/github.com/moby/swarmkit/v2/log/context.go deleted file mode 100644 index 9c797debaa..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/log/context.go +++ /dev/null @@ -1,99 +0,0 @@ -package log - -import ( - "context" - "path" - - "github.com/sirupsen/logrus" -) - -var ( - // G is an alias for GetLogger. - // - // We may want to define this locally to a package to get package tagged log - // messages. - G = GetLogger - - // L is an alias for the the standard logger. - L = logrus.NewEntry(logrus.StandardLogger()) -) - -type ( - loggerKey struct{} - moduleKey struct{} -) - -// Fields type to pass to "WithFields". -type Fields = map[string]any - -// WithLogger returns a new context with the provided logger. Use in -// combination with logger.WithField(s) for great effect. -func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context { - return context.WithValue(ctx, loggerKey{}, logger) -} - -// WithFields returns a new context with added fields to logger. -func WithFields(ctx context.Context, fields Fields) context.Context { - logger := ctx.Value(loggerKey{}) - - if logger == nil { - logger = L - } - return WithLogger(ctx, logger.(*logrus.Entry).WithFields(fields)) -} - -// WithField is convenience wrapper around WithFields. -func WithField(ctx context.Context, key, value string) context.Context { - return WithFields(ctx, Fields{key: value}) -} - -// GetLogger retrieves the current logger from the context. If no logger is -// available, the default logger is returned. -func GetLogger(ctx context.Context) *logrus.Entry { - logger := ctx.Value(loggerKey{}) - - if logger == nil { - return L - } - - return logger.(*logrus.Entry) -} - -// WithModule adds the module to the context, appending it with a slash if a -// module already exists. A module is just a roughly correlated defined by the -// call tree for a given context. -// -// As an example, we might have a "node" module already part of a context. If -// this function is called with "tls", the new value of module will be -// "node/tls". -// -// Modules represent the call path. If the new module and last module are the -// same, a new module entry will not be created. If the new module and old -// older module are the same but separated by other modules, the cycle will be -// represented by the module path. -func WithModule(ctx context.Context, module string) context.Context { - parent := GetModulePath(ctx) - - if parent != "" { - // don't re-append module when module is the same. - if path.Base(parent) == module { - return ctx - } - - module = path.Join(parent, module) - } - - ctx = WithLogger(ctx, GetLogger(ctx).WithField("module", module)) - return context.WithValue(ctx, moduleKey{}, module) -} - -// GetModulePath returns the module path for the provided context. If no module -// is set, an empty string is returned. -func GetModulePath(ctx context.Context) string { - module := ctx.Value(moduleKey{}) - if module == nil { - return "" - } - - return module.(string) -} diff --git a/vendor/github.com/moby/swarmkit/v2/log/grpc.go b/vendor/github.com/moby/swarmkit/v2/log/grpc.go deleted file mode 100644 index bced5cfa1b..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/log/grpc.go +++ /dev/null @@ -1,31 +0,0 @@ -package log - -import ( - "context" - - "github.com/sirupsen/logrus" - "google.golang.org/grpc/grpclog" -) - -type logrusWrapper struct { - *logrus.Entry -} - -// V provides the functionality that returns whether a particular log level is at -// least l - this is needed to meet the LoggerV2 interface. GRPC's logging levels -// are: https://github.com/grpc/grpc-go/blob/master/grpclog/loggerv2.go#L71 -// 0=info, 1=warning, 2=error, 3=fatal -// logrus's are: https://github.com/sirupsen/logrus/blob/master/logrus.go -// 0=panic, 1=fatal, 2=error, 3=warn, 4=info, 5=debug -func (lw logrusWrapper) V(l int) bool { - // translate to logrus level - logrusLevel := 4 - l - return int(lw.Logger.Level) <= logrusLevel -} - -func init() { - ctx := WithModule(context.Background(), "grpc") - - // completely replace the grpc logger with the logrus logger. - grpclog.SetLoggerV2(logrusWrapper{Entry: G(ctx)}) -} diff --git a/vendor/github.com/moby/swarmkit/v2/manager/raftselector/raftselector.go b/vendor/github.com/moby/swarmkit/v2/manager/raftselector/raftselector.go deleted file mode 100644 index 47adcf0fd9..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/manager/raftselector/raftselector.go +++ /dev/null @@ -1,19 +0,0 @@ -package raftselector - -import ( - "context" - "errors" - - "google.golang.org/grpc" -) - -// ConnProvider is basic interface for connecting API package(raft proxy in particular) -// to manager/state/raft package without import cycles. It provides only one -// method for obtaining connection to leader. -type ConnProvider interface { - LeaderConn(ctx context.Context) (*grpc.ClientConn, error) -} - -// ErrIsLeader is returned from LeaderConn method when current machine is leader. -// It's just shim between packages to avoid import cycles. -var ErrIsLeader = errors.New("current node is leader") diff --git a/vendor/github.com/moby/swarmkit/v2/protobuf/plugin/helpers.go b/vendor/github.com/moby/swarmkit/v2/protobuf/plugin/helpers.go deleted file mode 100644 index daea795b36..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/protobuf/plugin/helpers.go +++ /dev/null @@ -1,11 +0,0 @@ -package plugin - -import ( - "github.com/gogo/protobuf/proto" - google_protobuf "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" -) - -// DeepcopyEnabled returns true if deepcopy is enabled for the descriptor. -func DeepcopyEnabled(options *google_protobuf.MessageOptions) bool { - return proto.GetBoolExtension(options, E_Deepcopy, true) -} diff --git a/vendor/github.com/moby/swarmkit/v2/protobuf/plugin/plugin.pb.go b/vendor/github.com/moby/swarmkit/v2/protobuf/plugin/plugin.pb.go deleted file mode 100644 index d947c8b530..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/protobuf/plugin/plugin.pb.go +++ /dev/null @@ -1,1273 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/docker/swarmkit/protobuf/plugin/plugin.proto - -package plugin - -import ( - fmt "fmt" - github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" - proto "github.com/gogo/protobuf/proto" - descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" - github_com_moby_swarmkit_v2_api_deepcopy "github.com/moby/swarmkit/v2/api/deepcopy" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type WatchSelectors struct { - // supported by all object types - ID *bool `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - IDPrefix *bool `protobuf:"varint,2,opt,name=id_prefix,json=idPrefix" json:"id_prefix,omitempty"` - Name *bool `protobuf:"varint,3,opt,name=name" json:"name,omitempty"` - NamePrefix *bool `protobuf:"varint,4,opt,name=name_prefix,json=namePrefix" json:"name_prefix,omitempty"` - Custom *bool `protobuf:"varint,5,opt,name=custom" json:"custom,omitempty"` - CustomPrefix *bool `protobuf:"varint,6,opt,name=custom_prefix,json=customPrefix" json:"custom_prefix,omitempty"` - // supported by tasks only - ServiceID *bool `protobuf:"varint,7,opt,name=service_id,json=serviceId" json:"service_id,omitempty"` - NodeID *bool `protobuf:"varint,8,opt,name=node_id,json=nodeId" json:"node_id,omitempty"` - Slot *bool `protobuf:"varint,9,opt,name=slot" json:"slot,omitempty"` - DesiredState *bool `protobuf:"varint,10,opt,name=desired_state,json=desiredState" json:"desired_state,omitempty"` - // supported by nodes only - Role *bool `protobuf:"varint,11,opt,name=role" json:"role,omitempty"` - Membership *bool `protobuf:"varint,12,opt,name=membership" json:"membership,omitempty"` - // supported by: resource - Kind *bool `protobuf:"varint,13,opt,name=kind" json:"kind,omitempty"` -} - -func (m *WatchSelectors) Reset() { *m = WatchSelectors{} } -func (*WatchSelectors) ProtoMessage() {} -func (*WatchSelectors) Descriptor() ([]byte, []int) { - return fileDescriptor_3708583e03e1c1e3, []int{0} -} -func (m *WatchSelectors) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WatchSelectors) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WatchSelectors.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *WatchSelectors) XXX_Merge(src proto.Message) { - xxx_messageInfo_WatchSelectors.Merge(m, src) -} -func (m *WatchSelectors) XXX_Size() int { - return m.Size() -} -func (m *WatchSelectors) XXX_DiscardUnknown() { - xxx_messageInfo_WatchSelectors.DiscardUnknown(m) -} - -var xxx_messageInfo_WatchSelectors proto.InternalMessageInfo - -type StoreObject struct { - WatchSelectors *WatchSelectors `protobuf:"bytes,1,req,name=watch_selectors,json=watchSelectors" json:"watch_selectors,omitempty"` -} - -func (m *StoreObject) Reset() { *m = StoreObject{} } -func (*StoreObject) ProtoMessage() {} -func (*StoreObject) Descriptor() ([]byte, []int) { - return fileDescriptor_3708583e03e1c1e3, []int{1} -} -func (m *StoreObject) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StoreObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StoreObject.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StoreObject) XXX_Merge(src proto.Message) { - xxx_messageInfo_StoreObject.Merge(m, src) -} -func (m *StoreObject) XXX_Size() int { - return m.Size() -} -func (m *StoreObject) XXX_DiscardUnknown() { - xxx_messageInfo_StoreObject.DiscardUnknown(m) -} - -var xxx_messageInfo_StoreObject proto.InternalMessageInfo - -type TLSAuthorization struct { - // Roles contains the acceptable TLS OU roles for the handler. - Roles []string `protobuf:"bytes,1,rep,name=roles" json:"roles,omitempty"` - // Insecure is set to true if this method does not require - // authorization. NOTE: Specifying both "insecure" and a nonempty - // list of roles is invalid. This would fail at codegen time. - Insecure *bool `protobuf:"varint,2,opt,name=insecure" json:"insecure,omitempty"` -} - -func (m *TLSAuthorization) Reset() { *m = TLSAuthorization{} } -func (*TLSAuthorization) ProtoMessage() {} -func (*TLSAuthorization) Descriptor() ([]byte, []int) { - return fileDescriptor_3708583e03e1c1e3, []int{2} -} -func (m *TLSAuthorization) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TLSAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TLSAuthorization.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TLSAuthorization) XXX_Merge(src proto.Message) { - xxx_messageInfo_TLSAuthorization.Merge(m, src) -} -func (m *TLSAuthorization) XXX_Size() int { - return m.Size() -} -func (m *TLSAuthorization) XXX_DiscardUnknown() { - xxx_messageInfo_TLSAuthorization.DiscardUnknown(m) -} - -var xxx_messageInfo_TLSAuthorization proto.InternalMessageInfo - -var E_Deepcopy = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 70000, - Name: "docker.protobuf.plugin.deepcopy", - Tag: "varint,70000,opt,name=deepcopy,def=1", - Filename: "github.com/docker/swarmkit/protobuf/plugin/plugin.proto", -} - -var E_StoreObject = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*StoreObject)(nil), - Field: 70001, - Name: "docker.protobuf.plugin.store_object", - Tag: "bytes,70001,opt,name=store_object", - Filename: "github.com/docker/swarmkit/protobuf/plugin/plugin.proto", -} - -var E_TlsAuthorization = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MethodOptions)(nil), - ExtensionType: (*TLSAuthorization)(nil), - Field: 73626345, - Name: "docker.protobuf.plugin.tls_authorization", - Tag: "bytes,73626345,opt,name=tls_authorization", - Filename: "github.com/docker/swarmkit/protobuf/plugin/plugin.proto", -} - -func init() { - proto.RegisterType((*WatchSelectors)(nil), "docker.protobuf.plugin.WatchSelectors") - proto.RegisterType((*StoreObject)(nil), "docker.protobuf.plugin.StoreObject") - proto.RegisterType((*TLSAuthorization)(nil), "docker.protobuf.plugin.TLSAuthorization") - proto.RegisterExtension(E_Deepcopy) - proto.RegisterExtension(E_StoreObject) - proto.RegisterExtension(E_TlsAuthorization) -} - -func init() { - proto.RegisterFile("github.com/docker/swarmkit/protobuf/plugin/plugin.proto", fileDescriptor_3708583e03e1c1e3) -} - -var fileDescriptor_3708583e03e1c1e3 = []byte{ - // 588 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x41, 0x6f, 0xd3, 0x4c, - 0x10, 0x8d, 0xd3, 0x36, 0x4d, 0x26, 0x69, 0xbf, 0x7e, 0x2b, 0x54, 0x59, 0x3d, 0x38, 0x55, 0x83, - 0x50, 0x90, 0x90, 0x23, 0xf5, 0x82, 0x94, 0x1b, 0x25, 0x97, 0x48, 0x40, 0x91, 0x83, 0xc4, 0x8d, - 0xc8, 0xf1, 0x4e, 0x93, 0xa5, 0x8e, 0xd7, 0xda, 0x5d, 0xd3, 0xc2, 0x89, 0x3f, 0x80, 0xc4, 0x95, - 0x2b, 0xbf, 0xa6, 0xc7, 0x1e, 0x7b, 0x8a, 0xa8, 0x23, 0x0e, 0xdc, 0xe0, 0x1f, 0xa0, 0xdd, 0x75, - 0x1a, 0x82, 0x5a, 0x71, 0xf2, 0xcc, 0x9b, 0xf7, 0x66, 0xe6, 0xed, 0x18, 0x1e, 0x8f, 0x99, 0x9a, - 0x64, 0x23, 0x3f, 0xe2, 0xd3, 0x0e, 0xe5, 0xd1, 0x29, 0x8a, 0x8e, 0x3c, 0x0b, 0xc5, 0xf4, 0x94, - 0xa9, 0x4e, 0x2a, 0xb8, 0xe2, 0xa3, 0xec, 0xa4, 0x93, 0xc6, 0xd9, 0x98, 0x25, 0xc5, 0xc7, 0x37, - 0x30, 0xd9, 0xb5, 0x6c, 0x7f, 0x41, 0xf2, 0x6d, 0x75, 0x6f, 0x7f, 0xcc, 0xf9, 0x38, 0xc6, 0xa5, - 0x98, 0xa2, 0x8c, 0x04, 0x4b, 0x15, 0x2f, 0xb8, 0x07, 0x5f, 0xd6, 0x60, 0xfb, 0x75, 0xa8, 0xa2, - 0xc9, 0x00, 0x63, 0x8c, 0x14, 0x17, 0x92, 0xec, 0x42, 0x99, 0x51, 0xd7, 0xd9, 0x77, 0xda, 0xd5, - 0xa3, 0x4a, 0x3e, 0x6b, 0x96, 0xfb, 0xbd, 0xa0, 0xcc, 0x28, 0x79, 0x08, 0x35, 0x46, 0x87, 0xa9, - 0xc0, 0x13, 0x76, 0xee, 0x96, 0x4d, 0xb9, 0x91, 0xcf, 0x9a, 0xd5, 0x7e, 0xef, 0xa5, 0xc1, 0x82, - 0x2a, 0xa3, 0x36, 0x22, 0x04, 0xd6, 0x93, 0x70, 0x8a, 0xee, 0x9a, 0x66, 0x05, 0x26, 0x26, 0x4d, - 0xa8, 0xeb, 0xef, 0xa2, 0xc1, 0xba, 0x29, 0x81, 0x86, 0x0a, 0xd1, 0x2e, 0x54, 0xa2, 0x4c, 0x2a, - 0x3e, 0x75, 0x37, 0x4c, 0xad, 0xc8, 0x48, 0x0b, 0xb6, 0x6c, 0xb4, 0x90, 0x56, 0x4c, 0xb9, 0x61, - 0xc1, 0x42, 0xfc, 0x08, 0x40, 0xa2, 0x78, 0xc7, 0x22, 0x1c, 0x32, 0xea, 0x6e, 0x9a, 0xed, 0xb6, - 0xf2, 0x59, 0xb3, 0x36, 0xb0, 0x68, 0xbf, 0x17, 0xd4, 0x0a, 0x42, 0x9f, 0x92, 0x16, 0x6c, 0x26, - 0x9c, 0x1a, 0x6a, 0xd5, 0x50, 0x21, 0x9f, 0x35, 0x2b, 0x2f, 0x38, 0xd5, 0xbc, 0x8a, 0x2e, 0xf5, - 0xa9, 0x36, 0x21, 0x63, 0xae, 0xdc, 0x9a, 0x35, 0xa1, 0x63, 0xbd, 0x0b, 0x45, 0xc9, 0x04, 0xd2, - 0xa1, 0x54, 0xa1, 0x42, 0x17, 0xec, 0x2e, 0x05, 0x38, 0xd0, 0x98, 0x16, 0x0a, 0x1e, 0xa3, 0x5b, - 0xb7, 0x42, 0x1d, 0x13, 0x0f, 0x60, 0x8a, 0xd3, 0x11, 0x0a, 0x39, 0x61, 0xa9, 0xdb, 0xb0, 0xe6, - 0x97, 0x88, 0xd6, 0x9c, 0xb2, 0x84, 0xba, 0x5b, 0x56, 0xa3, 0xe3, 0x83, 0x37, 0x50, 0x1f, 0x28, - 0x2e, 0xf0, 0x78, 0xf4, 0x16, 0x23, 0x45, 0x8e, 0xe1, 0xbf, 0x33, 0x7d, 0xa9, 0xa1, 0x5c, 0x9c, - 0xca, 0x75, 0xf6, 0xcb, 0xed, 0xfa, 0xe1, 0x03, 0xff, 0xf6, 0xf3, 0xfb, 0xab, 0x87, 0x0d, 0xb6, - 0xcf, 0x56, 0xf2, 0x83, 0x1e, 0xec, 0xbc, 0x7a, 0x36, 0x78, 0x92, 0xa9, 0x09, 0x17, 0xec, 0x43, - 0xa8, 0x18, 0x4f, 0xc8, 0x3d, 0xd8, 0xd0, 0xfb, 0xea, 0xd6, 0x6b, 0xed, 0x5a, 0x60, 0x13, 0xb2, - 0x07, 0x55, 0x96, 0x48, 0x8c, 0x32, 0x81, 0xf6, 0xf2, 0xc1, 0x4d, 0xde, 0x7d, 0x0a, 0x55, 0x8a, - 0x98, 0x46, 0x3c, 0x7d, 0x4f, 0x9a, 0xbe, 0xfd, 0xe1, 0x96, 0x9b, 0x3c, 0x47, 0x29, 0xc3, 0x31, - 0x1e, 0xa7, 0xba, 0xbb, 0x74, 0x7f, 0x7e, 0x35, 0x77, 0xef, 0xae, 0x2b, 0x91, 0x61, 0x70, 0x23, - 0xec, 0x32, 0x68, 0x48, 0x6d, 0x75, 0xc8, 0xad, 0xd7, 0x7f, 0x36, 0xfa, 0x65, 0x1a, 0xd5, 0x0f, - 0x5b, 0x77, 0x79, 0xff, 0xe3, 0xe5, 0x82, 0xba, 0x5c, 0x26, 0xdd, 0x73, 0xf8, 0x5f, 0xc5, 0x72, - 0x18, 0xae, 0xd8, 0xf6, 0x6e, 0x99, 0xa7, 0x26, 0x9c, 0x2e, 0xc6, 0xfd, 0xf8, 0xfe, 0xa9, 0x65, - 0xe6, 0xb5, 0xef, 0x9a, 0xf7, 0xf7, 0x4b, 0x06, 0x3b, 0x2a, 0x96, 0x2b, 0xc8, 0xd1, 0xfd, 0x8b, - 0x6b, 0xaf, 0x74, 0x75, 0xed, 0x95, 0x3e, 0xe6, 0x9e, 0x73, 0x91, 0x7b, 0xce, 0x65, 0xee, 0x39, - 0xdf, 0x72, 0xcf, 0xf9, 0x3c, 0xf7, 0x4a, 0x97, 0x73, 0xaf, 0x74, 0x35, 0xf7, 0x4a, 0xbf, 0x03, - 0x00, 0x00, 0xff, 0xff, 0x0f, 0x50, 0xb9, 0xa3, 0x05, 0x04, 0x00, 0x00, -} - -func (m *WatchSelectors) Copy() *WatchSelectors { - if m == nil { - return nil - } - o := &WatchSelectors{} - o.CopyFrom(m) - return o -} - -func (m *WatchSelectors) CopyFrom(src interface{}) { - - o := src.(*WatchSelectors) - *m = *o -} - -func (m *StoreObject) Copy() *StoreObject { - if m == nil { - return nil - } - o := &StoreObject{} - o.CopyFrom(m) - return o -} - -func (m *StoreObject) CopyFrom(src interface{}) { - - o := src.(*StoreObject) - *m = *o - if o.WatchSelectors != nil { - m.WatchSelectors = &WatchSelectors{} - github_com_moby_swarmkit_v2_api_deepcopy.Copy(m.WatchSelectors, o.WatchSelectors) - } -} - -func (m *TLSAuthorization) Copy() *TLSAuthorization { - if m == nil { - return nil - } - o := &TLSAuthorization{} - o.CopyFrom(m) - return o -} - -func (m *TLSAuthorization) CopyFrom(src interface{}) { - - o := src.(*TLSAuthorization) - *m = *o - if o.Roles != nil { - m.Roles = make([]string, len(o.Roles)) - copy(m.Roles, o.Roles) - } - -} - -func (m *WatchSelectors) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchSelectors) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchSelectors) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Kind != nil { - i-- - if *m.Kind { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x68 - } - if m.Membership != nil { - i-- - if *m.Membership { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x60 - } - if m.Role != nil { - i-- - if *m.Role { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x58 - } - if m.DesiredState != nil { - i-- - if *m.DesiredState { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x50 - } - if m.Slot != nil { - i-- - if *m.Slot { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x48 - } - if m.NodeID != nil { - i-- - if *m.NodeID { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if m.ServiceID != nil { - i-- - if *m.ServiceID { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - if m.CustomPrefix != nil { - i-- - if *m.CustomPrefix { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if m.Custom != nil { - i-- - if *m.Custom { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.NamePrefix != nil { - i-- - if *m.NamePrefix { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.Name != nil { - i-- - if *m.Name { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.IDPrefix != nil { - i-- - if *m.IDPrefix { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.ID != nil { - i-- - if *m.ID { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *StoreObject) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StoreObject) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreObject) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.WatchSelectors == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("watch_selectors") - } else { - { - size, err := m.WatchSelectors.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPlugin(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TLSAuthorization) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TLSAuthorization) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TLSAuthorization) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Insecure != nil { - i-- - if *m.Insecure { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.Roles) > 0 { - for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Roles[iNdEx]) - copy(dAtA[i:], m.Roles[iNdEx]) - i = encodeVarintPlugin(dAtA, i, uint64(len(m.Roles[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintPlugin(dAtA []byte, offset int, v uint64) int { - offset -= sovPlugin(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *WatchSelectors) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != nil { - n += 2 - } - if m.IDPrefix != nil { - n += 2 - } - if m.Name != nil { - n += 2 - } - if m.NamePrefix != nil { - n += 2 - } - if m.Custom != nil { - n += 2 - } - if m.CustomPrefix != nil { - n += 2 - } - if m.ServiceID != nil { - n += 2 - } - if m.NodeID != nil { - n += 2 - } - if m.Slot != nil { - n += 2 - } - if m.DesiredState != nil { - n += 2 - } - if m.Role != nil { - n += 2 - } - if m.Membership != nil { - n += 2 - } - if m.Kind != nil { - n += 2 - } - return n -} - -func (m *StoreObject) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.WatchSelectors != nil { - l = m.WatchSelectors.Size() - n += 1 + l + sovPlugin(uint64(l)) - } - return n -} - -func (m *TLSAuthorization) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Roles) > 0 { - for _, s := range m.Roles { - l = len(s) - n += 1 + l + sovPlugin(uint64(l)) - } - } - if m.Insecure != nil { - n += 2 - } - return n -} - -func sovPlugin(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozPlugin(x uint64) (n int) { - return sovPlugin(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *WatchSelectors) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&WatchSelectors{`, - `ID:` + valueToStringPlugin(this.ID) + `,`, - `IDPrefix:` + valueToStringPlugin(this.IDPrefix) + `,`, - `Name:` + valueToStringPlugin(this.Name) + `,`, - `NamePrefix:` + valueToStringPlugin(this.NamePrefix) + `,`, - `Custom:` + valueToStringPlugin(this.Custom) + `,`, - `CustomPrefix:` + valueToStringPlugin(this.CustomPrefix) + `,`, - `ServiceID:` + valueToStringPlugin(this.ServiceID) + `,`, - `NodeID:` + valueToStringPlugin(this.NodeID) + `,`, - `Slot:` + valueToStringPlugin(this.Slot) + `,`, - `DesiredState:` + valueToStringPlugin(this.DesiredState) + `,`, - `Role:` + valueToStringPlugin(this.Role) + `,`, - `Membership:` + valueToStringPlugin(this.Membership) + `,`, - `Kind:` + valueToStringPlugin(this.Kind) + `,`, - `}`, - }, "") - return s -} -func (this *StoreObject) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StoreObject{`, - `WatchSelectors:` + strings.Replace(this.WatchSelectors.String(), "WatchSelectors", "WatchSelectors", 1) + `,`, - `}`, - }, "") - return s -} -func (this *TLSAuthorization) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TLSAuthorization{`, - `Roles:` + fmt.Sprintf("%v", this.Roles) + `,`, - `Insecure:` + valueToStringPlugin(this.Insecure) + `,`, - `}`, - }, "") - return s -} -func valueToStringPlugin(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *WatchSelectors) Unmarshal(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 ErrIntOverflowPlugin - } - 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: WatchSelectors: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchSelectors: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.ID = &b - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IDPrefix", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.IDPrefix = &b - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Name = &b - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NamePrefix", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.NamePrefix = &b - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Custom", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Custom = &b - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CustomPrefix", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.CustomPrefix = &b - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.ServiceID = &b - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.NodeID = &b - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Slot = &b - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredState", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.DesiredState = &b - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Role = &b - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Membership", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Membership = &b - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Kind = &b - default: - iNdEx = preIndex - skippy, err := skipPlugin(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPlugin - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StoreObject) Unmarshal(dAtA []byte) error { - var hasFields [1]uint64 - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - 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: StoreObject: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StoreObject: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WatchSelectors", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPlugin - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPlugin - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.WatchSelectors == nil { - m.WatchSelectors = &WatchSelectors{} - } - if err := m.WatchSelectors.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - iNdEx = preIndex - skippy, err := skipPlugin(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPlugin - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("watch_selectors") - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TLSAuthorization) Unmarshal(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 ErrIntOverflowPlugin - } - 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: TLSAuthorization: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TLSAuthorization: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPlugin - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPlugin - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Insecure", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlugin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Insecure = &b - default: - iNdEx = preIndex - skippy, err := skipPlugin(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPlugin - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipPlugin(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPlugin - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPlugin - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPlugin - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthPlugin - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupPlugin - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthPlugin - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthPlugin = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPlugin = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupPlugin = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/moby/swarmkit/v2/protobuf/plugin/plugin.proto b/vendor/github.com/moby/swarmkit/v2/protobuf/plugin/plugin.proto deleted file mode 100644 index 312517d718..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/protobuf/plugin/plugin.proto +++ /dev/null @@ -1,53 +0,0 @@ -syntax = "proto2"; - -package docker.protobuf.plugin; - -import "google/protobuf/descriptor.proto"; - -message WatchSelectors { - // supported by all object types - optional bool id = 1; - optional bool id_prefix = 2; - optional bool name = 3; - optional bool name_prefix = 4; - optional bool custom = 5; - optional bool custom_prefix = 6; - - // supported by tasks only - optional bool service_id = 7; - optional bool node_id = 8; - optional bool slot = 9; - optional bool desired_state = 10; - - // supported by nodes only - optional bool role = 11; - optional bool membership = 12; - - // supported by: resource - optional bool kind = 13; -} - -message StoreObject { - required WatchSelectors watch_selectors = 1; -} - -extend google.protobuf.MessageOptions { - optional bool deepcopy = 70000 [default=true]; - optional StoreObject store_object = 70001; -} - -message TLSAuthorization { - // Roles contains the acceptable TLS OU roles for the handler. - repeated string roles = 1; - - // Insecure is set to true if this method does not require - // authorization. NOTE: Specifying both "insecure" and a nonempty - // list of roles is invalid. This would fail at codegen time. - optional bool insecure = 2; -} - -extend google.protobuf.MethodOptions { - // TLSAuthorization contains the authorization parameters for this - // method. - optional TLSAuthorization tls_authorization = 73626345; -} diff --git a/vendor/github.com/moby/swarmkit/v2/protobuf/ptypes/doc.go b/vendor/github.com/moby/swarmkit/v2/protobuf/ptypes/doc.go deleted file mode 100644 index b997ca1712..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/protobuf/ptypes/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package ptypes provides utility functions for use with -// gogo/protobuf/ptypes. -package ptypes diff --git a/vendor/github.com/moby/swarmkit/v2/protobuf/ptypes/timestamp.go b/vendor/github.com/moby/swarmkit/v2/protobuf/ptypes/timestamp.go deleted file mode 100644 index 3890384cfc..0000000000 --- a/vendor/github.com/moby/swarmkit/v2/protobuf/ptypes/timestamp.go +++ /dev/null @@ -1,17 +0,0 @@ -package ptypes - -import ( - "time" - - gogotypes "github.com/gogo/protobuf/types" -) - -// MustTimestampProto converts time.Time to a google.protobuf.Timestamp proto. -// It panics if input timestamp is invalid. -func MustTimestampProto(t time.Time) *gogotypes.Timestamp { - ts, err := gogotypes.TimestampProto(t) - if err != nil { - panic(err.Error()) - } - return ts -} diff --git a/vendor/github.com/opencontainers/image-spec/identity/chainid.go b/vendor/github.com/opencontainers/image-spec/identity/chainid.go deleted file mode 100644 index 0bb2853573..0000000000 --- a/vendor/github.com/opencontainers/image-spec/identity/chainid.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2016 The Linux Foundation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package identity provides implementations of subtle calculations pertaining -// to image and layer identity. The primary item present here is the ChainID -// calculation used in identifying the result of subsequent layer applications. -// -// Helpers are also provided here to ease transition to the -// github.com/opencontainers/go-digest package, but that package may be used -// directly. -package identity - -import "github.com/opencontainers/go-digest" - -// ChainID takes a slice of digests and returns the ChainID corresponding to -// the last entry. Typically, these are a list of layer DiffIDs, with the -// result providing the ChainID identifying the result of sequential -// application of the preceding layers. -func ChainID(dgsts []digest.Digest) digest.Digest { - chainIDs := make([]digest.Digest, len(dgsts)) - copy(chainIDs, dgsts) - ChainIDs(chainIDs) - - if len(chainIDs) == 0 { - return "" - } - return chainIDs[len(chainIDs)-1] -} - -// ChainIDs calculates the recursively applied chain id for each identifier in -// the slice. The result is written direcly back into the slice such that the -// ChainID for each item will be in the respective position. -// -// By definition of ChainID, the zeroth element will always be the same before -// and after the call. -// -// As an example, given the chain of ids `[A, B, C]`, the result `[A, -// ChainID(A|B), ChainID(A|B|C)]` will be written back to the slice. -// -// The input is provided as a return value for convenience. -// -// Typically, these are a list of layer DiffIDs, with the -// result providing the ChainID for each the result of each layer application -// sequentially. -func ChainIDs(dgsts []digest.Digest) []digest.Digest { - if len(dgsts) < 2 { - return dgsts - } - - parent := digest.FromBytes([]byte(dgsts[0] + " " + dgsts[1])) - next := dgsts[1:] - next[0] = parent - ChainIDs(next) - - return dgsts -} diff --git a/vendor/github.com/opencontainers/image-spec/identity/helpers.go b/vendor/github.com/opencontainers/image-spec/identity/helpers.go deleted file mode 100644 index 9d96eaa981..0000000000 --- a/vendor/github.com/opencontainers/image-spec/identity/helpers.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2016 The Linux Foundation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package identity - -import ( - _ "crypto/sha256" // side-effect to install impls, sha256 - _ "crypto/sha512" // side-effect to install impls, sha384/sh512 - - "io" - - digest "github.com/opencontainers/go-digest" -) - -// FromReader consumes the content of rd until io.EOF, returning canonical -// digest. -func FromReader(rd io.Reader) (digest.Digest, error) { - return digest.Canonical.FromReader(rd) -} - -// FromBytes digests the input and returns a Digest. -func FromBytes(p []byte) digest.Digest { - return digest.Canonical.FromBytes(p) -} - -// FromString digests the input and returns a Digest. -func FromString(s string) digest.Digest { - return digest.Canonical.FromString(s) -} diff --git a/vendor/github.com/opencontainers/runtime-spec/specs-go/features/features.go b/vendor/github.com/opencontainers/runtime-spec/specs-go/features/features.go deleted file mode 100644 index 949f532b65..0000000000 --- a/vendor/github.com/opencontainers/runtime-spec/specs-go/features/features.go +++ /dev/null @@ -1,145 +0,0 @@ -// Package features provides the Features struct. -package features - -// Features represents the supported features of the runtime. -type Features struct { - // OCIVersionMin is the minimum OCI Runtime Spec version recognized by the runtime, e.g., "1.0.0". - OCIVersionMin string `json:"ociVersionMin,omitempty"` - - // OCIVersionMax is the maximum OCI Runtime Spec version recognized by the runtime, e.g., "1.0.2-dev". - OCIVersionMax string `json:"ociVersionMax,omitempty"` - - // Hooks is the list of the recognized hook names, e.g., "createRuntime". - // Nil value means "unknown", not "no support for any hook". - Hooks []string `json:"hooks,omitempty"` - - // MountOptions is the list of the recognized mount options, e.g., "ro". - // Nil value means "unknown", not "no support for any mount option". - // This list does not contain filesystem-specific options passed to mount(2) syscall as (const void *). - MountOptions []string `json:"mountOptions,omitempty"` - - // Linux is specific to Linux. - Linux *Linux `json:"linux,omitempty"` - - // Annotations contains implementation-specific annotation strings, - // such as the implementation version, and third-party extensions. - Annotations map[string]string `json:"annotations,omitempty"` - - // PotentiallyUnsafeConfigAnnotations the list of the potential unsafe annotations - // that may appear in `config.json`. - // - // A value that ends with "." is interpreted as a prefix of annotations. - PotentiallyUnsafeConfigAnnotations []string `json:"potentiallyUnsafeConfigAnnotations,omitempty"` -} - -// Linux is specific to Linux. -type Linux struct { - // Namespaces is the list of the recognized namespaces, e.g., "mount". - // Nil value means "unknown", not "no support for any namespace". - Namespaces []string `json:"namespaces,omitempty"` - - // Capabilities is the list of the recognized capabilities , e.g., "CAP_SYS_ADMIN". - // Nil value means "unknown", not "no support for any capability". - Capabilities []string `json:"capabilities,omitempty"` - - Cgroup *Cgroup `json:"cgroup,omitempty"` - Seccomp *Seccomp `json:"seccomp,omitempty"` - Apparmor *Apparmor `json:"apparmor,omitempty"` - Selinux *Selinux `json:"selinux,omitempty"` - IntelRdt *IntelRdt `json:"intelRdt,omitempty"` - MountExtensions *MountExtensions `json:"mountExtensions,omitempty"` -} - -// Cgroup represents the "cgroup" field. -type Cgroup struct { - // V1 represents whether Cgroup v1 support is compiled in. - // Unrelated to whether the host uses cgroup v1 or not. - // Nil value means "unknown", not "false". - V1 *bool `json:"v1,omitempty"` - - // V2 represents whether Cgroup v2 support is compiled in. - // Unrelated to whether the host uses cgroup v2 or not. - // Nil value means "unknown", not "false". - V2 *bool `json:"v2,omitempty"` - - // Systemd represents whether systemd-cgroup support is compiled in. - // Unrelated to whether the host uses systemd or not. - // Nil value means "unknown", not "false". - Systemd *bool `json:"systemd,omitempty"` - - // SystemdUser represents whether user-scoped systemd-cgroup support is compiled in. - // Unrelated to whether the host uses systemd or not. - // Nil value means "unknown", not "false". - SystemdUser *bool `json:"systemdUser,omitempty"` - - // Rdma represents whether RDMA cgroup support is compiled in. - // Unrelated to whether the host supports RDMA or not. - // Nil value means "unknown", not "false". - Rdma *bool `json:"rdma,omitempty"` -} - -// Seccomp represents the "seccomp" field. -type Seccomp struct { - // Enabled is true if seccomp support is compiled in. - // Nil value means "unknown", not "false". - Enabled *bool `json:"enabled,omitempty"` - - // Actions is the list of the recognized actions, e.g., "SCMP_ACT_NOTIFY". - // Nil value means "unknown", not "no support for any action". - Actions []string `json:"actions,omitempty"` - - // Operators is the list of the recognized operators, e.g., "SCMP_CMP_NE". - // Nil value means "unknown", not "no support for any operator". - Operators []string `json:"operators,omitempty"` - - // Archs is the list of the recognized archs, e.g., "SCMP_ARCH_X86_64". - // Nil value means "unknown", not "no support for any arch". - Archs []string `json:"archs,omitempty"` - - // KnownFlags is the list of the recognized filter flags, e.g., "SECCOMP_FILTER_FLAG_LOG". - // Nil value means "unknown", not "no flags are recognized". - KnownFlags []string `json:"knownFlags,omitempty"` - - // SupportedFlags is the list of the supported filter flags, e.g., "SECCOMP_FILTER_FLAG_LOG". - // This list may be a subset of KnownFlags due to some flags - // not supported by the current kernel and/or libseccomp. - // Nil value means "unknown", not "no flags are supported". - SupportedFlags []string `json:"supportedFlags,omitempty"` -} - -// Apparmor represents the "apparmor" field. -type Apparmor struct { - // Enabled is true if AppArmor support is compiled in. - // Unrelated to whether the host supports AppArmor or not. - // Nil value means "unknown", not "false". - Enabled *bool `json:"enabled,omitempty"` -} - -// Selinux represents the "selinux" field. -type Selinux struct { - // Enabled is true if SELinux support is compiled in. - // Unrelated to whether the host supports SELinux or not. - // Nil value means "unknown", not "false". - Enabled *bool `json:"enabled,omitempty"` -} - -// IntelRdt represents the "intelRdt" field. -type IntelRdt struct { - // Enabled is true if Intel RDT support is compiled in. - // Unrelated to whether the host supports Intel RDT or not. - // Nil value means "unknown", not "false". - Enabled *bool `json:"enabled,omitempty"` -} - -// MountExtensions represents the "mountExtensions" field. -type MountExtensions struct { - // IDMap represents the status of idmap mounts support. - IDMap *IDMap `json:"idmap,omitempty"` -} - -type IDMap struct { - // Enabled represents whether idmap mounts supports is compiled in. - // Unrelated to whether the host supports it or not. - // Nil value means "unknown", not "false". - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/vendor/github.com/opencontainers/selinux/LICENSE b/vendor/github.com/opencontainers/selinux/LICENSE deleted file mode 100644 index 8dada3edaf..0000000000 --- a/vendor/github.com/opencontainers/selinux/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/doc.go b/vendor/github.com/opencontainers/selinux/go-selinux/doc.go deleted file mode 100644 index 57a15c9a11..0000000000 --- a/vendor/github.com/opencontainers/selinux/go-selinux/doc.go +++ /dev/null @@ -1,13 +0,0 @@ -/* -Package selinux provides a high-level interface for interacting with selinux. - -Usage: - - import "github.com/opencontainers/selinux/go-selinux" - - // Ensure that selinux is enforcing mode. - if selinux.EnforceMode() != selinux.Enforcing { - selinux.SetEnforceMode(selinux.Enforcing) - } -*/ -package selinux diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/label/label.go b/vendor/github.com/opencontainers/selinux/go-selinux/label/label.go deleted file mode 100644 index 884a8b8059..0000000000 --- a/vendor/github.com/opencontainers/selinux/go-selinux/label/label.go +++ /dev/null @@ -1,48 +0,0 @@ -package label - -import ( - "fmt" - - "github.com/opencontainers/selinux/go-selinux" -) - -// Init initialises the labeling system -func Init() { - _ = selinux.GetEnabled() -} - -// FormatMountLabel returns a string to be used by the mount command. Using -// the SELinux `context` mount option. Changing labels of files on mount -// points with this option can never be changed. -// FormatMountLabel returns a string to be used by the mount command. -// The format of this string will be used to alter the labeling of the mountpoint. -// The string returned is suitable to be used as the options field of the mount command. -// If you need to have additional mount point options, you can pass them in as -// the first parameter. Second parameter is the label that you wish to apply -// to all content in the mount point. -func FormatMountLabel(src, mountLabel string) string { - return FormatMountLabelByType(src, mountLabel, "context") -} - -// FormatMountLabelByType returns a string to be used by the mount command. -// Allow caller to specify the mount options. For example using the SELinux -// `fscontext` mount option would allow certain container processes to change -// labels of files created on the mount points, where as `context` option does -// not. -// FormatMountLabelByType returns a string to be used by the mount command. -// The format of this string will be used to alter the labeling of the mountpoint. -// The string returned is suitable to be used as the options field of the mount command. -// If you need to have additional mount point options, you can pass them in as -// the first parameter. Second parameter is the label that you wish to apply -// to all content in the mount point. -func FormatMountLabelByType(src, mountLabel, contextType string) string { - if mountLabel != "" { - switch src { - case "": - src = fmt.Sprintf("%s=%q", contextType, mountLabel) - default: - src = fmt.Sprintf("%s,%s=%q", src, contextType, mountLabel) - } - } - return src -} diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go b/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go deleted file mode 100644 index 1258c98ce7..0000000000 --- a/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go +++ /dev/null @@ -1,136 +0,0 @@ -package label - -import ( - "errors" - "fmt" - "strings" - - "github.com/opencontainers/selinux/go-selinux" -) - -// Valid Label Options -var validOptions = map[string]bool{ - "disable": true, - "type": true, - "filetype": true, - "user": true, - "role": true, - "level": true, -} - -var ErrIncompatibleLabel = errors.New("Bad SELinux option z and Z can not be used together") - -// InitLabels returns the process label and file labels to be used within -// the container. A list of options can be passed into this function to alter -// the labels. The labels returned will include a random MCS String, that is -// guaranteed to be unique. -// If the disabled flag is passed in, the process label will not be set, but the mount label will be set -// to the container_file label with the maximum category. This label is not usable by any confined label. -func InitLabels(options []string) (plabel string, mlabel string, retErr error) { - if !selinux.GetEnabled() { - return "", "", nil - } - processLabel, mountLabel := selinux.ContainerLabels() - if processLabel != "" { - defer func() { - if retErr != nil { - selinux.ReleaseLabel(mountLabel) - } - }() - pcon, err := selinux.NewContext(processLabel) - if err != nil { - return "", "", err - } - mcsLevel := pcon["level"] - mcon, err := selinux.NewContext(mountLabel) - if err != nil { - return "", "", err - } - for _, opt := range options { - if opt == "disable" { - selinux.ReleaseLabel(mountLabel) - return "", selinux.PrivContainerMountLabel(), nil - } - if i := strings.Index(opt, ":"); i == -1 { - return "", "", fmt.Errorf("Bad label option %q, valid options 'disable' or \n'user, role, level, type, filetype' followed by ':' and a value", opt) - } - con := strings.SplitN(opt, ":", 2) - if !validOptions[con[0]] { - return "", "", fmt.Errorf("Bad label option %q, valid options 'disable, user, role, level, type, filetype'", con[0]) - } - if con[0] == "filetype" { - mcon["type"] = con[1] - continue - } - pcon[con[0]] = con[1] - if con[0] == "level" || con[0] == "user" { - mcon[con[0]] = con[1] - } - } - if pcon.Get() != processLabel { - if pcon["level"] != mcsLevel { - selinux.ReleaseLabel(processLabel) - } - processLabel = pcon.Get() - selinux.ReserveLabel(processLabel) - } - mountLabel = mcon.Get() - } - return processLabel, mountLabel, nil -} - -// SetFileLabel modifies the "path" label to the specified file label -func SetFileLabel(path string, fileLabel string) error { - if !selinux.GetEnabled() || fileLabel == "" { - return nil - } - return selinux.SetFileLabel(path, fileLabel) -} - -// SetFileCreateLabel tells the kernel the label for all files to be created -func SetFileCreateLabel(fileLabel string) error { - if !selinux.GetEnabled() { - return nil - } - return selinux.SetFSCreateLabel(fileLabel) -} - -// Relabel changes the label of path and all the entries beneath the path. -// It changes the MCS label to s0 if shared is true. -// This will allow all containers to share the content. -// -// The path itself is guaranteed to be relabeled last. -func Relabel(path string, fileLabel string, shared bool) error { - if !selinux.GetEnabled() || fileLabel == "" { - return nil - } - - if shared { - c, err := selinux.NewContext(fileLabel) - if err != nil { - return err - } - - c["level"] = "s0" - fileLabel = c.Get() - } - return selinux.Chcon(path, fileLabel, true) -} - -// Validate checks that the label does not include unexpected options -func Validate(label string) error { - if strings.Contains(label, "z") && strings.Contains(label, "Z") { - return ErrIncompatibleLabel - } - return nil -} - -// RelabelNeeded checks whether the user requested a relabel -func RelabelNeeded(label string) bool { - return strings.Contains(label, "z") || strings.Contains(label, "Z") -} - -// IsShared checks that the label includes a "shared" mark -func IsShared(label string) bool { - return strings.Contains(label, "z") -} diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/label/label_stub.go b/vendor/github.com/opencontainers/selinux/go-selinux/label/label_stub.go deleted file mode 100644 index 7a54afc5e6..0000000000 --- a/vendor/github.com/opencontainers/selinux/go-selinux/label/label_stub.go +++ /dev/null @@ -1,44 +0,0 @@ -//go:build !linux -// +build !linux - -package label - -// InitLabels returns the process label and file labels to be used within -// the container. A list of options can be passed into this function to alter -// the labels. -func InitLabels([]string) (string, string, error) { - return "", "", nil -} - -func SetFileLabel(string, string) error { - return nil -} - -func SetFileCreateLabel(string) error { - return nil -} - -func Relabel(string, string, bool) error { - return nil -} - -// DisableSecOpt returns a security opt that can disable labeling -// support for future container processes -func DisableSecOpt() []string { - return nil -} - -// Validate checks that the label does not include unexpected options -func Validate(string) error { - return nil -} - -// RelabelNeeded checks whether the user requested a relabel -func RelabelNeeded(string) bool { - return false -} - -// IsShared checks that the label includes a "shared" mark -func IsShared(string) bool { - return false -} diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/selinux.go b/vendor/github.com/opencontainers/selinux/go-selinux/selinux.go deleted file mode 100644 index 9f0740ef6f..0000000000 --- a/vendor/github.com/opencontainers/selinux/go-selinux/selinux.go +++ /dev/null @@ -1,322 +0,0 @@ -package selinux - -import ( - "errors" -) - -const ( - // Enforcing constant indicate SELinux is in enforcing mode - Enforcing = 1 - // Permissive constant to indicate SELinux is in permissive mode - Permissive = 0 - // Disabled constant to indicate SELinux is disabled - Disabled = -1 - // maxCategory is the maximum number of categories used within containers - maxCategory = 1024 - // DefaultCategoryRange is the upper bound on the category range - DefaultCategoryRange = uint32(maxCategory) -) - -var ( - // ErrMCSAlreadyExists is returned when trying to allocate a duplicate MCS. - ErrMCSAlreadyExists = errors.New("MCS label already exists") - // ErrEmptyPath is returned when an empty path has been specified. - ErrEmptyPath = errors.New("empty path") - - // ErrInvalidLabel is returned when an invalid label is specified. - ErrInvalidLabel = errors.New("invalid Label") - - // InvalidLabel is returned when an invalid label is specified. - // - // Deprecated: use [ErrInvalidLabel]. - InvalidLabel = ErrInvalidLabel - - // ErrIncomparable is returned two levels are not comparable - ErrIncomparable = errors.New("incomparable levels") - // ErrLevelSyntax is returned when a sensitivity or category do not have correct syntax in a level - ErrLevelSyntax = errors.New("invalid level syntax") - - // ErrContextMissing is returned if a requested context is not found in a file. - ErrContextMissing = errors.New("context does not have a match") - // ErrVerifierNil is returned when a context verifier function is nil. - ErrVerifierNil = errors.New("verifier function is nil") - - // ErrNotTGLeader is returned by [SetKeyLabel] if the calling thread - // is not the thread group leader. - ErrNotTGLeader = errors.New("calling thread is not the thread group leader") - - // CategoryRange allows the upper bound on the category range to be adjusted - CategoryRange = DefaultCategoryRange - - privContainerMountLabel string -) - -// Context is a representation of the SELinux label broken into 4 parts -type Context map[string]string - -// SetDisabled disables SELinux support for the package -func SetDisabled() { - setDisabled() -} - -// GetEnabled returns whether SELinux is currently enabled. -func GetEnabled() bool { - return getEnabled() -} - -// ClassIndex returns the int index for an object class in the loaded policy, -// or -1 and an error -func ClassIndex(class string) (int, error) { - return classIndex(class) -} - -// SetFileLabel sets the SELinux label for this path, following symlinks, -// or returns an error. -func SetFileLabel(fpath string, label string) error { - return setFileLabel(fpath, label) -} - -// LsetFileLabel sets the SELinux label for this path, not following symlinks, -// or returns an error. -func LsetFileLabel(fpath string, label string) error { - return lSetFileLabel(fpath, label) -} - -// FileLabel returns the SELinux label for this path, following symlinks, -// or returns an error. -func FileLabel(fpath string) (string, error) { - return fileLabel(fpath) -} - -// LfileLabel returns the SELinux label for this path, not following symlinks, -// or returns an error. -func LfileLabel(fpath string) (string, error) { - return lFileLabel(fpath) -} - -// SetFSCreateLabel tells the kernel what label to use for all file system objects -// created by this task. -// Set the label to an empty string to return to the default label. Calls to SetFSCreateLabel -// should be wrapped in runtime.LockOSThread()/runtime.UnlockOSThread() until file system -// objects created by this task are finished to guarantee another goroutine does not migrate -// to the current thread before execution is complete. -func SetFSCreateLabel(label string) error { - return setFSCreateLabel(label) -} - -// FSCreateLabel returns the default label the kernel which the kernel is using -// for file system objects created by this task. "" indicates default. -func FSCreateLabel() (string, error) { - return fsCreateLabel() -} - -// CurrentLabel returns the SELinux label of the current process thread, or an error. -func CurrentLabel() (string, error) { - return currentLabel() -} - -// PidLabel returns the SELinux label of the given pid, or an error. -func PidLabel(pid int) (string, error) { - return pidLabel(pid) -} - -// ExecLabel returns the SELinux label that the kernel will use for any programs -// that are executed by the current process thread, or an error. -func ExecLabel() (string, error) { - return execLabel() -} - -// CanonicalizeContext takes a context string and writes it to the kernel -// the function then returns the context that the kernel will use. Use this -// function to check if two contexts are equivalent -func CanonicalizeContext(val string) (string, error) { - return canonicalizeContext(val) -} - -// ComputeCreateContext requests the type transition from source to target for -// class from the kernel. -func ComputeCreateContext(source string, target string, class string) (string, error) { - return computeCreateContext(source, target, class) -} - -// CalculateGlbLub computes the glb (greatest lower bound) and lub (least upper bound) -// of a source and target range. -// The glblub is calculated as the greater of the low sensitivities and -// the lower of the high sensitivities and the and of each category bitset. -func CalculateGlbLub(sourceRange, targetRange string) (string, error) { - return calculateGlbLub(sourceRange, targetRange) -} - -// SetExecLabel sets the SELinux label that the kernel will use for any programs -// that are executed by the current process thread, or an error. Calls to SetExecLabel -// should be wrapped in runtime.LockOSThread()/runtime.UnlockOSThread() until execution -// of the program is finished to guarantee another goroutine does not migrate to the current -// thread before execution is complete. -func SetExecLabel(label string) error { - return writeCon(attrPath("exec"), label) -} - -// SetTaskLabel sets the SELinux label for the current thread, or an error. -// This requires the dyntransition permission. Calls to SetTaskLabel should -// be wrapped in runtime.LockOSThread()/runtime.UnlockOSThread() to guarantee -// the current thread does not run in a new mislabeled thread. -func SetTaskLabel(label string) error { - return writeCon(attrPath("current"), label) -} - -// SetSocketLabel takes a process label and tells the kernel to assign the -// label to the next socket that gets created. Calls to SetSocketLabel -// should be wrapped in runtime.LockOSThread()/runtime.UnlockOSThread() until -// the socket is created to guarantee another goroutine does not migrate -// to the current thread before execution is complete. -func SetSocketLabel(label string) error { - return writeCon(attrPath("sockcreate"), label) -} - -// SocketLabel retrieves the current socket label setting -func SocketLabel() (string, error) { - return readCon(attrPath("sockcreate")) -} - -// PeerLabel retrieves the label of the client on the other side of a socket -func PeerLabel(fd uintptr) (string, error) { - return peerLabel(fd) -} - -// SetKeyLabel takes a process label and tells the kernel to assign the -// label to the next kernel keyring that gets created. -// -// Calls to SetKeyLabel should be wrapped in -// runtime.LockOSThread()/runtime.UnlockOSThread() until the kernel keyring is -// created to guarantee another goroutine does not migrate to the current -// thread before execution is complete. -// -// Only the thread group leader can set key label. -func SetKeyLabel(label string) error { - return setKeyLabel(label) -} - -// KeyLabel retrieves the current kernel keyring label setting -func KeyLabel() (string, error) { - return readCon("/proc/self/attr/keycreate") -} - -// Get returns the Context as a string -func (c Context) Get() string { - return c.get() -} - -// NewContext creates a new Context struct from the specified label -func NewContext(label string) (Context, error) { - return newContext(label) -} - -// ClearLabels clears all reserved labels -func ClearLabels() { - clearLabels() -} - -// ReserveLabel reserves the MLS/MCS level component of the specified label -func ReserveLabel(label string) { - reserveLabel(label) -} - -// MLSEnabled checks if MLS is enabled. -func MLSEnabled() bool { - return isMLSEnabled() -} - -// EnforceMode returns the current SELinux mode Enforcing, Permissive, Disabled -func EnforceMode() int { - return enforceMode() -} - -// SetEnforceMode sets the current SELinux mode Enforcing, Permissive. -// Disabled is not valid, since this needs to be set at boot time. -func SetEnforceMode(mode int) error { - return setEnforceMode(mode) -} - -// DefaultEnforceMode returns the systems default SELinux mode Enforcing, -// Permissive or Disabled. Note this is just the default at boot time. -// EnforceMode tells you the systems current mode. -func DefaultEnforceMode() int { - return defaultEnforceMode() -} - -// ReleaseLabel un-reserves the MLS/MCS Level field of the specified label, -// allowing it to be used by another process. -func ReleaseLabel(label string) { - releaseLabel(label) -} - -// ROFileLabel returns the specified SELinux readonly file label -func ROFileLabel() string { - return roFileLabel() -} - -// KVMContainerLabels returns the default processLabel and mountLabel to be used -// for kvm containers by the calling process. -func KVMContainerLabels() (string, string) { - return kvmContainerLabels() -} - -// InitContainerLabels returns the default processLabel and file labels to be -// used for containers running an init system like systemd by the calling process. -func InitContainerLabels() (string, string) { - return initContainerLabels() -} - -// ContainerLabels returns an allocated processLabel and fileLabel to be used for -// container labeling by the calling process. -func ContainerLabels() (processLabel string, fileLabel string) { - return containerLabels() -} - -// SecurityCheckContext validates that the SELinux label is understood by the kernel -func SecurityCheckContext(val string) error { - return securityCheckContext(val) -} - -// CopyLevel returns a label with the MLS/MCS level from src label replaced on -// the dest label. -func CopyLevel(src, dest string) (string, error) { - return copyLevel(src, dest) -} - -// Chcon changes the fpath file object to the SELinux label. -// If fpath is a directory and recurse is true, then Chcon walks the -// directory tree setting the label. -// -// The fpath itself is guaranteed to be relabeled last. -func Chcon(fpath string, label string, recurse bool) error { - return chcon(fpath, label, recurse) -} - -// DupSecOpt takes an SELinux process label and returns security options that -// can be used to set the SELinux Type and Level for future container processes. -func DupSecOpt(src string) ([]string, error) { - return dupSecOpt(src) -} - -// DisableSecOpt returns a security opt that can be used to disable SELinux -// labeling support for future container processes. -func DisableSecOpt() []string { - return []string{"disable"} -} - -// GetDefaultContextWithLevel gets a single context for the specified SELinux user -// identity that is reachable from the specified scon context. The context is based -// on the per-user /etc/selinux/{SELINUXTYPE}/contexts/users/ if it exists, -// and falls back to the global /etc/selinux/{SELINUXTYPE}/contexts/default_contexts -// file. -func GetDefaultContextWithLevel(user, level, scon string) (string, error) { - return getDefaultContextWithLevel(user, level, scon) -} - -// PrivContainerMountLabel returns mount label for privileged containers -func PrivContainerMountLabel() string { - // Make sure label is initialized. - _ = label("") - return privContainerMountLabel -} diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go b/vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go deleted file mode 100644 index a607980724..0000000000 --- a/vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go +++ /dev/null @@ -1,1301 +0,0 @@ -package selinux - -import ( - "bufio" - "bytes" - "crypto/rand" - "encoding/binary" - "errors" - "fmt" - "io" - "io/fs" - "math/big" - "os" - "os/user" - "path/filepath" - "strconv" - "strings" - "sync" - - "github.com/opencontainers/selinux/pkg/pwalkdir" - "golang.org/x/sys/unix" -) - -const ( - minSensLen = 2 - contextFile = "/usr/share/containers/selinux/contexts" - selinuxDir = "/etc/selinux/" - selinuxUsersDir = "contexts/users" - defaultContexts = "contexts/default_contexts" - selinuxConfig = selinuxDir + "config" - selinuxfsMount = "/sys/fs/selinux" - selinuxTypeTag = "SELINUXTYPE" - selinuxTag = "SELINUX" - xattrNameSelinux = "security.selinux" -) - -type selinuxState struct { - mcsList map[string]bool - selinuxfs string - selinuxfsOnce sync.Once - enabledSet bool - enabled bool - sync.Mutex -} - -type level struct { - cats *big.Int - sens int -} - -type mlsRange struct { - low *level - high *level -} - -type defaultSECtx struct { - userRdr io.Reader - verifier func(string) error - defaultRdr io.Reader - user, level, scon string -} - -type levelItem byte - -const ( - sensitivity levelItem = 's' - category levelItem = 'c' -) - -var ( - readOnlyFileLabel string - state = selinuxState{ - mcsList: make(map[string]bool), - } - - // for attrPath() - attrPathOnce sync.Once - haveThreadSelf bool - - // for policyRoot() - policyRootOnce sync.Once - policyRootVal string - - // for label() - loadLabelsOnce sync.Once - labels map[string]string -) - -func policyRoot() string { - policyRootOnce.Do(func() { - policyRootVal = filepath.Join(selinuxDir, readConfig(selinuxTypeTag)) - }) - - return policyRootVal -} - -func (s *selinuxState) setEnable(enabled bool) bool { - s.Lock() - defer s.Unlock() - s.enabledSet = true - s.enabled = enabled - return s.enabled -} - -func (s *selinuxState) getEnabled() bool { - s.Lock() - enabled := s.enabled - enabledSet := s.enabledSet - s.Unlock() - if enabledSet { - return enabled - } - - enabled = false - if fs := getSelinuxMountPoint(); fs != "" { - if con, _ := CurrentLabel(); con != "kernel" { - enabled = true - } - } - return s.setEnable(enabled) -} - -// setDisabled disables SELinux support for the package -func setDisabled() { - state.setEnable(false) -} - -func verifySELinuxfsMount(mnt string) bool { - var buf unix.Statfs_t - for { - err := unix.Statfs(mnt, &buf) - if err == nil { - break - } - if err == unix.EAGAIN || err == unix.EINTR { - continue - } - return false - } - - //#nosec G115 -- there is no overflow here. - if uint32(buf.Type) != uint32(unix.SELINUX_MAGIC) { - return false - } - if (buf.Flags & unix.ST_RDONLY) != 0 { - return false - } - - return true -} - -func findSELinuxfs() string { - // fast path: check the default mount first - if verifySELinuxfsMount(selinuxfsMount) { - return selinuxfsMount - } - - // check if selinuxfs is available before going the slow path - fs, err := os.ReadFile("/proc/filesystems") - if err != nil { - return "" - } - if !bytes.Contains(fs, []byte("\tselinuxfs\n")) { - return "" - } - - // slow path: try to find among the mounts - f, err := os.Open("/proc/self/mountinfo") - if err != nil { - return "" - } - defer f.Close() - - scanner := bufio.NewScanner(f) - for { - mnt := findSELinuxfsMount(scanner) - if mnt == "" { // error or not found - return "" - } - if verifySELinuxfsMount(mnt) { - return mnt - } - } -} - -// findSELinuxfsMount returns a next selinuxfs mount point found, -// if there is one, or an empty string in case of EOF or error. -func findSELinuxfsMount(s *bufio.Scanner) string { - for s.Scan() { - txt := s.Bytes() - // The first field after - is fs type. - // Safe as spaces in mountpoints are encoded as \040 - if !bytes.Contains(txt, []byte(" - selinuxfs ")) { - continue - } - const mPos = 5 // mount point is 5th field - fields := bytes.SplitN(txt, []byte(" "), mPos+1) - if len(fields) < mPos+1 { - continue - } - return string(fields[mPos-1]) - } - - return "" -} - -func (s *selinuxState) getSELinuxfs() string { - s.selinuxfsOnce.Do(func() { - s.selinuxfs = findSELinuxfs() - }) - - return s.selinuxfs -} - -// getSelinuxMountPoint returns the path to the mountpoint of an selinuxfs -// filesystem or an empty string if no mountpoint is found. Selinuxfs is -// a proc-like pseudo-filesystem that exposes the SELinux policy API to -// processes. The existence of an selinuxfs mount is used to determine -// whether SELinux is currently enabled or not. -func getSelinuxMountPoint() string { - return state.getSELinuxfs() -} - -// getEnabled returns whether SELinux is currently enabled. -func getEnabled() bool { - return state.getEnabled() -} - -func readConfig(target string) string { - in, err := os.Open(selinuxConfig) - if err != nil { - return "" - } - defer in.Close() - - scanner := bufio.NewScanner(in) - - for scanner.Scan() { - line := bytes.TrimSpace(scanner.Bytes()) - if len(line) == 0 { - // Skip blank lines - continue - } - if line[0] == ';' || line[0] == '#' { - // Skip comments - continue - } - fields := bytes.SplitN(line, []byte{'='}, 2) - if len(fields) != 2 { - continue - } - if bytes.Equal(fields[0], []byte(target)) { - return string(bytes.Trim(fields[1], `"`)) - } - } - return "" -} - -func isProcHandle(fh *os.File) error { - var buf unix.Statfs_t - - for { - err := unix.Fstatfs(int(fh.Fd()), &buf) - if err == nil { - break - } - if err != unix.EINTR { - return &os.PathError{Op: "fstatfs", Path: fh.Name(), Err: err} - } - } - if buf.Type != unix.PROC_SUPER_MAGIC { - return fmt.Errorf("file %q is not on procfs", fh.Name()) - } - - return nil -} - -func readCon(fpath string) (string, error) { - if fpath == "" { - return "", ErrEmptyPath - } - - in, err := os.Open(fpath) - if err != nil { - return "", err - } - defer in.Close() - - if err := isProcHandle(in); err != nil { - return "", err - } - return readConFd(in) -} - -func readConFd(in *os.File) (string, error) { - data, err := io.ReadAll(in) - if err != nil { - return "", err - } - return string(bytes.TrimSuffix(data, []byte{0})), nil -} - -// classIndex returns the int index for an object class in the loaded policy, -// or -1 and an error -func classIndex(class string) (int, error) { - permpath := fmt.Sprintf("class/%s/index", class) - indexpath := filepath.Join(getSelinuxMountPoint(), permpath) - - indexB, err := os.ReadFile(indexpath) - if err != nil { - return -1, err - } - index, err := strconv.Atoi(string(indexB)) - if err != nil { - return -1, err - } - - return index, nil -} - -// lSetFileLabel sets the SELinux label for this path, not following symlinks, -// or returns an error. -func lSetFileLabel(fpath string, label string) error { - if fpath == "" { - return ErrEmptyPath - } - for { - err := unix.Lsetxattr(fpath, xattrNameSelinux, []byte(label), 0) - if err == nil { - break - } - if err != unix.EINTR { - return &os.PathError{Op: fmt.Sprintf("lsetxattr(label=%s)", label), Path: fpath, Err: err} - } - } - - return nil -} - -// setFileLabel sets the SELinux label for this path, following symlinks, -// or returns an error. -func setFileLabel(fpath string, label string) error { - if fpath == "" { - return ErrEmptyPath - } - for { - err := unix.Setxattr(fpath, xattrNameSelinux, []byte(label), 0) - if err == nil { - break - } - if err != unix.EINTR { - return &os.PathError{Op: fmt.Sprintf("setxattr(label=%s)", label), Path: fpath, Err: err} - } - } - - return nil -} - -// fileLabel returns the SELinux label for this path, following symlinks, -// or returns an error. -func fileLabel(fpath string) (string, error) { - if fpath == "" { - return "", ErrEmptyPath - } - - label, err := getxattr(fpath, xattrNameSelinux) - if err != nil { - return "", &os.PathError{Op: "getxattr", Path: fpath, Err: err} - } - // Trim the NUL byte at the end of the byte buffer, if present. - if len(label) > 0 && label[len(label)-1] == '\x00' { - label = label[:len(label)-1] - } - return string(label), nil -} - -// lFileLabel returns the SELinux label for this path, not following symlinks, -// or returns an error. -func lFileLabel(fpath string) (string, error) { - if fpath == "" { - return "", ErrEmptyPath - } - - label, err := lgetxattr(fpath, xattrNameSelinux) - if err != nil { - return "", &os.PathError{Op: "lgetxattr", Path: fpath, Err: err} - } - // Trim the NUL byte at the end of the byte buffer, if present. - if len(label) > 0 && label[len(label)-1] == '\x00' { - label = label[:len(label)-1] - } - return string(label), nil -} - -func setFSCreateLabel(label string) error { - return writeCon(attrPath("fscreate"), label) -} - -// fsCreateLabel returns the default label the kernel which the kernel is using -// for file system objects created by this task. "" indicates default. -func fsCreateLabel() (string, error) { - return readCon(attrPath("fscreate")) -} - -// currentLabel returns the SELinux label of the current process thread, or an error. -func currentLabel() (string, error) { - return readCon(attrPath("current")) -} - -// pidLabel returns the SELinux label of the given pid, or an error. -func pidLabel(pid int) (string, error) { - return readCon(fmt.Sprintf("/proc/%d/attr/current", pid)) -} - -// ExecLabel returns the SELinux label that the kernel will use for any programs -// that are executed by the current process thread, or an error. -func execLabel() (string, error) { - return readCon(attrPath("exec")) -} - -func writeCon(fpath, val string) error { - if fpath == "" { - return ErrEmptyPath - } - if val == "" { - if !getEnabled() { - return nil - } - } - - out, err := os.OpenFile(fpath, os.O_WRONLY, 0) - if err != nil { - return err - } - defer out.Close() - - if err := isProcHandle(out); err != nil { - return err - } - - if val != "" { - _, err = out.Write([]byte(val)) - } else { - _, err = out.Write(nil) - } - if err != nil { - return err - } - return nil -} - -func attrPath(attr string) string { - // Linux >= 3.17 provides this - const threadSelfPrefix = "/proc/thread-self/attr" - - attrPathOnce.Do(func() { - st, err := os.Stat(threadSelfPrefix) - if err == nil && st.Mode().IsDir() { - haveThreadSelf = true - } - }) - - if haveThreadSelf { - return filepath.Join(threadSelfPrefix, attr) - } - - return filepath.Join("/proc/self/task", strconv.Itoa(unix.Gettid()), "attr", attr) -} - -// canonicalizeContext takes a context string and writes it to the kernel -// the function then returns the context that the kernel will use. Use this -// function to check if two contexts are equivalent -func canonicalizeContext(val string) (string, error) { - return readWriteCon(filepath.Join(getSelinuxMountPoint(), "context"), val) -} - -// computeCreateContext requests the type transition from source to target for -// class from the kernel. -func computeCreateContext(source string, target string, class string) (string, error) { - classidx, err := classIndex(class) - if err != nil { - return "", err - } - - return readWriteCon(filepath.Join(getSelinuxMountPoint(), "create"), fmt.Sprintf("%s %s %d", source, target, classidx)) -} - -// catsToBitset stores categories in a bitset. -func catsToBitset(cats string) (*big.Int, error) { - bitset := new(big.Int) - - catlist := strings.Split(cats, ",") - for _, r := range catlist { - ranges := strings.SplitN(r, ".", 2) - if len(ranges) > 1 { - catstart, err := parseLevelItem(ranges[0], category) - if err != nil { - return nil, err - } - catend, err := parseLevelItem(ranges[1], category) - if err != nil { - return nil, err - } - for i := catstart; i <= catend; i++ { - bitset.SetBit(bitset, i, 1) - } - } else { - cat, err := parseLevelItem(ranges[0], category) - if err != nil { - return nil, err - } - bitset.SetBit(bitset, cat, 1) - } - } - - return bitset, nil -} - -// parseLevelItem parses and verifies that a sensitivity or category are valid -func parseLevelItem(s string, sep levelItem) (int, error) { - if len(s) < minSensLen || levelItem(s[0]) != sep { - return 0, ErrLevelSyntax - } - const bitSize = 31 // Make sure the result fits into signed int32. - val, err := strconv.ParseUint(s[1:], 10, bitSize) - if err != nil { - return 0, err - } - - return int(val), nil -} - -// parseLevel fills a level from a string that contains -// a sensitivity and categories -func (l *level) parseLevel(levelStr string) error { - lvl := strings.SplitN(levelStr, ":", 2) - sens, err := parseLevelItem(lvl[0], sensitivity) - if err != nil { - return fmt.Errorf("failed to parse sensitivity: %w", err) - } - l.sens = sens - if len(lvl) > 1 { - cats, err := catsToBitset(lvl[1]) - if err != nil { - return fmt.Errorf("failed to parse categories: %w", err) - } - l.cats = cats - } - - return nil -} - -// rangeStrToMLSRange marshals a string representation of a range. -func rangeStrToMLSRange(rangeStr string) (*mlsRange, error) { - r := &mlsRange{} - l := strings.SplitN(rangeStr, "-", 2) - - switch len(l) { - // rangeStr that has a low and a high level, e.g. s4:c0.c1023-s6:c0.c1023 - case 2: - r.high = &level{} - if err := r.high.parseLevel(l[1]); err != nil { - return nil, fmt.Errorf("failed to parse high level %q: %w", l[1], err) - } - fallthrough - // rangeStr that is single level, e.g. s6:c0,c3,c5,c30.c1023 - case 1: - r.low = &level{} - if err := r.low.parseLevel(l[0]); err != nil { - return nil, fmt.Errorf("failed to parse low level %q: %w", l[0], err) - } - } - - if r.high == nil { - r.high = r.low - } - - return r, nil -} - -// bitsetToStr takes a category bitset and returns it in the -// canonical selinux syntax -func bitsetToStr(c *big.Int) string { - var str string - - length := 0 - i0 := int(c.TrailingZeroBits()) //#nosec G115 -- don't expect TralingZeroBits to return values with highest bit set. - for i := i0; i < c.BitLen(); i++ { - if c.Bit(i) == 0 { - continue - } - if length == 0 { - if str != "" { - str += "," - } - str += "c" + strconv.Itoa(i) - } - if c.Bit(i+1) == 1 { - length++ - continue - } - if length == 1 { - str += ",c" + strconv.Itoa(i) - } else if length > 1 { - str += ".c" + strconv.Itoa(i) - } - length = 0 - } - - return str -} - -func (l *level) equal(l2 *level) bool { - if l2 == nil || l == nil { - return l == l2 - } - if l2.sens != l.sens { - return false - } - if l2.cats == nil || l.cats == nil { - return l2.cats == l.cats - } - return l.cats.Cmp(l2.cats) == 0 -} - -// String returns an mlsRange as a string. -func (m mlsRange) String() string { - low := "s" + strconv.Itoa(m.low.sens) - if m.low.cats != nil && m.low.cats.BitLen() > 0 { - low += ":" + bitsetToStr(m.low.cats) - } - - if m.low.equal(m.high) { - return low - } - - high := "s" + strconv.Itoa(m.high.sens) - if m.high.cats != nil && m.high.cats.BitLen() > 0 { - high += ":" + bitsetToStr(m.high.cats) - } - - return low + "-" + high -} - -// TODO: remove these in favor of built-in min/max -// once we stop supporting Go < 1.21. -func maxInt(a, b int) int { - if a > b { - return a - } - return b -} - -func minInt(a, b int) int { - if a < b { - return a - } - return b -} - -// calculateGlbLub computes the glb (greatest lower bound) and lub (least upper bound) -// of a source and target range. -// The glblub is calculated as the greater of the low sensitivities and -// the lower of the high sensitivities and the and of each category bitset. -func calculateGlbLub(sourceRange, targetRange string) (string, error) { - s, err := rangeStrToMLSRange(sourceRange) - if err != nil { - return "", err - } - t, err := rangeStrToMLSRange(targetRange) - if err != nil { - return "", err - } - - if s.high.sens < t.low.sens || t.high.sens < s.low.sens { - /* these ranges have no common sensitivities */ - return "", ErrIncomparable - } - - outrange := &mlsRange{low: &level{}, high: &level{}} - - /* take the greatest of the low */ - outrange.low.sens = maxInt(s.low.sens, t.low.sens) - - /* take the least of the high */ - outrange.high.sens = minInt(s.high.sens, t.high.sens) - - /* find the intersecting categories */ - if s.low.cats != nil && t.low.cats != nil { - outrange.low.cats = new(big.Int) - outrange.low.cats.And(s.low.cats, t.low.cats) - } - if s.high.cats != nil && t.high.cats != nil { - outrange.high.cats = new(big.Int) - outrange.high.cats.And(s.high.cats, t.high.cats) - } - - return outrange.String(), nil -} - -func readWriteCon(fpath string, val string) (string, error) { - if fpath == "" { - return "", ErrEmptyPath - } - f, err := os.OpenFile(fpath, os.O_RDWR, 0) - if err != nil { - return "", err - } - defer f.Close() - - _, err = f.Write([]byte(val)) - if err != nil { - return "", err - } - - return readConFd(f) -} - -// peerLabel retrieves the label of the client on the other side of a socket -func peerLabel(fd uintptr) (string, error) { - l, err := unix.GetsockoptString(int(fd), unix.SOL_SOCKET, unix.SO_PEERSEC) - if err != nil { - return "", &os.PathError{Op: "getsockopt", Path: "fd " + strconv.Itoa(int(fd)), Err: err} - } - return l, nil -} - -// setKeyLabel takes a process label and tells the kernel to assign the -// label to the next kernel keyring that gets created -func setKeyLabel(label string) error { - err := writeCon("/proc/self/attr/keycreate", label) - if errors.Is(err, os.ErrNotExist) { - return nil - } - if label == "" && errors.Is(err, os.ErrPermission) { - return nil - } - if errors.Is(err, unix.EACCES) && unix.Getuid() != unix.Gettid() { - return ErrNotTGLeader - } - return err -} - -// get returns the Context as a string -func (c Context) get() string { - if l := c["level"]; l != "" { - return c["user"] + ":" + c["role"] + ":" + c["type"] + ":" + l - } - return c["user"] + ":" + c["role"] + ":" + c["type"] -} - -// newContext creates a new Context struct from the specified label -func newContext(label string) (Context, error) { - c := make(Context) - - if len(label) != 0 { - con := strings.SplitN(label, ":", 4) - if len(con) < 3 { - return c, ErrInvalidLabel - } - c["user"] = con[0] - c["role"] = con[1] - c["type"] = con[2] - if len(con) > 3 { - c["level"] = con[3] - } - } - return c, nil -} - -// clearLabels clears all reserved labels -func clearLabels() { - state.Lock() - state.mcsList = make(map[string]bool) - state.Unlock() -} - -// reserveLabel reserves the MLS/MCS level component of the specified label -func reserveLabel(label string) { - if len(label) != 0 { - con := strings.SplitN(label, ":", 4) - if len(con) > 3 { - _ = mcsAdd(con[3]) - } - } -} - -func selinuxEnforcePath() string { - return filepath.Join(getSelinuxMountPoint(), "enforce") -} - -// isMLSEnabled checks if MLS is enabled. -func isMLSEnabled() bool { - enabledB, err := os.ReadFile(filepath.Join(getSelinuxMountPoint(), "mls")) - if err != nil { - return false - } - return bytes.Equal(enabledB, []byte{'1'}) -} - -// enforceMode returns the current SELinux mode Enforcing, Permissive, Disabled -func enforceMode() int { - var enforce int - - enforceB, err := os.ReadFile(selinuxEnforcePath()) - if err != nil { - return -1 - } - enforce, err = strconv.Atoi(string(enforceB)) - if err != nil { - return -1 - } - return enforce -} - -// setEnforceMode sets the current SELinux mode Enforcing, Permissive. -// Disabled is not valid, since this needs to be set at boot time. -func setEnforceMode(mode int) error { - return os.WriteFile(selinuxEnforcePath(), []byte(strconv.Itoa(mode)), 0) -} - -// defaultEnforceMode returns the systems default SELinux mode Enforcing, -// Permissive or Disabled. Note this is just the default at boot time. -// EnforceMode tells you the systems current mode. -func defaultEnforceMode() int { - switch readConfig(selinuxTag) { - case "enforcing": - return Enforcing - case "permissive": - return Permissive - } - return Disabled -} - -func mcsAdd(mcs string) error { - if mcs == "" { - return nil - } - state.Lock() - defer state.Unlock() - if state.mcsList[mcs] { - return ErrMCSAlreadyExists - } - state.mcsList[mcs] = true - return nil -} - -func mcsDelete(mcs string) { - if mcs == "" { - return - } - state.Lock() - defer state.Unlock() - state.mcsList[mcs] = false -} - -func intToMcs(id int, catRange uint32) string { - var ( - SETSIZE = int(catRange) - TIER = SETSIZE - ORD = id - ) - - if id < 1 || id > 523776 { - return "" - } - - for ORD > TIER { - ORD -= TIER - TIER-- - } - TIER = SETSIZE - TIER - ORD += TIER - return fmt.Sprintf("s0:c%d,c%d", TIER, ORD) -} - -func uniqMcs(catRange uint32) string { - var ( - n uint32 - c1, c2 uint32 - mcs string - ) - - for { - _ = binary.Read(rand.Reader, binary.LittleEndian, &n) - c1 = n % catRange - _ = binary.Read(rand.Reader, binary.LittleEndian, &n) - c2 = n % catRange - if c1 == c2 { - continue - } else if c1 > c2 { - c1, c2 = c2, c1 - } - mcs = fmt.Sprintf("s0:c%d,c%d", c1, c2) - if err := mcsAdd(mcs); err != nil { - continue - } - break - } - return mcs -} - -// releaseLabel un-reserves the MLS/MCS Level field of the specified label, -// allowing it to be used by another process. -func releaseLabel(label string) { - if len(label) != 0 { - con := strings.SplitN(label, ":", 4) - if len(con) > 3 { - mcsDelete(con[3]) - } - } -} - -// roFileLabel returns the specified SELinux readonly file label -func roFileLabel() string { - return readOnlyFileLabel -} - -func openContextFile() (*os.File, error) { - if f, err := os.Open(contextFile); err == nil { - return f, nil - } - return os.Open(filepath.Join(policyRoot(), "contexts", "lxc_contexts")) -} - -func loadLabels() { - labels = make(map[string]string) - in, err := openContextFile() - if err != nil { - return - } - defer in.Close() - - scanner := bufio.NewScanner(in) - - for scanner.Scan() { - line := bytes.TrimSpace(scanner.Bytes()) - if len(line) == 0 { - // Skip blank lines - continue - } - if line[0] == ';' || line[0] == '#' { - // Skip comments - continue - } - fields := bytes.SplitN(line, []byte{'='}, 2) - if len(fields) != 2 { - continue - } - key, val := bytes.TrimSpace(fields[0]), bytes.TrimSpace(fields[1]) - labels[string(key)] = string(bytes.Trim(val, `"`)) - } - - con, _ := NewContext(labels["file"]) - con["level"] = fmt.Sprintf("s0:c%d,c%d", maxCategory-2, maxCategory-1) - privContainerMountLabel = con.get() - reserveLabel(privContainerMountLabel) -} - -func label(key string) string { - loadLabelsOnce.Do(func() { - loadLabels() - }) - return labels[key] -} - -// kvmContainerLabels returns the default processLabel and mountLabel to be used -// for kvm containers by the calling process. -func kvmContainerLabels() (string, string) { - processLabel := label("kvm_process") - if processLabel == "" { - processLabel = label("process") - } - - return addMcs(processLabel, label("file")) -} - -// initContainerLabels returns the default processLabel and file labels to be -// used for containers running an init system like systemd by the calling process. -func initContainerLabels() (string, string) { - processLabel := label("init_process") - if processLabel == "" { - processLabel = label("process") - } - - return addMcs(processLabel, label("file")) -} - -// containerLabels returns an allocated processLabel and fileLabel to be used for -// container labeling by the calling process. -func containerLabels() (processLabel string, fileLabel string) { - if !getEnabled() { - return "", "" - } - - processLabel = label("process") - fileLabel = label("file") - readOnlyFileLabel = label("ro_file") - - if processLabel == "" || fileLabel == "" { - return "", fileLabel - } - - if readOnlyFileLabel == "" { - readOnlyFileLabel = fileLabel - } - - return addMcs(processLabel, fileLabel) -} - -func addMcs(processLabel, fileLabel string) (string, string) { - scon, _ := NewContext(processLabel) - if scon["level"] != "" { - mcs := uniqMcs(CategoryRange) - scon["level"] = mcs - processLabel = scon.Get() - scon, _ = NewContext(fileLabel) - scon["level"] = mcs - fileLabel = scon.Get() - } - return processLabel, fileLabel -} - -// securityCheckContext validates that the SELinux label is understood by the kernel -func securityCheckContext(val string) error { - return os.WriteFile(filepath.Join(getSelinuxMountPoint(), "context"), []byte(val), 0) -} - -// copyLevel returns a label with the MLS/MCS level from src label replaced on -// the dest label. -func copyLevel(src, dest string) (string, error) { - if src == "" { - return "", nil - } - if err := SecurityCheckContext(src); err != nil { - return "", err - } - if err := SecurityCheckContext(dest); err != nil { - return "", err - } - scon, err := NewContext(src) - if err != nil { - return "", err - } - tcon, err := NewContext(dest) - if err != nil { - return "", err - } - mcsDelete(tcon["level"]) - _ = mcsAdd(scon["level"]) - tcon["level"] = scon["level"] - return tcon.Get(), nil -} - -// chcon changes the fpath file object to the SELinux label. -// If fpath is a directory and recurse is true, then chcon walks the -// directory tree setting the label. -func chcon(fpath string, label string, recurse bool) error { - if fpath == "" { - return ErrEmptyPath - } - if label == "" { - return nil - } - - excludePaths := map[string]bool{ - "/": true, - "/bin": true, - "/boot": true, - "/dev": true, - "/etc": true, - "/etc/passwd": true, - "/etc/pki": true, - "/etc/shadow": true, - "/home": true, - "/lib": true, - "/lib64": true, - "/media": true, - "/opt": true, - "/proc": true, - "/root": true, - "/run": true, - "/sbin": true, - "/srv": true, - "/sys": true, - "/tmp": true, - "/usr": true, - "/var": true, - "/var/lib": true, - "/var/log": true, - } - - if home := os.Getenv("HOME"); home != "" { - excludePaths[home] = true - } - - if sudoUser := os.Getenv("SUDO_USER"); sudoUser != "" { - if usr, err := user.Lookup(sudoUser); err == nil { - excludePaths[usr.HomeDir] = true - } - } - - if fpath != "/" { - fpath = strings.TrimSuffix(fpath, "/") - } - if excludePaths[fpath] { - return fmt.Errorf("SELinux relabeling of %s is not allowed", fpath) - } - - if !recurse { - err := lSetFileLabel(fpath, label) - if err != nil { - // Check if file doesn't exist, must have been removed - if errors.Is(err, os.ErrNotExist) { - return nil - } - // Check if current label is correct on disk - flabel, nerr := lFileLabel(fpath) - if nerr == nil && flabel == label { - return nil - } - // Check if file doesn't exist, must have been removed - if errors.Is(nerr, os.ErrNotExist) { - return nil - } - return err - } - return nil - } - - return rchcon(fpath, label) -} - -func rchcon(fpath, label string) error { //revive:disable:cognitive-complexity - fastMode := false - // If the current label matches the new label, assume - // other labels are correct. - if cLabel, err := lFileLabel(fpath); err == nil && cLabel == label { - fastMode = true - } - return pwalkdir.Walk(fpath, func(p string, _ fs.DirEntry, _ error) error { - if fastMode { - if cLabel, err := lFileLabel(p); err == nil && cLabel == label { - return nil - } - } - err := lSetFileLabel(p, label) - // Walk a file tree can race with removal, so ignore ENOENT. - if errors.Is(err, os.ErrNotExist) { - return nil - } - return err - }) -} - -// dupSecOpt takes an SELinux process label and returns security options that -// can be used to set the SELinux Type and Level for future container processes. -func dupSecOpt(src string) ([]string, error) { - if src == "" { - return nil, nil - } - con, err := NewContext(src) - if err != nil { - return nil, err - } - if con["user"] == "" || - con["role"] == "" || - con["type"] == "" { - return nil, nil - } - dup := []string{ - "user:" + con["user"], - "role:" + con["role"], - "type:" + con["type"], - } - - if con["level"] != "" { - dup = append(dup, "level:"+con["level"]) - } - - return dup, nil -} - -// findUserInContext scans the reader for a valid SELinux context -// match that is verified with the verifier. Invalid contexts are -// skipped. It returns a matched context or an empty string if no -// match is found. If a scanner error occurs, it is returned. -func findUserInContext(context Context, r io.Reader, verifier func(string) error) (string, error) { - fromRole := context["role"] - fromType := context["type"] - scanner := bufio.NewScanner(r) - - for scanner.Scan() { - fromConns := strings.Fields(scanner.Text()) - if len(fromConns) == 0 { - // Skip blank lines - continue - } - - line := fromConns[0] - - if line[0] == ';' || line[0] == '#' { - // Skip comments - continue - } - - // user context files contexts are formatted as - // role_r:type_t:s0 where the user is missing. - lineArr := strings.SplitN(line, ":", 4) - // skip context with typo, or role and type do not match - if len(lineArr) != 3 || - lineArr[0] != fromRole || - lineArr[1] != fromType { - continue - } - - for _, cc := range fromConns[1:] { - toConns := strings.SplitN(cc, ":", 4) - if len(toConns) != 3 { - continue - } - - context["role"] = toConns[0] - context["type"] = toConns[1] - - outConn := context.get() - if err := verifier(outConn); err != nil { - continue - } - - return outConn, nil - } - } - if err := scanner.Err(); err != nil { - return "", fmt.Errorf("failed to scan for context: %w", err) - } - - return "", nil -} - -func getDefaultContextFromReaders(c *defaultSECtx) (string, error) { - if c.verifier == nil { - return "", ErrVerifierNil - } - - context, err := newContext(c.scon) - if err != nil { - return "", fmt.Errorf("failed to create label for %s: %w", c.scon, err) - } - - // set so the verifier validates the matched context with the provided user and level. - context["user"] = c.user - context["level"] = c.level - - conn, err := findUserInContext(context, c.userRdr, c.verifier) - if err != nil { - return "", err - } - - if conn != "" { - return conn, nil - } - - conn, err = findUserInContext(context, c.defaultRdr, c.verifier) - if err != nil { - return "", err - } - - if conn != "" { - return conn, nil - } - - return "", fmt.Errorf("context %q not found: %w", c.scon, ErrContextMissing) -} - -func getDefaultContextWithLevel(user, level, scon string) (string, error) { - userPath := filepath.Join(policyRoot(), selinuxUsersDir, user) - fu, err := os.Open(userPath) - if err != nil { - return "", err - } - defer fu.Close() - - defaultPath := filepath.Join(policyRoot(), defaultContexts) - fd, err := os.Open(defaultPath) - if err != nil { - return "", err - } - defer fd.Close() - - c := defaultSECtx{ - user: user, - level: level, - scon: scon, - userRdr: fu, - defaultRdr: fd, - verifier: securityCheckContext, - } - - return getDefaultContextFromReaders(&c) -} diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/selinux_stub.go b/vendor/github.com/opencontainers/selinux/go-selinux/selinux_stub.go deleted file mode 100644 index 0889fbe0e0..0000000000 --- a/vendor/github.com/opencontainers/selinux/go-selinux/selinux_stub.go +++ /dev/null @@ -1,155 +0,0 @@ -//go:build !linux -// +build !linux - -package selinux - -func attrPath(string) string { - return "" -} - -func readCon(string) (string, error) { - return "", nil -} - -func writeCon(string, string) error { - return nil -} - -func setDisabled() {} - -func getEnabled() bool { - return false -} - -func classIndex(string) (int, error) { - return -1, nil -} - -func setFileLabel(string, string) error { - return nil -} - -func lSetFileLabel(string, string) error { - return nil -} - -func fileLabel(string) (string, error) { - return "", nil -} - -func lFileLabel(string) (string, error) { - return "", nil -} - -func setFSCreateLabel(string) error { - return nil -} - -func fsCreateLabel() (string, error) { - return "", nil -} - -func currentLabel() (string, error) { - return "", nil -} - -func pidLabel(int) (string, error) { - return "", nil -} - -func execLabel() (string, error) { - return "", nil -} - -func canonicalizeContext(string) (string, error) { - return "", nil -} - -func computeCreateContext(string, string, string) (string, error) { - return "", nil -} - -func calculateGlbLub(string, string) (string, error) { - return "", nil -} - -func peerLabel(uintptr) (string, error) { - return "", nil -} - -func setKeyLabel(string) error { - return nil -} - -func (c Context) get() string { - return "" -} - -func newContext(string) (Context, error) { - return Context{}, nil -} - -func clearLabels() { -} - -func reserveLabel(string) { -} - -func isMLSEnabled() bool { - return false -} - -func enforceMode() int { - return Disabled -} - -func setEnforceMode(int) error { - return nil -} - -func defaultEnforceMode() int { - return Disabled -} - -func releaseLabel(string) { -} - -func roFileLabel() string { - return "" -} - -func kvmContainerLabels() (string, string) { - return "", "" -} - -func initContainerLabels() (string, string) { - return "", "" -} - -func containerLabels() (string, string) { - return "", "" -} - -func securityCheckContext(string) error { - return nil -} - -func copyLevel(string, string) (string, error) { - return "", nil -} - -func chcon(string, string, bool) error { - return nil -} - -func dupSecOpt(string) ([]string, error) { - return nil, nil -} - -func getDefaultContextWithLevel(string, string, string) (string, error) { - return "", nil -} - -func label(_ string) string { - return "" -} diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go b/vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go deleted file mode 100644 index 559c851075..0000000000 --- a/vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go +++ /dev/null @@ -1,71 +0,0 @@ -package selinux - -import ( - "golang.org/x/sys/unix" -) - -// lgetxattr returns a []byte slice containing the value of -// an extended attribute attr set for path. -func lgetxattr(path, attr string) ([]byte, error) { - // Start with a 128 length byte array - dest := make([]byte, 128) - sz, errno := doLgetxattr(path, attr, dest) - for errno == unix.ERANGE { //nolint:errorlint // unix errors are bare - // Buffer too small, use zero-sized buffer to get the actual size - sz, errno = doLgetxattr(path, attr, []byte{}) - if errno != nil { - return nil, errno - } - - dest = make([]byte, sz) - sz, errno = doLgetxattr(path, attr, dest) - } - if errno != nil { - return nil, errno - } - - return dest[:sz], nil -} - -// doLgetxattr is a wrapper that retries on EINTR -func doLgetxattr(path, attr string, dest []byte) (int, error) { - for { - sz, err := unix.Lgetxattr(path, attr, dest) - if err != unix.EINTR { - return sz, err - } - } -} - -// getxattr returns a []byte slice containing the value of -// an extended attribute attr set for path. -func getxattr(path, attr string) ([]byte, error) { - // Start with a 128 length byte array - dest := make([]byte, 128) - sz, errno := dogetxattr(path, attr, dest) - for errno == unix.ERANGE { //nolint:errorlint // unix errors are bare - // Buffer too small, use zero-sized buffer to get the actual size - sz, errno = dogetxattr(path, attr, []byte{}) - if errno != nil { - return nil, errno - } - - dest = make([]byte, sz) - sz, errno = dogetxattr(path, attr, dest) - } - if errno != nil { - return nil, errno - } - - return dest[:sz], nil -} - -// dogetxattr is a wrapper that retries on EINTR -func dogetxattr(path, attr string, dest []byte) (int, error) { - for { - sz, err := unix.Getxattr(path, attr, dest) - if err != unix.EINTR { - return sz, err - } - } -} diff --git a/vendor/github.com/opencontainers/selinux/pkg/pwalkdir/README.md b/vendor/github.com/opencontainers/selinux/pkg/pwalkdir/README.md deleted file mode 100644 index b827e7dd73..0000000000 --- a/vendor/github.com/opencontainers/selinux/pkg/pwalkdir/README.md +++ /dev/null @@ -1,56 +0,0 @@ -## pwalkdir: parallel implementation of filepath.WalkDir - -This is a wrapper for [filepath.WalkDir](https://pkg.go.dev/path/filepath#WalkDir) -which may speed it up by calling multiple callback functions (WalkDirFunc) -in parallel, utilizing goroutines. - -By default, it utilizes 2\*runtime.NumCPU() goroutines for callbacks. -This can be changed by using WalkN function which has the additional -parameter, specifying the number of goroutines (concurrency). - -### pwalk vs pwalkdir - -This package is very similar to -[pwalk](https://pkg.go.dev/github.com/opencontainers/selinux/pkg/pwalkdir), -but utilizes `filepath.WalkDir` (added to Go 1.16), which does not call stat(2) -on every entry and is therefore faster (up to 3x, depending on usage scenario). - -Users who are OK with requiring Go 1.16+ should switch to this -implementation. - -### Caveats - -Please note the following limitations of this code: - -* Unlike filepath.WalkDir, the order of calls is non-deterministic; - -* Only primitive error handling is supported: - - * fs.SkipDir is not supported; - - * ErrNotExist errors from filepath.WalkDir are silently ignored for any path - except the top directory (WalkDir argument); any other error is returned to - the caller of WalkDir; - - * once any error is returned from any walkDirFunc instance, no more calls - to WalkDirFunc are made, and the error is returned to the caller of WalkDir; - - * if more than one WalkDirFunc instance will return an error, only one - of such errors will be propagated to and returned by WalkDir, others - will be silently discarded. - -### Documentation - -For the official documentation, see -https://pkg.go.dev/github.com/opencontainers/selinux/pkg/pwalkdir - -### Benchmarks - -For a WalkDirFunc that consists solely of the return statement, this -implementation is about 15% slower than the standard library's -filepath.WalkDir. - -Otherwise (if a WalkDirFunc is actually doing something) this is usually -faster, except when the WalkDirN(..., 1) is used. Run `go test -bench .` -to see how different operations can benefit from it, as well as how the -level of parallelism affects the speed. diff --git a/vendor/github.com/opencontainers/selinux/pkg/pwalkdir/pwalkdir.go b/vendor/github.com/opencontainers/selinux/pkg/pwalkdir/pwalkdir.go deleted file mode 100644 index 5d2d09a298..0000000000 --- a/vendor/github.com/opencontainers/selinux/pkg/pwalkdir/pwalkdir.go +++ /dev/null @@ -1,123 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -package pwalkdir - -import ( - "errors" - "fmt" - "io/fs" - "path/filepath" - "runtime" - "sync" -) - -// Walk is a wrapper for filepath.WalkDir which can call multiple walkFn -// in parallel, allowing to handle each item concurrently. A maximum of -// twice the runtime.NumCPU() walkFn will be called at any one time. -// If you want to change the maximum, use WalkN instead. -// -// The order of calls is non-deterministic. -// -// Note that this implementation only supports primitive error handling: -// -// - no errors are ever passed to walkFn; -// -// - once a walkFn returns any error, all further processing stops -// and the error is returned to the caller of Walk; -// -// - filepath.SkipDir is not supported; -// -// - if more than one walkFn instance will return an error, only one -// of such errors will be propagated and returned by Walk, others -// will be silently discarded. -func Walk(root string, walkFn fs.WalkDirFunc) error { - return WalkN(root, walkFn, runtime.NumCPU()*2) -} - -// WalkN is a wrapper for filepath.WalkDir which can call multiple walkFn -// in parallel, allowing to handle each item concurrently. A maximum of -// num walkFn will be called at any one time. -// -// Please see Walk documentation for caveats of using this function. -func WalkN(root string, walkFn fs.WalkDirFunc, num int) error { - // make sure limit is sensible - if num < 1 { - return fmt.Errorf("walk(%q): num must be > 0", root) - } - - files := make(chan *walkArgs, 2*num) - errCh := make(chan error, 1) // Get the first error, ignore others. - - // Start walking a tree asap. - var ( - err error - wg sync.WaitGroup - - rootLen = len(root) - rootEntry *walkArgs - ) - wg.Add(1) - go func() { - err = filepath.WalkDir(root, func(p string, entry fs.DirEntry, err error) error { - if err != nil { - // Walking a file tree can race with removal, - // so ignore ENOENT, except for root. - // https://github.com/opencontainers/selinux/issues/199. - if errors.Is(err, fs.ErrNotExist) && len(p) != rootLen { - return nil - } - close(files) - return err - } - if len(p) == rootLen { - // Root entry is processed separately below. - rootEntry = &walkArgs{path: p, entry: entry} - return nil - } - // Add a file to the queue unless a callback sent an error. - select { - case e := <-errCh: - close(files) - return e - default: - files <- &walkArgs{path: p, entry: entry} - return nil - } - }) - if err == nil { - close(files) - } - wg.Done() - }() - - wg.Add(num) - for i := 0; i < num; i++ { - go func() { - for file := range files { - if e := walkFn(file.path, file.entry, nil); e != nil { - select { - case errCh <- e: // sent ok - default: // buffer full - } - } - } - wg.Done() - }() - } - - wg.Wait() - - if err == nil { - err = walkFn(rootEntry.path, rootEntry.entry, nil) - } - - return err -} - -// walkArgs holds the arguments that were passed to the Walk or WalkN -// functions. -type walkArgs struct { - entry fs.DirEntry - path string -} diff --git a/vendor/go.etcd.io/etcd/raft/v3/LICENSE b/vendor/go.etcd.io/etcd/raft/v3/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/vendor/go.etcd.io/etcd/raft/v3/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/go.etcd.io/etcd/raft/v3/raftpb/confchange.go b/vendor/go.etcd.io/etcd/raft/v3/raftpb/confchange.go deleted file mode 100644 index 47fae65dfe..0000000000 --- a/vendor/go.etcd.io/etcd/raft/v3/raftpb/confchange.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package raftpb - -import ( - "fmt" - "strconv" - "strings" - - "github.com/gogo/protobuf/proto" -) - -// ConfChangeI abstracts over ConfChangeV2 and (legacy) ConfChange to allow -// treating them in a unified manner. -type ConfChangeI interface { - AsV2() ConfChangeV2 - AsV1() (ConfChange, bool) -} - -// MarshalConfChange calls Marshal on the underlying ConfChange or ConfChangeV2 -// and returns the result along with the corresponding EntryType. -func MarshalConfChange(c ConfChangeI) (EntryType, []byte, error) { - var typ EntryType - var ccdata []byte - var err error - if ccv1, ok := c.AsV1(); ok { - typ = EntryConfChange - ccdata, err = ccv1.Marshal() - } else { - ccv2 := c.AsV2() - typ = EntryConfChangeV2 - ccdata, err = ccv2.Marshal() - } - return typ, ccdata, err -} - -// AsV2 returns a V2 configuration change carrying out the same operation. -func (c ConfChange) AsV2() ConfChangeV2 { - return ConfChangeV2{ - Changes: []ConfChangeSingle{{ - Type: c.Type, - NodeID: c.NodeID, - }}, - Context: c.Context, - } -} - -// AsV1 returns the ConfChange and true. -func (c ConfChange) AsV1() (ConfChange, bool) { - return c, true -} - -// AsV2 is the identity. -func (c ConfChangeV2) AsV2() ConfChangeV2 { return c } - -// AsV1 returns ConfChange{} and false. -func (c ConfChangeV2) AsV1() (ConfChange, bool) { return ConfChange{}, false } - -// EnterJoint returns two bools. The second bool is true if and only if this -// config change will use Joint Consensus, which is the case if it contains more -// than one change or if the use of Joint Consensus was requested explicitly. -// The first bool can only be true if second one is, and indicates whether the -// Joint State will be left automatically. -func (c ConfChangeV2) EnterJoint() (autoLeave bool, ok bool) { - // NB: in theory, more config changes could qualify for the "simple" - // protocol but it depends on the config on top of which the changes apply. - // For example, adding two learners is not OK if both nodes are part of the - // base config (i.e. two voters are turned into learners in the process of - // applying the conf change). In practice, these distinctions should not - // matter, so we keep it simple and use Joint Consensus liberally. - if c.Transition != ConfChangeTransitionAuto || len(c.Changes) > 1 { - // Use Joint Consensus. - var autoLeave bool - switch c.Transition { - case ConfChangeTransitionAuto: - autoLeave = true - case ConfChangeTransitionJointImplicit: - autoLeave = true - case ConfChangeTransitionJointExplicit: - default: - panic(fmt.Sprintf("unknown transition: %+v", c)) - } - return autoLeave, true - } - return false, false -} - -// LeaveJoint is true if the configuration change leaves a joint configuration. -// This is the case if the ConfChangeV2 is zero, with the possible exception of -// the Context field. -func (c ConfChangeV2) LeaveJoint() bool { - // NB: c is already a copy. - c.Context = nil - return proto.Equal(&c, &ConfChangeV2{}) -} - -// ConfChangesFromString parses a Space-delimited sequence of operations into a -// slice of ConfChangeSingle. The supported operations are: -// - vn: make n a voter, -// - ln: make n a learner, -// - rn: remove n, and -// - un: update n. -func ConfChangesFromString(s string) ([]ConfChangeSingle, error) { - var ccs []ConfChangeSingle - toks := strings.Split(strings.TrimSpace(s), " ") - if toks[0] == "" { - toks = nil - } - for _, tok := range toks { - if len(tok) < 2 { - return nil, fmt.Errorf("unknown token %s", tok) - } - var cc ConfChangeSingle - switch tok[0] { - case 'v': - cc.Type = ConfChangeAddNode - case 'l': - cc.Type = ConfChangeAddLearnerNode - case 'r': - cc.Type = ConfChangeRemoveNode - case 'u': - cc.Type = ConfChangeUpdateNode - default: - return nil, fmt.Errorf("unknown input: %s", tok) - } - id, err := strconv.ParseUint(tok[1:], 10, 64) - if err != nil { - return nil, err - } - cc.NodeID = id - ccs = append(ccs, cc) - } - return ccs, nil -} - -// ConfChangesToString is the inverse to ConfChangesFromString. -func ConfChangesToString(ccs []ConfChangeSingle) string { - var buf strings.Builder - for i, cc := range ccs { - if i > 0 { - buf.WriteByte(' ') - } - switch cc.Type { - case ConfChangeAddNode: - buf.WriteByte('v') - case ConfChangeAddLearnerNode: - buf.WriteByte('l') - case ConfChangeRemoveNode: - buf.WriteByte('r') - case ConfChangeUpdateNode: - buf.WriteByte('u') - default: - buf.WriteString("unknown") - } - fmt.Fprintf(&buf, "%d", cc.NodeID) - } - return buf.String() -} diff --git a/vendor/go.etcd.io/etcd/raft/v3/raftpb/confstate.go b/vendor/go.etcd.io/etcd/raft/v3/raftpb/confstate.go deleted file mode 100644 index 39b9dd7000..0000000000 --- a/vendor/go.etcd.io/etcd/raft/v3/raftpb/confstate.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package raftpb - -import ( - "fmt" - "reflect" - "sort" -) - -// Equivalent returns a nil error if the inputs describe the same configuration. -// On mismatch, returns a descriptive error showing the differences. -func (cs ConfState) Equivalent(cs2 ConfState) error { - cs1 := cs - orig1, orig2 := cs1, cs2 - s := func(sl *[]uint64) { - *sl = append([]uint64(nil), *sl...) - sort.Slice(*sl, func(i, j int) bool { return (*sl)[i] < (*sl)[j] }) - } - - for _, cs := range []*ConfState{&cs1, &cs2} { - s(&cs.Voters) - s(&cs.Learners) - s(&cs.VotersOutgoing) - s(&cs.LearnersNext) - } - - if !reflect.DeepEqual(cs1, cs2) { - return fmt.Errorf("ConfStates not equivalent after sorting:\n%+#v\n%+#v\nInputs were:\n%+#v\n%+#v", cs1, cs2, orig1, orig2) - } - return nil -} diff --git a/vendor/go.etcd.io/etcd/raft/v3/raftpb/raft.pb.go b/vendor/go.etcd.io/etcd/raft/v3/raftpb/raft.pb.go deleted file mode 100644 index 1ee77a9a45..0000000000 --- a/vendor/go.etcd.io/etcd/raft/v3/raftpb/raft.pb.go +++ /dev/null @@ -1,2988 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: raft.proto - -package raftpb - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/golang/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type EntryType int32 - -const ( - EntryNormal EntryType = 0 - EntryConfChange EntryType = 1 - EntryConfChangeV2 EntryType = 2 -) - -var EntryType_name = map[int32]string{ - 0: "EntryNormal", - 1: "EntryConfChange", - 2: "EntryConfChangeV2", -} - -var EntryType_value = map[string]int32{ - "EntryNormal": 0, - "EntryConfChange": 1, - "EntryConfChangeV2": 2, -} - -func (x EntryType) Enum() *EntryType { - p := new(EntryType) - *p = x - return p -} - -func (x EntryType) String() string { - return proto.EnumName(EntryType_name, int32(x)) -} - -func (x *EntryType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EntryType_value, data, "EntryType") - if err != nil { - return err - } - *x = EntryType(value) - return nil -} - -func (EntryType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b042552c306ae59b, []int{0} -} - -// For description of different message types, see: -// https://pkg.go.dev/go.etcd.io/etcd/raft/v3#hdr-MessageType -type MessageType int32 - -const ( - MsgHup MessageType = 0 - MsgBeat MessageType = 1 - MsgProp MessageType = 2 - MsgApp MessageType = 3 - MsgAppResp MessageType = 4 - MsgVote MessageType = 5 - MsgVoteResp MessageType = 6 - MsgSnap MessageType = 7 - MsgHeartbeat MessageType = 8 - MsgHeartbeatResp MessageType = 9 - MsgUnreachable MessageType = 10 - MsgSnapStatus MessageType = 11 - MsgCheckQuorum MessageType = 12 - MsgTransferLeader MessageType = 13 - MsgTimeoutNow MessageType = 14 - MsgReadIndex MessageType = 15 - MsgReadIndexResp MessageType = 16 - MsgPreVote MessageType = 17 - MsgPreVoteResp MessageType = 18 -) - -var MessageType_name = map[int32]string{ - 0: "MsgHup", - 1: "MsgBeat", - 2: "MsgProp", - 3: "MsgApp", - 4: "MsgAppResp", - 5: "MsgVote", - 6: "MsgVoteResp", - 7: "MsgSnap", - 8: "MsgHeartbeat", - 9: "MsgHeartbeatResp", - 10: "MsgUnreachable", - 11: "MsgSnapStatus", - 12: "MsgCheckQuorum", - 13: "MsgTransferLeader", - 14: "MsgTimeoutNow", - 15: "MsgReadIndex", - 16: "MsgReadIndexResp", - 17: "MsgPreVote", - 18: "MsgPreVoteResp", -} - -var MessageType_value = map[string]int32{ - "MsgHup": 0, - "MsgBeat": 1, - "MsgProp": 2, - "MsgApp": 3, - "MsgAppResp": 4, - "MsgVote": 5, - "MsgVoteResp": 6, - "MsgSnap": 7, - "MsgHeartbeat": 8, - "MsgHeartbeatResp": 9, - "MsgUnreachable": 10, - "MsgSnapStatus": 11, - "MsgCheckQuorum": 12, - "MsgTransferLeader": 13, - "MsgTimeoutNow": 14, - "MsgReadIndex": 15, - "MsgReadIndexResp": 16, - "MsgPreVote": 17, - "MsgPreVoteResp": 18, -} - -func (x MessageType) Enum() *MessageType { - p := new(MessageType) - *p = x - return p -} - -func (x MessageType) String() string { - return proto.EnumName(MessageType_name, int32(x)) -} - -func (x *MessageType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(MessageType_value, data, "MessageType") - if err != nil { - return err - } - *x = MessageType(value) - return nil -} - -func (MessageType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b042552c306ae59b, []int{1} -} - -// ConfChangeTransition specifies the behavior of a configuration change with -// respect to joint consensus. -type ConfChangeTransition int32 - -const ( - // Automatically use the simple protocol if possible, otherwise fall back - // to ConfChangeJointImplicit. Most applications will want to use this. - ConfChangeTransitionAuto ConfChangeTransition = 0 - // Use joint consensus unconditionally, and transition out of them - // automatically (by proposing a zero configuration change). - // - // This option is suitable for applications that want to minimize the time - // spent in the joint configuration and do not store the joint configuration - // in the state machine (outside of InitialState). - ConfChangeTransitionJointImplicit ConfChangeTransition = 1 - // Use joint consensus and remain in the joint configuration until the - // application proposes a no-op configuration change. This is suitable for - // applications that want to explicitly control the transitions, for example - // to use a custom payload (via the Context field). - ConfChangeTransitionJointExplicit ConfChangeTransition = 2 -) - -var ConfChangeTransition_name = map[int32]string{ - 0: "ConfChangeTransitionAuto", - 1: "ConfChangeTransitionJointImplicit", - 2: "ConfChangeTransitionJointExplicit", -} - -var ConfChangeTransition_value = map[string]int32{ - "ConfChangeTransitionAuto": 0, - "ConfChangeTransitionJointImplicit": 1, - "ConfChangeTransitionJointExplicit": 2, -} - -func (x ConfChangeTransition) Enum() *ConfChangeTransition { - p := new(ConfChangeTransition) - *p = x - return p -} - -func (x ConfChangeTransition) String() string { - return proto.EnumName(ConfChangeTransition_name, int32(x)) -} - -func (x *ConfChangeTransition) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ConfChangeTransition_value, data, "ConfChangeTransition") - if err != nil { - return err - } - *x = ConfChangeTransition(value) - return nil -} - -func (ConfChangeTransition) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b042552c306ae59b, []int{2} -} - -type ConfChangeType int32 - -const ( - ConfChangeAddNode ConfChangeType = 0 - ConfChangeRemoveNode ConfChangeType = 1 - ConfChangeUpdateNode ConfChangeType = 2 - ConfChangeAddLearnerNode ConfChangeType = 3 -) - -var ConfChangeType_name = map[int32]string{ - 0: "ConfChangeAddNode", - 1: "ConfChangeRemoveNode", - 2: "ConfChangeUpdateNode", - 3: "ConfChangeAddLearnerNode", -} - -var ConfChangeType_value = map[string]int32{ - "ConfChangeAddNode": 0, - "ConfChangeRemoveNode": 1, - "ConfChangeUpdateNode": 2, - "ConfChangeAddLearnerNode": 3, -} - -func (x ConfChangeType) Enum() *ConfChangeType { - p := new(ConfChangeType) - *p = x - return p -} - -func (x ConfChangeType) String() string { - return proto.EnumName(ConfChangeType_name, int32(x)) -} - -func (x *ConfChangeType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ConfChangeType_value, data, "ConfChangeType") - if err != nil { - return err - } - *x = ConfChangeType(value) - return nil -} - -func (ConfChangeType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b042552c306ae59b, []int{3} -} - -type Entry struct { - Term uint64 `protobuf:"varint,2,opt,name=Term" json:"Term"` - Index uint64 `protobuf:"varint,3,opt,name=Index" json:"Index"` - Type EntryType `protobuf:"varint,1,opt,name=Type,enum=raftpb.EntryType" json:"Type"` - Data []byte `protobuf:"bytes,4,opt,name=Data" json:"Data,omitempty"` -} - -func (m *Entry) Reset() { *m = Entry{} } -func (m *Entry) String() string { return proto.CompactTextString(m) } -func (*Entry) ProtoMessage() {} -func (*Entry) Descriptor() ([]byte, []int) { - return fileDescriptor_b042552c306ae59b, []int{0} -} -func (m *Entry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Entry.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Entry) XXX_Merge(src proto.Message) { - xxx_messageInfo_Entry.Merge(m, src) -} -func (m *Entry) XXX_Size() int { - return m.Size() -} -func (m *Entry) XXX_DiscardUnknown() { - xxx_messageInfo_Entry.DiscardUnknown(m) -} - -var xxx_messageInfo_Entry proto.InternalMessageInfo - -type SnapshotMetadata struct { - ConfState ConfState `protobuf:"bytes,1,opt,name=conf_state,json=confState" json:"conf_state"` - Index uint64 `protobuf:"varint,2,opt,name=index" json:"index"` - Term uint64 `protobuf:"varint,3,opt,name=term" json:"term"` -} - -func (m *SnapshotMetadata) Reset() { *m = SnapshotMetadata{} } -func (m *SnapshotMetadata) String() string { return proto.CompactTextString(m) } -func (*SnapshotMetadata) ProtoMessage() {} -func (*SnapshotMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_b042552c306ae59b, []int{1} -} -func (m *SnapshotMetadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SnapshotMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SnapshotMetadata.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SnapshotMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotMetadata.Merge(m, src) -} -func (m *SnapshotMetadata) XXX_Size() int { - return m.Size() -} -func (m *SnapshotMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotMetadata proto.InternalMessageInfo - -type Snapshot struct { - Data []byte `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` - Metadata SnapshotMetadata `protobuf:"bytes,2,opt,name=metadata" json:"metadata"` -} - -func (m *Snapshot) Reset() { *m = Snapshot{} } -func (m *Snapshot) String() string { return proto.CompactTextString(m) } -func (*Snapshot) ProtoMessage() {} -func (*Snapshot) Descriptor() ([]byte, []int) { - return fileDescriptor_b042552c306ae59b, []int{2} -} -func (m *Snapshot) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Snapshot.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Snapshot) XXX_Merge(src proto.Message) { - xxx_messageInfo_Snapshot.Merge(m, src) -} -func (m *Snapshot) XXX_Size() int { - return m.Size() -} -func (m *Snapshot) XXX_DiscardUnknown() { - xxx_messageInfo_Snapshot.DiscardUnknown(m) -} - -var xxx_messageInfo_Snapshot proto.InternalMessageInfo - -type Message struct { - Type MessageType `protobuf:"varint,1,opt,name=type,enum=raftpb.MessageType" json:"type"` - To uint64 `protobuf:"varint,2,opt,name=to" json:"to"` - From uint64 `protobuf:"varint,3,opt,name=from" json:"from"` - Term uint64 `protobuf:"varint,4,opt,name=term" json:"term"` - // logTerm is generally used for appending Raft logs to followers. For example, - // (type=MsgApp,index=100,logTerm=5) means leader appends entries starting at - // index=101, and the term of entry at index 100 is 5. - // (type=MsgAppResp,reject=true,index=100,logTerm=5) means follower rejects some - // entries from its leader as it already has an entry with term 5 at index 100. - LogTerm uint64 `protobuf:"varint,5,opt,name=logTerm" json:"logTerm"` - Index uint64 `protobuf:"varint,6,opt,name=index" json:"index"` - Entries []Entry `protobuf:"bytes,7,rep,name=entries" json:"entries"` - Commit uint64 `protobuf:"varint,8,opt,name=commit" json:"commit"` - Snapshot Snapshot `protobuf:"bytes,9,opt,name=snapshot" json:"snapshot"` - Reject bool `protobuf:"varint,10,opt,name=reject" json:"reject"` - RejectHint uint64 `protobuf:"varint,11,opt,name=rejectHint" json:"rejectHint"` - Context []byte `protobuf:"bytes,12,opt,name=context" json:"context,omitempty"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_b042552c306ae59b, []int{3} -} -func (m *Message) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(m, src) -} -func (m *Message) XXX_Size() int { - return m.Size() -} -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} - -var xxx_messageInfo_Message proto.InternalMessageInfo - -type HardState struct { - Term uint64 `protobuf:"varint,1,opt,name=term" json:"term"` - Vote uint64 `protobuf:"varint,2,opt,name=vote" json:"vote"` - Commit uint64 `protobuf:"varint,3,opt,name=commit" json:"commit"` -} - -func (m *HardState) Reset() { *m = HardState{} } -func (m *HardState) String() string { return proto.CompactTextString(m) } -func (*HardState) ProtoMessage() {} -func (*HardState) Descriptor() ([]byte, []int) { - return fileDescriptor_b042552c306ae59b, []int{4} -} -func (m *HardState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HardState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HardState.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HardState) XXX_Merge(src proto.Message) { - xxx_messageInfo_HardState.Merge(m, src) -} -func (m *HardState) XXX_Size() int { - return m.Size() -} -func (m *HardState) XXX_DiscardUnknown() { - xxx_messageInfo_HardState.DiscardUnknown(m) -} - -var xxx_messageInfo_HardState proto.InternalMessageInfo - -type ConfState struct { - // The voters in the incoming config. (If the configuration is not joint, - // then the outgoing config is empty). - Voters []uint64 `protobuf:"varint,1,rep,name=voters" json:"voters,omitempty"` - // The learners in the incoming config. - Learners []uint64 `protobuf:"varint,2,rep,name=learners" json:"learners,omitempty"` - // The voters in the outgoing config. - VotersOutgoing []uint64 `protobuf:"varint,3,rep,name=voters_outgoing,json=votersOutgoing" json:"voters_outgoing,omitempty"` - // The nodes that will become learners when the outgoing config is removed. - // These nodes are necessarily currently in nodes_joint (or they would have - // been added to the incoming config right away). - LearnersNext []uint64 `protobuf:"varint,4,rep,name=learners_next,json=learnersNext" json:"learners_next,omitempty"` - // If set, the config is joint and Raft will automatically transition into - // the final config (i.e. remove the outgoing config) when this is safe. - AutoLeave bool `protobuf:"varint,5,opt,name=auto_leave,json=autoLeave" json:"auto_leave"` -} - -func (m *ConfState) Reset() { *m = ConfState{} } -func (m *ConfState) String() string { return proto.CompactTextString(m) } -func (*ConfState) ProtoMessage() {} -func (*ConfState) Descriptor() ([]byte, []int) { - return fileDescriptor_b042552c306ae59b, []int{5} -} -func (m *ConfState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConfState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConfState.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ConfState) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfState.Merge(m, src) -} -func (m *ConfState) XXX_Size() int { - return m.Size() -} -func (m *ConfState) XXX_DiscardUnknown() { - xxx_messageInfo_ConfState.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfState proto.InternalMessageInfo - -type ConfChange struct { - Type ConfChangeType `protobuf:"varint,2,opt,name=type,enum=raftpb.ConfChangeType" json:"type"` - NodeID uint64 `protobuf:"varint,3,opt,name=node_id,json=nodeId" json:"node_id"` - Context []byte `protobuf:"bytes,4,opt,name=context" json:"context,omitempty"` - // NB: this is used only by etcd to thread through a unique identifier. - // Ideally it should really use the Context instead. No counterpart to - // this field exists in ConfChangeV2. - ID uint64 `protobuf:"varint,1,opt,name=id" json:"id"` -} - -func (m *ConfChange) Reset() { *m = ConfChange{} } -func (m *ConfChange) String() string { return proto.CompactTextString(m) } -func (*ConfChange) ProtoMessage() {} -func (*ConfChange) Descriptor() ([]byte, []int) { - return fileDescriptor_b042552c306ae59b, []int{6} -} -func (m *ConfChange) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConfChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConfChange.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ConfChange) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfChange.Merge(m, src) -} -func (m *ConfChange) XXX_Size() int { - return m.Size() -} -func (m *ConfChange) XXX_DiscardUnknown() { - xxx_messageInfo_ConfChange.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfChange proto.InternalMessageInfo - -// ConfChangeSingle is an individual configuration change operation. Multiple -// such operations can be carried out atomically via a ConfChangeV2. -type ConfChangeSingle struct { - Type ConfChangeType `protobuf:"varint,1,opt,name=type,enum=raftpb.ConfChangeType" json:"type"` - NodeID uint64 `protobuf:"varint,2,opt,name=node_id,json=nodeId" json:"node_id"` -} - -func (m *ConfChangeSingle) Reset() { *m = ConfChangeSingle{} } -func (m *ConfChangeSingle) String() string { return proto.CompactTextString(m) } -func (*ConfChangeSingle) ProtoMessage() {} -func (*ConfChangeSingle) Descriptor() ([]byte, []int) { - return fileDescriptor_b042552c306ae59b, []int{7} -} -func (m *ConfChangeSingle) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConfChangeSingle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConfChangeSingle.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ConfChangeSingle) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfChangeSingle.Merge(m, src) -} -func (m *ConfChangeSingle) XXX_Size() int { - return m.Size() -} -func (m *ConfChangeSingle) XXX_DiscardUnknown() { - xxx_messageInfo_ConfChangeSingle.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfChangeSingle proto.InternalMessageInfo - -// ConfChangeV2 messages initiate configuration changes. They support both the -// simple "one at a time" membership change protocol and full Joint Consensus -// allowing for arbitrary changes in membership. -// -// The supplied context is treated as an opaque payload and can be used to -// attach an action on the state machine to the application of the config change -// proposal. Note that contrary to Joint Consensus as outlined in the Raft -// paper[1], configuration changes become active when they are *applied* to the -// state machine (not when they are appended to the log). -// -// The simple protocol can be used whenever only a single change is made. -// -// Non-simple changes require the use of Joint Consensus, for which two -// configuration changes are run. The first configuration change specifies the -// desired changes and transitions the Raft group into the joint configuration, -// in which quorum requires a majority of both the pre-changes and post-changes -// configuration. Joint Consensus avoids entering fragile intermediate -// configurations that could compromise survivability. For example, without the -// use of Joint Consensus and running across three availability zones with a -// replication factor of three, it is not possible to replace a voter without -// entering an intermediate configuration that does not survive the outage of -// one availability zone. -// -// The provided ConfChangeTransition specifies how (and whether) Joint Consensus -// is used, and assigns the task of leaving the joint configuration either to -// Raft or the application. Leaving the joint configuration is accomplished by -// proposing a ConfChangeV2 with only and optionally the Context field -// populated. -// -// For details on Raft membership changes, see: -// -// [1]: https://github.com/ongardie/dissertation/blob/master/online-trim.pdf -type ConfChangeV2 struct { - Transition ConfChangeTransition `protobuf:"varint,1,opt,name=transition,enum=raftpb.ConfChangeTransition" json:"transition"` - Changes []ConfChangeSingle `protobuf:"bytes,2,rep,name=changes" json:"changes"` - Context []byte `protobuf:"bytes,3,opt,name=context" json:"context,omitempty"` -} - -func (m *ConfChangeV2) Reset() { *m = ConfChangeV2{} } -func (m *ConfChangeV2) String() string { return proto.CompactTextString(m) } -func (*ConfChangeV2) ProtoMessage() {} -func (*ConfChangeV2) Descriptor() ([]byte, []int) { - return fileDescriptor_b042552c306ae59b, []int{8} -} -func (m *ConfChangeV2) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConfChangeV2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConfChangeV2.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ConfChangeV2) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfChangeV2.Merge(m, src) -} -func (m *ConfChangeV2) XXX_Size() int { - return m.Size() -} -func (m *ConfChangeV2) XXX_DiscardUnknown() { - xxx_messageInfo_ConfChangeV2.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfChangeV2 proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("raftpb.EntryType", EntryType_name, EntryType_value) - proto.RegisterEnum("raftpb.MessageType", MessageType_name, MessageType_value) - proto.RegisterEnum("raftpb.ConfChangeTransition", ConfChangeTransition_name, ConfChangeTransition_value) - proto.RegisterEnum("raftpb.ConfChangeType", ConfChangeType_name, ConfChangeType_value) - proto.RegisterType((*Entry)(nil), "raftpb.Entry") - proto.RegisterType((*SnapshotMetadata)(nil), "raftpb.SnapshotMetadata") - proto.RegisterType((*Snapshot)(nil), "raftpb.Snapshot") - proto.RegisterType((*Message)(nil), "raftpb.Message") - proto.RegisterType((*HardState)(nil), "raftpb.HardState") - proto.RegisterType((*ConfState)(nil), "raftpb.ConfState") - proto.RegisterType((*ConfChange)(nil), "raftpb.ConfChange") - proto.RegisterType((*ConfChangeSingle)(nil), "raftpb.ConfChangeSingle") - proto.RegisterType((*ConfChangeV2)(nil), "raftpb.ConfChangeV2") -} - -func init() { proto.RegisterFile("raft.proto", fileDescriptor_b042552c306ae59b) } - -var fileDescriptor_b042552c306ae59b = []byte{ - // 1026 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcd, 0x6e, 0xdb, 0x46, - 0x17, 0x25, 0x29, 0x5a, 0x3f, 0x57, 0xb2, 0x3c, 0xbe, 0xf1, 0x17, 0x10, 0x86, 0xc1, 0xe8, 0x53, - 0x52, 0x44, 0x70, 0x11, 0xb7, 0xd0, 0xa2, 0x28, 0xba, 0xf3, 0x4f, 0x00, 0xab, 0xb0, 0xdc, 0x54, - 0x76, 0xbc, 0x28, 0x50, 0x08, 0x63, 0x71, 0x44, 0xb3, 0x15, 0x39, 0x04, 0x39, 0x72, 0xed, 0x4d, - 0x51, 0xf4, 0x09, 0xba, 0xec, 0x26, 0xdb, 0x3e, 0x40, 0x9f, 0xc2, 0x4b, 0x03, 0xdd, 0x74, 0x15, - 0x34, 0xf6, 0x8b, 0x14, 0x33, 0x1c, 0x4a, 0x94, 0x6c, 0x64, 0xd1, 0xdd, 0xcc, 0xb9, 0x67, 0xee, - 0x9c, 0x73, 0xef, 0xe5, 0x10, 0x20, 0xa1, 0x63, 0xb1, 0x13, 0x27, 0x5c, 0x70, 0x2c, 0xcb, 0x75, - 0x7c, 0xbe, 0xb9, 0xe1, 0x73, 0x9f, 0x2b, 0xe8, 0x33, 0xb9, 0xca, 0xa2, 0xed, 0x9f, 0x61, 0xe5, - 0x75, 0x24, 0x92, 0x6b, 0x74, 0xc0, 0x3e, 0x65, 0x49, 0xe8, 0x58, 0x2d, 0xb3, 0x63, 0xef, 0xd9, - 0x37, 0xef, 0x9f, 0x19, 0x03, 0x85, 0xe0, 0x26, 0xac, 0xf4, 0x22, 0x8f, 0x5d, 0x39, 0xa5, 0x42, - 0x28, 0x83, 0xf0, 0x53, 0xb0, 0x4f, 0xaf, 0x63, 0xe6, 0x98, 0x2d, 0xb3, 0xd3, 0xec, 0xae, 0xef, - 0x64, 0x77, 0xed, 0xa8, 0x94, 0x32, 0x30, 0x4b, 0x74, 0x1d, 0x33, 0x44, 0xb0, 0x0f, 0xa8, 0xa0, - 0x8e, 0xdd, 0x32, 0x3b, 0x8d, 0x81, 0x5a, 0xb7, 0x7f, 0x31, 0x81, 0x9c, 0x44, 0x34, 0x4e, 0x2f, - 0xb8, 0xe8, 0x33, 0x41, 0x3d, 0x2a, 0x28, 0x7e, 0x01, 0x30, 0xe2, 0xd1, 0x78, 0x98, 0x0a, 0x2a, - 0xb2, 0xdc, 0xf5, 0x79, 0xee, 0x7d, 0x1e, 0x8d, 0x4f, 0x64, 0x40, 0xe7, 0xae, 0x8d, 0x72, 0x40, - 0x2a, 0x0d, 0x94, 0xd2, 0xa2, 0x89, 0x0c, 0x92, 0xfe, 0x84, 0xf4, 0x57, 0x34, 0xa1, 0x90, 0xf6, - 0x77, 0x50, 0xcd, 0x15, 0x48, 0x89, 0x52, 0x81, 0xba, 0xb3, 0x31, 0x50, 0x6b, 0xfc, 0x0a, 0xaa, - 0xa1, 0x56, 0xa6, 0x12, 0xd7, 0xbb, 0x4e, 0xae, 0x65, 0x59, 0xb9, 0xce, 0x3b, 0xe3, 0xb7, 0xdf, - 0x95, 0xa0, 0xd2, 0x67, 0x69, 0x4a, 0x7d, 0x86, 0xaf, 0xc0, 0x16, 0xf3, 0x5a, 0x3d, 0xc9, 0x73, - 0xe8, 0x70, 0xb1, 0x5a, 0x92, 0x86, 0x1b, 0x60, 0x09, 0xbe, 0xe0, 0xc4, 0x12, 0x5c, 0xda, 0x18, - 0x27, 0x7c, 0xc9, 0x86, 0x44, 0x66, 0x06, 0xed, 0x65, 0x83, 0xe8, 0x42, 0x65, 0xc2, 0x7d, 0xd5, - 0xdd, 0x95, 0x42, 0x30, 0x07, 0xe7, 0x65, 0x2b, 0x3f, 0x2c, 0xdb, 0x2b, 0xa8, 0xb0, 0x48, 0x24, - 0x01, 0x4b, 0x9d, 0x4a, 0xab, 0xd4, 0xa9, 0x77, 0x57, 0x17, 0x7a, 0x9c, 0xa7, 0xd2, 0x1c, 0xdc, - 0x82, 0xf2, 0x88, 0x87, 0x61, 0x20, 0x9c, 0x6a, 0x21, 0x97, 0xc6, 0xb0, 0x0b, 0xd5, 0x54, 0x57, - 0xcc, 0xa9, 0xa9, 0x4a, 0x92, 0xe5, 0x4a, 0xe6, 0x15, 0xcc, 0x79, 0x32, 0x63, 0xc2, 0x7e, 0x60, - 0x23, 0xe1, 0x40, 0xcb, 0xec, 0x54, 0xf3, 0x8c, 0x19, 0x86, 0x2f, 0x00, 0xb2, 0xd5, 0x61, 0x10, - 0x09, 0xa7, 0x5e, 0xb8, 0xb3, 0x80, 0xa3, 0x03, 0x95, 0x11, 0x8f, 0x04, 0xbb, 0x12, 0x4e, 0x43, - 0x35, 0x36, 0xdf, 0xb6, 0xbf, 0x87, 0xda, 0x21, 0x4d, 0xbc, 0x6c, 0x7c, 0xf2, 0x0a, 0x9a, 0x0f, - 0x2a, 0xe8, 0x80, 0x7d, 0xc9, 0x05, 0x5b, 0xfc, 0x38, 0x24, 0x52, 0x30, 0x5c, 0x7a, 0x68, 0xb8, - 0xfd, 0xa7, 0x09, 0xb5, 0xd9, 0xbc, 0xe2, 0x53, 0x28, 0xcb, 0x33, 0x49, 0xea, 0x98, 0xad, 0x52, - 0xc7, 0x1e, 0xe8, 0x1d, 0x6e, 0x42, 0x75, 0xc2, 0x68, 0x12, 0xc9, 0x88, 0xa5, 0x22, 0xb3, 0x3d, - 0xbe, 0x84, 0xb5, 0x8c, 0x35, 0xe4, 0x53, 0xe1, 0xf3, 0x20, 0xf2, 0x9d, 0x92, 0xa2, 0x34, 0x33, - 0xf8, 0x1b, 0x8d, 0xe2, 0x73, 0x58, 0xcd, 0x0f, 0x0d, 0x23, 0xe9, 0xd4, 0x56, 0xb4, 0x46, 0x0e, - 0x1e, 0xb3, 0x2b, 0x81, 0xcf, 0x01, 0xe8, 0x54, 0xf0, 0xe1, 0x84, 0xd1, 0x4b, 0xa6, 0x86, 0x21, - 0x2f, 0x68, 0x4d, 0xe2, 0x47, 0x12, 0x6e, 0xbf, 0x33, 0x01, 0xa4, 0xe8, 0xfd, 0x0b, 0x1a, 0xf9, - 0x0c, 0x3f, 0xd7, 0x63, 0x6b, 0xa9, 0xb1, 0x7d, 0x5a, 0xfc, 0x0c, 0x33, 0xc6, 0x83, 0xc9, 0x7d, - 0x09, 0x95, 0x88, 0x7b, 0x6c, 0x18, 0x78, 0xba, 0x28, 0x4d, 0x19, 0xbc, 0x7b, 0xff, 0xac, 0x7c, - 0xcc, 0x3d, 0xd6, 0x3b, 0x18, 0x94, 0x65, 0xb8, 0xe7, 0x15, 0xfb, 0x62, 0x2f, 0xf4, 0x05, 0x37, - 0xc1, 0x0a, 0x3c, 0xdd, 0x08, 0xd0, 0xa7, 0xad, 0xde, 0xc1, 0xc0, 0x0a, 0xbc, 0x76, 0x08, 0x64, - 0x7e, 0xf9, 0x49, 0x10, 0xf9, 0x93, 0xb9, 0x48, 0xf3, 0xbf, 0x88, 0xb4, 0x3e, 0x26, 0xb2, 0xfd, - 0x87, 0x09, 0x8d, 0x79, 0x9e, 0xb3, 0x2e, 0xee, 0x01, 0x88, 0x84, 0x46, 0x69, 0x20, 0x02, 0x1e, - 0xe9, 0x1b, 0xb7, 0x1e, 0xb9, 0x71, 0xc6, 0xc9, 0x27, 0x72, 0x7e, 0x0a, 0xbf, 0x84, 0xca, 0x48, - 0xb1, 0xb2, 0x8e, 0x17, 0x9e, 0x94, 0x65, 0x6b, 0xf9, 0x17, 0xa6, 0xe9, 0xc5, 0x9a, 0x95, 0x16, - 0x6a, 0xb6, 0x7d, 0x08, 0xb5, 0xd9, 0xbb, 0x8b, 0x6b, 0x50, 0x57, 0x9b, 0x63, 0x9e, 0x84, 0x74, - 0x42, 0x0c, 0x7c, 0x02, 0x6b, 0x0a, 0x98, 0xe7, 0x27, 0x26, 0xfe, 0x0f, 0xd6, 0x97, 0xc0, 0xb3, - 0x2e, 0xb1, 0xb6, 0xff, 0xb2, 0xa0, 0x5e, 0x78, 0x96, 0x10, 0xa0, 0xdc, 0x4f, 0xfd, 0xc3, 0x69, - 0x4c, 0x0c, 0xac, 0x43, 0xa5, 0x9f, 0xfa, 0x7b, 0x8c, 0x0a, 0x62, 0xea, 0xcd, 0x9b, 0x84, 0xc7, - 0xc4, 0xd2, 0xac, 0xdd, 0x38, 0x26, 0x25, 0x6c, 0x02, 0x64, 0xeb, 0x01, 0x4b, 0x63, 0x62, 0x6b, - 0xe2, 0x19, 0x17, 0x8c, 0xac, 0x48, 0x6d, 0x7a, 0xa3, 0xa2, 0x65, 0x1d, 0x95, 0x4f, 0x00, 0xa9, - 0x20, 0x81, 0x86, 0xbc, 0x8c, 0xd1, 0x44, 0x9c, 0xcb, 0x5b, 0xaa, 0xb8, 0x01, 0xa4, 0x88, 0xa8, - 0x43, 0x35, 0x44, 0x68, 0xf6, 0x53, 0xff, 0x6d, 0x94, 0x30, 0x3a, 0xba, 0xa0, 0xe7, 0x13, 0x46, - 0x00, 0xd7, 0x61, 0x55, 0x27, 0x92, 0x5f, 0xdc, 0x34, 0x25, 0x75, 0x4d, 0xdb, 0xbf, 0x60, 0xa3, - 0x1f, 0xbf, 0x9d, 0xf2, 0x64, 0x1a, 0x92, 0x86, 0xb4, 0xdd, 0x4f, 0x7d, 0xd5, 0xa0, 0x31, 0x4b, - 0x8e, 0x18, 0xf5, 0x58, 0x42, 0x56, 0xf5, 0xe9, 0xd3, 0x20, 0x64, 0x7c, 0x2a, 0x8e, 0xf9, 0x4f, - 0xa4, 0xa9, 0xc5, 0x0c, 0x18, 0xf5, 0xd4, 0xff, 0x8e, 0xac, 0x69, 0x31, 0x33, 0x44, 0x89, 0x21, - 0xda, 0xef, 0x9b, 0x84, 0x29, 0x8b, 0xeb, 0xfa, 0x56, 0xbd, 0x57, 0x1c, 0xdc, 0xfe, 0xd5, 0x84, - 0x8d, 0xc7, 0xc6, 0x03, 0xb7, 0xc0, 0x79, 0x0c, 0xdf, 0x9d, 0x0a, 0x4e, 0x0c, 0xfc, 0x04, 0xfe, - 0xff, 0x58, 0xf4, 0x6b, 0x1e, 0x44, 0xa2, 0x17, 0xc6, 0x93, 0x60, 0x14, 0xc8, 0x56, 0x7c, 0x8c, - 0xf6, 0xfa, 0x4a, 0xd3, 0xac, 0xed, 0x6b, 0x68, 0x2e, 0x7e, 0x14, 0xb2, 0x18, 0x73, 0x64, 0xd7, - 0xf3, 0xe4, 0xf8, 0x13, 0x03, 0x9d, 0xa2, 0xd8, 0x01, 0x0b, 0xf9, 0x25, 0x53, 0x11, 0x73, 0x31, - 0xf2, 0x36, 0xf6, 0xa8, 0xc8, 0x22, 0xd6, 0xa2, 0x91, 0x5d, 0xcf, 0x3b, 0xca, 0xde, 0x1e, 0x15, - 0x2d, 0xed, 0xbd, 0xb8, 0xf9, 0xe0, 0x1a, 0xb7, 0x1f, 0x5c, 0xe3, 0xe6, 0xce, 0x35, 0x6f, 0xef, - 0x5c, 0xf3, 0x9f, 0x3b, 0xd7, 0xfc, 0xed, 0xde, 0x35, 0x7e, 0xbf, 0x77, 0x8d, 0xdb, 0x7b, 0xd7, - 0xf8, 0xfb, 0xde, 0x35, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xee, 0xe3, 0x39, 0x8b, 0xbb, 0x08, - 0x00, 0x00, -} - -func (m *Entry) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Entry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Entry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Data != nil { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintRaft(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x22 - } - i = encodeVarintRaft(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x18 - i = encodeVarintRaft(dAtA, i, uint64(m.Term)) - i-- - dAtA[i] = 0x10 - i = encodeVarintRaft(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - return len(dAtA) - i, nil -} - -func (m *SnapshotMetadata) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SnapshotMetadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i = encodeVarintRaft(dAtA, i, uint64(m.Term)) - i-- - dAtA[i] = 0x18 - i = encodeVarintRaft(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x10 - { - size, err := m.ConfState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Snapshot) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Snapshot) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.Data != nil { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintRaft(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Message) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Message) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Context != nil { - i -= len(m.Context) - copy(dAtA[i:], m.Context) - i = encodeVarintRaft(dAtA, i, uint64(len(m.Context))) - i-- - dAtA[i] = 0x62 - } - i = encodeVarintRaft(dAtA, i, uint64(m.RejectHint)) - i-- - dAtA[i] = 0x58 - i-- - if m.Reject { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x50 - { - size, err := m.Snapshot.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - i = encodeVarintRaft(dAtA, i, uint64(m.Commit)) - i-- - dAtA[i] = 0x40 - if len(m.Entries) > 0 { - for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - i = encodeVarintRaft(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x30 - i = encodeVarintRaft(dAtA, i, uint64(m.LogTerm)) - i-- - dAtA[i] = 0x28 - i = encodeVarintRaft(dAtA, i, uint64(m.Term)) - i-- - dAtA[i] = 0x20 - i = encodeVarintRaft(dAtA, i, uint64(m.From)) - i-- - dAtA[i] = 0x18 - i = encodeVarintRaft(dAtA, i, uint64(m.To)) - i-- - dAtA[i] = 0x10 - i = encodeVarintRaft(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - return len(dAtA) - i, nil -} - -func (m *HardState) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HardState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HardState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i = encodeVarintRaft(dAtA, i, uint64(m.Commit)) - i-- - dAtA[i] = 0x18 - i = encodeVarintRaft(dAtA, i, uint64(m.Vote)) - i-- - dAtA[i] = 0x10 - i = encodeVarintRaft(dAtA, i, uint64(m.Term)) - i-- - dAtA[i] = 0x8 - return len(dAtA) - i, nil -} - -func (m *ConfState) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConfState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConfState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i-- - if m.AutoLeave { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - if len(m.LearnersNext) > 0 { - for iNdEx := len(m.LearnersNext) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarintRaft(dAtA, i, uint64(m.LearnersNext[iNdEx])) - i-- - dAtA[i] = 0x20 - } - } - if len(m.VotersOutgoing) > 0 { - for iNdEx := len(m.VotersOutgoing) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarintRaft(dAtA, i, uint64(m.VotersOutgoing[iNdEx])) - i-- - dAtA[i] = 0x18 - } - } - if len(m.Learners) > 0 { - for iNdEx := len(m.Learners) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarintRaft(dAtA, i, uint64(m.Learners[iNdEx])) - i-- - dAtA[i] = 0x10 - } - } - if len(m.Voters) > 0 { - for iNdEx := len(m.Voters) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarintRaft(dAtA, i, uint64(m.Voters[iNdEx])) - i-- - dAtA[i] = 0x8 - } - } - return len(dAtA) - i, nil -} - -func (m *ConfChange) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConfChange) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConfChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Context != nil { - i -= len(m.Context) - copy(dAtA[i:], m.Context) - i = encodeVarintRaft(dAtA, i, uint64(len(m.Context))) - i-- - dAtA[i] = 0x22 - } - i = encodeVarintRaft(dAtA, i, uint64(m.NodeID)) - i-- - dAtA[i] = 0x18 - i = encodeVarintRaft(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x10 - i = encodeVarintRaft(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - return len(dAtA) - i, nil -} - -func (m *ConfChangeSingle) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConfChangeSingle) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConfChangeSingle) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i = encodeVarintRaft(dAtA, i, uint64(m.NodeID)) - i-- - dAtA[i] = 0x10 - i = encodeVarintRaft(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - return len(dAtA) - i, nil -} - -func (m *ConfChangeV2) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConfChangeV2) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConfChangeV2) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Context != nil { - i -= len(m.Context) - copy(dAtA[i:], m.Context) - i = encodeVarintRaft(dAtA, i, uint64(len(m.Context))) - i-- - dAtA[i] = 0x1a - } - if len(m.Changes) > 0 { - for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Changes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaft(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - i = encodeVarintRaft(dAtA, i, uint64(m.Transition)) - i-- - dAtA[i] = 0x8 - return len(dAtA) - i, nil -} - -func encodeVarintRaft(dAtA []byte, offset int, v uint64) int { - offset -= sovRaft(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Entry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovRaft(uint64(m.Type)) - n += 1 + sovRaft(uint64(m.Term)) - n += 1 + sovRaft(uint64(m.Index)) - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovRaft(uint64(l)) - } - return n -} - -func (m *SnapshotMetadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ConfState.Size() - n += 1 + l + sovRaft(uint64(l)) - n += 1 + sovRaft(uint64(m.Index)) - n += 1 + sovRaft(uint64(m.Term)) - return n -} - -func (m *Snapshot) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovRaft(uint64(l)) - } - l = m.Metadata.Size() - n += 1 + l + sovRaft(uint64(l)) - return n -} - -func (m *Message) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovRaft(uint64(m.Type)) - n += 1 + sovRaft(uint64(m.To)) - n += 1 + sovRaft(uint64(m.From)) - n += 1 + sovRaft(uint64(m.Term)) - n += 1 + sovRaft(uint64(m.LogTerm)) - n += 1 + sovRaft(uint64(m.Index)) - if len(m.Entries) > 0 { - for _, e := range m.Entries { - l = e.Size() - n += 1 + l + sovRaft(uint64(l)) - } - } - n += 1 + sovRaft(uint64(m.Commit)) - l = m.Snapshot.Size() - n += 1 + l + sovRaft(uint64(l)) - n += 2 - n += 1 + sovRaft(uint64(m.RejectHint)) - if m.Context != nil { - l = len(m.Context) - n += 1 + l + sovRaft(uint64(l)) - } - return n -} - -func (m *HardState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovRaft(uint64(m.Term)) - n += 1 + sovRaft(uint64(m.Vote)) - n += 1 + sovRaft(uint64(m.Commit)) - return n -} - -func (m *ConfState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Voters) > 0 { - for _, e := range m.Voters { - n += 1 + sovRaft(uint64(e)) - } - } - if len(m.Learners) > 0 { - for _, e := range m.Learners { - n += 1 + sovRaft(uint64(e)) - } - } - if len(m.VotersOutgoing) > 0 { - for _, e := range m.VotersOutgoing { - n += 1 + sovRaft(uint64(e)) - } - } - if len(m.LearnersNext) > 0 { - for _, e := range m.LearnersNext { - n += 1 + sovRaft(uint64(e)) - } - } - n += 2 - return n -} - -func (m *ConfChange) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovRaft(uint64(m.ID)) - n += 1 + sovRaft(uint64(m.Type)) - n += 1 + sovRaft(uint64(m.NodeID)) - if m.Context != nil { - l = len(m.Context) - n += 1 + l + sovRaft(uint64(l)) - } - return n -} - -func (m *ConfChangeSingle) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovRaft(uint64(m.Type)) - n += 1 + sovRaft(uint64(m.NodeID)) - return n -} - -func (m *ConfChangeV2) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovRaft(uint64(m.Transition)) - if len(m.Changes) > 0 { - for _, e := range m.Changes { - l = e.Size() - n += 1 + l + sovRaft(uint64(l)) - } - } - if m.Context != nil { - l = len(m.Context) - n += 1 + l + sovRaft(uint64(l)) - } - return n -} - -func sovRaft(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRaft(x uint64) (n int) { - return sovRaft(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Entry) Unmarshal(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 ErrIntOverflowRaft - } - 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: Entry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Entry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= EntryType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType) - } - m.Term = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Term |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SnapshotMetadata) Unmarshal(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 ErrIntOverflowRaft - } - 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: SnapshotMetadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotMetadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConfState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ConfState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType) - } - m.Term = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Term |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Snapshot) Unmarshal(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 ErrIntOverflowRaft - } - 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: Snapshot: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Message) Unmarshal(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 ErrIntOverflowRaft - } - 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: Message: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= MessageType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - m.To = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.To |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) - } - m.From = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.From |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType) - } - m.Term = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Term |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LogTerm", wireType) - } - m.LogTerm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LogTerm |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Entries = append(m.Entries, Entry{}) - if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) - } - m.Commit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Commit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Snapshot.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Reject", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Reject = bool(v != 0) - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RejectHint", wireType) - } - m.RejectHint = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RejectHint |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...) - if m.Context == nil { - m.Context = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HardState) Unmarshal(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 ErrIntOverflowRaft - } - 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: HardState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HardState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType) - } - m.Term = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Term |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) - } - m.Vote = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Vote |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) - } - m.Commit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Commit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConfState) Unmarshal(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 ErrIntOverflowRaft - } - 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: ConfState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConfState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Voters = append(m.Voters, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.Voters) == 0 { - m.Voters = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Voters = append(m.Voters, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Voters", wireType) - } - case 2: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Learners = append(m.Learners, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.Learners) == 0 { - m.Learners = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Learners = append(m.Learners, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Learners", wireType) - } - case 3: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.VotersOutgoing = append(m.VotersOutgoing, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.VotersOutgoing) == 0 { - m.VotersOutgoing = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.VotersOutgoing = append(m.VotersOutgoing, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field VotersOutgoing", wireType) - } - case 4: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.LearnersNext = append(m.LearnersNext, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.LearnersNext) == 0 { - m.LearnersNext = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.LearnersNext = append(m.LearnersNext, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field LearnersNext", wireType) - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AutoLeave", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AutoLeave = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConfChange) Unmarshal(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 ErrIntOverflowRaft - } - 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: ConfChange: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConfChange: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= ConfChangeType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - m.NodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NodeID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...) - if m.Context == nil { - m.Context = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConfChangeSingle) Unmarshal(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 ErrIntOverflowRaft - } - 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: ConfChangeSingle: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConfChangeSingle: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= ConfChangeType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - m.NodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NodeID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConfChangeV2) Unmarshal(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 ErrIntOverflowRaft - } - 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: ConfChangeV2: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConfChangeV2: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Transition", wireType) - } - m.Transition = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Transition |= ConfChangeTransition(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Changes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Changes = append(m.Changes, ConfChangeSingle{}) - if err := m.Changes[len(m.Changes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRaft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...) - if m.Context == nil { - m.Context = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRaft(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaft - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaft - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaft - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRaft - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRaft - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRaft - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthRaft = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRaft = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRaft = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/go.etcd.io/etcd/raft/v3/raftpb/raft.proto b/vendor/go.etcd.io/etcd/raft/v3/raftpb/raft.proto deleted file mode 100644 index f46a54c948..0000000000 --- a/vendor/go.etcd.io/etcd/raft/v3/raftpb/raft.proto +++ /dev/null @@ -1,187 +0,0 @@ -syntax = "proto2"; -package raftpb; - -import "gogoproto/gogo.proto"; - -option (gogoproto.marshaler_all) = true; -option (gogoproto.sizer_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.goproto_enum_prefix_all) = false; -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; - -enum EntryType { - EntryNormal = 0; - EntryConfChange = 1; // corresponds to pb.ConfChange - EntryConfChangeV2 = 2; // corresponds to pb.ConfChangeV2 -} - -message Entry { - optional uint64 Term = 2 [(gogoproto.nullable) = false]; // must be 64-bit aligned for atomic operations - optional uint64 Index = 3 [(gogoproto.nullable) = false]; // must be 64-bit aligned for atomic operations - optional EntryType Type = 1 [(gogoproto.nullable) = false]; - optional bytes Data = 4; -} - -message SnapshotMetadata { - optional ConfState conf_state = 1 [(gogoproto.nullable) = false]; - optional uint64 index = 2 [(gogoproto.nullable) = false]; - optional uint64 term = 3 [(gogoproto.nullable) = false]; -} - -message Snapshot { - optional bytes data = 1; - optional SnapshotMetadata metadata = 2 [(gogoproto.nullable) = false]; -} - -// For description of different message types, see: -// https://pkg.go.dev/go.etcd.io/etcd/raft/v3#hdr-MessageType -enum MessageType { - MsgHup = 0; - MsgBeat = 1; - MsgProp = 2; - MsgApp = 3; - MsgAppResp = 4; - MsgVote = 5; - MsgVoteResp = 6; - MsgSnap = 7; - MsgHeartbeat = 8; - MsgHeartbeatResp = 9; - MsgUnreachable = 10; - MsgSnapStatus = 11; - MsgCheckQuorum = 12; - MsgTransferLeader = 13; - MsgTimeoutNow = 14; - MsgReadIndex = 15; - MsgReadIndexResp = 16; - MsgPreVote = 17; - MsgPreVoteResp = 18; -} - -message Message { - optional MessageType type = 1 [(gogoproto.nullable) = false]; - optional uint64 to = 2 [(gogoproto.nullable) = false]; - optional uint64 from = 3 [(gogoproto.nullable) = false]; - optional uint64 term = 4 [(gogoproto.nullable) = false]; - // logTerm is generally used for appending Raft logs to followers. For example, - // (type=MsgApp,index=100,logTerm=5) means leader appends entries starting at - // index=101, and the term of entry at index 100 is 5. - // (type=MsgAppResp,reject=true,index=100,logTerm=5) means follower rejects some - // entries from its leader as it already has an entry with term 5 at index 100. - optional uint64 logTerm = 5 [(gogoproto.nullable) = false]; - optional uint64 index = 6 [(gogoproto.nullable) = false]; - repeated Entry entries = 7 [(gogoproto.nullable) = false]; - optional uint64 commit = 8 [(gogoproto.nullable) = false]; - optional Snapshot snapshot = 9 [(gogoproto.nullable) = false]; - optional bool reject = 10 [(gogoproto.nullable) = false]; - optional uint64 rejectHint = 11 [(gogoproto.nullable) = false]; - optional bytes context = 12; -} - -message HardState { - optional uint64 term = 1 [(gogoproto.nullable) = false]; - optional uint64 vote = 2 [(gogoproto.nullable) = false]; - optional uint64 commit = 3 [(gogoproto.nullable) = false]; -} - -// ConfChangeTransition specifies the behavior of a configuration change with -// respect to joint consensus. -enum ConfChangeTransition { - // Automatically use the simple protocol if possible, otherwise fall back - // to ConfChangeJointImplicit. Most applications will want to use this. - ConfChangeTransitionAuto = 0; - // Use joint consensus unconditionally, and transition out of them - // automatically (by proposing a zero configuration change). - // - // This option is suitable for applications that want to minimize the time - // spent in the joint configuration and do not store the joint configuration - // in the state machine (outside of InitialState). - ConfChangeTransitionJointImplicit = 1; - // Use joint consensus and remain in the joint configuration until the - // application proposes a no-op configuration change. This is suitable for - // applications that want to explicitly control the transitions, for example - // to use a custom payload (via the Context field). - ConfChangeTransitionJointExplicit = 2; -} - -message ConfState { - // The voters in the incoming config. (If the configuration is not joint, - // then the outgoing config is empty). - repeated uint64 voters = 1; - // The learners in the incoming config. - repeated uint64 learners = 2; - // The voters in the outgoing config. - repeated uint64 voters_outgoing = 3; - // The nodes that will become learners when the outgoing config is removed. - // These nodes are necessarily currently in nodes_joint (or they would have - // been added to the incoming config right away). - repeated uint64 learners_next = 4; - // If set, the config is joint and Raft will automatically transition into - // the final config (i.e. remove the outgoing config) when this is safe. - optional bool auto_leave = 5 [(gogoproto.nullable) = false]; -} - -enum ConfChangeType { - ConfChangeAddNode = 0; - ConfChangeRemoveNode = 1; - ConfChangeUpdateNode = 2; - ConfChangeAddLearnerNode = 3; -} - -message ConfChange { - optional ConfChangeType type = 2 [(gogoproto.nullable) = false]; - optional uint64 node_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "NodeID" ]; - optional bytes context = 4; - - // NB: this is used only by etcd to thread through a unique identifier. - // Ideally it should really use the Context instead. No counterpart to - // this field exists in ConfChangeV2. - optional uint64 id = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "ID" ]; -} - -// ConfChangeSingle is an individual configuration change operation. Multiple -// such operations can be carried out atomically via a ConfChangeV2. -message ConfChangeSingle { - optional ConfChangeType type = 1 [(gogoproto.nullable) = false]; - optional uint64 node_id = 2 [(gogoproto.nullable) = false, (gogoproto.customname) = "NodeID"]; -} - -// ConfChangeV2 messages initiate configuration changes. They support both the -// simple "one at a time" membership change protocol and full Joint Consensus -// allowing for arbitrary changes in membership. -// -// The supplied context is treated as an opaque payload and can be used to -// attach an action on the state machine to the application of the config change -// proposal. Note that contrary to Joint Consensus as outlined in the Raft -// paper[1], configuration changes become active when they are *applied* to the -// state machine (not when they are appended to the log). -// -// The simple protocol can be used whenever only a single change is made. -// -// Non-simple changes require the use of Joint Consensus, for which two -// configuration changes are run. The first configuration change specifies the -// desired changes and transitions the Raft group into the joint configuration, -// in which quorum requires a majority of both the pre-changes and post-changes -// configuration. Joint Consensus avoids entering fragile intermediate -// configurations that could compromise survivability. For example, without the -// use of Joint Consensus and running across three availability zones with a -// replication factor of three, it is not possible to replace a voter without -// entering an intermediate configuration that does not survive the outage of -// one availability zone. -// -// The provided ConfChangeTransition specifies how (and whether) Joint Consensus -// is used, and assigns the task of leaving the joint configuration either to -// Raft or the application. Leaving the joint configuration is accomplished by -// proposing a ConfChangeV2 with only and optionally the Context field -// populated. -// -// For details on Raft membership changes, see: -// -// [1]: https://github.com/ongardie/dissertation/blob/master/online-trim.pdf -message ConfChangeV2 { - optional ConfChangeTransition transition = 1 [(gogoproto.nullable) = false]; - repeated ConfChangeSingle changes = 2 [(gogoproto.nullable) = false]; - optional bytes context = 3; -} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/README.md deleted file mode 100644 index bc60aa6039..0000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Semconv v1.21.0 - -[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.21.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.21.0) diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go deleted file mode 100644 index a9a15a1dab..0000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go +++ /dev/null @@ -1,1866 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated from semantic convention specification. DO NOT EDIT. - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" - -import "go.opentelemetry.io/otel/attribute" - -// These attributes may be used to describe the client in a connection-based -// network interaction where there is one side that initiates the connection -// (the client is the side that initiates the connection). This covers all TCP -// network interactions since TCP is connection-based and one side initiates -// the connection (an exception is made for peer-to-peer communication over TCP -// where the "user-facing" surface of the protocol / API does not expose a -// clear notion of client and server). This also covers UDP network -// interactions where one side initiates the interaction, e.g. QUIC (HTTP/3) -// and DNS. -const ( - // ClientAddressKey is the attribute Key conforming to the "client.address" - // semantic conventions. It represents the client address - unix domain - // socket name, IPv4 or IPv6 address. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '/tmp/my.sock', '10.1.2.80' - // Note: When observed from the server side, and when communicating through - // an intermediary, `client.address` SHOULD represent client address behind - // any intermediaries (e.g. proxies) if it's available. - ClientAddressKey = attribute.Key("client.address") - - // ClientPortKey is the attribute Key conforming to the "client.port" - // semantic conventions. It represents the client port number - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 65123 - // Note: When observed from the server side, and when communicating through - // an intermediary, `client.port` SHOULD represent client port behind any - // intermediaries (e.g. proxies) if it's available. - ClientPortKey = attribute.Key("client.port") - - // ClientSocketAddressKey is the attribute Key conforming to the - // "client.socket.address" semantic conventions. It represents the - // immediate client peer address - unix domain socket name, IPv4 or IPv6 - // address. - // - // Type: string - // RequirementLevel: Recommended (If different than `client.address`.) - // Stability: stable - // Examples: '/tmp/my.sock', '127.0.0.1' - ClientSocketAddressKey = attribute.Key("client.socket.address") - - // ClientSocketPortKey is the attribute Key conforming to the - // "client.socket.port" semantic conventions. It represents the immediate - // client peer port number - // - // Type: int - // RequirementLevel: Recommended (If different than `client.port`.) - // Stability: stable - // Examples: 35555 - ClientSocketPortKey = attribute.Key("client.socket.port") -) - -// ClientAddress returns an attribute KeyValue conforming to the -// "client.address" semantic conventions. It represents the client address - -// unix domain socket name, IPv4 or IPv6 address. -func ClientAddress(val string) attribute.KeyValue { - return ClientAddressKey.String(val) -} - -// ClientPort returns an attribute KeyValue conforming to the "client.port" -// semantic conventions. It represents the client port number -func ClientPort(val int) attribute.KeyValue { - return ClientPortKey.Int(val) -} - -// ClientSocketAddress returns an attribute KeyValue conforming to the -// "client.socket.address" semantic conventions. It represents the immediate -// client peer address - unix domain socket name, IPv4 or IPv6 address. -func ClientSocketAddress(val string) attribute.KeyValue { - return ClientSocketAddressKey.String(val) -} - -// ClientSocketPort returns an attribute KeyValue conforming to the -// "client.socket.port" semantic conventions. It represents the immediate -// client peer port number -func ClientSocketPort(val int) attribute.KeyValue { - return ClientSocketPortKey.Int(val) -} - -// Describes deprecated HTTP attributes. -const ( - // HTTPMethodKey is the attribute Key conforming to the "http.method" - // semantic conventions. It represents the deprecated, use - // `http.request.method` instead. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 'GET', 'POST', 'HEAD' - HTTPMethodKey = attribute.Key("http.method") - - // HTTPStatusCodeKey is the attribute Key conforming to the - // "http.status_code" semantic conventions. It represents the deprecated, - // use `http.response.status_code` instead. - // - // Type: int - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 200 - HTTPStatusCodeKey = attribute.Key("http.status_code") - - // HTTPSchemeKey is the attribute Key conforming to the "http.scheme" - // semantic conventions. It represents the deprecated, use `url.scheme` - // instead. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 'http', 'https' - HTTPSchemeKey = attribute.Key("http.scheme") - - // HTTPURLKey is the attribute Key conforming to the "http.url" semantic - // conventions. It represents the deprecated, use `url.full` instead. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv' - HTTPURLKey = attribute.Key("http.url") - - // HTTPTargetKey is the attribute Key conforming to the "http.target" - // semantic conventions. It represents the deprecated, use `url.path` and - // `url.query` instead. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: '/search?q=OpenTelemetry#SemConv' - HTTPTargetKey = attribute.Key("http.target") - - // HTTPRequestContentLengthKey is the attribute Key conforming to the - // "http.request_content_length" semantic conventions. It represents the - // deprecated, use `http.request.body.size` instead. - // - // Type: int - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 3495 - HTTPRequestContentLengthKey = attribute.Key("http.request_content_length") - - // HTTPResponseContentLengthKey is the attribute Key conforming to the - // "http.response_content_length" semantic conventions. It represents the - // deprecated, use `http.response.body.size` instead. - // - // Type: int - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 3495 - HTTPResponseContentLengthKey = attribute.Key("http.response_content_length") -) - -// HTTPMethod returns an attribute KeyValue conforming to the "http.method" -// semantic conventions. It represents the deprecated, use -// `http.request.method` instead. -func HTTPMethod(val string) attribute.KeyValue { - return HTTPMethodKey.String(val) -} - -// HTTPStatusCode returns an attribute KeyValue conforming to the -// "http.status_code" semantic conventions. It represents the deprecated, use -// `http.response.status_code` instead. -func HTTPStatusCode(val int) attribute.KeyValue { - return HTTPStatusCodeKey.Int(val) -} - -// HTTPScheme returns an attribute KeyValue conforming to the "http.scheme" -// semantic conventions. It represents the deprecated, use `url.scheme` -// instead. -func HTTPScheme(val string) attribute.KeyValue { - return HTTPSchemeKey.String(val) -} - -// HTTPURL returns an attribute KeyValue conforming to the "http.url" -// semantic conventions. It represents the deprecated, use `url.full` instead. -func HTTPURL(val string) attribute.KeyValue { - return HTTPURLKey.String(val) -} - -// HTTPTarget returns an attribute KeyValue conforming to the "http.target" -// semantic conventions. It represents the deprecated, use `url.path` and -// `url.query` instead. -func HTTPTarget(val string) attribute.KeyValue { - return HTTPTargetKey.String(val) -} - -// HTTPRequestContentLength returns an attribute KeyValue conforming to the -// "http.request_content_length" semantic conventions. It represents the -// deprecated, use `http.request.body.size` instead. -func HTTPRequestContentLength(val int) attribute.KeyValue { - return HTTPRequestContentLengthKey.Int(val) -} - -// HTTPResponseContentLength returns an attribute KeyValue conforming to the -// "http.response_content_length" semantic conventions. It represents the -// deprecated, use `http.response.body.size` instead. -func HTTPResponseContentLength(val int) attribute.KeyValue { - return HTTPResponseContentLengthKey.Int(val) -} - -// These attributes may be used for any network related operation. -const ( - // NetSockPeerNameKey is the attribute Key conforming to the - // "net.sock.peer.name" semantic conventions. It represents the deprecated, - // use `server.socket.domain` on client spans. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: '/var/my.sock' - NetSockPeerNameKey = attribute.Key("net.sock.peer.name") - - // NetSockPeerAddrKey is the attribute Key conforming to the - // "net.sock.peer.addr" semantic conventions. It represents the deprecated, - // use `server.socket.address` on client spans and `client.socket.address` - // on server spans. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: '192.168.0.1' - NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr") - - // NetSockPeerPortKey is the attribute Key conforming to the - // "net.sock.peer.port" semantic conventions. It represents the deprecated, - // use `server.socket.port` on client spans and `client.socket.port` on - // server spans. - // - // Type: int - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 65531 - NetSockPeerPortKey = attribute.Key("net.sock.peer.port") - - // NetPeerNameKey is the attribute Key conforming to the "net.peer.name" - // semantic conventions. It represents the deprecated, use `server.address` - // on client spans and `client.address` on server spans. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 'example.com' - NetPeerNameKey = attribute.Key("net.peer.name") - - // NetPeerPortKey is the attribute Key conforming to the "net.peer.port" - // semantic conventions. It represents the deprecated, use `server.port` on - // client spans and `client.port` on server spans. - // - // Type: int - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 8080 - NetPeerPortKey = attribute.Key("net.peer.port") - - // NetHostNameKey is the attribute Key conforming to the "net.host.name" - // semantic conventions. It represents the deprecated, use - // `server.address`. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 'example.com' - NetHostNameKey = attribute.Key("net.host.name") - - // NetHostPortKey is the attribute Key conforming to the "net.host.port" - // semantic conventions. It represents the deprecated, use `server.port`. - // - // Type: int - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 8080 - NetHostPortKey = attribute.Key("net.host.port") - - // NetSockHostAddrKey is the attribute Key conforming to the - // "net.sock.host.addr" semantic conventions. It represents the deprecated, - // use `server.socket.address`. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: '/var/my.sock' - NetSockHostAddrKey = attribute.Key("net.sock.host.addr") - - // NetSockHostPortKey is the attribute Key conforming to the - // "net.sock.host.port" semantic conventions. It represents the deprecated, - // use `server.socket.port`. - // - // Type: int - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 8080 - NetSockHostPortKey = attribute.Key("net.sock.host.port") - - // NetTransportKey is the attribute Key conforming to the "net.transport" - // semantic conventions. It represents the deprecated, use - // `network.transport`. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: deprecated - NetTransportKey = attribute.Key("net.transport") - - // NetProtocolNameKey is the attribute Key conforming to the - // "net.protocol.name" semantic conventions. It represents the deprecated, - // use `network.protocol.name`. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 'amqp', 'http', 'mqtt' - NetProtocolNameKey = attribute.Key("net.protocol.name") - - // NetProtocolVersionKey is the attribute Key conforming to the - // "net.protocol.version" semantic conventions. It represents the - // deprecated, use `network.protocol.version`. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: '3.1.1' - NetProtocolVersionKey = attribute.Key("net.protocol.version") - - // NetSockFamilyKey is the attribute Key conforming to the - // "net.sock.family" semantic conventions. It represents the deprecated, - // use `network.transport` and `network.type`. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: deprecated - NetSockFamilyKey = attribute.Key("net.sock.family") -) - -var ( - // ip_tcp - NetTransportTCP = NetTransportKey.String("ip_tcp") - // ip_udp - NetTransportUDP = NetTransportKey.String("ip_udp") - // Named or anonymous pipe - NetTransportPipe = NetTransportKey.String("pipe") - // In-process communication - NetTransportInProc = NetTransportKey.String("inproc") - // Something else (non IP-based) - NetTransportOther = NetTransportKey.String("other") -) - -var ( - // IPv4 address - NetSockFamilyInet = NetSockFamilyKey.String("inet") - // IPv6 address - NetSockFamilyInet6 = NetSockFamilyKey.String("inet6") - // Unix domain socket path - NetSockFamilyUnix = NetSockFamilyKey.String("unix") -) - -// NetSockPeerName returns an attribute KeyValue conforming to the -// "net.sock.peer.name" semantic conventions. It represents the deprecated, use -// `server.socket.domain` on client spans. -func NetSockPeerName(val string) attribute.KeyValue { - return NetSockPeerNameKey.String(val) -} - -// NetSockPeerAddr returns an attribute KeyValue conforming to the -// "net.sock.peer.addr" semantic conventions. It represents the deprecated, use -// `server.socket.address` on client spans and `client.socket.address` on -// server spans. -func NetSockPeerAddr(val string) attribute.KeyValue { - return NetSockPeerAddrKey.String(val) -} - -// NetSockPeerPort returns an attribute KeyValue conforming to the -// "net.sock.peer.port" semantic conventions. It represents the deprecated, use -// `server.socket.port` on client spans and `client.socket.port` on server -// spans. -func NetSockPeerPort(val int) attribute.KeyValue { - return NetSockPeerPortKey.Int(val) -} - -// NetPeerName returns an attribute KeyValue conforming to the -// "net.peer.name" semantic conventions. It represents the deprecated, use -// `server.address` on client spans and `client.address` on server spans. -func NetPeerName(val string) attribute.KeyValue { - return NetPeerNameKey.String(val) -} - -// NetPeerPort returns an attribute KeyValue conforming to the -// "net.peer.port" semantic conventions. It represents the deprecated, use -// `server.port` on client spans and `client.port` on server spans. -func NetPeerPort(val int) attribute.KeyValue { - return NetPeerPortKey.Int(val) -} - -// NetHostName returns an attribute KeyValue conforming to the -// "net.host.name" semantic conventions. It represents the deprecated, use -// `server.address`. -func NetHostName(val string) attribute.KeyValue { - return NetHostNameKey.String(val) -} - -// NetHostPort returns an attribute KeyValue conforming to the -// "net.host.port" semantic conventions. It represents the deprecated, use -// `server.port`. -func NetHostPort(val int) attribute.KeyValue { - return NetHostPortKey.Int(val) -} - -// NetSockHostAddr returns an attribute KeyValue conforming to the -// "net.sock.host.addr" semantic conventions. It represents the deprecated, use -// `server.socket.address`. -func NetSockHostAddr(val string) attribute.KeyValue { - return NetSockHostAddrKey.String(val) -} - -// NetSockHostPort returns an attribute KeyValue conforming to the -// "net.sock.host.port" semantic conventions. It represents the deprecated, use -// `server.socket.port`. -func NetSockHostPort(val int) attribute.KeyValue { - return NetSockHostPortKey.Int(val) -} - -// NetProtocolName returns an attribute KeyValue conforming to the -// "net.protocol.name" semantic conventions. It represents the deprecated, use -// `network.protocol.name`. -func NetProtocolName(val string) attribute.KeyValue { - return NetProtocolNameKey.String(val) -} - -// NetProtocolVersion returns an attribute KeyValue conforming to the -// "net.protocol.version" semantic conventions. It represents the deprecated, -// use `network.protocol.version`. -func NetProtocolVersion(val string) attribute.KeyValue { - return NetProtocolVersionKey.String(val) -} - -// These attributes may be used to describe the receiver of a network -// exchange/packet. These should be used when there is no client/server -// relationship between the two sides, or when that relationship is unknown. -// This covers low-level network interactions (e.g. packet tracing) where you -// don't know if there was a connection or which side initiated it. This also -// covers unidirectional UDP flows and peer-to-peer communication where the -// "user-facing" surface of the protocol / API does not expose a clear notion -// of client and server. -const ( - // DestinationDomainKey is the attribute Key conforming to the - // "destination.domain" semantic conventions. It represents the domain name - // of the destination system. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'foo.example.com' - // Note: This value may be a host name, a fully qualified domain name, or - // another host naming format. - DestinationDomainKey = attribute.Key("destination.domain") - - // DestinationAddressKey is the attribute Key conforming to the - // "destination.address" semantic conventions. It represents the peer - // address, for example IP address or UNIX socket name. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '10.5.3.2' - DestinationAddressKey = attribute.Key("destination.address") - - // DestinationPortKey is the attribute Key conforming to the - // "destination.port" semantic conventions. It represents the peer port - // number - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 3389, 2888 - DestinationPortKey = attribute.Key("destination.port") -) - -// DestinationDomain returns an attribute KeyValue conforming to the -// "destination.domain" semantic conventions. It represents the domain name of -// the destination system. -func DestinationDomain(val string) attribute.KeyValue { - return DestinationDomainKey.String(val) -} - -// DestinationAddress returns an attribute KeyValue conforming to the -// "destination.address" semantic conventions. It represents the peer address, -// for example IP address or UNIX socket name. -func DestinationAddress(val string) attribute.KeyValue { - return DestinationAddressKey.String(val) -} - -// DestinationPort returns an attribute KeyValue conforming to the -// "destination.port" semantic conventions. It represents the peer port number -func DestinationPort(val int) attribute.KeyValue { - return DestinationPortKey.Int(val) -} - -// Describes HTTP attributes. -const ( - // HTTPRequestMethodKey is the attribute Key conforming to the - // "http.request.method" semantic conventions. It represents the hTTP - // request method. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - // Examples: 'GET', 'POST', 'HEAD' - // Note: HTTP request method value SHOULD be "known" to the - // instrumentation. - // By default, this convention defines "known" methods as the ones listed - // in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) - // and the PATCH method defined in - // [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). - // - // If the HTTP request method is not known to instrumentation, it MUST set - // the `http.request.method` attribute to `_OTHER` and, except if reporting - // a metric, MUST - // set the exact method received in the request line as value of the - // `http.request.method_original` attribute. - // - // If the HTTP instrumentation could end up converting valid HTTP request - // methods to `_OTHER`, then it MUST provide a way to override - // the list of known HTTP methods. If this override is done via environment - // variable, then the environment variable MUST be named - // OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated - // list of case-sensitive known HTTP methods - // (this list MUST be a full override of the default known method, it is - // not a list of known methods in addition to the defaults). - // - // HTTP method names are case-sensitive and `http.request.method` attribute - // value MUST match a known HTTP method name exactly. - // Instrumentations for specific web frameworks that consider HTTP methods - // to be case insensitive, SHOULD populate a canonical equivalent. - // Tracing instrumentations that do so, MUST also set - // `http.request.method_original` to the original value. - HTTPRequestMethodKey = attribute.Key("http.request.method") - - // HTTPResponseStatusCodeKey is the attribute Key conforming to the - // "http.response.status_code" semantic conventions. It represents the - // [HTTP response status - // code](https://tools.ietf.org/html/rfc7231#section-6). - // - // Type: int - // RequirementLevel: ConditionallyRequired (If and only if one was - // received/sent.) - // Stability: stable - // Examples: 200 - HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code") -) - -var ( - // CONNECT method - HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT") - // DELETE method - HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE") - // GET method - HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET") - // HEAD method - HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD") - // OPTIONS method - HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS") - // PATCH method - HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH") - // POST method - HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST") - // PUT method - HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT") - // TRACE method - HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE") - // Any HTTP method that the instrumentation has no prior knowledge of - HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER") -) - -// HTTPResponseStatusCode returns an attribute KeyValue conforming to the -// "http.response.status_code" semantic conventions. It represents the [HTTP -// response status code](https://tools.ietf.org/html/rfc7231#section-6). -func HTTPResponseStatusCode(val int) attribute.KeyValue { - return HTTPResponseStatusCodeKey.Int(val) -} - -// HTTP Server attributes -const ( - // HTTPRouteKey is the attribute Key conforming to the "http.route" - // semantic conventions. It represents the matched route (path template in - // the format used by the respective server framework). See note below - // - // Type: string - // RequirementLevel: ConditionallyRequired (If and only if it's available) - // Stability: stable - // Examples: '/users/:userID?', '{controller}/{action}/{id?}' - // Note: MUST NOT be populated when this is not supported by the HTTP - // server framework as the route attribute should have low-cardinality and - // the URI path can NOT substitute it. - // SHOULD include the [application - // root](/docs/http/http-spans.md#http-server-definitions) if there is one. - HTTPRouteKey = attribute.Key("http.route") -) - -// HTTPRoute returns an attribute KeyValue conforming to the "http.route" -// semantic conventions. It represents the matched route (path template in the -// format used by the respective server framework). See note below -func HTTPRoute(val string) attribute.KeyValue { - return HTTPRouteKey.String(val) -} - -// Attributes for Events represented using Log Records. -const ( - // EventNameKey is the attribute Key conforming to the "event.name" - // semantic conventions. It represents the name identifies the event. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'click', 'exception' - EventNameKey = attribute.Key("event.name") - - // EventDomainKey is the attribute Key conforming to the "event.domain" - // semantic conventions. It represents the domain identifies the business - // context for the events. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - // Note: Events across different domains may have same `event.name`, yet be - // unrelated events. - EventDomainKey = attribute.Key("event.domain") -) - -var ( - // Events from browser apps - EventDomainBrowser = EventDomainKey.String("browser") - // Events from mobile apps - EventDomainDevice = EventDomainKey.String("device") - // Events from Kubernetes - EventDomainK8S = EventDomainKey.String("k8s") -) - -// EventName returns an attribute KeyValue conforming to the "event.name" -// semantic conventions. It represents the name identifies the event. -func EventName(val string) attribute.KeyValue { - return EventNameKey.String(val) -} - -// The attributes described in this section are rather generic. They may be -// used in any Log Record they apply to. -const ( - // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid" - // semantic conventions. It represents a unique identifier for the Log - // Record. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '01ARZ3NDEKTSV4RRFFQ69G5FAV' - // Note: If an id is provided, other log records with the same id will be - // considered duplicates and can be removed safely. This means, that two - // distinguishable log records MUST have different values. - // The id MAY be an [Universally Unique Lexicographically Sortable - // Identifier (ULID)](https://github.com/ulid/spec), but other identifiers - // (e.g. UUID) may be used as needed. - LogRecordUIDKey = attribute.Key("log.record.uid") -) - -// LogRecordUID returns an attribute KeyValue conforming to the -// "log.record.uid" semantic conventions. It represents a unique identifier for -// the Log Record. -func LogRecordUID(val string) attribute.KeyValue { - return LogRecordUIDKey.String(val) -} - -// Describes Log attributes -const ( - // LogIostreamKey is the attribute Key conforming to the "log.iostream" - // semantic conventions. It represents the stream associated with the log. - // See below for a list of well-known values. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - LogIostreamKey = attribute.Key("log.iostream") -) - -var ( - // Logs from stdout stream - LogIostreamStdout = LogIostreamKey.String("stdout") - // Events from stderr stream - LogIostreamStderr = LogIostreamKey.String("stderr") -) - -// A file to which log was emitted. -const ( - // LogFileNameKey is the attribute Key conforming to the "log.file.name" - // semantic conventions. It represents the basename of the file. - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'audit.log' - LogFileNameKey = attribute.Key("log.file.name") - - // LogFilePathKey is the attribute Key conforming to the "log.file.path" - // semantic conventions. It represents the full path to the file. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '/var/log/mysql/audit.log' - LogFilePathKey = attribute.Key("log.file.path") - - // LogFileNameResolvedKey is the attribute Key conforming to the - // "log.file.name_resolved" semantic conventions. It represents the - // basename of the file, with symlinks resolved. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'uuid.log' - LogFileNameResolvedKey = attribute.Key("log.file.name_resolved") - - // LogFilePathResolvedKey is the attribute Key conforming to the - // "log.file.path_resolved" semantic conventions. It represents the full - // path to the file, with symlinks resolved. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '/var/lib/docker/uuid.log' - LogFilePathResolvedKey = attribute.Key("log.file.path_resolved") -) - -// LogFileName returns an attribute KeyValue conforming to the -// "log.file.name" semantic conventions. It represents the basename of the -// file. -func LogFileName(val string) attribute.KeyValue { - return LogFileNameKey.String(val) -} - -// LogFilePath returns an attribute KeyValue conforming to the -// "log.file.path" semantic conventions. It represents the full path to the -// file. -func LogFilePath(val string) attribute.KeyValue { - return LogFilePathKey.String(val) -} - -// LogFileNameResolved returns an attribute KeyValue conforming to the -// "log.file.name_resolved" semantic conventions. It represents the basename of -// the file, with symlinks resolved. -func LogFileNameResolved(val string) attribute.KeyValue { - return LogFileNameResolvedKey.String(val) -} - -// LogFilePathResolved returns an attribute KeyValue conforming to the -// "log.file.path_resolved" semantic conventions. It represents the full path -// to the file, with symlinks resolved. -func LogFilePathResolved(val string) attribute.KeyValue { - return LogFilePathResolvedKey.String(val) -} - -// Describes JVM memory metric attributes. -const ( - // TypeKey is the attribute Key conforming to the "type" semantic - // conventions. It represents the type of memory. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'heap', 'non_heap' - TypeKey = attribute.Key("type") - - // PoolKey is the attribute Key conforming to the "pool" semantic - // conventions. It represents the name of the memory pool. - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'G1 Old Gen', 'G1 Eden space', 'G1 Survivor Space' - // Note: Pool names are generally obtained via - // [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - PoolKey = attribute.Key("pool") -) - -var ( - // Heap memory - TypeHeap = TypeKey.String("heap") - // Non-heap memory - TypeNonHeap = TypeKey.String("non_heap") -) - -// Pool returns an attribute KeyValue conforming to the "pool" semantic -// conventions. It represents the name of the memory pool. -func Pool(val string) attribute.KeyValue { - return PoolKey.String(val) -} - -// These attributes may be used to describe the server in a connection-based -// network interaction where there is one side that initiates the connection -// (the client is the side that initiates the connection). This covers all TCP -// network interactions since TCP is connection-based and one side initiates -// the connection (an exception is made for peer-to-peer communication over TCP -// where the "user-facing" surface of the protocol / API does not expose a -// clear notion of client and server). This also covers UDP network -// interactions where one side initiates the interaction, e.g. QUIC (HTTP/3) -// and DNS. -const ( - // ServerAddressKey is the attribute Key conforming to the "server.address" - // semantic conventions. It represents the logical server hostname, matches - // server FQDN if available, and IP or socket address if FQDN is not known. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'example.com' - ServerAddressKey = attribute.Key("server.address") - - // ServerPortKey is the attribute Key conforming to the "server.port" - // semantic conventions. It represents the logical server port number - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 80, 8080, 443 - ServerPortKey = attribute.Key("server.port") - - // ServerSocketDomainKey is the attribute Key conforming to the - // "server.socket.domain" semantic conventions. It represents the domain - // name of an immediate peer. - // - // Type: string - // RequirementLevel: Recommended (If different than `server.address`.) - // Stability: stable - // Examples: 'proxy.example.com' - // Note: Typically observed from the client side, and represents a proxy or - // other intermediary domain name. - ServerSocketDomainKey = attribute.Key("server.socket.domain") - - // ServerSocketAddressKey is the attribute Key conforming to the - // "server.socket.address" semantic conventions. It represents the physical - // server IP address or Unix socket address. If set from the client, should - // simply use the socket's peer address, and not attempt to find any actual - // server IP (i.e., if set from client, this may represent some proxy - // server instead of the logical server). - // - // Type: string - // RequirementLevel: Recommended (If different than `server.address`.) - // Stability: stable - // Examples: '10.5.3.2' - ServerSocketAddressKey = attribute.Key("server.socket.address") - - // ServerSocketPortKey is the attribute Key conforming to the - // "server.socket.port" semantic conventions. It represents the physical - // server port. - // - // Type: int - // RequirementLevel: Recommended (If different than `server.port`.) - // Stability: stable - // Examples: 16456 - ServerSocketPortKey = attribute.Key("server.socket.port") -) - -// ServerAddress returns an attribute KeyValue conforming to the -// "server.address" semantic conventions. It represents the logical server -// hostname, matches server FQDN if available, and IP or socket address if FQDN -// is not known. -func ServerAddress(val string) attribute.KeyValue { - return ServerAddressKey.String(val) -} - -// ServerPort returns an attribute KeyValue conforming to the "server.port" -// semantic conventions. It represents the logical server port number -func ServerPort(val int) attribute.KeyValue { - return ServerPortKey.Int(val) -} - -// ServerSocketDomain returns an attribute KeyValue conforming to the -// "server.socket.domain" semantic conventions. It represents the domain name -// of an immediate peer. -func ServerSocketDomain(val string) attribute.KeyValue { - return ServerSocketDomainKey.String(val) -} - -// ServerSocketAddress returns an attribute KeyValue conforming to the -// "server.socket.address" semantic conventions. It represents the physical -// server IP address or Unix socket address. If set from the client, should -// simply use the socket's peer address, and not attempt to find any actual -// server IP (i.e., if set from client, this may represent some proxy server -// instead of the logical server). -func ServerSocketAddress(val string) attribute.KeyValue { - return ServerSocketAddressKey.String(val) -} - -// ServerSocketPort returns an attribute KeyValue conforming to the -// "server.socket.port" semantic conventions. It represents the physical server -// port. -func ServerSocketPort(val int) attribute.KeyValue { - return ServerSocketPortKey.Int(val) -} - -// These attributes may be used to describe the sender of a network -// exchange/packet. These should be used when there is no client/server -// relationship between the two sides, or when that relationship is unknown. -// This covers low-level network interactions (e.g. packet tracing) where you -// don't know if there was a connection or which side initiated it. This also -// covers unidirectional UDP flows and peer-to-peer communication where the -// "user-facing" surface of the protocol / API does not expose a clear notion -// of client and server. -const ( - // SourceDomainKey is the attribute Key conforming to the "source.domain" - // semantic conventions. It represents the domain name of the source - // system. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'foo.example.com' - // Note: This value may be a host name, a fully qualified domain name, or - // another host naming format. - SourceDomainKey = attribute.Key("source.domain") - - // SourceAddressKey is the attribute Key conforming to the "source.address" - // semantic conventions. It represents the source address, for example IP - // address or Unix socket name. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '10.5.3.2' - SourceAddressKey = attribute.Key("source.address") - - // SourcePortKey is the attribute Key conforming to the "source.port" - // semantic conventions. It represents the source port number - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 3389, 2888 - SourcePortKey = attribute.Key("source.port") -) - -// SourceDomain returns an attribute KeyValue conforming to the -// "source.domain" semantic conventions. It represents the domain name of the -// source system. -func SourceDomain(val string) attribute.KeyValue { - return SourceDomainKey.String(val) -} - -// SourceAddress returns an attribute KeyValue conforming to the -// "source.address" semantic conventions. It represents the source address, for -// example IP address or Unix socket name. -func SourceAddress(val string) attribute.KeyValue { - return SourceAddressKey.String(val) -} - -// SourcePort returns an attribute KeyValue conforming to the "source.port" -// semantic conventions. It represents the source port number -func SourcePort(val int) attribute.KeyValue { - return SourcePortKey.Int(val) -} - -// These attributes may be used for any network related operation. -const ( - // NetworkTransportKey is the attribute Key conforming to the - // "network.transport" semantic conventions. It represents the [OSI - // Transport Layer](https://osi-model.com/transport-layer/) or - // [Inter-process Communication - // method](https://en.wikipedia.org/wiki/Inter-process_communication). The - // value SHOULD be normalized to lowercase. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Examples: 'tcp', 'udp' - NetworkTransportKey = attribute.Key("network.transport") - - // NetworkTypeKey is the attribute Key conforming to the "network.type" - // semantic conventions. It represents the [OSI Network - // Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The - // value SHOULD be normalized to lowercase. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Examples: 'ipv4', 'ipv6' - NetworkTypeKey = attribute.Key("network.type") - - // NetworkProtocolNameKey is the attribute Key conforming to the - // "network.protocol.name" semantic conventions. It represents the [OSI - // Application Layer](https://osi-model.com/application-layer/) or non-OSI - // equivalent. The value SHOULD be normalized to lowercase. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'amqp', 'http', 'mqtt' - NetworkProtocolNameKey = attribute.Key("network.protocol.name") - - // NetworkProtocolVersionKey is the attribute Key conforming to the - // "network.protocol.version" semantic conventions. It represents the - // version of the application layer protocol used. See note below. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '3.1.1' - // Note: `network.protocol.version` refers to the version of the protocol - // used and might be different from the protocol client's version. If the - // HTTP client used has a version of `0.27.2`, but sends HTTP version - // `1.1`, this attribute should be set to `1.1`. - NetworkProtocolVersionKey = attribute.Key("network.protocol.version") -) - -var ( - // TCP - NetworkTransportTCP = NetworkTransportKey.String("tcp") - // UDP - NetworkTransportUDP = NetworkTransportKey.String("udp") - // Named or anonymous pipe. See note below - NetworkTransportPipe = NetworkTransportKey.String("pipe") - // Unix domain socket - NetworkTransportUnix = NetworkTransportKey.String("unix") -) - -var ( - // IPv4 - NetworkTypeIpv4 = NetworkTypeKey.String("ipv4") - // IPv6 - NetworkTypeIpv6 = NetworkTypeKey.String("ipv6") -) - -// NetworkProtocolName returns an attribute KeyValue conforming to the -// "network.protocol.name" semantic conventions. It represents the [OSI -// Application Layer](https://osi-model.com/application-layer/) or non-OSI -// equivalent. The value SHOULD be normalized to lowercase. -func NetworkProtocolName(val string) attribute.KeyValue { - return NetworkProtocolNameKey.String(val) -} - -// NetworkProtocolVersion returns an attribute KeyValue conforming to the -// "network.protocol.version" semantic conventions. It represents the version -// of the application layer protocol used. See note below. -func NetworkProtocolVersion(val string) attribute.KeyValue { - return NetworkProtocolVersionKey.String(val) -} - -// These attributes may be used for any network related operation. -const ( - // NetworkConnectionTypeKey is the attribute Key conforming to the - // "network.connection.type" semantic conventions. It represents the - // internet connection type. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Examples: 'wifi' - NetworkConnectionTypeKey = attribute.Key("network.connection.type") - - // NetworkConnectionSubtypeKey is the attribute Key conforming to the - // "network.connection.subtype" semantic conventions. It represents the - // this describes more details regarding the connection.type. It may be the - // type of cell technology connection, but it could be used for describing - // details about a wifi connection. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Examples: 'LTE' - NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype") - - // NetworkCarrierNameKey is the attribute Key conforming to the - // "network.carrier.name" semantic conventions. It represents the name of - // the mobile carrier. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'sprint' - NetworkCarrierNameKey = attribute.Key("network.carrier.name") - - // NetworkCarrierMccKey is the attribute Key conforming to the - // "network.carrier.mcc" semantic conventions. It represents the mobile - // carrier country code. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '310' - NetworkCarrierMccKey = attribute.Key("network.carrier.mcc") - - // NetworkCarrierMncKey is the attribute Key conforming to the - // "network.carrier.mnc" semantic conventions. It represents the mobile - // carrier network code. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '001' - NetworkCarrierMncKey = attribute.Key("network.carrier.mnc") - - // NetworkCarrierIccKey is the attribute Key conforming to the - // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1 - // alpha-2 2-character country code associated with the mobile carrier - // network. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'DE' - NetworkCarrierIccKey = attribute.Key("network.carrier.icc") -) - -var ( - // wifi - NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi") - // wired - NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired") - // cell - NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell") - // unavailable - NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable") - // unknown - NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown") -) - -var ( - // GPRS - NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs") - // EDGE - NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge") - // UMTS - NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts") - // CDMA - NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma") - // EVDO Rel. 0 - NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0") - // EVDO Rev. A - NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a") - // CDMA2000 1XRTT - NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt") - // HSDPA - NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa") - // HSUPA - NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa") - // HSPA - NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa") - // IDEN - NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden") - // EVDO Rev. B - NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b") - // LTE - NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte") - // EHRPD - NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd") - // HSPAP - NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap") - // GSM - NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm") - // TD-SCDMA - NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma") - // IWLAN - NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan") - // 5G NR (New Radio) - NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr") - // 5G NRNSA (New Radio Non-Standalone) - NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa") - // LTE CA - NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca") -) - -// NetworkCarrierName returns an attribute KeyValue conforming to the -// "network.carrier.name" semantic conventions. It represents the name of the -// mobile carrier. -func NetworkCarrierName(val string) attribute.KeyValue { - return NetworkCarrierNameKey.String(val) -} - -// NetworkCarrierMcc returns an attribute KeyValue conforming to the -// "network.carrier.mcc" semantic conventions. It represents the mobile carrier -// country code. -func NetworkCarrierMcc(val string) attribute.KeyValue { - return NetworkCarrierMccKey.String(val) -} - -// NetworkCarrierMnc returns an attribute KeyValue conforming to the -// "network.carrier.mnc" semantic conventions. It represents the mobile carrier -// network code. -func NetworkCarrierMnc(val string) attribute.KeyValue { - return NetworkCarrierMncKey.String(val) -} - -// NetworkCarrierIcc returns an attribute KeyValue conforming to the -// "network.carrier.icc" semantic conventions. It represents the ISO 3166-1 -// alpha-2 2-character country code associated with the mobile carrier network. -func NetworkCarrierIcc(val string) attribute.KeyValue { - return NetworkCarrierIccKey.String(val) -} - -// Semantic conventions for HTTP client and server Spans. -const ( - // HTTPRequestMethodOriginalKey is the attribute Key conforming to the - // "http.request.method_original" semantic conventions. It represents the - // original HTTP method sent by the client in the request line. - // - // Type: string - // RequirementLevel: ConditionallyRequired (If and only if it's different - // than `http.request.method`.) - // Stability: stable - // Examples: 'GeT', 'ACL', 'foo' - HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original") - - // HTTPRequestBodySizeKey is the attribute Key conforming to the - // "http.request.body.size" semantic conventions. It represents the size of - // the request payload body in bytes. This is the number of bytes - // transferred excluding headers and is often, but not always, present as - // the - // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) - // header. For requests using transport encoding, this should be the - // compressed size. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 3495 - HTTPRequestBodySizeKey = attribute.Key("http.request.body.size") - - // HTTPResponseBodySizeKey is the attribute Key conforming to the - // "http.response.body.size" semantic conventions. It represents the size - // of the response payload body in bytes. This is the number of bytes - // transferred excluding headers and is often, but not always, present as - // the - // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) - // header. For requests using transport encoding, this should be the - // compressed size. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 3495 - HTTPResponseBodySizeKey = attribute.Key("http.response.body.size") -) - -// HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the -// "http.request.method_original" semantic conventions. It represents the -// original HTTP method sent by the client in the request line. -func HTTPRequestMethodOriginal(val string) attribute.KeyValue { - return HTTPRequestMethodOriginalKey.String(val) -} - -// HTTPRequestBodySize returns an attribute KeyValue conforming to the -// "http.request.body.size" semantic conventions. It represents the size of the -// request payload body in bytes. This is the number of bytes transferred -// excluding headers and is often, but not always, present as the -// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) -// header. For requests using transport encoding, this should be the compressed -// size. -func HTTPRequestBodySize(val int) attribute.KeyValue { - return HTTPRequestBodySizeKey.Int(val) -} - -// HTTPResponseBodySize returns an attribute KeyValue conforming to the -// "http.response.body.size" semantic conventions. It represents the size of -// the response payload body in bytes. This is the number of bytes transferred -// excluding headers and is often, but not always, present as the -// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) -// header. For requests using transport encoding, this should be the compressed -// size. -func HTTPResponseBodySize(val int) attribute.KeyValue { - return HTTPResponseBodySizeKey.Int(val) -} - -// Semantic convention describing per-message attributes populated on messaging -// spans or links. -const ( - // MessagingMessageIDKey is the attribute Key conforming to the - // "messaging.message.id" semantic conventions. It represents a value used - // by the messaging system as an identifier for the message, represented as - // a string. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '452a7c7c7c7048c2f887f61572b18fc2' - MessagingMessageIDKey = attribute.Key("messaging.message.id") - - // MessagingMessageConversationIDKey is the attribute Key conforming to the - // "messaging.message.conversation_id" semantic conventions. It represents - // the [conversation ID](#conversations) identifying the conversation to - // which the message belongs, represented as a string. Sometimes called - // "Correlation ID". - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'MyConversationID' - MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id") - - // MessagingMessagePayloadSizeBytesKey is the attribute Key conforming to - // the "messaging.message.payload_size_bytes" semantic conventions. It - // represents the (uncompressed) size of the message payload in bytes. Also - // use this attribute if it is unknown whether the compressed or - // uncompressed payload size is reported. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 2738 - MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message.payload_size_bytes") - - // MessagingMessagePayloadCompressedSizeBytesKey is the attribute Key - // conforming to the "messaging.message.payload_compressed_size_bytes" - // semantic conventions. It represents the compressed size of the message - // payload in bytes. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 2048 - MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message.payload_compressed_size_bytes") -) - -// MessagingMessageID returns an attribute KeyValue conforming to the -// "messaging.message.id" semantic conventions. It represents a value used by -// the messaging system as an identifier for the message, represented as a -// string. -func MessagingMessageID(val string) attribute.KeyValue { - return MessagingMessageIDKey.String(val) -} - -// MessagingMessageConversationID returns an attribute KeyValue conforming -// to the "messaging.message.conversation_id" semantic conventions. It -// represents the [conversation ID](#conversations) identifying the -// conversation to which the message belongs, represented as a string. -// Sometimes called "Correlation ID". -func MessagingMessageConversationID(val string) attribute.KeyValue { - return MessagingMessageConversationIDKey.String(val) -} - -// MessagingMessagePayloadSizeBytes returns an attribute KeyValue conforming -// to the "messaging.message.payload_size_bytes" semantic conventions. It -// represents the (uncompressed) size of the message payload in bytes. Also use -// this attribute if it is unknown whether the compressed or uncompressed -// payload size is reported. -func MessagingMessagePayloadSizeBytes(val int) attribute.KeyValue { - return MessagingMessagePayloadSizeBytesKey.Int(val) -} - -// MessagingMessagePayloadCompressedSizeBytes returns an attribute KeyValue -// conforming to the "messaging.message.payload_compressed_size_bytes" semantic -// conventions. It represents the compressed size of the message payload in -// bytes. -func MessagingMessagePayloadCompressedSizeBytes(val int) attribute.KeyValue { - return MessagingMessagePayloadCompressedSizeBytesKey.Int(val) -} - -// Semantic convention for attributes that describe messaging destination on -// broker -const ( - // MessagingDestinationNameKey is the attribute Key conforming to the - // "messaging.destination.name" semantic conventions. It represents the - // message destination name - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'MyQueue', 'MyTopic' - // Note: Destination name SHOULD uniquely identify a specific queue, topic - // or other entity within the broker. If - // the broker does not have such notion, the destination name SHOULD - // uniquely identify the broker. - MessagingDestinationNameKey = attribute.Key("messaging.destination.name") - - // MessagingDestinationTemplateKey is the attribute Key conforming to the - // "messaging.destination.template" semantic conventions. It represents the - // low cardinality representation of the messaging destination name - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '/customers/{customerID}' - // Note: Destination names could be constructed from templates. An example - // would be a destination name involving a user name or product id. - // Although the destination name in this case is of high cardinality, the - // underlying template is of low cardinality and can be effectively used - // for grouping and aggregation. - MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template") - - // MessagingDestinationTemporaryKey is the attribute Key conforming to the - // "messaging.destination.temporary" semantic conventions. It represents a - // boolean that is true if the message destination is temporary and might - // not exist anymore after messages are processed. - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary") - - // MessagingDestinationAnonymousKey is the attribute Key conforming to the - // "messaging.destination.anonymous" semantic conventions. It represents a - // boolean that is true if the message destination is anonymous (could be - // unnamed or have auto-generated name). - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous") -) - -// MessagingDestinationName returns an attribute KeyValue conforming to the -// "messaging.destination.name" semantic conventions. It represents the message -// destination name -func MessagingDestinationName(val string) attribute.KeyValue { - return MessagingDestinationNameKey.String(val) -} - -// MessagingDestinationTemplate returns an attribute KeyValue conforming to -// the "messaging.destination.template" semantic conventions. It represents the -// low cardinality representation of the messaging destination name -func MessagingDestinationTemplate(val string) attribute.KeyValue { - return MessagingDestinationTemplateKey.String(val) -} - -// MessagingDestinationTemporary returns an attribute KeyValue conforming to -// the "messaging.destination.temporary" semantic conventions. It represents a -// boolean that is true if the message destination is temporary and might not -// exist anymore after messages are processed. -func MessagingDestinationTemporary(val bool) attribute.KeyValue { - return MessagingDestinationTemporaryKey.Bool(val) -} - -// MessagingDestinationAnonymous returns an attribute KeyValue conforming to -// the "messaging.destination.anonymous" semantic conventions. It represents a -// boolean that is true if the message destination is anonymous (could be -// unnamed or have auto-generated name). -func MessagingDestinationAnonymous(val bool) attribute.KeyValue { - return MessagingDestinationAnonymousKey.Bool(val) -} - -// Attributes for RabbitMQ -const ( - // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key - // conforming to the "messaging.rabbitmq.destination.routing_key" semantic - // conventions. It represents the rabbitMQ message routing key. - // - // Type: string - // RequirementLevel: ConditionallyRequired (If not empty.) - // Stability: stable - // Examples: 'myKey' - MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key") -) - -// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue -// conforming to the "messaging.rabbitmq.destination.routing_key" semantic -// conventions. It represents the rabbitMQ message routing key. -func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue { - return MessagingRabbitmqDestinationRoutingKeyKey.String(val) -} - -// Attributes for Apache Kafka -const ( - // MessagingKafkaMessageKeyKey is the attribute Key conforming to the - // "messaging.kafka.message.key" semantic conventions. It represents the - // message keys in Kafka are used for grouping alike messages to ensure - // they're processed on the same partition. They differ from - // `messaging.message.id` in that they're not unique. If the key is `null`, - // the attribute MUST NOT be set. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'myKey' - // Note: If the key type is not string, it's string representation has to - // be supplied for the attribute. If the key has no unambiguous, canonical - // string form, don't include its value. - MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key") - - // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the - // "messaging.kafka.consumer.group" semantic conventions. It represents the - // name of the Kafka Consumer Group that is handling the message. Only - // applies to consumers, not producers. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'my-group' - MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group") - - // MessagingKafkaDestinationPartitionKey is the attribute Key conforming to - // the "messaging.kafka.destination.partition" semantic conventions. It - // represents the partition the message is sent to. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 2 - MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition") - - // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the - // "messaging.kafka.message.offset" semantic conventions. It represents the - // offset of a record in the corresponding Kafka partition. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 42 - MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset") - - // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the - // "messaging.kafka.message.tombstone" semantic conventions. It represents - // a boolean that is true if the message is a tombstone. - // - // Type: boolean - // RequirementLevel: ConditionallyRequired (If value is `true`. When - // missing, the value is assumed to be `false`.) - // Stability: stable - MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone") -) - -// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the -// "messaging.kafka.message.key" semantic conventions. It represents the -// message keys in Kafka are used for grouping alike messages to ensure they're -// processed on the same partition. They differ from `messaging.message.id` in -// that they're not unique. If the key is `null`, the attribute MUST NOT be -// set. -func MessagingKafkaMessageKey(val string) attribute.KeyValue { - return MessagingKafkaMessageKeyKey.String(val) -} - -// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to -// the "messaging.kafka.consumer.group" semantic conventions. It represents the -// name of the Kafka Consumer Group that is handling the message. Only applies -// to consumers, not producers. -func MessagingKafkaConsumerGroup(val string) attribute.KeyValue { - return MessagingKafkaConsumerGroupKey.String(val) -} - -// MessagingKafkaDestinationPartition returns an attribute KeyValue -// conforming to the "messaging.kafka.destination.partition" semantic -// conventions. It represents the partition the message is sent to. -func MessagingKafkaDestinationPartition(val int) attribute.KeyValue { - return MessagingKafkaDestinationPartitionKey.Int(val) -} - -// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to -// the "messaging.kafka.message.offset" semantic conventions. It represents the -// offset of a record in the corresponding Kafka partition. -func MessagingKafkaMessageOffset(val int) attribute.KeyValue { - return MessagingKafkaMessageOffsetKey.Int(val) -} - -// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming -// to the "messaging.kafka.message.tombstone" semantic conventions. It -// represents a boolean that is true if the message is a tombstone. -func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue { - return MessagingKafkaMessageTombstoneKey.Bool(val) -} - -// Attributes for Apache RocketMQ -const ( - // MessagingRocketmqNamespaceKey is the attribute Key conforming to the - // "messaging.rocketmq.namespace" semantic conventions. It represents the - // namespace of RocketMQ resources, resources in different namespaces are - // individual. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'myNamespace' - MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace") - - // MessagingRocketmqClientGroupKey is the attribute Key conforming to the - // "messaging.rocketmq.client_group" semantic conventions. It represents - // the name of the RocketMQ producer/consumer group that is handling the - // message. The client type is identified by the SpanKind. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'myConsumerGroup' - MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group") - - // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key - // conforming to the "messaging.rocketmq.message.delivery_timestamp" - // semantic conventions. It represents the timestamp in milliseconds that - // the delay message is expected to be delivered to consumer. - // - // Type: int - // RequirementLevel: ConditionallyRequired (If the message type is delay - // and delay time level is not specified.) - // Stability: stable - // Examples: 1665987217045 - MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp") - - // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key - // conforming to the "messaging.rocketmq.message.delay_time_level" semantic - // conventions. It represents the delay time level for delay message, which - // determines the message delay time. - // - // Type: int - // RequirementLevel: ConditionallyRequired (If the message type is delay - // and delivery timestamp is not specified.) - // Stability: stable - // Examples: 3 - MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level") - - // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the - // "messaging.rocketmq.message.group" semantic conventions. It represents - // the it is essential for FIFO message. Messages that belong to the same - // message group are always processed one by one within the same consumer - // group. - // - // Type: string - // RequirementLevel: ConditionallyRequired (If the message type is FIFO.) - // Stability: stable - // Examples: 'myMessageGroup' - MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group") - - // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the - // "messaging.rocketmq.message.type" semantic conventions. It represents - // the type of message. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type") - - // MessagingRocketmqMessageTagKey is the attribute Key conforming to the - // "messaging.rocketmq.message.tag" semantic conventions. It represents the - // secondary classifier of message besides topic. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'tagA' - MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag") - - // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the - // "messaging.rocketmq.message.keys" semantic conventions. It represents - // the key(s) of message, another way to mark message besides message id. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: 'keyA', 'keyB' - MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys") - - // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to - // the "messaging.rocketmq.consumption_model" semantic conventions. It - // represents the model of message consumption. This only applies to - // consumer spans. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model") -) - -var ( - // Normal message - MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal") - // FIFO message - MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo") - // Delay message - MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay") - // Transaction message - MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction") -) - -var ( - // Clustering consumption model - MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering") - // Broadcasting consumption model - MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting") -) - -// MessagingRocketmqNamespace returns an attribute KeyValue conforming to -// the "messaging.rocketmq.namespace" semantic conventions. It represents the -// namespace of RocketMQ resources, resources in different namespaces are -// individual. -func MessagingRocketmqNamespace(val string) attribute.KeyValue { - return MessagingRocketmqNamespaceKey.String(val) -} - -// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to -// the "messaging.rocketmq.client_group" semantic conventions. It represents -// the name of the RocketMQ producer/consumer group that is handling the -// message. The client type is identified by the SpanKind. -func MessagingRocketmqClientGroup(val string) attribute.KeyValue { - return MessagingRocketmqClientGroupKey.String(val) -} - -// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue -// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic -// conventions. It represents the timestamp in milliseconds that the delay -// message is expected to be delivered to consumer. -func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue { - return MessagingRocketmqMessageDeliveryTimestampKey.Int(val) -} - -// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue -// conforming to the "messaging.rocketmq.message.delay_time_level" semantic -// conventions. It represents the delay time level for delay message, which -// determines the message delay time. -func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue { - return MessagingRocketmqMessageDelayTimeLevelKey.Int(val) -} - -// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to -// the "messaging.rocketmq.message.group" semantic conventions. It represents -// the it is essential for FIFO message. Messages that belong to the same -// message group are always processed one by one within the same consumer -// group. -func MessagingRocketmqMessageGroup(val string) attribute.KeyValue { - return MessagingRocketmqMessageGroupKey.String(val) -} - -// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to -// the "messaging.rocketmq.message.tag" semantic conventions. It represents the -// secondary classifier of message besides topic. -func MessagingRocketmqMessageTag(val string) attribute.KeyValue { - return MessagingRocketmqMessageTagKey.String(val) -} - -// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to -// the "messaging.rocketmq.message.keys" semantic conventions. It represents -// the key(s) of message, another way to mark message besides message id. -func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue { - return MessagingRocketmqMessageKeysKey.StringSlice(val) -} - -// Attributes describing URL. -const ( - // URLSchemeKey is the attribute Key conforming to the "url.scheme" - // semantic conventions. It represents the [URI - // scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component - // identifying the used protocol. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'https', 'ftp', 'telnet' - URLSchemeKey = attribute.Key("url.scheme") - - // URLFullKey is the attribute Key conforming to the "url.full" semantic - // conventions. It represents the absolute URL describing a network - // resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv', - // '//localhost' - // Note: For network calls, URL usually has - // `scheme://host[:port][path][?query][#fragment]` format, where the - // fragment is not transmitted over HTTP, but if it is known, it should be - // included nevertheless. - // `url.full` MUST NOT contain credentials passed via URL in form of - // `https://username:password@www.example.com/`. In such case username and - // password should be redacted and attribute's value should be - // `https://REDACTED:REDACTED@www.example.com/`. - // `url.full` SHOULD capture the absolute URL when it is available (or can - // be reconstructed) and SHOULD NOT be validated or modified except for - // sanitizing purposes. - URLFullKey = attribute.Key("url.full") - - // URLPathKey is the attribute Key conforming to the "url.path" semantic - // conventions. It represents the [URI - // path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '/search' - // Note: When missing, the value is assumed to be `/` - URLPathKey = attribute.Key("url.path") - - // URLQueryKey is the attribute Key conforming to the "url.query" semantic - // conventions. It represents the [URI - // query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'q=OpenTelemetry' - // Note: Sensitive content provided in query string SHOULD be scrubbed when - // instrumentations can identify it. - URLQueryKey = attribute.Key("url.query") - - // URLFragmentKey is the attribute Key conforming to the "url.fragment" - // semantic conventions. It represents the [URI - // fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'SemConv' - URLFragmentKey = attribute.Key("url.fragment") -) - -// URLScheme returns an attribute KeyValue conforming to the "url.scheme" -// semantic conventions. It represents the [URI -// scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component -// identifying the used protocol. -func URLScheme(val string) attribute.KeyValue { - return URLSchemeKey.String(val) -} - -// URLFull returns an attribute KeyValue conforming to the "url.full" -// semantic conventions. It represents the absolute URL describing a network -// resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) -func URLFull(val string) attribute.KeyValue { - return URLFullKey.String(val) -} - -// URLPath returns an attribute KeyValue conforming to the "url.path" -// semantic conventions. It represents the [URI -// path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component -func URLPath(val string) attribute.KeyValue { - return URLPathKey.String(val) -} - -// URLQuery returns an attribute KeyValue conforming to the "url.query" -// semantic conventions. It represents the [URI -// query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component -func URLQuery(val string) attribute.KeyValue { - return URLQueryKey.String(val) -} - -// URLFragment returns an attribute KeyValue conforming to the -// "url.fragment" semantic conventions. It represents the [URI -// fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component -func URLFragment(val string) attribute.KeyValue { - return URLFragmentKey.String(val) -} - -// Describes user-agent attributes. -const ( - // UserAgentOriginalKey is the attribute Key conforming to the - // "user_agent.original" semantic conventions. It represents the value of - // the [HTTP - // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) - // header sent by the client. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'CERN-LineMode/2.15 libwww/2.17b3' - UserAgentOriginalKey = attribute.Key("user_agent.original") -) - -// UserAgentOriginal returns an attribute KeyValue conforming to the -// "user_agent.original" semantic conventions. It represents the value of the -// [HTTP -// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) -// header sent by the client. -func UserAgentOriginal(val string) attribute.KeyValue { - return UserAgentOriginalKey.String(val) -} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go deleted file mode 100644 index 461331a555..0000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Package semconv implements OpenTelemetry semantic conventions. -// -// OpenTelemetry semantic conventions are agreed standardized naming -// patterns for OpenTelemetry things. This package represents the v1.21.0 -// version of the OpenTelemetry semantic conventions. -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go deleted file mode 100644 index c09d9317e2..0000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated from semantic convention specification. DO NOT EDIT. - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" - -import "go.opentelemetry.io/otel/attribute" - -// This semantic convention defines the attributes used to represent a feature -// flag evaluation as an event. -const ( - // FeatureFlagKeyKey is the attribute Key conforming to the - // "feature_flag.key" semantic conventions. It represents the unique - // identifier of the feature flag. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'logo-color' - FeatureFlagKeyKey = attribute.Key("feature_flag.key") - - // FeatureFlagProviderNameKey is the attribute Key conforming to the - // "feature_flag.provider_name" semantic conventions. It represents the - // name of the service provider that performs the flag evaluation. - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'Flag Manager' - FeatureFlagProviderNameKey = attribute.Key("feature_flag.provider_name") - - // FeatureFlagVariantKey is the attribute Key conforming to the - // "feature_flag.variant" semantic conventions. It represents the sHOULD be - // a semantic identifier for a value. If one is unavailable, a stringified - // version of the value can be used. - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'red', 'true', 'on' - // Note: A semantic identifier, commonly referred to as a variant, provides - // a means - // for referring to a value without including the value itself. This can - // provide additional context for understanding the meaning behind a value. - // For example, the variant `red` maybe be used for the value `#c05543`. - // - // A stringified version of the value can be used in situations where a - // semantic identifier is unavailable. String representation of the value - // should be determined by the implementer. - FeatureFlagVariantKey = attribute.Key("feature_flag.variant") -) - -// FeatureFlagKey returns an attribute KeyValue conforming to the -// "feature_flag.key" semantic conventions. It represents the unique identifier -// of the feature flag. -func FeatureFlagKey(val string) attribute.KeyValue { - return FeatureFlagKeyKey.String(val) -} - -// FeatureFlagProviderName returns an attribute KeyValue conforming to the -// "feature_flag.provider_name" semantic conventions. It represents the name of -// the service provider that performs the flag evaluation. -func FeatureFlagProviderName(val string) attribute.KeyValue { - return FeatureFlagProviderNameKey.String(val) -} - -// FeatureFlagVariant returns an attribute KeyValue conforming to the -// "feature_flag.variant" semantic conventions. It represents the sHOULD be a -// semantic identifier for a value. If one is unavailable, a stringified -// version of the value can be used. -func FeatureFlagVariant(val string) attribute.KeyValue { - return FeatureFlagVariantKey.String(val) -} - -// RPC received/sent message. -const ( - // MessageTypeKey is the attribute Key conforming to the "message.type" - // semantic conventions. It represents the whether this is a received or - // sent message. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - MessageTypeKey = attribute.Key("message.type") - - // MessageIDKey is the attribute Key conforming to the "message.id" - // semantic conventions. It represents the mUST be calculated as two - // different counters starting from `1` one for sent messages and one for - // received message. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Note: This way we guarantee that the values will be consistent between - // different implementations. - MessageIDKey = attribute.Key("message.id") - - // MessageCompressedSizeKey is the attribute Key conforming to the - // "message.compressed_size" semantic conventions. It represents the - // compressed size of the message in bytes. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - MessageCompressedSizeKey = attribute.Key("message.compressed_size") - - // MessageUncompressedSizeKey is the attribute Key conforming to the - // "message.uncompressed_size" semantic conventions. It represents the - // uncompressed size of the message in bytes. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - MessageUncompressedSizeKey = attribute.Key("message.uncompressed_size") -) - -var ( - // sent - MessageTypeSent = MessageTypeKey.String("SENT") - // received - MessageTypeReceived = MessageTypeKey.String("RECEIVED") -) - -// MessageID returns an attribute KeyValue conforming to the "message.id" -// semantic conventions. It represents the mUST be calculated as two different -// counters starting from `1` one for sent messages and one for received -// message. -func MessageID(val int) attribute.KeyValue { - return MessageIDKey.Int(val) -} - -// MessageCompressedSize returns an attribute KeyValue conforming to the -// "message.compressed_size" semantic conventions. It represents the compressed -// size of the message in bytes. -func MessageCompressedSize(val int) attribute.KeyValue { - return MessageCompressedSizeKey.Int(val) -} - -// MessageUncompressedSize returns an attribute KeyValue conforming to the -// "message.uncompressed_size" semantic conventions. It represents the -// uncompressed size of the message in bytes. -func MessageUncompressedSize(val int) attribute.KeyValue { - return MessageUncompressedSizeKey.Int(val) -} - -// The attributes used to report a single exception associated with a span. -const ( - // ExceptionEscapedKey is the attribute Key conforming to the - // "exception.escaped" semantic conventions. It represents the sHOULD be - // set to true if the exception event is recorded at a point where it is - // known that the exception is escaping the scope of the span. - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - // Note: An exception is considered to have escaped (or left) the scope of - // a span, - // if that span is ended while the exception is still logically "in - // flight". - // This may be actually "in flight" in some languages (e.g. if the - // exception - // is passed to a Context manager's `__exit__` method in Python) but will - // usually be caught at the point of recording the exception in most - // languages. - // - // It is usually not possible to determine at the point where an exception - // is thrown - // whether it will escape the scope of a span. - // However, it is trivial to know that an exception - // will escape, if one checks for an active exception just before ending - // the span, - // as done in the [example above](#recording-an-exception). - // - // It follows that an exception may still escape the scope of the span - // even if the `exception.escaped` attribute was not set or set to false, - // since the event might have been recorded at a time where it was not - // clear whether the exception will escape. - ExceptionEscapedKey = attribute.Key("exception.escaped") -) - -// ExceptionEscaped returns an attribute KeyValue conforming to the -// "exception.escaped" semantic conventions. It represents the sHOULD be set to -// true if the exception event is recorded at a point where it is known that -// the exception is escaping the scope of the span. -func ExceptionEscaped(val bool) attribute.KeyValue { - return ExceptionEscapedKey.Bool(val) -} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go deleted file mode 100644 index 5184ee339a..0000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" - -const ( - // ExceptionEventName is the name of the Span event representing an exception. - ExceptionEventName = "exception" -) diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go deleted file mode 100644 index f7aaa50b9e..0000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go +++ /dev/null @@ -1,2299 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated from semantic convention specification. DO NOT EDIT. - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" - -import "go.opentelemetry.io/otel/attribute" - -// The web browser in which the application represented by the resource is -// running. The `browser.*` attributes MUST be used only for resources that -// represent applications running in a web browser (regardless of whether -// running on a mobile or desktop device). -const ( - // BrowserBrandsKey is the attribute Key conforming to the "browser.brands" - // semantic conventions. It represents the array of brand name and version - // separated by a space - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: ' Not A;Brand 99', 'Chromium 99', 'Chrome 99' - // Note: This value is intended to be taken from the [UA client hints - // API](https://wicg.github.io/ua-client-hints/#interface) - // (`navigator.userAgentData.brands`). - BrowserBrandsKey = attribute.Key("browser.brands") - - // BrowserPlatformKey is the attribute Key conforming to the - // "browser.platform" semantic conventions. It represents the platform on - // which the browser is running - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Windows', 'macOS', 'Android' - // Note: This value is intended to be taken from the [UA client hints - // API](https://wicg.github.io/ua-client-hints/#interface) - // (`navigator.userAgentData.platform`). If unavailable, the legacy - // `navigator.platform` API SHOULD NOT be used instead and this attribute - // SHOULD be left unset in order for the values to be consistent. - // The list of possible values is defined in the [W3C User-Agent Client - // Hints - // specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). - // Note that some (but not all) of these values can overlap with values in - // the [`os.type` and `os.name` attributes](./os.md). However, for - // consistency, the values in the `browser.platform` attribute should - // capture the exact value that the user agent provides. - BrowserPlatformKey = attribute.Key("browser.platform") - - // BrowserMobileKey is the attribute Key conforming to the "browser.mobile" - // semantic conventions. It represents a boolean that is true if the - // browser is running on a mobile device - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - // Note: This value is intended to be taken from the [UA client hints - // API](https://wicg.github.io/ua-client-hints/#interface) - // (`navigator.userAgentData.mobile`). If unavailable, this attribute - // SHOULD be left unset. - BrowserMobileKey = attribute.Key("browser.mobile") - - // BrowserLanguageKey is the attribute Key conforming to the - // "browser.language" semantic conventions. It represents the preferred - // language of the user using the browser - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'en', 'en-US', 'fr', 'fr-FR' - // Note: This value is intended to be taken from the Navigator API - // `navigator.language`. - BrowserLanguageKey = attribute.Key("browser.language") -) - -// BrowserBrands returns an attribute KeyValue conforming to the -// "browser.brands" semantic conventions. It represents the array of brand name -// and version separated by a space -func BrowserBrands(val ...string) attribute.KeyValue { - return BrowserBrandsKey.StringSlice(val) -} - -// BrowserPlatform returns an attribute KeyValue conforming to the -// "browser.platform" semantic conventions. It represents the platform on which -// the browser is running -func BrowserPlatform(val string) attribute.KeyValue { - return BrowserPlatformKey.String(val) -} - -// BrowserMobile returns an attribute KeyValue conforming to the -// "browser.mobile" semantic conventions. It represents a boolean that is true -// if the browser is running on a mobile device -func BrowserMobile(val bool) attribute.KeyValue { - return BrowserMobileKey.Bool(val) -} - -// BrowserLanguage returns an attribute KeyValue conforming to the -// "browser.language" semantic conventions. It represents the preferred -// language of the user using the browser -func BrowserLanguage(val string) attribute.KeyValue { - return BrowserLanguageKey.String(val) -} - -// A cloud environment (e.g. GCP, Azure, AWS) -const ( - // CloudProviderKey is the attribute Key conforming to the "cloud.provider" - // semantic conventions. It represents the name of the cloud provider. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - CloudProviderKey = attribute.Key("cloud.provider") - - // CloudAccountIDKey is the attribute Key conforming to the - // "cloud.account.id" semantic conventions. It represents the cloud account - // ID the resource is assigned to. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '111111111111', 'opentelemetry' - CloudAccountIDKey = attribute.Key("cloud.account.id") - - // CloudRegionKey is the attribute Key conforming to the "cloud.region" - // semantic conventions. It represents the geographical region the resource - // is running. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'us-central1', 'us-east-1' - // Note: Refer to your provider's docs to see the available regions, for - // example [Alibaba Cloud - // regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS - // regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), - // [Azure - // regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), - // [Google Cloud regions](https://cloud.google.com/about/locations), or - // [Tencent Cloud - // regions](https://www.tencentcloud.com/document/product/213/6091). - CloudRegionKey = attribute.Key("cloud.region") - - // CloudResourceIDKey is the attribute Key conforming to the - // "cloud.resource_id" semantic conventions. It represents the cloud - // provider-specific native identifier of the monitored cloud resource - // (e.g. an - // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // on AWS, a [fully qualified resource - // ID](https://learn.microsoft.com/en-us/rest/api/resources/resources/get-by-id) - // on Azure, a [full resource - // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) - // on GCP) - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function', - // '//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID', - // '/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/' - // Note: On some cloud providers, it may not be possible to determine the - // full ID at startup, - // so it may be necessary to set `cloud.resource_id` as a span attribute - // instead. - // - // The exact value to use for `cloud.resource_id` depends on the cloud - // provider. - // The following well-known definitions MUST be used if you set this - // attribute and they apply: - // - // * **AWS Lambda:** The function - // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - // Take care not to use the "invoked ARN" directly but replace any - // [alias - // suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) - // with the resolved function version, as the same runtime instance may - // be invokable with - // multiple different aliases. - // * **GCP:** The [URI of the - // resource](https://cloud.google.com/iam/docs/full-resource-names) - // * **Azure:** The [Fully Qualified Resource - // ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id) - // of the invoked function, - // *not* the function app, having the form - // `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. - // This means that a span attribute MUST be used, as an Azure function - // app can host multiple functions that would usually share - // a TracerProvider. - CloudResourceIDKey = attribute.Key("cloud.resource_id") - - // CloudAvailabilityZoneKey is the attribute Key conforming to the - // "cloud.availability_zone" semantic conventions. It represents the cloud - // regions often have multiple, isolated locations known as zones to - // increase availability. Availability zone represents the zone where the - // resource is running. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'us-east-1c' - // Note: Availability zones are called "zones" on Alibaba Cloud and Google - // Cloud. - CloudAvailabilityZoneKey = attribute.Key("cloud.availability_zone") - - // CloudPlatformKey is the attribute Key conforming to the "cloud.platform" - // semantic conventions. It represents the cloud platform in use. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Note: The prefix of the service SHOULD match the one specified in - // `cloud.provider`. - CloudPlatformKey = attribute.Key("cloud.platform") -) - -var ( - // Alibaba Cloud - CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud") - // Amazon Web Services - CloudProviderAWS = CloudProviderKey.String("aws") - // Microsoft Azure - CloudProviderAzure = CloudProviderKey.String("azure") - // Google Cloud Platform - CloudProviderGCP = CloudProviderKey.String("gcp") - // Heroku Platform as a Service - CloudProviderHeroku = CloudProviderKey.String("heroku") - // IBM Cloud - CloudProviderIbmCloud = CloudProviderKey.String("ibm_cloud") - // Tencent Cloud - CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud") -) - -var ( - // Alibaba Cloud Elastic Compute Service - CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs") - // Alibaba Cloud Function Compute - CloudPlatformAlibabaCloudFc = CloudPlatformKey.String("alibaba_cloud_fc") - // Red Hat OpenShift on Alibaba Cloud - CloudPlatformAlibabaCloudOpenshift = CloudPlatformKey.String("alibaba_cloud_openshift") - // AWS Elastic Compute Cloud - CloudPlatformAWSEC2 = CloudPlatformKey.String("aws_ec2") - // AWS Elastic Container Service - CloudPlatformAWSECS = CloudPlatformKey.String("aws_ecs") - // AWS Elastic Kubernetes Service - CloudPlatformAWSEKS = CloudPlatformKey.String("aws_eks") - // AWS Lambda - CloudPlatformAWSLambda = CloudPlatformKey.String("aws_lambda") - // AWS Elastic Beanstalk - CloudPlatformAWSElasticBeanstalk = CloudPlatformKey.String("aws_elastic_beanstalk") - // AWS App Runner - CloudPlatformAWSAppRunner = CloudPlatformKey.String("aws_app_runner") - // Red Hat OpenShift on AWS (ROSA) - CloudPlatformAWSOpenshift = CloudPlatformKey.String("aws_openshift") - // Azure Virtual Machines - CloudPlatformAzureVM = CloudPlatformKey.String("azure_vm") - // Azure Container Instances - CloudPlatformAzureContainerInstances = CloudPlatformKey.String("azure_container_instances") - // Azure Kubernetes Service - CloudPlatformAzureAKS = CloudPlatformKey.String("azure_aks") - // Azure Functions - CloudPlatformAzureFunctions = CloudPlatformKey.String("azure_functions") - // Azure App Service - CloudPlatformAzureAppService = CloudPlatformKey.String("azure_app_service") - // Azure Red Hat OpenShift - CloudPlatformAzureOpenshift = CloudPlatformKey.String("azure_openshift") - // Google Bare Metal Solution (BMS) - CloudPlatformGCPBareMetalSolution = CloudPlatformKey.String("gcp_bare_metal_solution") - // Google Cloud Compute Engine (GCE) - CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine") - // Google Cloud Run - CloudPlatformGCPCloudRun = CloudPlatformKey.String("gcp_cloud_run") - // Google Cloud Kubernetes Engine (GKE) - CloudPlatformGCPKubernetesEngine = CloudPlatformKey.String("gcp_kubernetes_engine") - // Google Cloud Functions (GCF) - CloudPlatformGCPCloudFunctions = CloudPlatformKey.String("gcp_cloud_functions") - // Google Cloud App Engine (GAE) - CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine") - // Red Hat OpenShift on Google Cloud - CloudPlatformGCPOpenshift = CloudPlatformKey.String("gcp_openshift") - // Red Hat OpenShift on IBM Cloud - CloudPlatformIbmCloudOpenshift = CloudPlatformKey.String("ibm_cloud_openshift") - // Tencent Cloud Cloud Virtual Machine (CVM) - CloudPlatformTencentCloudCvm = CloudPlatformKey.String("tencent_cloud_cvm") - // Tencent Cloud Elastic Kubernetes Service (EKS) - CloudPlatformTencentCloudEKS = CloudPlatformKey.String("tencent_cloud_eks") - // Tencent Cloud Serverless Cloud Function (SCF) - CloudPlatformTencentCloudScf = CloudPlatformKey.String("tencent_cloud_scf") -) - -// CloudAccountID returns an attribute KeyValue conforming to the -// "cloud.account.id" semantic conventions. It represents the cloud account ID -// the resource is assigned to. -func CloudAccountID(val string) attribute.KeyValue { - return CloudAccountIDKey.String(val) -} - -// CloudRegion returns an attribute KeyValue conforming to the -// "cloud.region" semantic conventions. It represents the geographical region -// the resource is running. -func CloudRegion(val string) attribute.KeyValue { - return CloudRegionKey.String(val) -} - -// CloudResourceID returns an attribute KeyValue conforming to the -// "cloud.resource_id" semantic conventions. It represents the cloud -// provider-specific native identifier of the monitored cloud resource (e.g. an -// [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) -// on AWS, a [fully qualified resource -// ID](https://learn.microsoft.com/en-us/rest/api/resources/resources/get-by-id) -// on Azure, a [full resource -// name](https://cloud.google.com/apis/design/resource_names#full_resource_name) -// on GCP) -func CloudResourceID(val string) attribute.KeyValue { - return CloudResourceIDKey.String(val) -} - -// CloudAvailabilityZone returns an attribute KeyValue conforming to the -// "cloud.availability_zone" semantic conventions. It represents the cloud -// regions often have multiple, isolated locations known as zones to increase -// availability. Availability zone represents the zone where the resource is -// running. -func CloudAvailabilityZone(val string) attribute.KeyValue { - return CloudAvailabilityZoneKey.String(val) -} - -// Resources used by AWS Elastic Container Service (ECS). -const ( - // AWSECSContainerARNKey is the attribute Key conforming to the - // "aws.ecs.container.arn" semantic conventions. It represents the Amazon - // Resource Name (ARN) of an [ECS container - // instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9' - AWSECSContainerARNKey = attribute.Key("aws.ecs.container.arn") - - // AWSECSClusterARNKey is the attribute Key conforming to the - // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an - // [ECS - // cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster' - AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn") - - // AWSECSLaunchtypeKey is the attribute Key conforming to the - // "aws.ecs.launchtype" semantic conventions. It represents the [launch - // type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) - // for an ECS task. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype") - - // AWSECSTaskARNKey is the attribute Key conforming to the - // "aws.ecs.task.arn" semantic conventions. It represents the ARN of an - // [ECS task - // definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b' - AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn") - - // AWSECSTaskFamilyKey is the attribute Key conforming to the - // "aws.ecs.task.family" semantic conventions. It represents the task - // definition family this task definition is a member of. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry-family' - AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family") - - // AWSECSTaskRevisionKey is the attribute Key conforming to the - // "aws.ecs.task.revision" semantic conventions. It represents the revision - // for this task definition. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '8', '26' - AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision") -) - -var ( - // ec2 - AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2") - // fargate - AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate") -) - -// AWSECSContainerARN returns an attribute KeyValue conforming to the -// "aws.ecs.container.arn" semantic conventions. It represents the Amazon -// Resource Name (ARN) of an [ECS container -// instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). -func AWSECSContainerARN(val string) attribute.KeyValue { - return AWSECSContainerARNKey.String(val) -} - -// AWSECSClusterARN returns an attribute KeyValue conforming to the -// "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an [ECS -// cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). -func AWSECSClusterARN(val string) attribute.KeyValue { - return AWSECSClusterARNKey.String(val) -} - -// AWSECSTaskARN returns an attribute KeyValue conforming to the -// "aws.ecs.task.arn" semantic conventions. It represents the ARN of an [ECS -// task -// definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). -func AWSECSTaskARN(val string) attribute.KeyValue { - return AWSECSTaskARNKey.String(val) -} - -// AWSECSTaskFamily returns an attribute KeyValue conforming to the -// "aws.ecs.task.family" semantic conventions. It represents the task -// definition family this task definition is a member of. -func AWSECSTaskFamily(val string) attribute.KeyValue { - return AWSECSTaskFamilyKey.String(val) -} - -// AWSECSTaskRevision returns an attribute KeyValue conforming to the -// "aws.ecs.task.revision" semantic conventions. It represents the revision for -// this task definition. -func AWSECSTaskRevision(val string) attribute.KeyValue { - return AWSECSTaskRevisionKey.String(val) -} - -// Resources used by AWS Elastic Kubernetes Service (EKS). -const ( - // AWSEKSClusterARNKey is the attribute Key conforming to the - // "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an - // EKS cluster. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster' - AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn") -) - -// AWSEKSClusterARN returns an attribute KeyValue conforming to the -// "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS -// cluster. -func AWSEKSClusterARN(val string) attribute.KeyValue { - return AWSEKSClusterARNKey.String(val) -} - -// Resources specific to Amazon Web Services. -const ( - // AWSLogGroupNamesKey is the attribute Key conforming to the - // "aws.log.group.names" semantic conventions. It represents the name(s) of - // the AWS log group(s) an application is writing to. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: '/aws/lambda/my-function', 'opentelemetry-service' - // Note: Multiple log groups must be supported for cases like - // multi-container applications, where a single application has sidecar - // containers, and each write to their own log group. - AWSLogGroupNamesKey = attribute.Key("aws.log.group.names") - - // AWSLogGroupARNsKey is the attribute Key conforming to the - // "aws.log.group.arns" semantic conventions. It represents the Amazon - // Resource Name(s) (ARN) of the AWS log group(s). - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*' - // Note: See the [log group ARN format - // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). - AWSLogGroupARNsKey = attribute.Key("aws.log.group.arns") - - // AWSLogStreamNamesKey is the attribute Key conforming to the - // "aws.log.stream.names" semantic conventions. It represents the name(s) - // of the AWS log stream(s) an application is writing to. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: 'logs/main/10838bed-421f-43ef-870a-f43feacbbb5b' - AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names") - - // AWSLogStreamARNsKey is the attribute Key conforming to the - // "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of - // the AWS log stream(s). - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b' - // Note: See the [log stream ARN format - // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). - // One log group can contain several log streams, so these ARNs necessarily - // identify both a log group and a log stream. - AWSLogStreamARNsKey = attribute.Key("aws.log.stream.arns") -) - -// AWSLogGroupNames returns an attribute KeyValue conforming to the -// "aws.log.group.names" semantic conventions. It represents the name(s) of the -// AWS log group(s) an application is writing to. -func AWSLogGroupNames(val ...string) attribute.KeyValue { - return AWSLogGroupNamesKey.StringSlice(val) -} - -// AWSLogGroupARNs returns an attribute KeyValue conforming to the -// "aws.log.group.arns" semantic conventions. It represents the Amazon Resource -// Name(s) (ARN) of the AWS log group(s). -func AWSLogGroupARNs(val ...string) attribute.KeyValue { - return AWSLogGroupARNsKey.StringSlice(val) -} - -// AWSLogStreamNames returns an attribute KeyValue conforming to the -// "aws.log.stream.names" semantic conventions. It represents the name(s) of -// the AWS log stream(s) an application is writing to. -func AWSLogStreamNames(val ...string) attribute.KeyValue { - return AWSLogStreamNamesKey.StringSlice(val) -} - -// AWSLogStreamARNs returns an attribute KeyValue conforming to the -// "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the -// AWS log stream(s). -func AWSLogStreamARNs(val ...string) attribute.KeyValue { - return AWSLogStreamARNsKey.StringSlice(val) -} - -// Resource used by Google Cloud Run. -const ( - // GCPCloudRunJobExecutionKey is the attribute Key conforming to the - // "gcp.cloud_run.job.execution" semantic conventions. It represents the - // name of the Cloud Run - // [execution](https://cloud.google.com/run/docs/managing/job-executions) - // being run for the Job, as set by the - // [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) - // environment variable. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'job-name-xxxx', 'sample-job-mdw84' - GCPCloudRunJobExecutionKey = attribute.Key("gcp.cloud_run.job.execution") - - // GCPCloudRunJobTaskIndexKey is the attribute Key conforming to the - // "gcp.cloud_run.job.task_index" semantic conventions. It represents the - // index for a task within an execution as provided by the - // [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) - // environment variable. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 0, 1 - GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index") -) - -// GCPCloudRunJobExecution returns an attribute KeyValue conforming to the -// "gcp.cloud_run.job.execution" semantic conventions. It represents the name -// of the Cloud Run -// [execution](https://cloud.google.com/run/docs/managing/job-executions) being -// run for the Job, as set by the -// [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) -// environment variable. -func GCPCloudRunJobExecution(val string) attribute.KeyValue { - return GCPCloudRunJobExecutionKey.String(val) -} - -// GCPCloudRunJobTaskIndex returns an attribute KeyValue conforming to the -// "gcp.cloud_run.job.task_index" semantic conventions. It represents the index -// for a task within an execution as provided by the -// [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) -// environment variable. -func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue { - return GCPCloudRunJobTaskIndexKey.Int(val) -} - -// Resources used by Google Compute Engine (GCE). -const ( - // GCPGceInstanceNameKey is the attribute Key conforming to the - // "gcp.gce.instance.name" semantic conventions. It represents the instance - // name of a GCE instance. This is the value provided by `host.name`, the - // visible name of the instance in the Cloud Console UI, and the prefix for - // the default hostname of the instance as defined by the [default internal - // DNS - // name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'instance-1', 'my-vm-name' - GCPGceInstanceNameKey = attribute.Key("gcp.gce.instance.name") - - // GCPGceInstanceHostnameKey is the attribute Key conforming to the - // "gcp.gce.instance.hostname" semantic conventions. It represents the - // hostname of a GCE instance. This is the full value of the default or - // [custom - // hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'my-host1234.example.com', - // 'sample-vm.us-west1-b.c.my-project.internal' - GCPGceInstanceHostnameKey = attribute.Key("gcp.gce.instance.hostname") -) - -// GCPGceInstanceName returns an attribute KeyValue conforming to the -// "gcp.gce.instance.name" semantic conventions. It represents the instance -// name of a GCE instance. This is the value provided by `host.name`, the -// visible name of the instance in the Cloud Console UI, and the prefix for the -// default hostname of the instance as defined by the [default internal DNS -// name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). -func GCPGceInstanceName(val string) attribute.KeyValue { - return GCPGceInstanceNameKey.String(val) -} - -// GCPGceInstanceHostname returns an attribute KeyValue conforming to the -// "gcp.gce.instance.hostname" semantic conventions. It represents the hostname -// of a GCE instance. This is the full value of the default or [custom -// hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). -func GCPGceInstanceHostname(val string) attribute.KeyValue { - return GCPGceInstanceHostnameKey.String(val) -} - -// Heroku dyno metadata -const ( - // HerokuReleaseCreationTimestampKey is the attribute Key conforming to the - // "heroku.release.creation_timestamp" semantic conventions. It represents - // the time and date the release was created - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '2022-10-23T18:00:42Z' - HerokuReleaseCreationTimestampKey = attribute.Key("heroku.release.creation_timestamp") - - // HerokuReleaseCommitKey is the attribute Key conforming to the - // "heroku.release.commit" semantic conventions. It represents the commit - // hash for the current release - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'e6134959463efd8966b20e75b913cafe3f5ec' - HerokuReleaseCommitKey = attribute.Key("heroku.release.commit") - - // HerokuAppIDKey is the attribute Key conforming to the "heroku.app.id" - // semantic conventions. It represents the unique identifier for the - // application - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '2daa2797-e42b-4624-9322-ec3f968df4da' - HerokuAppIDKey = attribute.Key("heroku.app.id") -) - -// HerokuReleaseCreationTimestamp returns an attribute KeyValue conforming -// to the "heroku.release.creation_timestamp" semantic conventions. It -// represents the time and date the release was created -func HerokuReleaseCreationTimestamp(val string) attribute.KeyValue { - return HerokuReleaseCreationTimestampKey.String(val) -} - -// HerokuReleaseCommit returns an attribute KeyValue conforming to the -// "heroku.release.commit" semantic conventions. It represents the commit hash -// for the current release -func HerokuReleaseCommit(val string) attribute.KeyValue { - return HerokuReleaseCommitKey.String(val) -} - -// HerokuAppID returns an attribute KeyValue conforming to the -// "heroku.app.id" semantic conventions. It represents the unique identifier -// for the application -func HerokuAppID(val string) attribute.KeyValue { - return HerokuAppIDKey.String(val) -} - -// A container instance. -const ( - // ContainerNameKey is the attribute Key conforming to the "container.name" - // semantic conventions. It represents the container name used by container - // runtime. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry-autoconf' - ContainerNameKey = attribute.Key("container.name") - - // ContainerIDKey is the attribute Key conforming to the "container.id" - // semantic conventions. It represents the container ID. Usually a UUID, as - // for example used to [identify Docker - // containers](https://docs.docker.com/engine/reference/run/#container-identification). - // The UUID might be abbreviated. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'a3bf90e006b2' - ContainerIDKey = attribute.Key("container.id") - - // ContainerRuntimeKey is the attribute Key conforming to the - // "container.runtime" semantic conventions. It represents the container - // runtime managing this container. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'docker', 'containerd', 'rkt' - ContainerRuntimeKey = attribute.Key("container.runtime") - - // ContainerImageNameKey is the attribute Key conforming to the - // "container.image.name" semantic conventions. It represents the name of - // the image the container was built on. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'gcr.io/opentelemetry/operator' - ContainerImageNameKey = attribute.Key("container.image.name") - - // ContainerImageTagKey is the attribute Key conforming to the - // "container.image.tag" semantic conventions. It represents the container - // image tag. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '0.1' - ContainerImageTagKey = attribute.Key("container.image.tag") - - // ContainerImageIDKey is the attribute Key conforming to the - // "container.image.id" semantic conventions. It represents the runtime - // specific image identifier. Usually a hash algorithm followed by a UUID. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f' - // Note: Docker defines a sha256 of the image id; `container.image.id` - // corresponds to the `Image` field from the Docker container inspect - // [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) - // endpoint. - // K8S defines a link to the container registry repository with digest - // `"imageID": "registry.azurecr.io - // /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. - // OCI defines a digest of manifest. - ContainerImageIDKey = attribute.Key("container.image.id") - - // ContainerCommandKey is the attribute Key conforming to the - // "container.command" semantic conventions. It represents the command used - // to run the container (i.e. the command name). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'otelcontribcol' - // Note: If using embedded credentials or sensitive data, it is recommended - // to remove them to prevent potential leakage. - ContainerCommandKey = attribute.Key("container.command") - - // ContainerCommandLineKey is the attribute Key conforming to the - // "container.command_line" semantic conventions. It represents the full - // command run by the container as a single string representing the full - // command. [2] - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'otelcontribcol --config config.yaml' - ContainerCommandLineKey = attribute.Key("container.command_line") - - // ContainerCommandArgsKey is the attribute Key conforming to the - // "container.command_args" semantic conventions. It represents the all the - // command arguments (including the command/executable itself) run by the - // container. [2] - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: 'otelcontribcol, --config, config.yaml' - ContainerCommandArgsKey = attribute.Key("container.command_args") -) - -// ContainerName returns an attribute KeyValue conforming to the -// "container.name" semantic conventions. It represents the container name used -// by container runtime. -func ContainerName(val string) attribute.KeyValue { - return ContainerNameKey.String(val) -} - -// ContainerID returns an attribute KeyValue conforming to the -// "container.id" semantic conventions. It represents the container ID. Usually -// a UUID, as for example used to [identify Docker -// containers](https://docs.docker.com/engine/reference/run/#container-identification). -// The UUID might be abbreviated. -func ContainerID(val string) attribute.KeyValue { - return ContainerIDKey.String(val) -} - -// ContainerRuntime returns an attribute KeyValue conforming to the -// "container.runtime" semantic conventions. It represents the container -// runtime managing this container. -func ContainerRuntime(val string) attribute.KeyValue { - return ContainerRuntimeKey.String(val) -} - -// ContainerImageName returns an attribute KeyValue conforming to the -// "container.image.name" semantic conventions. It represents the name of the -// image the container was built on. -func ContainerImageName(val string) attribute.KeyValue { - return ContainerImageNameKey.String(val) -} - -// ContainerImageTag returns an attribute KeyValue conforming to the -// "container.image.tag" semantic conventions. It represents the container -// image tag. -func ContainerImageTag(val string) attribute.KeyValue { - return ContainerImageTagKey.String(val) -} - -// ContainerImageID returns an attribute KeyValue conforming to the -// "container.image.id" semantic conventions. It represents the runtime -// specific image identifier. Usually a hash algorithm followed by a UUID. -func ContainerImageID(val string) attribute.KeyValue { - return ContainerImageIDKey.String(val) -} - -// ContainerCommand returns an attribute KeyValue conforming to the -// "container.command" semantic conventions. It represents the command used to -// run the container (i.e. the command name). -func ContainerCommand(val string) attribute.KeyValue { - return ContainerCommandKey.String(val) -} - -// ContainerCommandLine returns an attribute KeyValue conforming to the -// "container.command_line" semantic conventions. It represents the full -// command run by the container as a single string representing the full -// command. [2] -func ContainerCommandLine(val string) attribute.KeyValue { - return ContainerCommandLineKey.String(val) -} - -// ContainerCommandArgs returns an attribute KeyValue conforming to the -// "container.command_args" semantic conventions. It represents the all the -// command arguments (including the command/executable itself) run by the -// container. [2] -func ContainerCommandArgs(val ...string) attribute.KeyValue { - return ContainerCommandArgsKey.StringSlice(val) -} - -// The software deployment. -const ( - // DeploymentEnvironmentKey is the attribute Key conforming to the - // "deployment.environment" semantic conventions. It represents the name of - // the [deployment - // environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka - // deployment tier). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'staging', 'production' - DeploymentEnvironmentKey = attribute.Key("deployment.environment") -) - -// DeploymentEnvironment returns an attribute KeyValue conforming to the -// "deployment.environment" semantic conventions. It represents the name of the -// [deployment -// environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka -// deployment tier). -func DeploymentEnvironment(val string) attribute.KeyValue { - return DeploymentEnvironmentKey.String(val) -} - -// The device on which the process represented by this resource is running. -const ( - // DeviceIDKey is the attribute Key conforming to the "device.id" semantic - // conventions. It represents a unique identifier representing the device - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '2ab2916d-a51f-4ac8-80ee-45ac31a28092' - // Note: The device identifier MUST only be defined using the values - // outlined below. This value is not an advertising identifier and MUST NOT - // be used as such. On iOS (Swift or Objective-C), this value MUST be equal - // to the [vendor - // identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). - // On Android (Java or Kotlin), this value MUST be equal to the Firebase - // Installation ID or a globally unique UUID which is persisted across - // sessions in your application. More information can be found - // [here](https://developer.android.com/training/articles/user-data-ids) on - // best practices and exact implementation details. Caution should be taken - // when storing personal data or anything which can identify a user. GDPR - // and data protection laws may apply, ensure you do your own due - // diligence. - DeviceIDKey = attribute.Key("device.id") - - // DeviceModelIdentifierKey is the attribute Key conforming to the - // "device.model.identifier" semantic conventions. It represents the model - // identifier for the device - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'iPhone3,4', 'SM-G920F' - // Note: It's recommended this value represents a machine readable version - // of the model identifier rather than the market or consumer-friendly name - // of the device. - DeviceModelIdentifierKey = attribute.Key("device.model.identifier") - - // DeviceModelNameKey is the attribute Key conforming to the - // "device.model.name" semantic conventions. It represents the marketing - // name for the device model - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'iPhone 6s Plus', 'Samsung Galaxy S6' - // Note: It's recommended this value represents a human readable version of - // the device model rather than a machine readable alternative. - DeviceModelNameKey = attribute.Key("device.model.name") - - // DeviceManufacturerKey is the attribute Key conforming to the - // "device.manufacturer" semantic conventions. It represents the name of - // the device manufacturer - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Apple', 'Samsung' - // Note: The Android OS provides this field via - // [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). - // iOS apps SHOULD hardcode the value `Apple`. - DeviceManufacturerKey = attribute.Key("device.manufacturer") -) - -// DeviceID returns an attribute KeyValue conforming to the "device.id" -// semantic conventions. It represents a unique identifier representing the -// device -func DeviceID(val string) attribute.KeyValue { - return DeviceIDKey.String(val) -} - -// DeviceModelIdentifier returns an attribute KeyValue conforming to the -// "device.model.identifier" semantic conventions. It represents the model -// identifier for the device -func DeviceModelIdentifier(val string) attribute.KeyValue { - return DeviceModelIdentifierKey.String(val) -} - -// DeviceModelName returns an attribute KeyValue conforming to the -// "device.model.name" semantic conventions. It represents the marketing name -// for the device model -func DeviceModelName(val string) attribute.KeyValue { - return DeviceModelNameKey.String(val) -} - -// DeviceManufacturer returns an attribute KeyValue conforming to the -// "device.manufacturer" semantic conventions. It represents the name of the -// device manufacturer -func DeviceManufacturer(val string) attribute.KeyValue { - return DeviceManufacturerKey.String(val) -} - -// A serverless instance. -const ( - // FaaSNameKey is the attribute Key conforming to the "faas.name" semantic - // conventions. It represents the name of the single function that this - // runtime instance executes. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'my-function', 'myazurefunctionapp/some-function-name' - // Note: This is the name of the function as configured/deployed on the - // FaaS - // platform and is usually different from the name of the callback - // function (which may be stored in the - // [`code.namespace`/`code.function`](/docs/general/general-attributes.md#source-code-attributes) - // span attributes). - // - // For some cloud providers, the above definition is ambiguous. The - // following - // definition of function name MUST be used for this attribute - // (and consequently the span name) for the listed cloud - // providers/products: - // - // * **Azure:** The full name `/`, i.e., function app name - // followed by a forward slash followed by the function name (this form - // can also be seen in the resource JSON for the function). - // This means that a span attribute MUST be used, as an Azure function - // app can host multiple functions that would usually share - // a TracerProvider (see also the `cloud.resource_id` attribute). - FaaSNameKey = attribute.Key("faas.name") - - // FaaSVersionKey is the attribute Key conforming to the "faas.version" - // semantic conventions. It represents the immutable version of the - // function being executed. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '26', 'pinkfroid-00002' - // Note: Depending on the cloud provider and platform, use: - // - // * **AWS Lambda:** The [function - // version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) - // (an integer represented as a decimal string). - // * **Google Cloud Run (Services):** The - // [revision](https://cloud.google.com/run/docs/managing/revisions) - // (i.e., the function name plus the revision suffix). - // * **Google Cloud Functions:** The value of the - // [`K_REVISION` environment - // variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). - // * **Azure Functions:** Not applicable. Do not set this attribute. - FaaSVersionKey = attribute.Key("faas.version") - - // FaaSInstanceKey is the attribute Key conforming to the "faas.instance" - // semantic conventions. It represents the execution environment ID as a - // string, that will be potentially reused for other invocations to the - // same function/function version. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de' - // Note: * **AWS Lambda:** Use the (full) log stream name. - FaaSInstanceKey = attribute.Key("faas.instance") - - // FaaSMaxMemoryKey is the attribute Key conforming to the - // "faas.max_memory" semantic conventions. It represents the amount of - // memory available to the serverless function converted to Bytes. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 134217728 - // Note: It's recommended to set this attribute since e.g. too little - // memory can easily stop a Java AWS Lambda function from working - // correctly. On AWS Lambda, the environment variable - // `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must - // be multiplied by 1,048,576). - FaaSMaxMemoryKey = attribute.Key("faas.max_memory") -) - -// FaaSName returns an attribute KeyValue conforming to the "faas.name" -// semantic conventions. It represents the name of the single function that -// this runtime instance executes. -func FaaSName(val string) attribute.KeyValue { - return FaaSNameKey.String(val) -} - -// FaaSVersion returns an attribute KeyValue conforming to the -// "faas.version" semantic conventions. It represents the immutable version of -// the function being executed. -func FaaSVersion(val string) attribute.KeyValue { - return FaaSVersionKey.String(val) -} - -// FaaSInstance returns an attribute KeyValue conforming to the -// "faas.instance" semantic conventions. It represents the execution -// environment ID as a string, that will be potentially reused for other -// invocations to the same function/function version. -func FaaSInstance(val string) attribute.KeyValue { - return FaaSInstanceKey.String(val) -} - -// FaaSMaxMemory returns an attribute KeyValue conforming to the -// "faas.max_memory" semantic conventions. It represents the amount of memory -// available to the serverless function converted to Bytes. -func FaaSMaxMemory(val int) attribute.KeyValue { - return FaaSMaxMemoryKey.Int(val) -} - -// A host is defined as a computing instance. For example, physical servers, -// virtual machines, switches or disk array. -const ( - // HostIDKey is the attribute Key conforming to the "host.id" semantic - // conventions. It represents the unique host ID. For Cloud, this must be - // the instance_id assigned by the cloud provider. For non-containerized - // systems, this should be the `machine-id`. See the table below for the - // sources to use to determine the `machine-id` based on operating system. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'fdbf79e8af94cb7f9e8df36789187052' - HostIDKey = attribute.Key("host.id") - - // HostNameKey is the attribute Key conforming to the "host.name" semantic - // conventions. It represents the name of the host. On Unix systems, it may - // contain what the hostname command returns, or the fully qualified - // hostname, or another name specified by the user. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry-test' - HostNameKey = attribute.Key("host.name") - - // HostTypeKey is the attribute Key conforming to the "host.type" semantic - // conventions. It represents the type of host. For Cloud, this must be the - // machine type. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'n1-standard-1' - HostTypeKey = attribute.Key("host.type") - - // HostArchKey is the attribute Key conforming to the "host.arch" semantic - // conventions. It represents the CPU architecture the host system is - // running on. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - HostArchKey = attribute.Key("host.arch") - - // HostImageNameKey is the attribute Key conforming to the - // "host.image.name" semantic conventions. It represents the name of the VM - // image or OS install the host was instantiated from. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'infra-ami-eks-worker-node-7d4ec78312', 'CentOS-8-x86_64-1905' - HostImageNameKey = attribute.Key("host.image.name") - - // HostImageIDKey is the attribute Key conforming to the "host.image.id" - // semantic conventions. It represents the vM image ID or host OS image ID. - // For Cloud, this value is from the provider. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'ami-07b06b442921831e5' - HostImageIDKey = attribute.Key("host.image.id") - - // HostImageVersionKey is the attribute Key conforming to the - // "host.image.version" semantic conventions. It represents the version - // string of the VM image or host OS as defined in [Version - // Attributes](README.md#version-attributes). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '0.1' - HostImageVersionKey = attribute.Key("host.image.version") -) - -var ( - // AMD64 - HostArchAMD64 = HostArchKey.String("amd64") - // ARM32 - HostArchARM32 = HostArchKey.String("arm32") - // ARM64 - HostArchARM64 = HostArchKey.String("arm64") - // Itanium - HostArchIA64 = HostArchKey.String("ia64") - // 32-bit PowerPC - HostArchPPC32 = HostArchKey.String("ppc32") - // 64-bit PowerPC - HostArchPPC64 = HostArchKey.String("ppc64") - // IBM z/Architecture - HostArchS390x = HostArchKey.String("s390x") - // 32-bit x86 - HostArchX86 = HostArchKey.String("x86") -) - -// HostID returns an attribute KeyValue conforming to the "host.id" semantic -// conventions. It represents the unique host ID. For Cloud, this must be the -// instance_id assigned by the cloud provider. For non-containerized systems, -// this should be the `machine-id`. See the table below for the sources to use -// to determine the `machine-id` based on operating system. -func HostID(val string) attribute.KeyValue { - return HostIDKey.String(val) -} - -// HostName returns an attribute KeyValue conforming to the "host.name" -// semantic conventions. It represents the name of the host. On Unix systems, -// it may contain what the hostname command returns, or the fully qualified -// hostname, or another name specified by the user. -func HostName(val string) attribute.KeyValue { - return HostNameKey.String(val) -} - -// HostType returns an attribute KeyValue conforming to the "host.type" -// semantic conventions. It represents the type of host. For Cloud, this must -// be the machine type. -func HostType(val string) attribute.KeyValue { - return HostTypeKey.String(val) -} - -// HostImageName returns an attribute KeyValue conforming to the -// "host.image.name" semantic conventions. It represents the name of the VM -// image or OS install the host was instantiated from. -func HostImageName(val string) attribute.KeyValue { - return HostImageNameKey.String(val) -} - -// HostImageID returns an attribute KeyValue conforming to the -// "host.image.id" semantic conventions. It represents the vM image ID or host -// OS image ID. For Cloud, this value is from the provider. -func HostImageID(val string) attribute.KeyValue { - return HostImageIDKey.String(val) -} - -// HostImageVersion returns an attribute KeyValue conforming to the -// "host.image.version" semantic conventions. It represents the version string -// of the VM image or host OS as defined in [Version -// Attributes](README.md#version-attributes). -func HostImageVersion(val string) attribute.KeyValue { - return HostImageVersionKey.String(val) -} - -// A Kubernetes Cluster. -const ( - // K8SClusterNameKey is the attribute Key conforming to the - // "k8s.cluster.name" semantic conventions. It represents the name of the - // cluster. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry-cluster' - K8SClusterNameKey = attribute.Key("k8s.cluster.name") - - // K8SClusterUIDKey is the attribute Key conforming to the - // "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for - // the cluster, set to the UID of the `kube-system` namespace. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '218fc5a9-a5f1-4b54-aa05-46717d0ab26d' - // Note: K8S does not have support for obtaining a cluster ID. If this is - // ever - // added, we will recommend collecting the `k8s.cluster.uid` through the - // official APIs. In the meantime, we are able to use the `uid` of the - // `kube-system` namespace as a proxy for cluster ID. Read on for the - // rationale. - // - // Every object created in a K8S cluster is assigned a distinct UID. The - // `kube-system` namespace is used by Kubernetes itself and will exist - // for the lifetime of the cluster. Using the `uid` of the `kube-system` - // namespace is a reasonable proxy for the K8S ClusterID as it will only - // change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are - // UUIDs as standardized by - // [ISO/IEC 9834-8 and ITU-T - // X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html). - // Which states: - // - // > If generated according to one of the mechanisms defined in Rec. - // ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be - // different from all other UUIDs generated before 3603 A.D., or is - // extremely likely to be different (depending on the mechanism chosen). - // - // Therefore, UIDs between clusters should be extremely unlikely to - // conflict. - K8SClusterUIDKey = attribute.Key("k8s.cluster.uid") -) - -// K8SClusterName returns an attribute KeyValue conforming to the -// "k8s.cluster.name" semantic conventions. It represents the name of the -// cluster. -func K8SClusterName(val string) attribute.KeyValue { - return K8SClusterNameKey.String(val) -} - -// K8SClusterUID returns an attribute KeyValue conforming to the -// "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for the -// cluster, set to the UID of the `kube-system` namespace. -func K8SClusterUID(val string) attribute.KeyValue { - return K8SClusterUIDKey.String(val) -} - -// A Kubernetes Node object. -const ( - // K8SNodeNameKey is the attribute Key conforming to the "k8s.node.name" - // semantic conventions. It represents the name of the Node. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'node-1' - K8SNodeNameKey = attribute.Key("k8s.node.name") - - // K8SNodeUIDKey is the attribute Key conforming to the "k8s.node.uid" - // semantic conventions. It represents the UID of the Node. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2' - K8SNodeUIDKey = attribute.Key("k8s.node.uid") -) - -// K8SNodeName returns an attribute KeyValue conforming to the -// "k8s.node.name" semantic conventions. It represents the name of the Node. -func K8SNodeName(val string) attribute.KeyValue { - return K8SNodeNameKey.String(val) -} - -// K8SNodeUID returns an attribute KeyValue conforming to the "k8s.node.uid" -// semantic conventions. It represents the UID of the Node. -func K8SNodeUID(val string) attribute.KeyValue { - return K8SNodeUIDKey.String(val) -} - -// A Kubernetes Namespace. -const ( - // K8SNamespaceNameKey is the attribute Key conforming to the - // "k8s.namespace.name" semantic conventions. It represents the name of the - // namespace that the pod is running in. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'default' - K8SNamespaceNameKey = attribute.Key("k8s.namespace.name") -) - -// K8SNamespaceName returns an attribute KeyValue conforming to the -// "k8s.namespace.name" semantic conventions. It represents the name of the -// namespace that the pod is running in. -func K8SNamespaceName(val string) attribute.KeyValue { - return K8SNamespaceNameKey.String(val) -} - -// A Kubernetes Pod object. -const ( - // K8SPodUIDKey is the attribute Key conforming to the "k8s.pod.uid" - // semantic conventions. It represents the UID of the Pod. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SPodUIDKey = attribute.Key("k8s.pod.uid") - - // K8SPodNameKey is the attribute Key conforming to the "k8s.pod.name" - // semantic conventions. It represents the name of the Pod. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry-pod-autoconf' - K8SPodNameKey = attribute.Key("k8s.pod.name") -) - -// K8SPodUID returns an attribute KeyValue conforming to the "k8s.pod.uid" -// semantic conventions. It represents the UID of the Pod. -func K8SPodUID(val string) attribute.KeyValue { - return K8SPodUIDKey.String(val) -} - -// K8SPodName returns an attribute KeyValue conforming to the "k8s.pod.name" -// semantic conventions. It represents the name of the Pod. -func K8SPodName(val string) attribute.KeyValue { - return K8SPodNameKey.String(val) -} - -// A container in a -// [PodTemplate](https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates). -const ( - // K8SContainerNameKey is the attribute Key conforming to the - // "k8s.container.name" semantic conventions. It represents the name of the - // Container from Pod specification, must be unique within a Pod. Container - // runtime usually uses different globally unique name (`container.name`). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'redis' - K8SContainerNameKey = attribute.Key("k8s.container.name") - - // K8SContainerRestartCountKey is the attribute Key conforming to the - // "k8s.container.restart_count" semantic conventions. It represents the - // number of times the container was restarted. This attribute can be used - // to identify a particular container (running or stopped) within a - // container spec. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 0, 2 - K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count") -) - -// K8SContainerName returns an attribute KeyValue conforming to the -// "k8s.container.name" semantic conventions. It represents the name of the -// Container from Pod specification, must be unique within a Pod. Container -// runtime usually uses different globally unique name (`container.name`). -func K8SContainerName(val string) attribute.KeyValue { - return K8SContainerNameKey.String(val) -} - -// K8SContainerRestartCount returns an attribute KeyValue conforming to the -// "k8s.container.restart_count" semantic conventions. It represents the number -// of times the container was restarted. This attribute can be used to identify -// a particular container (running or stopped) within a container spec. -func K8SContainerRestartCount(val int) attribute.KeyValue { - return K8SContainerRestartCountKey.Int(val) -} - -// A Kubernetes ReplicaSet object. -const ( - // K8SReplicaSetUIDKey is the attribute Key conforming to the - // "k8s.replicaset.uid" semantic conventions. It represents the UID of the - // ReplicaSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid") - - // K8SReplicaSetNameKey is the attribute Key conforming to the - // "k8s.replicaset.name" semantic conventions. It represents the name of - // the ReplicaSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name") -) - -// K8SReplicaSetUID returns an attribute KeyValue conforming to the -// "k8s.replicaset.uid" semantic conventions. It represents the UID of the -// ReplicaSet. -func K8SReplicaSetUID(val string) attribute.KeyValue { - return K8SReplicaSetUIDKey.String(val) -} - -// K8SReplicaSetName returns an attribute KeyValue conforming to the -// "k8s.replicaset.name" semantic conventions. It represents the name of the -// ReplicaSet. -func K8SReplicaSetName(val string) attribute.KeyValue { - return K8SReplicaSetNameKey.String(val) -} - -// A Kubernetes Deployment object. -const ( - // K8SDeploymentUIDKey is the attribute Key conforming to the - // "k8s.deployment.uid" semantic conventions. It represents the UID of the - // Deployment. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid") - - // K8SDeploymentNameKey is the attribute Key conforming to the - // "k8s.deployment.name" semantic conventions. It represents the name of - // the Deployment. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SDeploymentNameKey = attribute.Key("k8s.deployment.name") -) - -// K8SDeploymentUID returns an attribute KeyValue conforming to the -// "k8s.deployment.uid" semantic conventions. It represents the UID of the -// Deployment. -func K8SDeploymentUID(val string) attribute.KeyValue { - return K8SDeploymentUIDKey.String(val) -} - -// K8SDeploymentName returns an attribute KeyValue conforming to the -// "k8s.deployment.name" semantic conventions. It represents the name of the -// Deployment. -func K8SDeploymentName(val string) attribute.KeyValue { - return K8SDeploymentNameKey.String(val) -} - -// A Kubernetes StatefulSet object. -const ( - // K8SStatefulSetUIDKey is the attribute Key conforming to the - // "k8s.statefulset.uid" semantic conventions. It represents the UID of the - // StatefulSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid") - - // K8SStatefulSetNameKey is the attribute Key conforming to the - // "k8s.statefulset.name" semantic conventions. It represents the name of - // the StatefulSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name") -) - -// K8SStatefulSetUID returns an attribute KeyValue conforming to the -// "k8s.statefulset.uid" semantic conventions. It represents the UID of the -// StatefulSet. -func K8SStatefulSetUID(val string) attribute.KeyValue { - return K8SStatefulSetUIDKey.String(val) -} - -// K8SStatefulSetName returns an attribute KeyValue conforming to the -// "k8s.statefulset.name" semantic conventions. It represents the name of the -// StatefulSet. -func K8SStatefulSetName(val string) attribute.KeyValue { - return K8SStatefulSetNameKey.String(val) -} - -// A Kubernetes DaemonSet object. -const ( - // K8SDaemonSetUIDKey is the attribute Key conforming to the - // "k8s.daemonset.uid" semantic conventions. It represents the UID of the - // DaemonSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid") - - // K8SDaemonSetNameKey is the attribute Key conforming to the - // "k8s.daemonset.name" semantic conventions. It represents the name of the - // DaemonSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name") -) - -// K8SDaemonSetUID returns an attribute KeyValue conforming to the -// "k8s.daemonset.uid" semantic conventions. It represents the UID of the -// DaemonSet. -func K8SDaemonSetUID(val string) attribute.KeyValue { - return K8SDaemonSetUIDKey.String(val) -} - -// K8SDaemonSetName returns an attribute KeyValue conforming to the -// "k8s.daemonset.name" semantic conventions. It represents the name of the -// DaemonSet. -func K8SDaemonSetName(val string) attribute.KeyValue { - return K8SDaemonSetNameKey.String(val) -} - -// A Kubernetes Job object. -const ( - // K8SJobUIDKey is the attribute Key conforming to the "k8s.job.uid" - // semantic conventions. It represents the UID of the Job. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SJobUIDKey = attribute.Key("k8s.job.uid") - - // K8SJobNameKey is the attribute Key conforming to the "k8s.job.name" - // semantic conventions. It represents the name of the Job. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SJobNameKey = attribute.Key("k8s.job.name") -) - -// K8SJobUID returns an attribute KeyValue conforming to the "k8s.job.uid" -// semantic conventions. It represents the UID of the Job. -func K8SJobUID(val string) attribute.KeyValue { - return K8SJobUIDKey.String(val) -} - -// K8SJobName returns an attribute KeyValue conforming to the "k8s.job.name" -// semantic conventions. It represents the name of the Job. -func K8SJobName(val string) attribute.KeyValue { - return K8SJobNameKey.String(val) -} - -// A Kubernetes CronJob object. -const ( - // K8SCronJobUIDKey is the attribute Key conforming to the - // "k8s.cronjob.uid" semantic conventions. It represents the UID of the - // CronJob. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid") - - // K8SCronJobNameKey is the attribute Key conforming to the - // "k8s.cronjob.name" semantic conventions. It represents the name of the - // CronJob. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SCronJobNameKey = attribute.Key("k8s.cronjob.name") -) - -// K8SCronJobUID returns an attribute KeyValue conforming to the -// "k8s.cronjob.uid" semantic conventions. It represents the UID of the -// CronJob. -func K8SCronJobUID(val string) attribute.KeyValue { - return K8SCronJobUIDKey.String(val) -} - -// K8SCronJobName returns an attribute KeyValue conforming to the -// "k8s.cronjob.name" semantic conventions. It represents the name of the -// CronJob. -func K8SCronJobName(val string) attribute.KeyValue { - return K8SCronJobNameKey.String(val) -} - -// The operating system (OS) on which the process represented by this resource -// is running. -const ( - // OSTypeKey is the attribute Key conforming to the "os.type" semantic - // conventions. It represents the operating system type. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - OSTypeKey = attribute.Key("os.type") - - // OSDescriptionKey is the attribute Key conforming to the "os.description" - // semantic conventions. It represents the human readable (not intended to - // be parsed) OS version information, like e.g. reported by `ver` or - // `lsb_release -a` commands. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Microsoft Windows [Version 10.0.18363.778]', 'Ubuntu 18.04.1 - // LTS' - OSDescriptionKey = attribute.Key("os.description") - - // OSNameKey is the attribute Key conforming to the "os.name" semantic - // conventions. It represents the human readable operating system name. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'iOS', 'Android', 'Ubuntu' - OSNameKey = attribute.Key("os.name") - - // OSVersionKey is the attribute Key conforming to the "os.version" - // semantic conventions. It represents the version string of the operating - // system as defined in [Version - // Attributes](/docs/resource/README.md#version-attributes). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '14.2.1', '18.04.1' - OSVersionKey = attribute.Key("os.version") -) - -var ( - // Microsoft Windows - OSTypeWindows = OSTypeKey.String("windows") - // Linux - OSTypeLinux = OSTypeKey.String("linux") - // Apple Darwin - OSTypeDarwin = OSTypeKey.String("darwin") - // FreeBSD - OSTypeFreeBSD = OSTypeKey.String("freebsd") - // NetBSD - OSTypeNetBSD = OSTypeKey.String("netbsd") - // OpenBSD - OSTypeOpenBSD = OSTypeKey.String("openbsd") - // DragonFly BSD - OSTypeDragonflyBSD = OSTypeKey.String("dragonflybsd") - // HP-UX (Hewlett Packard Unix) - OSTypeHPUX = OSTypeKey.String("hpux") - // AIX (Advanced Interactive eXecutive) - OSTypeAIX = OSTypeKey.String("aix") - // SunOS, Oracle Solaris - OSTypeSolaris = OSTypeKey.String("solaris") - // IBM z/OS - OSTypeZOS = OSTypeKey.String("z_os") -) - -// OSDescription returns an attribute KeyValue conforming to the -// "os.description" semantic conventions. It represents the human readable (not -// intended to be parsed) OS version information, like e.g. reported by `ver` -// or `lsb_release -a` commands. -func OSDescription(val string) attribute.KeyValue { - return OSDescriptionKey.String(val) -} - -// OSName returns an attribute KeyValue conforming to the "os.name" semantic -// conventions. It represents the human readable operating system name. -func OSName(val string) attribute.KeyValue { - return OSNameKey.String(val) -} - -// OSVersion returns an attribute KeyValue conforming to the "os.version" -// semantic conventions. It represents the version string of the operating -// system as defined in [Version -// Attributes](/docs/resource/README.md#version-attributes). -func OSVersion(val string) attribute.KeyValue { - return OSVersionKey.String(val) -} - -// An operating system process. -const ( - // ProcessPIDKey is the attribute Key conforming to the "process.pid" - // semantic conventions. It represents the process identifier (PID). - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 1234 - ProcessPIDKey = attribute.Key("process.pid") - - // ProcessParentPIDKey is the attribute Key conforming to the - // "process.parent_pid" semantic conventions. It represents the parent - // Process identifier (PID). - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 111 - ProcessParentPIDKey = attribute.Key("process.parent_pid") - - // ProcessExecutableNameKey is the attribute Key conforming to the - // "process.executable.name" semantic conventions. It represents the name - // of the process executable. On Linux based systems, can be set to the - // `Name` in `proc/[pid]/status`. On Windows, can be set to the base name - // of `GetProcessImageFileNameW`. - // - // Type: string - // RequirementLevel: ConditionallyRequired (See alternative attributes - // below.) - // Stability: stable - // Examples: 'otelcol' - ProcessExecutableNameKey = attribute.Key("process.executable.name") - - // ProcessExecutablePathKey is the attribute Key conforming to the - // "process.executable.path" semantic conventions. It represents the full - // path to the process executable. On Linux based systems, can be set to - // the target of `proc/[pid]/exe`. On Windows, can be set to the result of - // `GetProcessImageFileNameW`. - // - // Type: string - // RequirementLevel: ConditionallyRequired (See alternative attributes - // below.) - // Stability: stable - // Examples: '/usr/bin/cmd/otelcol' - ProcessExecutablePathKey = attribute.Key("process.executable.path") - - // ProcessCommandKey is the attribute Key conforming to the - // "process.command" semantic conventions. It represents the command used - // to launch the process (i.e. the command name). On Linux based systems, - // can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can - // be set to the first parameter extracted from `GetCommandLineW`. - // - // Type: string - // RequirementLevel: ConditionallyRequired (See alternative attributes - // below.) - // Stability: stable - // Examples: 'cmd/otelcol' - ProcessCommandKey = attribute.Key("process.command") - - // ProcessCommandLineKey is the attribute Key conforming to the - // "process.command_line" semantic conventions. It represents the full - // command used to launch the process as a single string representing the - // full command. On Windows, can be set to the result of `GetCommandLineW`. - // Do not set this if you have to assemble it just for monitoring; use - // `process.command_args` instead. - // - // Type: string - // RequirementLevel: ConditionallyRequired (See alternative attributes - // below.) - // Stability: stable - // Examples: 'C:\\cmd\\otecol --config="my directory\\config.yaml"' - ProcessCommandLineKey = attribute.Key("process.command_line") - - // ProcessCommandArgsKey is the attribute Key conforming to the - // "process.command_args" semantic conventions. It represents the all the - // command arguments (including the command/executable itself) as received - // by the process. On Linux-based systems (and some other Unixoid systems - // supporting procfs), can be set according to the list of null-delimited - // strings extracted from `proc/[pid]/cmdline`. For libc-based executables, - // this would be the full argv vector passed to `main`. - // - // Type: string[] - // RequirementLevel: ConditionallyRequired (See alternative attributes - // below.) - // Stability: stable - // Examples: 'cmd/otecol', '--config=config.yaml' - ProcessCommandArgsKey = attribute.Key("process.command_args") - - // ProcessOwnerKey is the attribute Key conforming to the "process.owner" - // semantic conventions. It represents the username of the user that owns - // the process. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'root' - ProcessOwnerKey = attribute.Key("process.owner") -) - -// ProcessPID returns an attribute KeyValue conforming to the "process.pid" -// semantic conventions. It represents the process identifier (PID). -func ProcessPID(val int) attribute.KeyValue { - return ProcessPIDKey.Int(val) -} - -// ProcessParentPID returns an attribute KeyValue conforming to the -// "process.parent_pid" semantic conventions. It represents the parent Process -// identifier (PID). -func ProcessParentPID(val int) attribute.KeyValue { - return ProcessParentPIDKey.Int(val) -} - -// ProcessExecutableName returns an attribute KeyValue conforming to the -// "process.executable.name" semantic conventions. It represents the name of -// the process executable. On Linux based systems, can be set to the `Name` in -// `proc/[pid]/status`. On Windows, can be set to the base name of -// `GetProcessImageFileNameW`. -func ProcessExecutableName(val string) attribute.KeyValue { - return ProcessExecutableNameKey.String(val) -} - -// ProcessExecutablePath returns an attribute KeyValue conforming to the -// "process.executable.path" semantic conventions. It represents the full path -// to the process executable. On Linux based systems, can be set to the target -// of `proc/[pid]/exe`. On Windows, can be set to the result of -// `GetProcessImageFileNameW`. -func ProcessExecutablePath(val string) attribute.KeyValue { - return ProcessExecutablePathKey.String(val) -} - -// ProcessCommand returns an attribute KeyValue conforming to the -// "process.command" semantic conventions. It represents the command used to -// launch the process (i.e. the command name). On Linux based systems, can be -// set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to -// the first parameter extracted from `GetCommandLineW`. -func ProcessCommand(val string) attribute.KeyValue { - return ProcessCommandKey.String(val) -} - -// ProcessCommandLine returns an attribute KeyValue conforming to the -// "process.command_line" semantic conventions. It represents the full command -// used to launch the process as a single string representing the full command. -// On Windows, can be set to the result of `GetCommandLineW`. Do not set this -// if you have to assemble it just for monitoring; use `process.command_args` -// instead. -func ProcessCommandLine(val string) attribute.KeyValue { - return ProcessCommandLineKey.String(val) -} - -// ProcessCommandArgs returns an attribute KeyValue conforming to the -// "process.command_args" semantic conventions. It represents the all the -// command arguments (including the command/executable itself) as received by -// the process. On Linux-based systems (and some other Unixoid systems -// supporting procfs), can be set according to the list of null-delimited -// strings extracted from `proc/[pid]/cmdline`. For libc-based executables, -// this would be the full argv vector passed to `main`. -func ProcessCommandArgs(val ...string) attribute.KeyValue { - return ProcessCommandArgsKey.StringSlice(val) -} - -// ProcessOwner returns an attribute KeyValue conforming to the -// "process.owner" semantic conventions. It represents the username of the user -// that owns the process. -func ProcessOwner(val string) attribute.KeyValue { - return ProcessOwnerKey.String(val) -} - -// The single (language) runtime instance which is monitored. -const ( - // ProcessRuntimeNameKey is the attribute Key conforming to the - // "process.runtime.name" semantic conventions. It represents the name of - // the runtime of this process. For compiled native binaries, this SHOULD - // be the name of the compiler. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'OpenJDK Runtime Environment' - ProcessRuntimeNameKey = attribute.Key("process.runtime.name") - - // ProcessRuntimeVersionKey is the attribute Key conforming to the - // "process.runtime.version" semantic conventions. It represents the - // version of the runtime of this process, as returned by the runtime - // without modification. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '14.0.2' - ProcessRuntimeVersionKey = attribute.Key("process.runtime.version") - - // ProcessRuntimeDescriptionKey is the attribute Key conforming to the - // "process.runtime.description" semantic conventions. It represents an - // additional description about the runtime of the process, for example a - // specific vendor customization of the runtime environment. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0' - ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description") -) - -// ProcessRuntimeName returns an attribute KeyValue conforming to the -// "process.runtime.name" semantic conventions. It represents the name of the -// runtime of this process. For compiled native binaries, this SHOULD be the -// name of the compiler. -func ProcessRuntimeName(val string) attribute.KeyValue { - return ProcessRuntimeNameKey.String(val) -} - -// ProcessRuntimeVersion returns an attribute KeyValue conforming to the -// "process.runtime.version" semantic conventions. It represents the version of -// the runtime of this process, as returned by the runtime without -// modification. -func ProcessRuntimeVersion(val string) attribute.KeyValue { - return ProcessRuntimeVersionKey.String(val) -} - -// ProcessRuntimeDescription returns an attribute KeyValue conforming to the -// "process.runtime.description" semantic conventions. It represents an -// additional description about the runtime of the process, for example a -// specific vendor customization of the runtime environment. -func ProcessRuntimeDescription(val string) attribute.KeyValue { - return ProcessRuntimeDescriptionKey.String(val) -} - -// A service instance. -const ( - // ServiceNameKey is the attribute Key conforming to the "service.name" - // semantic conventions. It represents the logical name of the service. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'shoppingcart' - // Note: MUST be the same for all instances of horizontally scaled - // services. If the value was not specified, SDKs MUST fallback to - // `unknown_service:` concatenated with - // [`process.executable.name`](process.md#process), e.g. - // `unknown_service:bash`. If `process.executable.name` is not available, - // the value MUST be set to `unknown_service`. - ServiceNameKey = attribute.Key("service.name") - - // ServiceVersionKey is the attribute Key conforming to the - // "service.version" semantic conventions. It represents the version string - // of the service API or implementation. The format is not defined by these - // conventions. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '2.0.0', 'a01dbef8a' - ServiceVersionKey = attribute.Key("service.version") -) - -// ServiceName returns an attribute KeyValue conforming to the -// "service.name" semantic conventions. It represents the logical name of the -// service. -func ServiceName(val string) attribute.KeyValue { - return ServiceNameKey.String(val) -} - -// ServiceVersion returns an attribute KeyValue conforming to the -// "service.version" semantic conventions. It represents the version string of -// the service API or implementation. The format is not defined by these -// conventions. -func ServiceVersion(val string) attribute.KeyValue { - return ServiceVersionKey.String(val) -} - -// A service instance. -const ( - // ServiceNamespaceKey is the attribute Key conforming to the - // "service.namespace" semantic conventions. It represents a namespace for - // `service.name`. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Shop' - // Note: A string value having a meaning that helps to distinguish a group - // of services, for example the team name that owns a group of services. - // `service.name` is expected to be unique within the same namespace. If - // `service.namespace` is not specified in the Resource then `service.name` - // is expected to be unique for all services that have no explicit - // namespace defined (so the empty/unspecified namespace is simply one more - // valid namespace). Zero-length namespace string is assumed equal to - // unspecified namespace. - ServiceNamespaceKey = attribute.Key("service.namespace") - - // ServiceInstanceIDKey is the attribute Key conforming to the - // "service.instance.id" semantic conventions. It represents the string ID - // of the service instance. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'my-k8s-pod-deployment-1', - // '627cc493-f310-47de-96bd-71410b7dec09' - // Note: MUST be unique for each instance of the same - // `service.namespace,service.name` pair (in other words - // `service.namespace,service.name,service.instance.id` triplet MUST be - // globally unique). The ID helps to distinguish instances of the same - // service that exist at the same time (e.g. instances of a horizontally - // scaled service). It is preferable for the ID to be persistent and stay - // the same for the lifetime of the service instance, however it is - // acceptable that the ID is ephemeral and changes during important - // lifetime events for the service (e.g. service restarts). If the service - // has no inherent unique ID that can be used as the value of this - // attribute it is recommended to generate a random Version 1 or Version 4 - // RFC 4122 UUID (services aiming for reproducible UUIDs may also use - // Version 5, see RFC 4122 for more recommendations). - ServiceInstanceIDKey = attribute.Key("service.instance.id") -) - -// ServiceNamespace returns an attribute KeyValue conforming to the -// "service.namespace" semantic conventions. It represents a namespace for -// `service.name`. -func ServiceNamespace(val string) attribute.KeyValue { - return ServiceNamespaceKey.String(val) -} - -// ServiceInstanceID returns an attribute KeyValue conforming to the -// "service.instance.id" semantic conventions. It represents the string ID of -// the service instance. -func ServiceInstanceID(val string) attribute.KeyValue { - return ServiceInstanceIDKey.String(val) -} - -// The telemetry SDK used to capture data recorded by the instrumentation -// libraries. -const ( - // TelemetrySDKNameKey is the attribute Key conforming to the - // "telemetry.sdk.name" semantic conventions. It represents the name of the - // telemetry SDK as defined above. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'opentelemetry' - // Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute - // to `opentelemetry`. - // If another SDK, like a fork or a vendor-provided implementation, is - // used, this SDK MUST set the - // `telemetry.sdk.name` attribute to the fully-qualified class or module - // name of this SDK's main entry point - // or another suitable identifier depending on the language. - // The identifier `opentelemetry` is reserved and MUST NOT be used in this - // case. - // All custom identifiers SHOULD be stable across different versions of an - // implementation. - TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name") - - // TelemetrySDKLanguageKey is the attribute Key conforming to the - // "telemetry.sdk.language" semantic conventions. It represents the - // language of the telemetry SDK. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language") - - // TelemetrySDKVersionKey is the attribute Key conforming to the - // "telemetry.sdk.version" semantic conventions. It represents the version - // string of the telemetry SDK. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: '1.2.3' - TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version") -) - -var ( - // cpp - TelemetrySDKLanguageCPP = TelemetrySDKLanguageKey.String("cpp") - // dotnet - TelemetrySDKLanguageDotnet = TelemetrySDKLanguageKey.String("dotnet") - // erlang - TelemetrySDKLanguageErlang = TelemetrySDKLanguageKey.String("erlang") - // go - TelemetrySDKLanguageGo = TelemetrySDKLanguageKey.String("go") - // java - TelemetrySDKLanguageJava = TelemetrySDKLanguageKey.String("java") - // nodejs - TelemetrySDKLanguageNodejs = TelemetrySDKLanguageKey.String("nodejs") - // php - TelemetrySDKLanguagePHP = TelemetrySDKLanguageKey.String("php") - // python - TelemetrySDKLanguagePython = TelemetrySDKLanguageKey.String("python") - // ruby - TelemetrySDKLanguageRuby = TelemetrySDKLanguageKey.String("ruby") - // rust - TelemetrySDKLanguageRust = TelemetrySDKLanguageKey.String("rust") - // swift - TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift") - // webjs - TelemetrySDKLanguageWebjs = TelemetrySDKLanguageKey.String("webjs") -) - -// TelemetrySDKName returns an attribute KeyValue conforming to the -// "telemetry.sdk.name" semantic conventions. It represents the name of the -// telemetry SDK as defined above. -func TelemetrySDKName(val string) attribute.KeyValue { - return TelemetrySDKNameKey.String(val) -} - -// TelemetrySDKVersion returns an attribute KeyValue conforming to the -// "telemetry.sdk.version" semantic conventions. It represents the version -// string of the telemetry SDK. -func TelemetrySDKVersion(val string) attribute.KeyValue { - return TelemetrySDKVersionKey.String(val) -} - -// The telemetry SDK used to capture data recorded by the instrumentation -// libraries. -const ( - // TelemetryAutoVersionKey is the attribute Key conforming to the - // "telemetry.auto.version" semantic conventions. It represents the version - // string of the auto instrumentation agent, if used. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '1.2.3' - TelemetryAutoVersionKey = attribute.Key("telemetry.auto.version") -) - -// TelemetryAutoVersion returns an attribute KeyValue conforming to the -// "telemetry.auto.version" semantic conventions. It represents the version -// string of the auto instrumentation agent, if used. -func TelemetryAutoVersion(val string) attribute.KeyValue { - return TelemetryAutoVersionKey.String(val) -} - -// Resource describing the packaged software running the application code. Web -// engines are typically executed using process.runtime. -const ( - // WebEngineNameKey is the attribute Key conforming to the "webengine.name" - // semantic conventions. It represents the name of the web engine. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'WildFly' - WebEngineNameKey = attribute.Key("webengine.name") - - // WebEngineVersionKey is the attribute Key conforming to the - // "webengine.version" semantic conventions. It represents the version of - // the web engine. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '21.0.0' - WebEngineVersionKey = attribute.Key("webengine.version") - - // WebEngineDescriptionKey is the attribute Key conforming to the - // "webengine.description" semantic conventions. It represents the - // additional description of the web engine (e.g. detailed version and - // edition information). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - - // 2.2.2.Final' - WebEngineDescriptionKey = attribute.Key("webengine.description") -) - -// WebEngineName returns an attribute KeyValue conforming to the -// "webengine.name" semantic conventions. It represents the name of the web -// engine. -func WebEngineName(val string) attribute.KeyValue { - return WebEngineNameKey.String(val) -} - -// WebEngineVersion returns an attribute KeyValue conforming to the -// "webengine.version" semantic conventions. It represents the version of the -// web engine. -func WebEngineVersion(val string) attribute.KeyValue { - return WebEngineVersionKey.String(val) -} - -// WebEngineDescription returns an attribute KeyValue conforming to the -// "webengine.description" semantic conventions. It represents the additional -// description of the web engine (e.g. detailed version and edition -// information). -func WebEngineDescription(val string) attribute.KeyValue { - return WebEngineDescriptionKey.String(val) -} - -// Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's -// concepts. -const ( - // OTelScopeNameKey is the attribute Key conforming to the - // "otel.scope.name" semantic conventions. It represents the name of the - // instrumentation scope - (`InstrumentationScope.Name` in OTLP). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'io.opentelemetry.contrib.mongodb' - OTelScopeNameKey = attribute.Key("otel.scope.name") - - // OTelScopeVersionKey is the attribute Key conforming to the - // "otel.scope.version" semantic conventions. It represents the version of - // the instrumentation scope - (`InstrumentationScope.Version` in OTLP). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '1.0.0' - OTelScopeVersionKey = attribute.Key("otel.scope.version") -) - -// OTelScopeName returns an attribute KeyValue conforming to the -// "otel.scope.name" semantic conventions. It represents the name of the -// instrumentation scope - (`InstrumentationScope.Name` in OTLP). -func OTelScopeName(val string) attribute.KeyValue { - return OTelScopeNameKey.String(val) -} - -// OTelScopeVersion returns an attribute KeyValue conforming to the -// "otel.scope.version" semantic conventions. It represents the version of the -// instrumentation scope - (`InstrumentationScope.Version` in OTLP). -func OTelScopeVersion(val string) attribute.KeyValue { - return OTelScopeVersionKey.String(val) -} - -// Span attributes used by non-OTLP exporters to represent OpenTelemetry -// Scope's concepts. -const ( - // OTelLibraryNameKey is the attribute Key conforming to the - // "otel.library.name" semantic conventions. It represents the deprecated, - // use the `otel.scope.name` attribute. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 'io.opentelemetry.contrib.mongodb' - OTelLibraryNameKey = attribute.Key("otel.library.name") - - // OTelLibraryVersionKey is the attribute Key conforming to the - // "otel.library.version" semantic conventions. It represents the - // deprecated, use the `otel.scope.version` attribute. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: '1.0.0' - OTelLibraryVersionKey = attribute.Key("otel.library.version") -) - -// OTelLibraryName returns an attribute KeyValue conforming to the -// "otel.library.name" semantic conventions. It represents the deprecated, use -// the `otel.scope.name` attribute. -func OTelLibraryName(val string) attribute.KeyValue { - return OTelLibraryNameKey.String(val) -} - -// OTelLibraryVersion returns an attribute KeyValue conforming to the -// "otel.library.version" semantic conventions. It represents the deprecated, -// use the `otel.scope.version` attribute. -func OTelLibraryVersion(val string) attribute.KeyValue { - return OTelLibraryVersionKey.String(val) -} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go deleted file mode 100644 index be07217d8a..0000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" - -// SchemaURL is the schema URL that matches the version of the semantic conventions -// that this package defines. Semconv packages starting from v1.4.0 must declare -// non-empty schema URL in the form https://opentelemetry.io/schemas/ -const SchemaURL = "https://opentelemetry.io/schemas/1.21.0" diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go deleted file mode 100644 index 55698cc447..0000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go +++ /dev/null @@ -1,2484 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated from semantic convention specification. DO NOT EDIT. - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" - -import "go.opentelemetry.io/otel/attribute" - -// The shared attributes used to report a single exception associated with a -// span or log. -const ( - // ExceptionTypeKey is the attribute Key conforming to the "exception.type" - // semantic conventions. It represents the type of the exception (its - // fully-qualified class name, if applicable). The dynamic type of the - // exception should be preferred over the static type in languages that - // support it. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'java.net.ConnectException', 'OSError' - ExceptionTypeKey = attribute.Key("exception.type") - - // ExceptionMessageKey is the attribute Key conforming to the - // "exception.message" semantic conventions. It represents the exception - // message. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Division by zero', "Can't convert 'int' object to str - // implicitly" - ExceptionMessageKey = attribute.Key("exception.message") - - // ExceptionStacktraceKey is the attribute Key conforming to the - // "exception.stacktrace" semantic conventions. It represents a stacktrace - // as a string in the natural representation for the language runtime. The - // representation is to be determined and documented by each language SIG. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test - // exception\\n at ' - // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at ' - // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at ' - // 'com.example.GenerateTrace.main(GenerateTrace.java:5)' - ExceptionStacktraceKey = attribute.Key("exception.stacktrace") -) - -// ExceptionType returns an attribute KeyValue conforming to the -// "exception.type" semantic conventions. It represents the type of the -// exception (its fully-qualified class name, if applicable). The dynamic type -// of the exception should be preferred over the static type in languages that -// support it. -func ExceptionType(val string) attribute.KeyValue { - return ExceptionTypeKey.String(val) -} - -// ExceptionMessage returns an attribute KeyValue conforming to the -// "exception.message" semantic conventions. It represents the exception -// message. -func ExceptionMessage(val string) attribute.KeyValue { - return ExceptionMessageKey.String(val) -} - -// ExceptionStacktrace returns an attribute KeyValue conforming to the -// "exception.stacktrace" semantic conventions. It represents a stacktrace as a -// string in the natural representation for the language runtime. The -// representation is to be determined and documented by each language SIG. -func ExceptionStacktrace(val string) attribute.KeyValue { - return ExceptionStacktraceKey.String(val) -} - -// Span attributes used by AWS Lambda (in addition to general `faas` -// attributes). -const ( - // AWSLambdaInvokedARNKey is the attribute Key conforming to the - // "aws.lambda.invoked_arn" semantic conventions. It represents the full - // invoked ARN as provided on the `Context` passed to the function - // (`Lambda-Runtime-Invoked-Function-ARN` header on the - // `/runtime/invocation/next` applicable). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias' - // Note: This may be different from `cloud.resource_id` if an alias is - // involved. - AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn") -) - -// AWSLambdaInvokedARN returns an attribute KeyValue conforming to the -// "aws.lambda.invoked_arn" semantic conventions. It represents the full -// invoked ARN as provided on the `Context` passed to the function -// (`Lambda-Runtime-Invoked-Function-ARN` header on the -// `/runtime/invocation/next` applicable). -func AWSLambdaInvokedARN(val string) attribute.KeyValue { - return AWSLambdaInvokedARNKey.String(val) -} - -// Attributes for CloudEvents. CloudEvents is a specification on how to define -// event data in a standard way. These attributes can be attached to spans when -// performing operations with CloudEvents, regardless of the protocol being -// used. -const ( - // CloudeventsEventIDKey is the attribute Key conforming to the - // "cloudevents.event_id" semantic conventions. It represents the - // [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) - // uniquely identifies the event. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: '123e4567-e89b-12d3-a456-426614174000', '0001' - CloudeventsEventIDKey = attribute.Key("cloudevents.event_id") - - // CloudeventsEventSourceKey is the attribute Key conforming to the - // "cloudevents.event_source" semantic conventions. It represents the - // [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) - // identifies the context in which an event happened. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'https://github.com/cloudevents', - // '/cloudevents/spec/pull/123', 'my-service' - CloudeventsEventSourceKey = attribute.Key("cloudevents.event_source") - - // CloudeventsEventSpecVersionKey is the attribute Key conforming to the - // "cloudevents.event_spec_version" semantic conventions. It represents the - // [version of the CloudEvents - // specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) - // which the event uses. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '1.0' - CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version") - - // CloudeventsEventTypeKey is the attribute Key conforming to the - // "cloudevents.event_type" semantic conventions. It represents the - // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) - // contains a value describing the type of event related to the originating - // occurrence. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'com.github.pull_request.opened', - // 'com.example.object.deleted.v2' - CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type") - - // CloudeventsEventSubjectKey is the attribute Key conforming to the - // "cloudevents.event_subject" semantic conventions. It represents the - // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) - // of the event in the context of the event producer (identified by - // source). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'mynewfile.jpg' - CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject") -) - -// CloudeventsEventID returns an attribute KeyValue conforming to the -// "cloudevents.event_id" semantic conventions. It represents the -// [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) -// uniquely identifies the event. -func CloudeventsEventID(val string) attribute.KeyValue { - return CloudeventsEventIDKey.String(val) -} - -// CloudeventsEventSource returns an attribute KeyValue conforming to the -// "cloudevents.event_source" semantic conventions. It represents the -// [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) -// identifies the context in which an event happened. -func CloudeventsEventSource(val string) attribute.KeyValue { - return CloudeventsEventSourceKey.String(val) -} - -// CloudeventsEventSpecVersion returns an attribute KeyValue conforming to -// the "cloudevents.event_spec_version" semantic conventions. It represents the -// [version of the CloudEvents -// specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) -// which the event uses. -func CloudeventsEventSpecVersion(val string) attribute.KeyValue { - return CloudeventsEventSpecVersionKey.String(val) -} - -// CloudeventsEventType returns an attribute KeyValue conforming to the -// "cloudevents.event_type" semantic conventions. It represents the -// [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) -// contains a value describing the type of event related to the originating -// occurrence. -func CloudeventsEventType(val string) attribute.KeyValue { - return CloudeventsEventTypeKey.String(val) -} - -// CloudeventsEventSubject returns an attribute KeyValue conforming to the -// "cloudevents.event_subject" semantic conventions. It represents the -// [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) -// of the event in the context of the event producer (identified by source). -func CloudeventsEventSubject(val string) attribute.KeyValue { - return CloudeventsEventSubjectKey.String(val) -} - -// Semantic conventions for the OpenTracing Shim -const ( - // OpentracingRefTypeKey is the attribute Key conforming to the - // "opentracing.ref_type" semantic conventions. It represents the - // parent-child Reference type - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Note: The causal relationship between a child Span and a parent Span. - OpentracingRefTypeKey = attribute.Key("opentracing.ref_type") -) - -var ( - // The parent Span depends on the child Span in some capacity - OpentracingRefTypeChildOf = OpentracingRefTypeKey.String("child_of") - // The parent Span does not depend in any way on the result of the child Span - OpentracingRefTypeFollowsFrom = OpentracingRefTypeKey.String("follows_from") -) - -// The attributes used to perform database client calls. -const ( - // DBSystemKey is the attribute Key conforming to the "db.system" semantic - // conventions. It represents an identifier for the database management - // system (DBMS) product being used. See below for a list of well-known - // identifiers. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - DBSystemKey = attribute.Key("db.system") - - // DBConnectionStringKey is the attribute Key conforming to the - // "db.connection_string" semantic conventions. It represents the - // connection string used to connect to the database. It is recommended to - // remove embedded credentials. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Server=(localdb)\\v11.0;Integrated Security=true;' - DBConnectionStringKey = attribute.Key("db.connection_string") - - // DBUserKey is the attribute Key conforming to the "db.user" semantic - // conventions. It represents the username for accessing the database. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'readonly_user', 'reporting_user' - DBUserKey = attribute.Key("db.user") - - // DBJDBCDriverClassnameKey is the attribute Key conforming to the - // "db.jdbc.driver_classname" semantic conventions. It represents the - // fully-qualified class name of the [Java Database Connectivity - // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) - // driver used to connect. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'org.postgresql.Driver', - // 'com.microsoft.sqlserver.jdbc.SQLServerDriver' - DBJDBCDriverClassnameKey = attribute.Key("db.jdbc.driver_classname") - - // DBNameKey is the attribute Key conforming to the "db.name" semantic - // conventions. It represents the this attribute is used to report the name - // of the database being accessed. For commands that switch the database, - // this should be set to the target database (even if the command fails). - // - // Type: string - // RequirementLevel: ConditionallyRequired (If applicable.) - // Stability: stable - // Examples: 'customers', 'main' - // Note: In some SQL databases, the database name to be used is called - // "schema name". In case there are multiple layers that could be - // considered for database name (e.g. Oracle instance name and schema - // name), the database name to be used is the more specific layer (e.g. - // Oracle schema name). - DBNameKey = attribute.Key("db.name") - - // DBStatementKey is the attribute Key conforming to the "db.statement" - // semantic conventions. It represents the database statement being - // executed. - // - // Type: string - // RequirementLevel: Recommended (Should be collected by default only if - // there is sanitization that excludes sensitive information.) - // Stability: stable - // Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"' - DBStatementKey = attribute.Key("db.statement") - - // DBOperationKey is the attribute Key conforming to the "db.operation" - // semantic conventions. It represents the name of the operation being - // executed, e.g. the [MongoDB command - // name](https://docs.mongodb.com/manual/reference/command/#database-operations) - // such as `findAndModify`, or the SQL keyword. - // - // Type: string - // RequirementLevel: ConditionallyRequired (If `db.statement` is not - // applicable.) - // Stability: stable - // Examples: 'findAndModify', 'HMSET', 'SELECT' - // Note: When setting this to an SQL keyword, it is not recommended to - // attempt any client-side parsing of `db.statement` just to get this - // property, but it should be set if the operation name is provided by the - // library being instrumented. If the SQL statement has an ambiguous - // operation, or performs more than one operation, this value may be - // omitted. - DBOperationKey = attribute.Key("db.operation") -) - -var ( - // Some other SQL database. Fallback only. See notes - DBSystemOtherSQL = DBSystemKey.String("other_sql") - // Microsoft SQL Server - DBSystemMSSQL = DBSystemKey.String("mssql") - // Microsoft SQL Server Compact - DBSystemMssqlcompact = DBSystemKey.String("mssqlcompact") - // MySQL - DBSystemMySQL = DBSystemKey.String("mysql") - // Oracle Database - DBSystemOracle = DBSystemKey.String("oracle") - // IBM DB2 - DBSystemDB2 = DBSystemKey.String("db2") - // PostgreSQL - DBSystemPostgreSQL = DBSystemKey.String("postgresql") - // Amazon Redshift - DBSystemRedshift = DBSystemKey.String("redshift") - // Apache Hive - DBSystemHive = DBSystemKey.String("hive") - // Cloudscape - DBSystemCloudscape = DBSystemKey.String("cloudscape") - // HyperSQL DataBase - DBSystemHSQLDB = DBSystemKey.String("hsqldb") - // Progress Database - DBSystemProgress = DBSystemKey.String("progress") - // SAP MaxDB - DBSystemMaxDB = DBSystemKey.String("maxdb") - // SAP HANA - DBSystemHanaDB = DBSystemKey.String("hanadb") - // Ingres - DBSystemIngres = DBSystemKey.String("ingres") - // FirstSQL - DBSystemFirstSQL = DBSystemKey.String("firstsql") - // EnterpriseDB - DBSystemEDB = DBSystemKey.String("edb") - // InterSystems Caché - DBSystemCache = DBSystemKey.String("cache") - // Adabas (Adaptable Database System) - DBSystemAdabas = DBSystemKey.String("adabas") - // Firebird - DBSystemFirebird = DBSystemKey.String("firebird") - // Apache Derby - DBSystemDerby = DBSystemKey.String("derby") - // FileMaker - DBSystemFilemaker = DBSystemKey.String("filemaker") - // Informix - DBSystemInformix = DBSystemKey.String("informix") - // InstantDB - DBSystemInstantDB = DBSystemKey.String("instantdb") - // InterBase - DBSystemInterbase = DBSystemKey.String("interbase") - // MariaDB - DBSystemMariaDB = DBSystemKey.String("mariadb") - // Netezza - DBSystemNetezza = DBSystemKey.String("netezza") - // Pervasive PSQL - DBSystemPervasive = DBSystemKey.String("pervasive") - // PointBase - DBSystemPointbase = DBSystemKey.String("pointbase") - // SQLite - DBSystemSqlite = DBSystemKey.String("sqlite") - // Sybase - DBSystemSybase = DBSystemKey.String("sybase") - // Teradata - DBSystemTeradata = DBSystemKey.String("teradata") - // Vertica - DBSystemVertica = DBSystemKey.String("vertica") - // H2 - DBSystemH2 = DBSystemKey.String("h2") - // ColdFusion IMQ - DBSystemColdfusion = DBSystemKey.String("coldfusion") - // Apache Cassandra - DBSystemCassandra = DBSystemKey.String("cassandra") - // Apache HBase - DBSystemHBase = DBSystemKey.String("hbase") - // MongoDB - DBSystemMongoDB = DBSystemKey.String("mongodb") - // Redis - DBSystemRedis = DBSystemKey.String("redis") - // Couchbase - DBSystemCouchbase = DBSystemKey.String("couchbase") - // CouchDB - DBSystemCouchDB = DBSystemKey.String("couchdb") - // Microsoft Azure Cosmos DB - DBSystemCosmosDB = DBSystemKey.String("cosmosdb") - // Amazon DynamoDB - DBSystemDynamoDB = DBSystemKey.String("dynamodb") - // Neo4j - DBSystemNeo4j = DBSystemKey.String("neo4j") - // Apache Geode - DBSystemGeode = DBSystemKey.String("geode") - // Elasticsearch - DBSystemElasticsearch = DBSystemKey.String("elasticsearch") - // Memcached - DBSystemMemcached = DBSystemKey.String("memcached") - // CockroachDB - DBSystemCockroachdb = DBSystemKey.String("cockroachdb") - // OpenSearch - DBSystemOpensearch = DBSystemKey.String("opensearch") - // ClickHouse - DBSystemClickhouse = DBSystemKey.String("clickhouse") - // Cloud Spanner - DBSystemSpanner = DBSystemKey.String("spanner") - // Trino - DBSystemTrino = DBSystemKey.String("trino") -) - -// DBConnectionString returns an attribute KeyValue conforming to the -// "db.connection_string" semantic conventions. It represents the connection -// string used to connect to the database. It is recommended to remove embedded -// credentials. -func DBConnectionString(val string) attribute.KeyValue { - return DBConnectionStringKey.String(val) -} - -// DBUser returns an attribute KeyValue conforming to the "db.user" semantic -// conventions. It represents the username for accessing the database. -func DBUser(val string) attribute.KeyValue { - return DBUserKey.String(val) -} - -// DBJDBCDriverClassname returns an attribute KeyValue conforming to the -// "db.jdbc.driver_classname" semantic conventions. It represents the -// fully-qualified class name of the [Java Database Connectivity -// (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver -// used to connect. -func DBJDBCDriverClassname(val string) attribute.KeyValue { - return DBJDBCDriverClassnameKey.String(val) -} - -// DBName returns an attribute KeyValue conforming to the "db.name" semantic -// conventions. It represents the this attribute is used to report the name of -// the database being accessed. For commands that switch the database, this -// should be set to the target database (even if the command fails). -func DBName(val string) attribute.KeyValue { - return DBNameKey.String(val) -} - -// DBStatement returns an attribute KeyValue conforming to the -// "db.statement" semantic conventions. It represents the database statement -// being executed. -func DBStatement(val string) attribute.KeyValue { - return DBStatementKey.String(val) -} - -// DBOperation returns an attribute KeyValue conforming to the -// "db.operation" semantic conventions. It represents the name of the operation -// being executed, e.g. the [MongoDB command -// name](https://docs.mongodb.com/manual/reference/command/#database-operations) -// such as `findAndModify`, or the SQL keyword. -func DBOperation(val string) attribute.KeyValue { - return DBOperationKey.String(val) -} - -// Connection-level attributes for Microsoft SQL Server -const ( - // DBMSSQLInstanceNameKey is the attribute Key conforming to the - // "db.mssql.instance_name" semantic conventions. It represents the - // Microsoft SQL Server [instance - // name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) - // connecting to. This name is used to determine the port of a named - // instance. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'MSSQLSERVER' - // Note: If setting a `db.mssql.instance_name`, `server.port` is no longer - // required (but still recommended if non-standard). - DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name") -) - -// DBMSSQLInstanceName returns an attribute KeyValue conforming to the -// "db.mssql.instance_name" semantic conventions. It represents the Microsoft -// SQL Server [instance -// name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) -// connecting to. This name is used to determine the port of a named instance. -func DBMSSQLInstanceName(val string) attribute.KeyValue { - return DBMSSQLInstanceNameKey.String(val) -} - -// Call-level attributes for Cassandra -const ( - // DBCassandraPageSizeKey is the attribute Key conforming to the - // "db.cassandra.page_size" semantic conventions. It represents the fetch - // size used for paging, i.e. how many rows will be returned at once. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 5000 - DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size") - - // DBCassandraConsistencyLevelKey is the attribute Key conforming to the - // "db.cassandra.consistency_level" semantic conventions. It represents the - // consistency level of the query. Based on consistency values from - // [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level") - - // DBCassandraTableKey is the attribute Key conforming to the - // "db.cassandra.table" semantic conventions. It represents the name of the - // primary table that the operation is acting upon, including the keyspace - // name (if applicable). - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'mytable' - // Note: This mirrors the db.sql.table attribute but references cassandra - // rather than sql. It is not recommended to attempt any client-side - // parsing of `db.statement` just to get this property, but it should be - // set if it is provided by the library being instrumented. If the - // operation is acting upon an anonymous table, or more than one table, - // this value MUST NOT be set. - DBCassandraTableKey = attribute.Key("db.cassandra.table") - - // DBCassandraIdempotenceKey is the attribute Key conforming to the - // "db.cassandra.idempotence" semantic conventions. It represents the - // whether or not the query is idempotent. - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence") - - // DBCassandraSpeculativeExecutionCountKey is the attribute Key conforming - // to the "db.cassandra.speculative_execution_count" semantic conventions. - // It represents the number of times a query was speculatively executed. - // Not set or `0` if the query was not executed speculatively. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 0, 2 - DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count") - - // DBCassandraCoordinatorIDKey is the attribute Key conforming to the - // "db.cassandra.coordinator.id" semantic conventions. It represents the ID - // of the coordinating node for a query. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af' - DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id") - - // DBCassandraCoordinatorDCKey is the attribute Key conforming to the - // "db.cassandra.coordinator.dc" semantic conventions. It represents the - // data center of the coordinating node for a query. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'us-west-2' - DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc") -) - -var ( - // all - DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all") - // each_quorum - DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum") - // quorum - DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum") - // local_quorum - DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum") - // one - DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one") - // two - DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two") - // three - DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three") - // local_one - DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one") - // any - DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any") - // serial - DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial") - // local_serial - DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial") -) - -// DBCassandraPageSize returns an attribute KeyValue conforming to the -// "db.cassandra.page_size" semantic conventions. It represents the fetch size -// used for paging, i.e. how many rows will be returned at once. -func DBCassandraPageSize(val int) attribute.KeyValue { - return DBCassandraPageSizeKey.Int(val) -} - -// DBCassandraTable returns an attribute KeyValue conforming to the -// "db.cassandra.table" semantic conventions. It represents the name of the -// primary table that the operation is acting upon, including the keyspace name -// (if applicable). -func DBCassandraTable(val string) attribute.KeyValue { - return DBCassandraTableKey.String(val) -} - -// DBCassandraIdempotence returns an attribute KeyValue conforming to the -// "db.cassandra.idempotence" semantic conventions. It represents the whether -// or not the query is idempotent. -func DBCassandraIdempotence(val bool) attribute.KeyValue { - return DBCassandraIdempotenceKey.Bool(val) -} - -// DBCassandraSpeculativeExecutionCount returns an attribute KeyValue -// conforming to the "db.cassandra.speculative_execution_count" semantic -// conventions. It represents the number of times a query was speculatively -// executed. Not set or `0` if the query was not executed speculatively. -func DBCassandraSpeculativeExecutionCount(val int) attribute.KeyValue { - return DBCassandraSpeculativeExecutionCountKey.Int(val) -} - -// DBCassandraCoordinatorID returns an attribute KeyValue conforming to the -// "db.cassandra.coordinator.id" semantic conventions. It represents the ID of -// the coordinating node for a query. -func DBCassandraCoordinatorID(val string) attribute.KeyValue { - return DBCassandraCoordinatorIDKey.String(val) -} - -// DBCassandraCoordinatorDC returns an attribute KeyValue conforming to the -// "db.cassandra.coordinator.dc" semantic conventions. It represents the data -// center of the coordinating node for a query. -func DBCassandraCoordinatorDC(val string) attribute.KeyValue { - return DBCassandraCoordinatorDCKey.String(val) -} - -// Call-level attributes for Redis -const ( - // DBRedisDBIndexKey is the attribute Key conforming to the - // "db.redis.database_index" semantic conventions. It represents the index - // of the database being accessed as used in the [`SELECT` - // command](https://redis.io/commands/select), provided as an integer. To - // be used instead of the generic `db.name` attribute. - // - // Type: int - // RequirementLevel: ConditionallyRequired (If other than the default - // database (`0`).) - // Stability: stable - // Examples: 0, 1, 15 - DBRedisDBIndexKey = attribute.Key("db.redis.database_index") -) - -// DBRedisDBIndex returns an attribute KeyValue conforming to the -// "db.redis.database_index" semantic conventions. It represents the index of -// the database being accessed as used in the [`SELECT` -// command](https://redis.io/commands/select), provided as an integer. To be -// used instead of the generic `db.name` attribute. -func DBRedisDBIndex(val int) attribute.KeyValue { - return DBRedisDBIndexKey.Int(val) -} - -// Call-level attributes for MongoDB -const ( - // DBMongoDBCollectionKey is the attribute Key conforming to the - // "db.mongodb.collection" semantic conventions. It represents the - // collection being accessed within the database stated in `db.name`. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'customers', 'products' - DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection") -) - -// DBMongoDBCollection returns an attribute KeyValue conforming to the -// "db.mongodb.collection" semantic conventions. It represents the collection -// being accessed within the database stated in `db.name`. -func DBMongoDBCollection(val string) attribute.KeyValue { - return DBMongoDBCollectionKey.String(val) -} - -// Call-level attributes for SQL databases -const ( - // DBSQLTableKey is the attribute Key conforming to the "db.sql.table" - // semantic conventions. It represents the name of the primary table that - // the operation is acting upon, including the database name (if - // applicable). - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'public.users', 'customers' - // Note: It is not recommended to attempt any client-side parsing of - // `db.statement` just to get this property, but it should be set if it is - // provided by the library being instrumented. If the operation is acting - // upon an anonymous table, or more than one table, this value MUST NOT be - // set. - DBSQLTableKey = attribute.Key("db.sql.table") -) - -// DBSQLTable returns an attribute KeyValue conforming to the "db.sql.table" -// semantic conventions. It represents the name of the primary table that the -// operation is acting upon, including the database name (if applicable). -func DBSQLTable(val string) attribute.KeyValue { - return DBSQLTableKey.String(val) -} - -// Call-level attributes for Cosmos DB. -const ( - // DBCosmosDBClientIDKey is the attribute Key conforming to the - // "db.cosmosdb.client_id" semantic conventions. It represents the unique - // Cosmos client instance id. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '3ba4827d-4422-483f-b59f-85b74211c11d' - DBCosmosDBClientIDKey = attribute.Key("db.cosmosdb.client_id") - - // DBCosmosDBOperationTypeKey is the attribute Key conforming to the - // "db.cosmosdb.operation_type" semantic conventions. It represents the - // cosmosDB Operation Type. - // - // Type: Enum - // RequirementLevel: ConditionallyRequired (when performing one of the - // operations in this list) - // Stability: stable - DBCosmosDBOperationTypeKey = attribute.Key("db.cosmosdb.operation_type") - - // DBCosmosDBConnectionModeKey is the attribute Key conforming to the - // "db.cosmosdb.connection_mode" semantic conventions. It represents the - // cosmos client connection mode. - // - // Type: Enum - // RequirementLevel: ConditionallyRequired (if not `direct` (or pick gw as - // default)) - // Stability: stable - DBCosmosDBConnectionModeKey = attribute.Key("db.cosmosdb.connection_mode") - - // DBCosmosDBContainerKey is the attribute Key conforming to the - // "db.cosmosdb.container" semantic conventions. It represents the cosmos - // DB container name. - // - // Type: string - // RequirementLevel: ConditionallyRequired (if available) - // Stability: stable - // Examples: 'anystring' - DBCosmosDBContainerKey = attribute.Key("db.cosmosdb.container") - - // DBCosmosDBRequestContentLengthKey is the attribute Key conforming to the - // "db.cosmosdb.request_content_length" semantic conventions. It represents - // the request payload size in bytes - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - DBCosmosDBRequestContentLengthKey = attribute.Key("db.cosmosdb.request_content_length") - - // DBCosmosDBStatusCodeKey is the attribute Key conforming to the - // "db.cosmosdb.status_code" semantic conventions. It represents the cosmos - // DB status code. - // - // Type: int - // RequirementLevel: ConditionallyRequired (if response was received) - // Stability: stable - // Examples: 200, 201 - DBCosmosDBStatusCodeKey = attribute.Key("db.cosmosdb.status_code") - - // DBCosmosDBSubStatusCodeKey is the attribute Key conforming to the - // "db.cosmosdb.sub_status_code" semantic conventions. It represents the - // cosmos DB sub status code. - // - // Type: int - // RequirementLevel: ConditionallyRequired (when response was received and - // contained sub-code.) - // Stability: stable - // Examples: 1000, 1002 - DBCosmosDBSubStatusCodeKey = attribute.Key("db.cosmosdb.sub_status_code") - - // DBCosmosDBRequestChargeKey is the attribute Key conforming to the - // "db.cosmosdb.request_charge" semantic conventions. It represents the rU - // consumed for that operation - // - // Type: double - // RequirementLevel: ConditionallyRequired (when available) - // Stability: stable - // Examples: 46.18, 1.0 - DBCosmosDBRequestChargeKey = attribute.Key("db.cosmosdb.request_charge") -) - -var ( - // invalid - DBCosmosDBOperationTypeInvalid = DBCosmosDBOperationTypeKey.String("Invalid") - // create - DBCosmosDBOperationTypeCreate = DBCosmosDBOperationTypeKey.String("Create") - // patch - DBCosmosDBOperationTypePatch = DBCosmosDBOperationTypeKey.String("Patch") - // read - DBCosmosDBOperationTypeRead = DBCosmosDBOperationTypeKey.String("Read") - // read_feed - DBCosmosDBOperationTypeReadFeed = DBCosmosDBOperationTypeKey.String("ReadFeed") - // delete - DBCosmosDBOperationTypeDelete = DBCosmosDBOperationTypeKey.String("Delete") - // replace - DBCosmosDBOperationTypeReplace = DBCosmosDBOperationTypeKey.String("Replace") - // execute - DBCosmosDBOperationTypeExecute = DBCosmosDBOperationTypeKey.String("Execute") - // query - DBCosmosDBOperationTypeQuery = DBCosmosDBOperationTypeKey.String("Query") - // head - DBCosmosDBOperationTypeHead = DBCosmosDBOperationTypeKey.String("Head") - // head_feed - DBCosmosDBOperationTypeHeadFeed = DBCosmosDBOperationTypeKey.String("HeadFeed") - // upsert - DBCosmosDBOperationTypeUpsert = DBCosmosDBOperationTypeKey.String("Upsert") - // batch - DBCosmosDBOperationTypeBatch = DBCosmosDBOperationTypeKey.String("Batch") - // query_plan - DBCosmosDBOperationTypeQueryPlan = DBCosmosDBOperationTypeKey.String("QueryPlan") - // execute_javascript - DBCosmosDBOperationTypeExecuteJavascript = DBCosmosDBOperationTypeKey.String("ExecuteJavaScript") -) - -var ( - // Gateway (HTTP) connections mode - DBCosmosDBConnectionModeGateway = DBCosmosDBConnectionModeKey.String("gateway") - // Direct connection - DBCosmosDBConnectionModeDirect = DBCosmosDBConnectionModeKey.String("direct") -) - -// DBCosmosDBClientID returns an attribute KeyValue conforming to the -// "db.cosmosdb.client_id" semantic conventions. It represents the unique -// Cosmos client instance id. -func DBCosmosDBClientID(val string) attribute.KeyValue { - return DBCosmosDBClientIDKey.String(val) -} - -// DBCosmosDBContainer returns an attribute KeyValue conforming to the -// "db.cosmosdb.container" semantic conventions. It represents the cosmos DB -// container name. -func DBCosmosDBContainer(val string) attribute.KeyValue { - return DBCosmosDBContainerKey.String(val) -} - -// DBCosmosDBRequestContentLength returns an attribute KeyValue conforming -// to the "db.cosmosdb.request_content_length" semantic conventions. It -// represents the request payload size in bytes -func DBCosmosDBRequestContentLength(val int) attribute.KeyValue { - return DBCosmosDBRequestContentLengthKey.Int(val) -} - -// DBCosmosDBStatusCode returns an attribute KeyValue conforming to the -// "db.cosmosdb.status_code" semantic conventions. It represents the cosmos DB -// status code. -func DBCosmosDBStatusCode(val int) attribute.KeyValue { - return DBCosmosDBStatusCodeKey.Int(val) -} - -// DBCosmosDBSubStatusCode returns an attribute KeyValue conforming to the -// "db.cosmosdb.sub_status_code" semantic conventions. It represents the cosmos -// DB sub status code. -func DBCosmosDBSubStatusCode(val int) attribute.KeyValue { - return DBCosmosDBSubStatusCodeKey.Int(val) -} - -// DBCosmosDBRequestCharge returns an attribute KeyValue conforming to the -// "db.cosmosdb.request_charge" semantic conventions. It represents the rU -// consumed for that operation -func DBCosmosDBRequestCharge(val float64) attribute.KeyValue { - return DBCosmosDBRequestChargeKey.Float64(val) -} - -// Span attributes used by non-OTLP exporters to represent OpenTelemetry Span's -// concepts. -const ( - // OTelStatusCodeKey is the attribute Key conforming to the - // "otel.status_code" semantic conventions. It represents the name of the - // code, either "OK" or "ERROR". MUST NOT be set if the status code is - // UNSET. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - OTelStatusCodeKey = attribute.Key("otel.status_code") - - // OTelStatusDescriptionKey is the attribute Key conforming to the - // "otel.status_description" semantic conventions. It represents the - // description of the Status if it has a value, otherwise not set. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'resource not found' - OTelStatusDescriptionKey = attribute.Key("otel.status_description") -) - -var ( - // The operation has been validated by an Application developer or Operator to have completed successfully - OTelStatusCodeOk = OTelStatusCodeKey.String("OK") - // The operation contains an error - OTelStatusCodeError = OTelStatusCodeKey.String("ERROR") -) - -// OTelStatusDescription returns an attribute KeyValue conforming to the -// "otel.status_description" semantic conventions. It represents the -// description of the Status if it has a value, otherwise not set. -func OTelStatusDescription(val string) attribute.KeyValue { - return OTelStatusDescriptionKey.String(val) -} - -// This semantic convention describes an instance of a function that runs -// without provisioning or managing of servers (also known as serverless -// functions or Function as a Service (FaaS)) with spans. -const ( - // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger" - // semantic conventions. It represents the type of the trigger which caused - // this function invocation. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Note: For the server/consumer span on the incoming side, - // `faas.trigger` MUST be set. - // - // Clients invoking FaaS instances usually cannot set `faas.trigger`, - // since they would typically need to look in the payload to determine - // the event type. If clients set it, it should be the same as the - // trigger that corresponding incoming would have (i.e., this has - // nothing to do with the underlying transport used to make the API - // call to invoke the lambda, which is often HTTP). - FaaSTriggerKey = attribute.Key("faas.trigger") - - // FaaSInvocationIDKey is the attribute Key conforming to the - // "faas.invocation_id" semantic conventions. It represents the invocation - // ID of the current function invocation. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28' - FaaSInvocationIDKey = attribute.Key("faas.invocation_id") -) - -var ( - // A response to some data source operation such as a database or filesystem read/write - FaaSTriggerDatasource = FaaSTriggerKey.String("datasource") - // To provide an answer to an inbound HTTP request - FaaSTriggerHTTP = FaaSTriggerKey.String("http") - // A function is set to be executed when messages are sent to a messaging system - FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub") - // A function is scheduled to be executed regularly - FaaSTriggerTimer = FaaSTriggerKey.String("timer") - // If none of the others apply - FaaSTriggerOther = FaaSTriggerKey.String("other") -) - -// FaaSInvocationID returns an attribute KeyValue conforming to the -// "faas.invocation_id" semantic conventions. It represents the invocation ID -// of the current function invocation. -func FaaSInvocationID(val string) attribute.KeyValue { - return FaaSInvocationIDKey.String(val) -} - -// Semantic Convention for FaaS triggered as a response to some data source -// operation such as a database or filesystem read/write. -const ( - // FaaSDocumentCollectionKey is the attribute Key conforming to the - // "faas.document.collection" semantic conventions. It represents the name - // of the source on which the triggering operation was performed. For - // example, in Cloud Storage or S3 corresponds to the bucket name, and in - // Cosmos DB to the database name. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'myBucketName', 'myDBName' - FaaSDocumentCollectionKey = attribute.Key("faas.document.collection") - - // FaaSDocumentOperationKey is the attribute Key conforming to the - // "faas.document.operation" semantic conventions. It represents the - // describes the type of the operation that was performed on the data. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - FaaSDocumentOperationKey = attribute.Key("faas.document.operation") - - // FaaSDocumentTimeKey is the attribute Key conforming to the - // "faas.document.time" semantic conventions. It represents a string - // containing the time when the data was accessed in the [ISO - // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format - // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '2020-01-23T13:47:06Z' - FaaSDocumentTimeKey = attribute.Key("faas.document.time") - - // FaaSDocumentNameKey is the attribute Key conforming to the - // "faas.document.name" semantic conventions. It represents the document - // name/table subjected to the operation. For example, in Cloud Storage or - // S3 is the name of the file, and in Cosmos DB the table name. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'myFile.txt', 'myTableName' - FaaSDocumentNameKey = attribute.Key("faas.document.name") -) - -var ( - // When a new object is created - FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert") - // When an object is modified - FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit") - // When an object is deleted - FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete") -) - -// FaaSDocumentCollection returns an attribute KeyValue conforming to the -// "faas.document.collection" semantic conventions. It represents the name of -// the source on which the triggering operation was performed. For example, in -// Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the -// database name. -func FaaSDocumentCollection(val string) attribute.KeyValue { - return FaaSDocumentCollectionKey.String(val) -} - -// FaaSDocumentTime returns an attribute KeyValue conforming to the -// "faas.document.time" semantic conventions. It represents a string containing -// the time when the data was accessed in the [ISO -// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format -// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). -func FaaSDocumentTime(val string) attribute.KeyValue { - return FaaSDocumentTimeKey.String(val) -} - -// FaaSDocumentName returns an attribute KeyValue conforming to the -// "faas.document.name" semantic conventions. It represents the document -// name/table subjected to the operation. For example, in Cloud Storage or S3 -// is the name of the file, and in Cosmos DB the table name. -func FaaSDocumentName(val string) attribute.KeyValue { - return FaaSDocumentNameKey.String(val) -} - -// Semantic Convention for FaaS scheduled to be executed regularly. -const ( - // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic - // conventions. It represents a string containing the function invocation - // time in the [ISO - // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format - // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '2020-01-23T13:47:06Z' - FaaSTimeKey = attribute.Key("faas.time") - - // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic - // conventions. It represents a string containing the schedule period as - // [Cron - // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '0/5 * * * ? *' - FaaSCronKey = attribute.Key("faas.cron") -) - -// FaaSTime returns an attribute KeyValue conforming to the "faas.time" -// semantic conventions. It represents a string containing the function -// invocation time in the [ISO -// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format -// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). -func FaaSTime(val string) attribute.KeyValue { - return FaaSTimeKey.String(val) -} - -// FaaSCron returns an attribute KeyValue conforming to the "faas.cron" -// semantic conventions. It represents a string containing the schedule period -// as [Cron -// Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). -func FaaSCron(val string) attribute.KeyValue { - return FaaSCronKey.String(val) -} - -// Contains additional attributes for incoming FaaS spans. -const ( - // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart" - // semantic conventions. It represents a boolean that is true if the - // serverless function is executed for the first time (aka cold-start). - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - FaaSColdstartKey = attribute.Key("faas.coldstart") -) - -// FaaSColdstart returns an attribute KeyValue conforming to the -// "faas.coldstart" semantic conventions. It represents a boolean that is true -// if the serverless function is executed for the first time (aka cold-start). -func FaaSColdstart(val bool) attribute.KeyValue { - return FaaSColdstartKey.Bool(val) -} - -// Contains additional attributes for outgoing FaaS spans. -const ( - // FaaSInvokedNameKey is the attribute Key conforming to the - // "faas.invoked_name" semantic conventions. It represents the name of the - // invoked function. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'my-function' - // Note: SHOULD be equal to the `faas.name` resource attribute of the - // invoked function. - FaaSInvokedNameKey = attribute.Key("faas.invoked_name") - - // FaaSInvokedProviderKey is the attribute Key conforming to the - // "faas.invoked_provider" semantic conventions. It represents the cloud - // provider of the invoked function. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - // Note: SHOULD be equal to the `cloud.provider` resource attribute of the - // invoked function. - FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider") - - // FaaSInvokedRegionKey is the attribute Key conforming to the - // "faas.invoked_region" semantic conventions. It represents the cloud - // region of the invoked function. - // - // Type: string - // RequirementLevel: ConditionallyRequired (For some cloud providers, like - // AWS or GCP, the region in which a function is hosted is essential to - // uniquely identify the function and also part of its endpoint. Since it's - // part of the endpoint being called, the region is always known to - // clients. In these cases, `faas.invoked_region` MUST be set accordingly. - // If the region is unknown to the client or not required for identifying - // the invoked function, setting `faas.invoked_region` is optional.) - // Stability: stable - // Examples: 'eu-central-1' - // Note: SHOULD be equal to the `cloud.region` resource attribute of the - // invoked function. - FaaSInvokedRegionKey = attribute.Key("faas.invoked_region") -) - -var ( - // Alibaba Cloud - FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud") - // Amazon Web Services - FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws") - // Microsoft Azure - FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure") - // Google Cloud Platform - FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp") - // Tencent Cloud - FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud") -) - -// FaaSInvokedName returns an attribute KeyValue conforming to the -// "faas.invoked_name" semantic conventions. It represents the name of the -// invoked function. -func FaaSInvokedName(val string) attribute.KeyValue { - return FaaSInvokedNameKey.String(val) -} - -// FaaSInvokedRegion returns an attribute KeyValue conforming to the -// "faas.invoked_region" semantic conventions. It represents the cloud region -// of the invoked function. -func FaaSInvokedRegion(val string) attribute.KeyValue { - return FaaSInvokedRegionKey.String(val) -} - -// Operations that access some remote service. -const ( - // PeerServiceKey is the attribute Key conforming to the "peer.service" - // semantic conventions. It represents the - // [`service.name`](/docs/resource/README.md#service) of the remote - // service. SHOULD be equal to the actual `service.name` resource attribute - // of the remote service if any. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'AuthTokenCache' - PeerServiceKey = attribute.Key("peer.service") -) - -// PeerService returns an attribute KeyValue conforming to the -// "peer.service" semantic conventions. It represents the -// [`service.name`](/docs/resource/README.md#service) of the remote service. -// SHOULD be equal to the actual `service.name` resource attribute of the -// remote service if any. -func PeerService(val string) attribute.KeyValue { - return PeerServiceKey.String(val) -} - -// These attributes may be used for any operation with an authenticated and/or -// authorized enduser. -const ( - // EnduserIDKey is the attribute Key conforming to the "enduser.id" - // semantic conventions. It represents the username or client_id extracted - // from the access token or - // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header - // in the inbound request from outside the system. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'username' - EnduserIDKey = attribute.Key("enduser.id") - - // EnduserRoleKey is the attribute Key conforming to the "enduser.role" - // semantic conventions. It represents the actual/assumed role the client - // is making the request under extracted from token or application security - // context. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'admin' - EnduserRoleKey = attribute.Key("enduser.role") - - // EnduserScopeKey is the attribute Key conforming to the "enduser.scope" - // semantic conventions. It represents the scopes or granted authorities - // the client currently possesses extracted from token or application - // security context. The value would come from the scope associated with an - // [OAuth 2.0 Access - // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute - // value in a [SAML 2.0 - // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'read:message, write:files' - EnduserScopeKey = attribute.Key("enduser.scope") -) - -// EnduserID returns an attribute KeyValue conforming to the "enduser.id" -// semantic conventions. It represents the username or client_id extracted from -// the access token or -// [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in -// the inbound request from outside the system. -func EnduserID(val string) attribute.KeyValue { - return EnduserIDKey.String(val) -} - -// EnduserRole returns an attribute KeyValue conforming to the -// "enduser.role" semantic conventions. It represents the actual/assumed role -// the client is making the request under extracted from token or application -// security context. -func EnduserRole(val string) attribute.KeyValue { - return EnduserRoleKey.String(val) -} - -// EnduserScope returns an attribute KeyValue conforming to the -// "enduser.scope" semantic conventions. It represents the scopes or granted -// authorities the client currently possesses extracted from token or -// application security context. The value would come from the scope associated -// with an [OAuth 2.0 Access -// Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute -// value in a [SAML 2.0 -// Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). -func EnduserScope(val string) attribute.KeyValue { - return EnduserScopeKey.String(val) -} - -// These attributes may be used for any operation to store information about a -// thread that started a span. -const ( - // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic - // conventions. It represents the current "managed" thread ID (as opposed - // to OS thread ID). - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 42 - ThreadIDKey = attribute.Key("thread.id") - - // ThreadNameKey is the attribute Key conforming to the "thread.name" - // semantic conventions. It represents the current thread name. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'main' - ThreadNameKey = attribute.Key("thread.name") -) - -// ThreadID returns an attribute KeyValue conforming to the "thread.id" -// semantic conventions. It represents the current "managed" thread ID (as -// opposed to OS thread ID). -func ThreadID(val int) attribute.KeyValue { - return ThreadIDKey.Int(val) -} - -// ThreadName returns an attribute KeyValue conforming to the "thread.name" -// semantic conventions. It represents the current thread name. -func ThreadName(val string) attribute.KeyValue { - return ThreadNameKey.String(val) -} - -// These attributes allow to report this unit of code and therefore to provide -// more context about the span. -const ( - // CodeFunctionKey is the attribute Key conforming to the "code.function" - // semantic conventions. It represents the method or function name, or - // equivalent (usually rightmost part of the code unit's name). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'serveRequest' - CodeFunctionKey = attribute.Key("code.function") - - // CodeNamespaceKey is the attribute Key conforming to the "code.namespace" - // semantic conventions. It represents the "namespace" within which - // `code.function` is defined. Usually the qualified class or module name, - // such that `code.namespace` + some separator + `code.function` form a - // unique identifier for the code unit. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'com.example.MyHTTPService' - CodeNamespaceKey = attribute.Key("code.namespace") - - // CodeFilepathKey is the attribute Key conforming to the "code.filepath" - // semantic conventions. It represents the source code file name that - // identifies the code unit as uniquely as possible (preferably an absolute - // file path). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '/usr/local/MyApplication/content_root/app/index.php' - CodeFilepathKey = attribute.Key("code.filepath") - - // CodeLineNumberKey is the attribute Key conforming to the "code.lineno" - // semantic conventions. It represents the line number in `code.filepath` - // best representing the operation. It SHOULD point within the code unit - // named in `code.function`. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 42 - CodeLineNumberKey = attribute.Key("code.lineno") - - // CodeColumnKey is the attribute Key conforming to the "code.column" - // semantic conventions. It represents the column number in `code.filepath` - // best representing the operation. It SHOULD point within the code unit - // named in `code.function`. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 16 - CodeColumnKey = attribute.Key("code.column") -) - -// CodeFunction returns an attribute KeyValue conforming to the -// "code.function" semantic conventions. It represents the method or function -// name, or equivalent (usually rightmost part of the code unit's name). -func CodeFunction(val string) attribute.KeyValue { - return CodeFunctionKey.String(val) -} - -// CodeNamespace returns an attribute KeyValue conforming to the -// "code.namespace" semantic conventions. It represents the "namespace" within -// which `code.function` is defined. Usually the qualified class or module -// name, such that `code.namespace` + some separator + `code.function` form a -// unique identifier for the code unit. -func CodeNamespace(val string) attribute.KeyValue { - return CodeNamespaceKey.String(val) -} - -// CodeFilepath returns an attribute KeyValue conforming to the -// "code.filepath" semantic conventions. It represents the source code file -// name that identifies the code unit as uniquely as possible (preferably an -// absolute file path). -func CodeFilepath(val string) attribute.KeyValue { - return CodeFilepathKey.String(val) -} - -// CodeLineNumber returns an attribute KeyValue conforming to the "code.lineno" -// semantic conventions. It represents the line number in `code.filepath` best -// representing the operation. It SHOULD point within the code unit named in -// `code.function`. -func CodeLineNumber(val int) attribute.KeyValue { - return CodeLineNumberKey.Int(val) -} - -// CodeColumn returns an attribute KeyValue conforming to the "code.column" -// semantic conventions. It represents the column number in `code.filepath` -// best representing the operation. It SHOULD point within the code unit named -// in `code.function`. -func CodeColumn(val int) attribute.KeyValue { - return CodeColumnKey.Int(val) -} - -// Semantic Convention for HTTP Client -const ( - // HTTPResendCountKey is the attribute Key conforming to the - // "http.resend_count" semantic conventions. It represents the ordinal - // number of request resending attempt (for any reason, including - // redirects). - // - // Type: int - // RequirementLevel: Recommended (if and only if request was retried.) - // Stability: stable - // Examples: 3 - // Note: The resend count SHOULD be updated each time an HTTP request gets - // resent by the client, regardless of what was the cause of the resending - // (e.g. redirection, authorization failure, 503 Server Unavailable, - // network issues, or any other). - HTTPResendCountKey = attribute.Key("http.resend_count") -) - -// HTTPResendCount returns an attribute KeyValue conforming to the -// "http.resend_count" semantic conventions. It represents the ordinal number -// of request resending attempt (for any reason, including redirects). -func HTTPResendCount(val int) attribute.KeyValue { - return HTTPResendCountKey.Int(val) -} - -// The `aws` conventions apply to operations using the AWS SDK. They map -// request or response parameters in AWS SDK API calls to attributes on a Span. -// The conventions have been collected over time based on feedback from AWS -// users of tracing and will continue to evolve as new interesting conventions -// are found. -// Some descriptions are also provided for populating general OpenTelemetry -// semantic conventions based on these APIs. -const ( - // AWSRequestIDKey is the attribute Key conforming to the "aws.request_id" - // semantic conventions. It represents the AWS request ID as returned in - // the response headers `x-amz-request-id` or `x-amz-requestid`. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '79b9da39-b7ae-508a-a6bc-864b2829c622', 'C9ER4AJX75574TDJ' - AWSRequestIDKey = attribute.Key("aws.request_id") -) - -// AWSRequestID returns an attribute KeyValue conforming to the -// "aws.request_id" semantic conventions. It represents the AWS request ID as -// returned in the response headers `x-amz-request-id` or `x-amz-requestid`. -func AWSRequestID(val string) attribute.KeyValue { - return AWSRequestIDKey.String(val) -} - -// Attributes that exist for multiple DynamoDB request types. -const ( - // AWSDynamoDBTableNamesKey is the attribute Key conforming to the - // "aws.dynamodb.table_names" semantic conventions. It represents the keys - // in the `RequestItems` object field. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Users', 'Cats' - AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names") - - // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the - // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the - // JSON-serialized value of each item in the `ConsumedCapacity` response - // field. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": { - // "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, - // "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" : - // { "CapacityUnits": number, "ReadCapacityUnits": number, - // "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table": - // { "CapacityUnits": number, "ReadCapacityUnits": number, - // "WriteCapacityUnits": number }, "TableName": "string", - // "WriteCapacityUnits": number }' - AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity") - - // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to - // the "aws.dynamodb.item_collection_metrics" semantic conventions. It - // represents the JSON-serialized value of the `ItemCollectionMetrics` - // response field. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B": - // blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { - // "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], - // "NULL": boolean, "S": "string", "SS": [ "string" ] } }, - // "SizeEstimateRangeGB": [ number ] } ] }' - AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics") - - // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to - // the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It - // represents the value of the `ProvisionedThroughput.ReadCapacityUnits` - // request parameter. - // - // Type: double - // RequirementLevel: Optional - // Stability: stable - // Examples: 1.0, 2.0 - AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity") - - // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming - // to the "aws.dynamodb.provisioned_write_capacity" semantic conventions. - // It represents the value of the - // `ProvisionedThroughput.WriteCapacityUnits` request parameter. - // - // Type: double - // RequirementLevel: Optional - // Stability: stable - // Examples: 1.0, 2.0 - AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity") - - // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the - // "aws.dynamodb.consistent_read" semantic conventions. It represents the - // value of the `ConsistentRead` request parameter. - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read") - - // AWSDynamoDBProjectionKey is the attribute Key conforming to the - // "aws.dynamodb.projection" semantic conventions. It represents the value - // of the `ProjectionExpression` request parameter. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Title', 'Title, Price, Color', 'Title, Description, - // RelatedItems, ProductReviews' - AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection") - - // AWSDynamoDBLimitKey is the attribute Key conforming to the - // "aws.dynamodb.limit" semantic conventions. It represents the value of - // the `Limit` request parameter. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 10 - AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit") - - // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the - // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the - // value of the `AttributesToGet` request parameter. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: 'lives', 'id' - AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get") - - // AWSDynamoDBIndexNameKey is the attribute Key conforming to the - // "aws.dynamodb.index_name" semantic conventions. It represents the value - // of the `IndexName` request parameter. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'name_to_group' - AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name") - - // AWSDynamoDBSelectKey is the attribute Key conforming to the - // "aws.dynamodb.select" semantic conventions. It represents the value of - // the `Select` request parameter. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'ALL_ATTRIBUTES', 'COUNT' - AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select") -) - -// AWSDynamoDBTableNames returns an attribute KeyValue conforming to the -// "aws.dynamodb.table_names" semantic conventions. It represents the keys in -// the `RequestItems` object field. -func AWSDynamoDBTableNames(val ...string) attribute.KeyValue { - return AWSDynamoDBTableNamesKey.StringSlice(val) -} - -// AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to -// the "aws.dynamodb.consumed_capacity" semantic conventions. It represents the -// JSON-serialized value of each item in the `ConsumedCapacity` response field. -func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue { - return AWSDynamoDBConsumedCapacityKey.StringSlice(val) -} - -// AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming -// to the "aws.dynamodb.item_collection_metrics" semantic conventions. It -// represents the JSON-serialized value of the `ItemCollectionMetrics` response -// field. -func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue { - return AWSDynamoDBItemCollectionMetricsKey.String(val) -} - -// AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue -// conforming to the "aws.dynamodb.provisioned_read_capacity" semantic -// conventions. It represents the value of the -// `ProvisionedThroughput.ReadCapacityUnits` request parameter. -func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue { - return AWSDynamoDBProvisionedReadCapacityKey.Float64(val) -} - -// AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue -// conforming to the "aws.dynamodb.provisioned_write_capacity" semantic -// conventions. It represents the value of the -// `ProvisionedThroughput.WriteCapacityUnits` request parameter. -func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue { - return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val) -} - -// AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the -// "aws.dynamodb.consistent_read" semantic conventions. It represents the value -// of the `ConsistentRead` request parameter. -func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue { - return AWSDynamoDBConsistentReadKey.Bool(val) -} - -// AWSDynamoDBProjection returns an attribute KeyValue conforming to the -// "aws.dynamodb.projection" semantic conventions. It represents the value of -// the `ProjectionExpression` request parameter. -func AWSDynamoDBProjection(val string) attribute.KeyValue { - return AWSDynamoDBProjectionKey.String(val) -} - -// AWSDynamoDBLimit returns an attribute KeyValue conforming to the -// "aws.dynamodb.limit" semantic conventions. It represents the value of the -// `Limit` request parameter. -func AWSDynamoDBLimit(val int) attribute.KeyValue { - return AWSDynamoDBLimitKey.Int(val) -} - -// AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to -// the "aws.dynamodb.attributes_to_get" semantic conventions. It represents the -// value of the `AttributesToGet` request parameter. -func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue { - return AWSDynamoDBAttributesToGetKey.StringSlice(val) -} - -// AWSDynamoDBIndexName returns an attribute KeyValue conforming to the -// "aws.dynamodb.index_name" semantic conventions. It represents the value of -// the `IndexName` request parameter. -func AWSDynamoDBIndexName(val string) attribute.KeyValue { - return AWSDynamoDBIndexNameKey.String(val) -} - -// AWSDynamoDBSelect returns an attribute KeyValue conforming to the -// "aws.dynamodb.select" semantic conventions. It represents the value of the -// `Select` request parameter. -func AWSDynamoDBSelect(val string) attribute.KeyValue { - return AWSDynamoDBSelectKey.String(val) -} - -// DynamoDB.CreateTable -const ( - // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to - // the "aws.dynamodb.global_secondary_indexes" semantic conventions. It - // represents the JSON-serialized value of each item of the - // `GlobalSecondaryIndexes` request field - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName": - // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ - // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { - // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }' - AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes") - - // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to - // the "aws.dynamodb.local_secondary_indexes" semantic conventions. It - // represents the JSON-serialized value of each item of the - // `LocalSecondaryIndexes` request field. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: '{ "IndexARN": "string", "IndexName": "string", - // "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ { - // "AttributeName": "string", "KeyType": "string" } ], "Projection": { - // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }' - AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes") -) - -// AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue -// conforming to the "aws.dynamodb.global_secondary_indexes" semantic -// conventions. It represents the JSON-serialized value of each item of the -// `GlobalSecondaryIndexes` request field -func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue { - return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val) -} - -// AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming -// to the "aws.dynamodb.local_secondary_indexes" semantic conventions. It -// represents the JSON-serialized value of each item of the -// `LocalSecondaryIndexes` request field. -func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue { - return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val) -} - -// DynamoDB.ListTables -const ( - // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the - // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents - // the value of the `ExclusiveStartTableName` request parameter. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Users', 'CatsTable' - AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table") - - // AWSDynamoDBTableCountKey is the attribute Key conforming to the - // "aws.dynamodb.table_count" semantic conventions. It represents the the - // number of items in the `TableNames` response parameter. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 20 - AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count") -) - -// AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming -// to the "aws.dynamodb.exclusive_start_table" semantic conventions. It -// represents the value of the `ExclusiveStartTableName` request parameter. -func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue { - return AWSDynamoDBExclusiveStartTableKey.String(val) -} - -// AWSDynamoDBTableCount returns an attribute KeyValue conforming to the -// "aws.dynamodb.table_count" semantic conventions. It represents the the -// number of items in the `TableNames` response parameter. -func AWSDynamoDBTableCount(val int) attribute.KeyValue { - return AWSDynamoDBTableCountKey.Int(val) -} - -// DynamoDB.Query -const ( - // AWSDynamoDBScanForwardKey is the attribute Key conforming to the - // "aws.dynamodb.scan_forward" semantic conventions. It represents the - // value of the `ScanIndexForward` request parameter. - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward") -) - -// AWSDynamoDBScanForward returns an attribute KeyValue conforming to the -// "aws.dynamodb.scan_forward" semantic conventions. It represents the value of -// the `ScanIndexForward` request parameter. -func AWSDynamoDBScanForward(val bool) attribute.KeyValue { - return AWSDynamoDBScanForwardKey.Bool(val) -} - -// DynamoDB.Scan -const ( - // AWSDynamoDBSegmentKey is the attribute Key conforming to the - // "aws.dynamodb.segment" semantic conventions. It represents the value of - // the `Segment` request parameter. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 10 - AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment") - - // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the - // "aws.dynamodb.total_segments" semantic conventions. It represents the - // value of the `TotalSegments` request parameter. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 100 - AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments") - - // AWSDynamoDBCountKey is the attribute Key conforming to the - // "aws.dynamodb.count" semantic conventions. It represents the value of - // the `Count` response parameter. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 10 - AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count") - - // AWSDynamoDBScannedCountKey is the attribute Key conforming to the - // "aws.dynamodb.scanned_count" semantic conventions. It represents the - // value of the `ScannedCount` response parameter. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 50 - AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count") -) - -// AWSDynamoDBSegment returns an attribute KeyValue conforming to the -// "aws.dynamodb.segment" semantic conventions. It represents the value of the -// `Segment` request parameter. -func AWSDynamoDBSegment(val int) attribute.KeyValue { - return AWSDynamoDBSegmentKey.Int(val) -} - -// AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the -// "aws.dynamodb.total_segments" semantic conventions. It represents the value -// of the `TotalSegments` request parameter. -func AWSDynamoDBTotalSegments(val int) attribute.KeyValue { - return AWSDynamoDBTotalSegmentsKey.Int(val) -} - -// AWSDynamoDBCount returns an attribute KeyValue conforming to the -// "aws.dynamodb.count" semantic conventions. It represents the value of the -// `Count` response parameter. -func AWSDynamoDBCount(val int) attribute.KeyValue { - return AWSDynamoDBCountKey.Int(val) -} - -// AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the -// "aws.dynamodb.scanned_count" semantic conventions. It represents the value -// of the `ScannedCount` response parameter. -func AWSDynamoDBScannedCount(val int) attribute.KeyValue { - return AWSDynamoDBScannedCountKey.Int(val) -} - -// DynamoDB.UpdateTable -const ( - // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to - // the "aws.dynamodb.attribute_definitions" semantic conventions. It - // represents the JSON-serialized value of each item in the - // `AttributeDefinitions` request field. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: '{ "AttributeName": "string", "AttributeType": "string" }' - AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions") - - // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key - // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic - // conventions. It represents the JSON-serialized value of each item in the - // the `GlobalSecondaryIndexUpdates` request field. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ { - // "AttributeName": "string", "KeyType": "string" } ], "Projection": { - // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, - // "ProvisionedThroughput": { "ReadCapacityUnits": number, - // "WriteCapacityUnits": number } }' - AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates") -) - -// AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming -// to the "aws.dynamodb.attribute_definitions" semantic conventions. It -// represents the JSON-serialized value of each item in the -// `AttributeDefinitions` request field. -func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue { - return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val) -} - -// AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue -// conforming to the "aws.dynamodb.global_secondary_index_updates" semantic -// conventions. It represents the JSON-serialized value of each item in the the -// `GlobalSecondaryIndexUpdates` request field. -func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue { - return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val) -} - -// Attributes that exist for S3 request types. -const ( - // AWSS3BucketKey is the attribute Key conforming to the "aws.s3.bucket" - // semantic conventions. It represents the S3 bucket name the request - // refers to. Corresponds to the `--bucket` parameter of the [S3 - // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) - // operations. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'some-bucket-name' - // Note: The `bucket` attribute is applicable to all S3 operations that - // reference a bucket, i.e. that require the bucket name as a mandatory - // parameter. - // This applies to almost all S3 operations except `list-buckets`. - AWSS3BucketKey = attribute.Key("aws.s3.bucket") - - // AWSS3KeyKey is the attribute Key conforming to the "aws.s3.key" semantic - // conventions. It represents the S3 object key the request refers to. - // Corresponds to the `--key` parameter of the [S3 - // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) - // operations. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'someFile.yml' - // Note: The `key` attribute is applicable to all object-related S3 - // operations, i.e. that require the object key as a mandatory parameter. - // This applies in particular to the following operations: - // - // - - // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) - // - - // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) - // - - // [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html) - // - - // [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html) - // - - // [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html) - // - - // [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html) - // - - // [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html) - // - - // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) - // - - // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) - // - - // [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html) - // - - // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) - // - - // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - // - - // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) - AWSS3KeyKey = attribute.Key("aws.s3.key") - - // AWSS3CopySourceKey is the attribute Key conforming to the - // "aws.s3.copy_source" semantic conventions. It represents the source - // object (in the form `bucket`/`key`) for the copy operation. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'someFile.yml' - // Note: The `copy_source` attribute applies to S3 copy operations and - // corresponds to the `--copy-source` parameter - // of the [copy-object operation within the S3 - // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). - // This applies in particular to the following operations: - // - // - - // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) - // - - // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) - AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source") - - // AWSS3UploadIDKey is the attribute Key conforming to the - // "aws.s3.upload_id" semantic conventions. It represents the upload ID - // that identifies the multipart upload. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ' - // Note: The `upload_id` attribute applies to S3 multipart-upload - // operations and corresponds to the `--upload-id` parameter - // of the [S3 - // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) - // multipart operations. - // This applies in particular to the following operations: - // - // - - // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) - // - - // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) - // - - // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) - // - - // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - // - - // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) - AWSS3UploadIDKey = attribute.Key("aws.s3.upload_id") - - // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete" - // semantic conventions. It represents the delete request container that - // specifies the objects to be deleted. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'Objects=[{Key=string,VersionID=string},{Key=string,VersionID=string}],Quiet=boolean' - // Note: The `delete` attribute is only applicable to the - // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) - // operation. - // The `delete` attribute corresponds to the `--delete` parameter of the - // [delete-objects operation within the S3 - // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). - AWSS3DeleteKey = attribute.Key("aws.s3.delete") - - // AWSS3PartNumberKey is the attribute Key conforming to the - // "aws.s3.part_number" semantic conventions. It represents the part number - // of the part being uploaded in a multipart-upload operation. This is a - // positive integer between 1 and 10,000. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 3456 - // Note: The `part_number` attribute is only applicable to the - // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - // and - // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) - // operations. - // The `part_number` attribute corresponds to the `--part-number` parameter - // of the - // [upload-part operation within the S3 - // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). - AWSS3PartNumberKey = attribute.Key("aws.s3.part_number") -) - -// AWSS3Bucket returns an attribute KeyValue conforming to the -// "aws.s3.bucket" semantic conventions. It represents the S3 bucket name the -// request refers to. Corresponds to the `--bucket` parameter of the [S3 -// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) -// operations. -func AWSS3Bucket(val string) attribute.KeyValue { - return AWSS3BucketKey.String(val) -} - -// AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key" -// semantic conventions. It represents the S3 object key the request refers to. -// Corresponds to the `--key` parameter of the [S3 -// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) -// operations. -func AWSS3Key(val string) attribute.KeyValue { - return AWSS3KeyKey.String(val) -} - -// AWSS3CopySource returns an attribute KeyValue conforming to the -// "aws.s3.copy_source" semantic conventions. It represents the source object -// (in the form `bucket`/`key`) for the copy operation. -func AWSS3CopySource(val string) attribute.KeyValue { - return AWSS3CopySourceKey.String(val) -} - -// AWSS3UploadID returns an attribute KeyValue conforming to the -// "aws.s3.upload_id" semantic conventions. It represents the upload ID that -// identifies the multipart upload. -func AWSS3UploadID(val string) attribute.KeyValue { - return AWSS3UploadIDKey.String(val) -} - -// AWSS3Delete returns an attribute KeyValue conforming to the -// "aws.s3.delete" semantic conventions. It represents the delete request -// container that specifies the objects to be deleted. -func AWSS3Delete(val string) attribute.KeyValue { - return AWSS3DeleteKey.String(val) -} - -// AWSS3PartNumber returns an attribute KeyValue conforming to the -// "aws.s3.part_number" semantic conventions. It represents the part number of -// the part being uploaded in a multipart-upload operation. This is a positive -// integer between 1 and 10,000. -func AWSS3PartNumber(val int) attribute.KeyValue { - return AWSS3PartNumberKey.Int(val) -} - -// Semantic conventions to apply when instrumenting the GraphQL implementation. -// They map GraphQL operations to attributes on a Span. -const ( - // GraphqlOperationNameKey is the attribute Key conforming to the - // "graphql.operation.name" semantic conventions. It represents the name of - // the operation being executed. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'findBookByID' - GraphqlOperationNameKey = attribute.Key("graphql.operation.name") - - // GraphqlOperationTypeKey is the attribute Key conforming to the - // "graphql.operation.type" semantic conventions. It represents the type of - // the operation being executed. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Examples: 'query', 'mutation', 'subscription' - GraphqlOperationTypeKey = attribute.Key("graphql.operation.type") - - // GraphqlDocumentKey is the attribute Key conforming to the - // "graphql.document" semantic conventions. It represents the GraphQL - // document being executed. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'query findBookByID { bookByID(id: ?) { name } }' - // Note: The value may be sanitized to exclude sensitive information. - GraphqlDocumentKey = attribute.Key("graphql.document") -) - -var ( - // GraphQL query - GraphqlOperationTypeQuery = GraphqlOperationTypeKey.String("query") - // GraphQL mutation - GraphqlOperationTypeMutation = GraphqlOperationTypeKey.String("mutation") - // GraphQL subscription - GraphqlOperationTypeSubscription = GraphqlOperationTypeKey.String("subscription") -) - -// GraphqlOperationName returns an attribute KeyValue conforming to the -// "graphql.operation.name" semantic conventions. It represents the name of the -// operation being executed. -func GraphqlOperationName(val string) attribute.KeyValue { - return GraphqlOperationNameKey.String(val) -} - -// GraphqlDocument returns an attribute KeyValue conforming to the -// "graphql.document" semantic conventions. It represents the GraphQL document -// being executed. -func GraphqlDocument(val string) attribute.KeyValue { - return GraphqlDocumentKey.String(val) -} - -// General attributes used in messaging systems. -const ( - // MessagingSystemKey is the attribute Key conforming to the - // "messaging.system" semantic conventions. It represents a string - // identifying the messaging system. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS' - MessagingSystemKey = attribute.Key("messaging.system") - - // MessagingOperationKey is the attribute Key conforming to the - // "messaging.operation" semantic conventions. It represents a string - // identifying the kind of messaging operation as defined in the [Operation - // names](#operation-names) section above. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - // Note: If a custom value is used, it MUST be of low cardinality. - MessagingOperationKey = attribute.Key("messaging.operation") - - // MessagingBatchMessageCountKey is the attribute Key conforming to the - // "messaging.batch.message_count" semantic conventions. It represents the - // number of messages sent, received, or processed in the scope of the - // batching operation. - // - // Type: int - // RequirementLevel: ConditionallyRequired (If the span describes an - // operation on a batch of messages.) - // Stability: stable - // Examples: 0, 1, 2 - // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on - // spans that operate with a single message. When a messaging client - // library supports both batch and single-message API for the same - // operation, instrumentations SHOULD use `messaging.batch.message_count` - // for batching APIs and SHOULD NOT use it for single-message APIs. - MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count") - - // MessagingClientIDKey is the attribute Key conforming to the - // "messaging.client_id" semantic conventions. It represents a unique - // identifier for the client that consumes or produces a message. - // - // Type: string - // RequirementLevel: Recommended (If a client id is available) - // Stability: stable - // Examples: 'client-5', 'myhost@8742@s8083jm' - MessagingClientIDKey = attribute.Key("messaging.client_id") -) - -var ( - // publish - MessagingOperationPublish = MessagingOperationKey.String("publish") - // receive - MessagingOperationReceive = MessagingOperationKey.String("receive") - // process - MessagingOperationProcess = MessagingOperationKey.String("process") -) - -// MessagingSystem returns an attribute KeyValue conforming to the -// "messaging.system" semantic conventions. It represents a string identifying -// the messaging system. -func MessagingSystem(val string) attribute.KeyValue { - return MessagingSystemKey.String(val) -} - -// MessagingBatchMessageCount returns an attribute KeyValue conforming to -// the "messaging.batch.message_count" semantic conventions. It represents the -// number of messages sent, received, or processed in the scope of the batching -// operation. -func MessagingBatchMessageCount(val int) attribute.KeyValue { - return MessagingBatchMessageCountKey.Int(val) -} - -// MessagingClientID returns an attribute KeyValue conforming to the -// "messaging.client_id" semantic conventions. It represents a unique -// identifier for the client that consumes or produces a message. -func MessagingClientID(val string) attribute.KeyValue { - return MessagingClientIDKey.String(val) -} - -// Semantic conventions for remote procedure calls. -const ( - // RPCSystemKey is the attribute Key conforming to the "rpc.system" - // semantic conventions. It represents a string identifying the remoting - // system. See below for a list of well-known identifiers. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - RPCSystemKey = attribute.Key("rpc.system") - - // RPCServiceKey is the attribute Key conforming to the "rpc.service" - // semantic conventions. It represents the full (logical) name of the - // service being called, including its package name, if applicable. - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'myservice.EchoService' - // Note: This is the logical name of the service from the RPC interface - // perspective, which can be different from the name of any implementing - // class. The `code.namespace` attribute may be used to store the latter - // (despite the attribute name, it may include a class name; e.g., class - // with method actually executing the call on the server side, RPC client - // stub class on the client side). - RPCServiceKey = attribute.Key("rpc.service") - - // RPCMethodKey is the attribute Key conforming to the "rpc.method" - // semantic conventions. It represents the name of the (logical) method - // being called, must be equal to the $method part in the span name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'exampleMethod' - // Note: This is the logical name of the method from the RPC interface - // perspective, which can be different from the name of any implementing - // method/function. The `code.function` attribute may be used to store the - // latter (e.g., method actually executing the call on the server side, RPC - // client stub method on the client side). - RPCMethodKey = attribute.Key("rpc.method") -) - -var ( - // gRPC - RPCSystemGRPC = RPCSystemKey.String("grpc") - // Java RMI - RPCSystemJavaRmi = RPCSystemKey.String("java_rmi") - // .NET WCF - RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf") - // Apache Dubbo - RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo") - // Connect RPC - RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc") -) - -// RPCService returns an attribute KeyValue conforming to the "rpc.service" -// semantic conventions. It represents the full (logical) name of the service -// being called, including its package name, if applicable. -func RPCService(val string) attribute.KeyValue { - return RPCServiceKey.String(val) -} - -// RPCMethod returns an attribute KeyValue conforming to the "rpc.method" -// semantic conventions. It represents the name of the (logical) method being -// called, must be equal to the $method part in the span name. -func RPCMethod(val string) attribute.KeyValue { - return RPCMethodKey.String(val) -} - -// Tech-specific attributes for gRPC. -const ( - // RPCGRPCStatusCodeKey is the attribute Key conforming to the - // "rpc.grpc.status_code" semantic conventions. It represents the [numeric - // status - // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of - // the gRPC request. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code") -) - -var ( - // OK - RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0) - // CANCELLED - RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1) - // UNKNOWN - RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2) - // INVALID_ARGUMENT - RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3) - // DEADLINE_EXCEEDED - RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4) - // NOT_FOUND - RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5) - // ALREADY_EXISTS - RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6) - // PERMISSION_DENIED - RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7) - // RESOURCE_EXHAUSTED - RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8) - // FAILED_PRECONDITION - RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9) - // ABORTED - RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10) - // OUT_OF_RANGE - RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11) - // UNIMPLEMENTED - RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12) - // INTERNAL - RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13) - // UNAVAILABLE - RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14) - // DATA_LOSS - RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15) - // UNAUTHENTICATED - RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16) -) - -// Tech-specific attributes for [JSON RPC](https://www.jsonrpc.org/). -const ( - // RPCJsonrpcVersionKey is the attribute Key conforming to the - // "rpc.jsonrpc.version" semantic conventions. It represents the protocol - // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 - // does not specify this, the value can be omitted. - // - // Type: string - // RequirementLevel: ConditionallyRequired (If other than the default - // version (`1.0`)) - // Stability: stable - // Examples: '2.0', '1.0' - RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version") - - // RPCJsonrpcRequestIDKey is the attribute Key conforming to the - // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` - // property of request or response. Since protocol allows id to be int, - // string, `null` or missing (for notifications), value is expected to be - // cast to string for simplicity. Use empty string in case of `null` value. - // Omit entirely if this is a notification. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '10', 'request-7', '' - RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id") - - // RPCJsonrpcErrorCodeKey is the attribute Key conforming to the - // "rpc.jsonrpc.error_code" semantic conventions. It represents the - // `error.code` property of response if it is an error response. - // - // Type: int - // RequirementLevel: ConditionallyRequired (If response is not successful.) - // Stability: stable - // Examples: -32700, 100 - RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code") - - // RPCJsonrpcErrorMessageKey is the attribute Key conforming to the - // "rpc.jsonrpc.error_message" semantic conventions. It represents the - // `error.message` property of response if it is an error response. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Parse error', 'User already exists' - RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message") -) - -// RPCJsonrpcVersion returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.version" semantic conventions. It represents the protocol -// version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 -// does not specify this, the value can be omitted. -func RPCJsonrpcVersion(val string) attribute.KeyValue { - return RPCJsonrpcVersionKey.String(val) -} - -// RPCJsonrpcRequestID returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` -// property of request or response. Since protocol allows id to be int, string, -// `null` or missing (for notifications), value is expected to be cast to -// string for simplicity. Use empty string in case of `null` value. Omit -// entirely if this is a notification. -func RPCJsonrpcRequestID(val string) attribute.KeyValue { - return RPCJsonrpcRequestIDKey.String(val) -} - -// RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.error_code" semantic conventions. It represents the -// `error.code` property of response if it is an error response. -func RPCJsonrpcErrorCode(val int) attribute.KeyValue { - return RPCJsonrpcErrorCodeKey.Int(val) -} - -// RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.error_message" semantic conventions. It represents the -// `error.message` property of response if it is an error response. -func RPCJsonrpcErrorMessage(val string) attribute.KeyValue { - return RPCJsonrpcErrorMessageKey.String(val) -} - -// Tech-specific attributes for Connect RPC. -const ( - // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the - // "rpc.connect_rpc.error_code" semantic conventions. It represents the - // [error codes](https://connect.build/docs/protocol/#error-codes) of the - // Connect request. Error codes are always string values. - // - // Type: Enum - // RequirementLevel: ConditionallyRequired (If response is not successful - // and if error code available.) - // Stability: stable - RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code") -) - -var ( - // cancelled - RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled") - // unknown - RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown") - // invalid_argument - RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument") - // deadline_exceeded - RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded") - // not_found - RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found") - // already_exists - RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists") - // permission_denied - RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied") - // resource_exhausted - RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted") - // failed_precondition - RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition") - // aborted - RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted") - // out_of_range - RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range") - // unimplemented - RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented") - // internal - RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal") - // unavailable - RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable") - // data_loss - RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss") - // unauthenticated - RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated") -) diff --git a/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go b/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go deleted file mode 100644 index faa59e4182..0000000000 --- a/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go +++ /dev/null @@ -1,384 +0,0 @@ -// Copyright 2015 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// The canonical version of this proto can be found at -// https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.5 -// protoc v5.27.1 -// source: grpc/health/v1/health.proto - -package grpc_health_v1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -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) -) - -type HealthCheckResponse_ServingStatus int32 - -const ( - HealthCheckResponse_UNKNOWN HealthCheckResponse_ServingStatus = 0 - HealthCheckResponse_SERVING HealthCheckResponse_ServingStatus = 1 - HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2 - HealthCheckResponse_SERVICE_UNKNOWN HealthCheckResponse_ServingStatus = 3 // Used only by the Watch method. -) - -// Enum value maps for HealthCheckResponse_ServingStatus. -var ( - HealthCheckResponse_ServingStatus_name = map[int32]string{ - 0: "UNKNOWN", - 1: "SERVING", - 2: "NOT_SERVING", - 3: "SERVICE_UNKNOWN", - } - HealthCheckResponse_ServingStatus_value = map[string]int32{ - "UNKNOWN": 0, - "SERVING": 1, - "NOT_SERVING": 2, - "SERVICE_UNKNOWN": 3, - } -) - -func (x HealthCheckResponse_ServingStatus) Enum() *HealthCheckResponse_ServingStatus { - p := new(HealthCheckResponse_ServingStatus) - *p = x - return p -} - -func (x HealthCheckResponse_ServingStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (HealthCheckResponse_ServingStatus) Descriptor() protoreflect.EnumDescriptor { - return file_grpc_health_v1_health_proto_enumTypes[0].Descriptor() -} - -func (HealthCheckResponse_ServingStatus) Type() protoreflect.EnumType { - return &file_grpc_health_v1_health_proto_enumTypes[0] -} - -func (x HealthCheckResponse_ServingStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use HealthCheckResponse_ServingStatus.Descriptor instead. -func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) { - return file_grpc_health_v1_health_proto_rawDescGZIP(), []int{1, 0} -} - -type HealthCheckRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *HealthCheckRequest) Reset() { - *x = HealthCheckRequest{} - mi := &file_grpc_health_v1_health_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *HealthCheckRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HealthCheckRequest) ProtoMessage() {} - -func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message { - mi := &file_grpc_health_v1_health_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HealthCheckRequest.ProtoReflect.Descriptor instead. -func (*HealthCheckRequest) Descriptor() ([]byte, []int) { - return file_grpc_health_v1_health_proto_rawDescGZIP(), []int{0} -} - -func (x *HealthCheckRequest) GetService() string { - if x != nil { - return x.Service - } - return "" -} - -type HealthCheckResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=grpc.health.v1.HealthCheckResponse_ServingStatus" json:"status,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *HealthCheckResponse) Reset() { - *x = HealthCheckResponse{} - mi := &file_grpc_health_v1_health_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *HealthCheckResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HealthCheckResponse) ProtoMessage() {} - -func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message { - mi := &file_grpc_health_v1_health_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead. -func (*HealthCheckResponse) Descriptor() ([]byte, []int) { - return file_grpc_health_v1_health_proto_rawDescGZIP(), []int{1} -} - -func (x *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus { - if x != nil { - return x.Status - } - return HealthCheckResponse_UNKNOWN -} - -type HealthListRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *HealthListRequest) Reset() { - *x = HealthListRequest{} - mi := &file_grpc_health_v1_health_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *HealthListRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HealthListRequest) ProtoMessage() {} - -func (x *HealthListRequest) ProtoReflect() protoreflect.Message { - mi := &file_grpc_health_v1_health_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HealthListRequest.ProtoReflect.Descriptor instead. -func (*HealthListRequest) Descriptor() ([]byte, []int) { - return file_grpc_health_v1_health_proto_rawDescGZIP(), []int{2} -} - -type HealthListResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // statuses contains all the services and their respective status. - Statuses map[string]*HealthCheckResponse `protobuf:"bytes,1,rep,name=statuses,proto3" json:"statuses,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *HealthListResponse) Reset() { - *x = HealthListResponse{} - mi := &file_grpc_health_v1_health_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *HealthListResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HealthListResponse) ProtoMessage() {} - -func (x *HealthListResponse) ProtoReflect() protoreflect.Message { - mi := &file_grpc_health_v1_health_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HealthListResponse.ProtoReflect.Descriptor instead. -func (*HealthListResponse) Descriptor() ([]byte, []int) { - return file_grpc_health_v1_health_proto_rawDescGZIP(), []int{3} -} - -func (x *HealthListResponse) GetStatuses() map[string]*HealthCheckResponse { - if x != nil { - return x.Statuses - } - return nil -} - -var File_grpc_health_v1_health_proto protoreflect.FileDescriptor - -var file_grpc_health_v1_health_proto_rawDesc = string([]byte{ - 0x0a, 0x1b, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2f, 0x76, 0x31, - 0x2f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x22, 0x2e, 0x0a, - 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0xb1, 0x01, - 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, - 0x6c, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x22, 0x4f, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, - 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, - 0x4f, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, - 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, - 0x03, 0x22, 0x13, 0x0a, 0x11, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xc4, 0x01, 0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, - 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x30, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x1a, 0x60, 0x0a, 0x0d, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 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, 0x39, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x48, - 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0xfd, 0x01, - 0x0a, 0x06, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x50, 0x0a, 0x05, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x12, 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, - 0x6c, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x04, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x21, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, - 0x6c, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x05, 0x57, 0x61, 0x74, - 0x63, 0x68, 0x12, 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, - 0x61, 0x6c, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0x70, 0x0a, - 0x11, 0x69, 0x6f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x42, 0x0b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x2c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, - 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x76, 0x31, 0xa2, - 0x02, 0x0c, 0x47, 0x72, 0x70, 0x63, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x56, 0x31, 0xaa, 0x02, - 0x0e, 0x47, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -}) - -var ( - file_grpc_health_v1_health_proto_rawDescOnce sync.Once - file_grpc_health_v1_health_proto_rawDescData []byte -) - -func file_grpc_health_v1_health_proto_rawDescGZIP() []byte { - file_grpc_health_v1_health_proto_rawDescOnce.Do(func() { - file_grpc_health_v1_health_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_grpc_health_v1_health_proto_rawDesc), len(file_grpc_health_v1_health_proto_rawDesc))) - }) - return file_grpc_health_v1_health_proto_rawDescData -} - -var file_grpc_health_v1_health_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_grpc_health_v1_health_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_grpc_health_v1_health_proto_goTypes = []any{ - (HealthCheckResponse_ServingStatus)(0), // 0: grpc.health.v1.HealthCheckResponse.ServingStatus - (*HealthCheckRequest)(nil), // 1: grpc.health.v1.HealthCheckRequest - (*HealthCheckResponse)(nil), // 2: grpc.health.v1.HealthCheckResponse - (*HealthListRequest)(nil), // 3: grpc.health.v1.HealthListRequest - (*HealthListResponse)(nil), // 4: grpc.health.v1.HealthListResponse - nil, // 5: grpc.health.v1.HealthListResponse.StatusesEntry -} -var file_grpc_health_v1_health_proto_depIdxs = []int32{ - 0, // 0: grpc.health.v1.HealthCheckResponse.status:type_name -> grpc.health.v1.HealthCheckResponse.ServingStatus - 5, // 1: grpc.health.v1.HealthListResponse.statuses:type_name -> grpc.health.v1.HealthListResponse.StatusesEntry - 2, // 2: grpc.health.v1.HealthListResponse.StatusesEntry.value:type_name -> grpc.health.v1.HealthCheckResponse - 1, // 3: grpc.health.v1.Health.Check:input_type -> grpc.health.v1.HealthCheckRequest - 3, // 4: grpc.health.v1.Health.List:input_type -> grpc.health.v1.HealthListRequest - 1, // 5: grpc.health.v1.Health.Watch:input_type -> grpc.health.v1.HealthCheckRequest - 2, // 6: grpc.health.v1.Health.Check:output_type -> grpc.health.v1.HealthCheckResponse - 4, // 7: grpc.health.v1.Health.List:output_type -> grpc.health.v1.HealthListResponse - 2, // 8: grpc.health.v1.Health.Watch:output_type -> grpc.health.v1.HealthCheckResponse - 6, // [6:9] is the sub-list for method output_type - 3, // [3:6] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_grpc_health_v1_health_proto_init() } -func file_grpc_health_v1_health_proto_init() { - if File_grpc_health_v1_health_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_grpc_health_v1_health_proto_rawDesc), len(file_grpc_health_v1_health_proto_rawDesc)), - NumEnums: 1, - NumMessages: 5, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_grpc_health_v1_health_proto_goTypes, - DependencyIndexes: file_grpc_health_v1_health_proto_depIdxs, - EnumInfos: file_grpc_health_v1_health_proto_enumTypes, - MessageInfos: file_grpc_health_v1_health_proto_msgTypes, - }.Build() - File_grpc_health_v1_health_proto = out.File - file_grpc_health_v1_health_proto_goTypes = nil - file_grpc_health_v1_health_proto_depIdxs = nil -} diff --git a/vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go b/vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go deleted file mode 100644 index 93136610ec..0000000000 --- a/vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright 2015 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// The canonical version of this proto can be found at -// https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v5.27.1 -// source: grpc/health/v1/health.proto - -package grpc_health_v1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Health_Check_FullMethodName = "/grpc.health.v1.Health/Check" - Health_List_FullMethodName = "/grpc.health.v1.Health/List" - Health_Watch_FullMethodName = "/grpc.health.v1.Health/Watch" -) - -// HealthClient is the client API for Health service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Health is gRPC's mechanism for checking whether a server is able to handle -// RPCs. Its semantics are documented in -// https://github.com/grpc/grpc/blob/master/doc/health-checking.md. -type HealthClient interface { - // Check gets the health of the specified service. If the requested service - // is unknown, the call will fail with status NOT_FOUND. If the caller does - // not specify a service name, the server should respond with its overall - // health status. - // - // Clients should set a deadline when calling Check, and can declare the - // server unhealthy if they do not receive a timely response. - Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) - // List provides a non-atomic snapshot of the health of all the available - // services. - // - // The server may respond with a RESOURCE_EXHAUSTED error if too many services - // exist. - // - // Clients should set a deadline when calling List, and can declare the server - // unhealthy if they do not receive a timely response. - // - // Clients should keep in mind that the list of health services exposed by an - // application can change over the lifetime of the process. - List(ctx context.Context, in *HealthListRequest, opts ...grpc.CallOption) (*HealthListResponse, error) - // Performs a watch for the serving status of the requested service. - // The server will immediately send back a message indicating the current - // serving status. It will then subsequently send a new message whenever - // the service's serving status changes. - // - // If the requested service is unknown when the call is received, the - // server will send a message setting the serving status to - // SERVICE_UNKNOWN but will *not* terminate the call. If at some - // future point, the serving status of the service becomes known, the - // server will send a new message with the service's serving status. - // - // If the call terminates with status UNIMPLEMENTED, then clients - // should assume this method is not supported and should not retry the - // call. If the call terminates with any other status (including OK), - // clients should retry the call with appropriate exponential backoff. - Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[HealthCheckResponse], error) -} - -type healthClient struct { - cc grpc.ClientConnInterface -} - -func NewHealthClient(cc grpc.ClientConnInterface) HealthClient { - return &healthClient{cc} -} - -func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(HealthCheckResponse) - err := c.cc.Invoke(ctx, Health_Check_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *healthClient) List(ctx context.Context, in *HealthListRequest, opts ...grpc.CallOption) (*HealthListResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(HealthListResponse) - err := c.cc.Invoke(ctx, Health_List_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *healthClient) Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[HealthCheckResponse], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &Health_ServiceDesc.Streams[0], Health_Watch_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &grpc.GenericClientStream[HealthCheckRequest, HealthCheckResponse]{ClientStream: stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type Health_WatchClient = grpc.ServerStreamingClient[HealthCheckResponse] - -// HealthServer is the server API for Health service. -// All implementations should embed UnimplementedHealthServer -// for forward compatibility. -// -// Health is gRPC's mechanism for checking whether a server is able to handle -// RPCs. Its semantics are documented in -// https://github.com/grpc/grpc/blob/master/doc/health-checking.md. -type HealthServer interface { - // Check gets the health of the specified service. If the requested service - // is unknown, the call will fail with status NOT_FOUND. If the caller does - // not specify a service name, the server should respond with its overall - // health status. - // - // Clients should set a deadline when calling Check, and can declare the - // server unhealthy if they do not receive a timely response. - Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) - // List provides a non-atomic snapshot of the health of all the available - // services. - // - // The server may respond with a RESOURCE_EXHAUSTED error if too many services - // exist. - // - // Clients should set a deadline when calling List, and can declare the server - // unhealthy if they do not receive a timely response. - // - // Clients should keep in mind that the list of health services exposed by an - // application can change over the lifetime of the process. - List(context.Context, *HealthListRequest) (*HealthListResponse, error) - // Performs a watch for the serving status of the requested service. - // The server will immediately send back a message indicating the current - // serving status. It will then subsequently send a new message whenever - // the service's serving status changes. - // - // If the requested service is unknown when the call is received, the - // server will send a message setting the serving status to - // SERVICE_UNKNOWN but will *not* terminate the call. If at some - // future point, the serving status of the service becomes known, the - // server will send a new message with the service's serving status. - // - // If the call terminates with status UNIMPLEMENTED, then clients - // should assume this method is not supported and should not retry the - // call. If the call terminates with any other status (including OK), - // clients should retry the call with appropriate exponential backoff. - Watch(*HealthCheckRequest, grpc.ServerStreamingServer[HealthCheckResponse]) error -} - -// UnimplementedHealthServer should be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedHealthServer struct{} - -func (UnimplementedHealthServer) Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") -} -func (UnimplementedHealthServer) List(context.Context, *HealthListRequest) (*HealthListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method List not implemented") -} -func (UnimplementedHealthServer) Watch(*HealthCheckRequest, grpc.ServerStreamingServer[HealthCheckResponse]) error { - return status.Errorf(codes.Unimplemented, "method Watch not implemented") -} -func (UnimplementedHealthServer) testEmbeddedByValue() {} - -// UnsafeHealthServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to HealthServer will -// result in compilation errors. -type UnsafeHealthServer interface { - mustEmbedUnimplementedHealthServer() -} - -func RegisterHealthServer(s grpc.ServiceRegistrar, srv HealthServer) { - // If the following call panics, it indicates UnimplementedHealthServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Health_ServiceDesc, srv) -} - -func _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HealthCheckRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(HealthServer).Check(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Health_Check_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HealthServer).Check(ctx, req.(*HealthCheckRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Health_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HealthListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(HealthServer).List(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Health_List_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HealthServer).List(ctx, req.(*HealthListRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Health_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(HealthCheckRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(HealthServer).Watch(m, &grpc.GenericServerStream[HealthCheckRequest, HealthCheckResponse]{ServerStream: stream}) -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type Health_WatchServer = grpc.ServerStreamingServer[HealthCheckResponse] - -// Health_ServiceDesc is the grpc.ServiceDesc for Health service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Health_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.health.v1.Health", - HandlerType: (*HealthServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Check", - Handler: _Health_Check_Handler, - }, - { - MethodName: "List", - Handler: _Health_List_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Watch", - Handler: _Health_Watch_Handler, - ServerStreams: true, - }, - }, - Metadata: "grpc/health/v1/health.proto", -} diff --git a/vendor/google.golang.org/protobuf/internal/editionssupport/editions.go b/vendor/google.golang.org/protobuf/internal/editionssupport/editions.go deleted file mode 100644 index bf1aba0e85..0000000000 --- a/vendor/google.golang.org/protobuf/internal/editionssupport/editions.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package editionssupport defines constants for editions that are supported. -package editionssupport - -import "google.golang.org/protobuf/types/descriptorpb" - -const ( - Minimum = descriptorpb.Edition_EDITION_PROTO2 - Maximum = descriptorpb.Edition_EDITION_2023 - - // MaximumKnown is the maximum edition that is known to Go Protobuf, but not - // declared as supported. In other words: end users cannot use it, but - // testprotos inside Go Protobuf can. - MaximumKnown = descriptorpb.Edition_EDITION_2024 -) diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go deleted file mode 100644 index 823dbf3ba6..0000000000 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package protodesc provides functionality for converting -// FileDescriptorProto messages to/from [protoreflect.FileDescriptor] values. -// -// The google.protobuf.FileDescriptorProto is a protobuf message that describes -// the type information for a .proto file in a form that is easily serializable. -// The [protoreflect.FileDescriptor] is a more structured representation of -// the FileDescriptorProto message where references and remote dependencies -// can be directly followed. -package protodesc - -import ( - "strings" - - "google.golang.org/protobuf/internal/editionssupport" - "google.golang.org/protobuf/internal/errors" - "google.golang.org/protobuf/internal/filedesc" - "google.golang.org/protobuf/internal/pragma" - "google.golang.org/protobuf/internal/strs" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - - "google.golang.org/protobuf/types/descriptorpb" -) - -// Resolver is the resolver used by [NewFile] to resolve dependencies. -// The enums and messages provided must belong to some parent file, -// which is also registered. -// -// It is implemented by [protoregistry.Files]. -type Resolver interface { - FindFileByPath(string) (protoreflect.FileDescriptor, error) - FindDescriptorByName(protoreflect.FullName) (protoreflect.Descriptor, error) -} - -// FileOptions configures the construction of file descriptors. -type FileOptions struct { - pragma.NoUnkeyedLiterals - - // AllowUnresolvable configures New to permissively allow unresolvable - // file, enum, or message dependencies. Unresolved dependencies are replaced - // by placeholder equivalents. - // - // The following dependencies may be left unresolved: - // • Resolving an imported file. - // • Resolving the type for a message field or extension field. - // If the kind of the field is unknown, then a placeholder is used for both - // the Enum and Message accessors on the protoreflect.FieldDescriptor. - // • Resolving an enum value set as the default for an optional enum field. - // If unresolvable, the protoreflect.FieldDescriptor.Default is set to the - // first value in the associated enum (or zero if the also enum dependency - // is also unresolvable). The protoreflect.FieldDescriptor.DefaultEnumValue - // is populated with a placeholder. - // • Resolving the extended message type for an extension field. - // • Resolving the input or output message type for a service method. - // - // If the unresolved dependency uses a relative name, - // then the placeholder will contain an invalid FullName with a "*." prefix, - // indicating that the starting prefix of the full name is unknown. - AllowUnresolvable bool -} - -// NewFile creates a new [protoreflect.FileDescriptor] from the provided -// file descriptor message. See [FileOptions.New] for more information. -func NewFile(fd *descriptorpb.FileDescriptorProto, r Resolver) (protoreflect.FileDescriptor, error) { - return FileOptions{}.New(fd, r) -} - -// NewFiles creates a new [protoregistry.Files] from the provided -// FileDescriptorSet message. See [FileOptions.NewFiles] for more information. -func NewFiles(fd *descriptorpb.FileDescriptorSet) (*protoregistry.Files, error) { - return FileOptions{}.NewFiles(fd) -} - -// New creates a new [protoreflect.FileDescriptor] from the provided -// file descriptor message. The file must represent a valid proto file according -// to protobuf semantics. The returned descriptor is a deep copy of the input. -// -// Any imported files, enum types, or message types referenced in the file are -// resolved using the provided registry. When looking up an import file path, -// the path must be unique. The newly created file descriptor is not registered -// back into the provided file registry. -func (o FileOptions) New(fd *descriptorpb.FileDescriptorProto, r Resolver) (protoreflect.FileDescriptor, error) { - if r == nil { - r = (*protoregistry.Files)(nil) // empty resolver - } - - // Handle the file descriptor content. - f := &filedesc.File{L2: &filedesc.FileL2{}} - switch fd.GetSyntax() { - case "proto2", "": - f.L1.Syntax = protoreflect.Proto2 - f.L1.Edition = filedesc.EditionProto2 - case "proto3": - f.L1.Syntax = protoreflect.Proto3 - f.L1.Edition = filedesc.EditionProto3 - case "editions": - f.L1.Syntax = protoreflect.Editions - f.L1.Edition = fromEditionProto(fd.GetEdition()) - default: - return nil, errors.New("invalid syntax: %q", fd.GetSyntax()) - } - f.L1.Path = fd.GetName() - if f.L1.Path == "" { - return nil, errors.New("file path must be populated") - } - if f.L1.Syntax == protoreflect.Editions && (fd.GetEdition() < editionssupport.Minimum || fd.GetEdition() > editionssupport.Maximum) { - // Allow cmd/protoc-gen-go/testdata to use any edition for easier - // testing of upcoming edition features. - if !strings.HasPrefix(fd.GetName(), "cmd/protoc-gen-go/testdata/") { - return nil, errors.New("use of edition %v not yet supported by the Go Protobuf runtime", fd.GetEdition()) - } - } - f.L1.Package = protoreflect.FullName(fd.GetPackage()) - if !f.L1.Package.IsValid() && f.L1.Package != "" { - return nil, errors.New("invalid package: %q", f.L1.Package) - } - if opts := fd.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.FileOptions) - f.L2.Options = func() protoreflect.ProtoMessage { return opts } - } - initFileDescFromFeatureSet(f, fd.GetOptions().GetFeatures()) - - f.L2.Imports = make(filedesc.FileImports, len(fd.GetDependency())) - for _, i := range fd.GetPublicDependency() { - if !(0 <= i && int(i) < len(f.L2.Imports)) || f.L2.Imports[i].IsPublic { - return nil, errors.New("invalid or duplicate public import index: %d", i) - } - f.L2.Imports[i].IsPublic = true - } - imps := importSet{f.Path(): true} - for i, path := range fd.GetDependency() { - imp := &f.L2.Imports[i] - f, err := r.FindFileByPath(path) - if err == protoregistry.NotFound && o.AllowUnresolvable { - f = filedesc.PlaceholderFile(path) - } else if err != nil { - return nil, errors.New("could not resolve import %q: %v", path, err) - } - imp.FileDescriptor = f - - if imps[imp.Path()] { - return nil, errors.New("already imported %q", path) - } - imps[imp.Path()] = true - } - for i := range fd.GetDependency() { - imp := &f.L2.Imports[i] - imps.importPublic(imp.Imports()) - } - - // Handle source locations. - f.L2.Locations.File = f - for _, loc := range fd.GetSourceCodeInfo().GetLocation() { - var l protoreflect.SourceLocation - // TODO: Validate that the path points to an actual declaration? - l.Path = protoreflect.SourcePath(loc.GetPath()) - s := loc.GetSpan() - switch len(s) { - case 3: - l.StartLine, l.StartColumn, l.EndLine, l.EndColumn = int(s[0]), int(s[1]), int(s[0]), int(s[2]) - case 4: - l.StartLine, l.StartColumn, l.EndLine, l.EndColumn = int(s[0]), int(s[1]), int(s[2]), int(s[3]) - default: - return nil, errors.New("invalid span: %v", s) - } - // TODO: Validate that the span information is sensible? - // See https://github.com/protocolbuffers/protobuf/issues/6378. - if false && (l.EndLine < l.StartLine || l.StartLine < 0 || l.StartColumn < 0 || l.EndColumn < 0 || - (l.StartLine == l.EndLine && l.EndColumn <= l.StartColumn)) { - return nil, errors.New("invalid span: %v", s) - } - l.LeadingDetachedComments = loc.GetLeadingDetachedComments() - l.LeadingComments = loc.GetLeadingComments() - l.TrailingComments = loc.GetTrailingComments() - f.L2.Locations.List = append(f.L2.Locations.List, l) - } - - // Step 1: Allocate and derive the names for all declarations. - // This copies all fields from the descriptor proto except: - // google.protobuf.FieldDescriptorProto.type_name - // google.protobuf.FieldDescriptorProto.default_value - // google.protobuf.FieldDescriptorProto.oneof_index - // google.protobuf.FieldDescriptorProto.extendee - // google.protobuf.MethodDescriptorProto.input - // google.protobuf.MethodDescriptorProto.output - var err error - sb := new(strs.Builder) - r1 := make(descsByName) - if f.L1.Enums.List, err = r1.initEnumDeclarations(fd.GetEnumType(), f, sb); err != nil { - return nil, err - } - if f.L1.Messages.List, err = r1.initMessagesDeclarations(fd.GetMessageType(), f, sb); err != nil { - return nil, err - } - if f.L1.Extensions.List, err = r1.initExtensionDeclarations(fd.GetExtension(), f, sb); err != nil { - return nil, err - } - if f.L1.Services.List, err = r1.initServiceDeclarations(fd.GetService(), f, sb); err != nil { - return nil, err - } - - // Step 2: Resolve every dependency reference not handled by step 1. - r2 := &resolver{local: r1, remote: r, imports: imps, allowUnresolvable: o.AllowUnresolvable} - if err := r2.resolveMessageDependencies(f.L1.Messages.List, fd.GetMessageType()); err != nil { - return nil, err - } - if err := r2.resolveExtensionDependencies(f.L1.Extensions.List, fd.GetExtension()); err != nil { - return nil, err - } - if err := r2.resolveServiceDependencies(f.L1.Services.List, fd.GetService()); err != nil { - return nil, err - } - - // Step 3: Validate every enum, message, and extension declaration. - if err := validateEnumDeclarations(f.L1.Enums.List, fd.GetEnumType()); err != nil { - return nil, err - } - if err := validateMessageDeclarations(f, f.L1.Messages.List, fd.GetMessageType()); err != nil { - return nil, err - } - if err := validateExtensionDeclarations(f, f.L1.Extensions.List, fd.GetExtension()); err != nil { - return nil, err - } - - return f, nil -} - -type importSet map[string]bool - -func (is importSet) importPublic(imps protoreflect.FileImports) { - for i := 0; i < imps.Len(); i++ { - if imp := imps.Get(i); imp.IsPublic { - is[imp.Path()] = true - is.importPublic(imp.Imports()) - } - } -} - -// NewFiles creates a new [protoregistry.Files] from the provided -// FileDescriptorSet message. The descriptor set must include only -// valid files according to protobuf semantics. The returned descriptors -// are a deep copy of the input. -func (o FileOptions) NewFiles(fds *descriptorpb.FileDescriptorSet) (*protoregistry.Files, error) { - files := make(map[string]*descriptorpb.FileDescriptorProto) - for _, fd := range fds.File { - if _, ok := files[fd.GetName()]; ok { - return nil, errors.New("file appears multiple times: %q", fd.GetName()) - } - files[fd.GetName()] = fd - } - r := &protoregistry.Files{} - for _, fd := range files { - if err := o.addFileDeps(r, fd, files); err != nil { - return nil, err - } - } - return r, nil -} -func (o FileOptions) addFileDeps(r *protoregistry.Files, fd *descriptorpb.FileDescriptorProto, files map[string]*descriptorpb.FileDescriptorProto) error { - // Set the entry to nil while descending into a file's dependencies to detect cycles. - files[fd.GetName()] = nil - for _, dep := range fd.Dependency { - depfd, ok := files[dep] - if depfd == nil { - if ok { - return errors.New("import cycle in file: %q", dep) - } - continue - } - if err := o.addFileDeps(r, depfd, files); err != nil { - return err - } - } - // Delete the entry once dependencies are processed. - delete(files, fd.GetName()) - f, err := o.New(fd, r) - if err != nil { - return err - } - return r.RegisterFile(f) -} diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go deleted file mode 100644 index 9da34998b1..0000000000 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package protodesc - -import ( - "google.golang.org/protobuf/internal/errors" - "google.golang.org/protobuf/internal/filedesc" - "google.golang.org/protobuf/internal/strs" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "google.golang.org/protobuf/types/descriptorpb" -) - -type descsByName map[protoreflect.FullName]protoreflect.Descriptor - -func (r descsByName) initEnumDeclarations(eds []*descriptorpb.EnumDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (es []filedesc.Enum, err error) { - es = make([]filedesc.Enum, len(eds)) // allocate up-front to ensure stable pointers - for i, ed := range eds { - e := &es[i] - e.L2 = new(filedesc.EnumL2) - if e.L0, err = r.makeBase(e, parent, ed.GetName(), i, sb); err != nil { - return nil, err - } - if opts := ed.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.EnumOptions) - e.L2.Options = func() protoreflect.ProtoMessage { return opts } - } - e.L1.EditionFeatures = mergeEditionFeatures(parent, ed.GetOptions().GetFeatures()) - for _, s := range ed.GetReservedName() { - e.L2.ReservedNames.List = append(e.L2.ReservedNames.List, protoreflect.Name(s)) - } - for _, rr := range ed.GetReservedRange() { - e.L2.ReservedRanges.List = append(e.L2.ReservedRanges.List, [2]protoreflect.EnumNumber{ - protoreflect.EnumNumber(rr.GetStart()), - protoreflect.EnumNumber(rr.GetEnd()), - }) - } - if e.L2.Values.List, err = r.initEnumValuesFromDescriptorProto(ed.GetValue(), e, sb); err != nil { - return nil, err - } - } - return es, nil -} - -func (r descsByName) initEnumValuesFromDescriptorProto(vds []*descriptorpb.EnumValueDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (vs []filedesc.EnumValue, err error) { - vs = make([]filedesc.EnumValue, len(vds)) // allocate up-front to ensure stable pointers - for i, vd := range vds { - v := &vs[i] - if v.L0, err = r.makeBase(v, parent, vd.GetName(), i, sb); err != nil { - return nil, err - } - if opts := vd.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.EnumValueOptions) - v.L1.Options = func() protoreflect.ProtoMessage { return opts } - } - v.L1.Number = protoreflect.EnumNumber(vd.GetNumber()) - } - return vs, nil -} - -func (r descsByName) initMessagesDeclarations(mds []*descriptorpb.DescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (ms []filedesc.Message, err error) { - ms = make([]filedesc.Message, len(mds)) // allocate up-front to ensure stable pointers - for i, md := range mds { - m := &ms[i] - m.L2 = new(filedesc.MessageL2) - if m.L0, err = r.makeBase(m, parent, md.GetName(), i, sb); err != nil { - return nil, err - } - m.L1.EditionFeatures = mergeEditionFeatures(parent, md.GetOptions().GetFeatures()) - if opts := md.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.MessageOptions) - m.L2.Options = func() protoreflect.ProtoMessage { return opts } - m.L1.IsMapEntry = opts.GetMapEntry() - m.L1.IsMessageSet = opts.GetMessageSetWireFormat() - } - for _, s := range md.GetReservedName() { - m.L2.ReservedNames.List = append(m.L2.ReservedNames.List, protoreflect.Name(s)) - } - for _, rr := range md.GetReservedRange() { - m.L2.ReservedRanges.List = append(m.L2.ReservedRanges.List, [2]protoreflect.FieldNumber{ - protoreflect.FieldNumber(rr.GetStart()), - protoreflect.FieldNumber(rr.GetEnd()), - }) - } - for _, xr := range md.GetExtensionRange() { - m.L2.ExtensionRanges.List = append(m.L2.ExtensionRanges.List, [2]protoreflect.FieldNumber{ - protoreflect.FieldNumber(xr.GetStart()), - protoreflect.FieldNumber(xr.GetEnd()), - }) - var optsFunc func() protoreflect.ProtoMessage - if opts := xr.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.ExtensionRangeOptions) - optsFunc = func() protoreflect.ProtoMessage { return opts } - } - m.L2.ExtensionRangeOptions = append(m.L2.ExtensionRangeOptions, optsFunc) - } - if m.L2.Fields.List, err = r.initFieldsFromDescriptorProto(md.GetField(), m, sb); err != nil { - return nil, err - } - if m.L2.Oneofs.List, err = r.initOneofsFromDescriptorProto(md.GetOneofDecl(), m, sb); err != nil { - return nil, err - } - if m.L1.Enums.List, err = r.initEnumDeclarations(md.GetEnumType(), m, sb); err != nil { - return nil, err - } - if m.L1.Messages.List, err = r.initMessagesDeclarations(md.GetNestedType(), m, sb); err != nil { - return nil, err - } - if m.L1.Extensions.List, err = r.initExtensionDeclarations(md.GetExtension(), m, sb); err != nil { - return nil, err - } - } - return ms, nil -} - -// canBePacked returns whether the field can use packed encoding: -// https://protobuf.dev/programming-guides/encoding/#packed -func canBePacked(fd *descriptorpb.FieldDescriptorProto) bool { - if fd.GetLabel() != descriptorpb.FieldDescriptorProto_LABEL_REPEATED { - return false // not a repeated field - } - - switch protoreflect.Kind(fd.GetType()) { - case protoreflect.MessageKind, protoreflect.GroupKind: - return false // not a scalar type field - - case protoreflect.StringKind, protoreflect.BytesKind: - // string and bytes can explicitly not be declared as packed, - // see https://protobuf.dev/programming-guides/encoding/#packed - return false - - default: - return true - } -} - -func (r descsByName) initFieldsFromDescriptorProto(fds []*descriptorpb.FieldDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (fs []filedesc.Field, err error) { - fs = make([]filedesc.Field, len(fds)) // allocate up-front to ensure stable pointers - for i, fd := range fds { - f := &fs[i] - if f.L0, err = r.makeBase(f, parent, fd.GetName(), i, sb); err != nil { - return nil, err - } - f.L1.EditionFeatures = mergeEditionFeatures(parent, fd.GetOptions().GetFeatures()) - f.L1.IsProto3Optional = fd.GetProto3Optional() - if opts := fd.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.FieldOptions) - f.L1.Options = func() protoreflect.ProtoMessage { return opts } - f.L1.IsLazy = opts.GetLazy() - if opts.Packed != nil { - f.L1.EditionFeatures.IsPacked = opts.GetPacked() - } - } - f.L1.Number = protoreflect.FieldNumber(fd.GetNumber()) - f.L1.Cardinality = protoreflect.Cardinality(fd.GetLabel()) - if fd.Type != nil { - f.L1.Kind = protoreflect.Kind(fd.GetType()) - } - if fd.JsonName != nil { - f.L1.StringName.InitJSON(fd.GetJsonName()) - } - - if f.L1.EditionFeatures.IsLegacyRequired { - f.L1.Cardinality = protoreflect.Required - } - - if f.L1.Kind == protoreflect.MessageKind && f.L1.EditionFeatures.IsDelimitedEncoded { - f.L1.Kind = protoreflect.GroupKind - } - } - return fs, nil -} - -func (r descsByName) initOneofsFromDescriptorProto(ods []*descriptorpb.OneofDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (os []filedesc.Oneof, err error) { - os = make([]filedesc.Oneof, len(ods)) // allocate up-front to ensure stable pointers - for i, od := range ods { - o := &os[i] - if o.L0, err = r.makeBase(o, parent, od.GetName(), i, sb); err != nil { - return nil, err - } - o.L1.EditionFeatures = mergeEditionFeatures(parent, od.GetOptions().GetFeatures()) - if opts := od.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.OneofOptions) - o.L1.Options = func() protoreflect.ProtoMessage { return opts } - } - } - return os, nil -} - -func (r descsByName) initExtensionDeclarations(xds []*descriptorpb.FieldDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (xs []filedesc.Extension, err error) { - xs = make([]filedesc.Extension, len(xds)) // allocate up-front to ensure stable pointers - for i, xd := range xds { - x := &xs[i] - x.L2 = new(filedesc.ExtensionL2) - if x.L0, err = r.makeBase(x, parent, xd.GetName(), i, sb); err != nil { - return nil, err - } - x.L1.EditionFeatures = mergeEditionFeatures(parent, xd.GetOptions().GetFeatures()) - if opts := xd.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.FieldOptions) - x.L2.Options = func() protoreflect.ProtoMessage { return opts } - if opts.Packed != nil { - x.L1.EditionFeatures.IsPacked = opts.GetPacked() - } - } - x.L1.Number = protoreflect.FieldNumber(xd.GetNumber()) - x.L1.Cardinality = protoreflect.Cardinality(xd.GetLabel()) - if xd.Type != nil { - x.L1.Kind = protoreflect.Kind(xd.GetType()) - } - if xd.JsonName != nil { - x.L2.StringName.InitJSON(xd.GetJsonName()) - } - if x.L1.Kind == protoreflect.MessageKind && x.L1.EditionFeatures.IsDelimitedEncoded { - x.L1.Kind = protoreflect.GroupKind - } - } - return xs, nil -} - -func (r descsByName) initServiceDeclarations(sds []*descriptorpb.ServiceDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (ss []filedesc.Service, err error) { - ss = make([]filedesc.Service, len(sds)) // allocate up-front to ensure stable pointers - for i, sd := range sds { - s := &ss[i] - s.L2 = new(filedesc.ServiceL2) - if s.L0, err = r.makeBase(s, parent, sd.GetName(), i, sb); err != nil { - return nil, err - } - if opts := sd.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.ServiceOptions) - s.L2.Options = func() protoreflect.ProtoMessage { return opts } - } - if s.L2.Methods.List, err = r.initMethodsFromDescriptorProto(sd.GetMethod(), s, sb); err != nil { - return nil, err - } - } - return ss, nil -} - -func (r descsByName) initMethodsFromDescriptorProto(mds []*descriptorpb.MethodDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (ms []filedesc.Method, err error) { - ms = make([]filedesc.Method, len(mds)) // allocate up-front to ensure stable pointers - for i, md := range mds { - m := &ms[i] - if m.L0, err = r.makeBase(m, parent, md.GetName(), i, sb); err != nil { - return nil, err - } - if opts := md.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.MethodOptions) - m.L1.Options = func() protoreflect.ProtoMessage { return opts } - } - m.L1.IsStreamingClient = md.GetClientStreaming() - m.L1.IsStreamingServer = md.GetServerStreaming() - } - return ms, nil -} - -func (r descsByName) makeBase(child, parent protoreflect.Descriptor, name string, idx int, sb *strs.Builder) (filedesc.BaseL0, error) { - if !protoreflect.Name(name).IsValid() { - return filedesc.BaseL0{}, errors.New("descriptor %q has an invalid nested name: %q", parent.FullName(), name) - } - - // Derive the full name of the child. - // Note that enum values are a sibling to the enum parent in the namespace. - var fullName protoreflect.FullName - if _, ok := parent.(protoreflect.EnumDescriptor); ok { - fullName = sb.AppendFullName(parent.FullName().Parent(), protoreflect.Name(name)) - } else { - fullName = sb.AppendFullName(parent.FullName(), protoreflect.Name(name)) - } - if _, ok := r[fullName]; ok { - return filedesc.BaseL0{}, errors.New("descriptor %q already declared", fullName) - } - r[fullName] = child - - // TODO: Verify that the full name does not already exist in the resolver? - // This is not as critical since most usages of NewFile will register - // the created file back into the registry, which will perform this check. - - return filedesc.BaseL0{ - FullName: fullName, - ParentFile: parent.ParentFile().(*filedesc.File), - Parent: parent, - Index: idx, - }, nil -} diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go deleted file mode 100644 index ff692436e9..0000000000 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package protodesc - -import ( - "google.golang.org/protobuf/internal/encoding/defval" - "google.golang.org/protobuf/internal/errors" - "google.golang.org/protobuf/internal/filedesc" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - - "google.golang.org/protobuf/types/descriptorpb" -) - -// resolver is a wrapper around a local registry of declarations within the file -// and the remote resolver. The remote resolver is restricted to only return -// descriptors that have been imported. -type resolver struct { - local descsByName - remote Resolver - imports importSet - - allowUnresolvable bool -} - -func (r *resolver) resolveMessageDependencies(ms []filedesc.Message, mds []*descriptorpb.DescriptorProto) (err error) { - for i, md := range mds { - m := &ms[i] - for j, fd := range md.GetField() { - f := &m.L2.Fields.List[j] - if f.L1.Cardinality == protoreflect.Required { - m.L2.RequiredNumbers.List = append(m.L2.RequiredNumbers.List, f.L1.Number) - } - if fd.OneofIndex != nil { - k := int(fd.GetOneofIndex()) - if !(0 <= k && k < len(md.GetOneofDecl())) { - return errors.New("message field %q has an invalid oneof index: %d", f.FullName(), k) - } - o := &m.L2.Oneofs.List[k] - f.L1.ContainingOneof = o - o.L1.Fields.List = append(o.L1.Fields.List, f) - } - - if f.L1.Kind, f.L1.Enum, f.L1.Message, err = r.findTarget(f.Kind(), f.Parent().FullName(), partialName(fd.GetTypeName())); err != nil { - return errors.New("message field %q cannot resolve type: %v", f.FullName(), err) - } - if f.L1.Kind == protoreflect.GroupKind && (f.IsMap() || f.IsMapEntry()) { - // A map field might inherit delimited encoding from a file-wide default feature. - // But maps never actually use delimited encoding. (At least for now...) - f.L1.Kind = protoreflect.MessageKind - } - if fd.DefaultValue != nil { - v, ev, err := unmarshalDefault(fd.GetDefaultValue(), f, r.allowUnresolvable) - if err != nil { - return errors.New("message field %q has invalid default: %v", f.FullName(), err) - } - f.L1.Default = filedesc.DefaultValue(v, ev) - } - } - - if err := r.resolveMessageDependencies(m.L1.Messages.List, md.GetNestedType()); err != nil { - return err - } - if err := r.resolveExtensionDependencies(m.L1.Extensions.List, md.GetExtension()); err != nil { - return err - } - } - return nil -} - -func (r *resolver) resolveExtensionDependencies(xs []filedesc.Extension, xds []*descriptorpb.FieldDescriptorProto) (err error) { - for i, xd := range xds { - x := &xs[i] - if x.L1.Extendee, err = r.findMessageDescriptor(x.Parent().FullName(), partialName(xd.GetExtendee())); err != nil { - return errors.New("extension field %q cannot resolve extendee: %v", x.FullName(), err) - } - if x.L1.Kind, x.L2.Enum, x.L2.Message, err = r.findTarget(x.Kind(), x.Parent().FullName(), partialName(xd.GetTypeName())); err != nil { - return errors.New("extension field %q cannot resolve type: %v", x.FullName(), err) - } - if xd.DefaultValue != nil { - v, ev, err := unmarshalDefault(xd.GetDefaultValue(), x, r.allowUnresolvable) - if err != nil { - return errors.New("extension field %q has invalid default: %v", x.FullName(), err) - } - x.L2.Default = filedesc.DefaultValue(v, ev) - } - } - return nil -} - -func (r *resolver) resolveServiceDependencies(ss []filedesc.Service, sds []*descriptorpb.ServiceDescriptorProto) (err error) { - for i, sd := range sds { - s := &ss[i] - for j, md := range sd.GetMethod() { - m := &s.L2.Methods.List[j] - m.L1.Input, err = r.findMessageDescriptor(m.Parent().FullName(), partialName(md.GetInputType())) - if err != nil { - return errors.New("service method %q cannot resolve input: %v", m.FullName(), err) - } - m.L1.Output, err = r.findMessageDescriptor(s.FullName(), partialName(md.GetOutputType())) - if err != nil { - return errors.New("service method %q cannot resolve output: %v", m.FullName(), err) - } - } - } - return nil -} - -// findTarget finds an enum or message descriptor if k is an enum, message, -// group, or unknown. If unknown, and the name could be resolved, the kind -// returned kind is set based on the type of the resolved descriptor. -func (r *resolver) findTarget(k protoreflect.Kind, scope protoreflect.FullName, ref partialName) (protoreflect.Kind, protoreflect.EnumDescriptor, protoreflect.MessageDescriptor, error) { - switch k { - case protoreflect.EnumKind: - ed, err := r.findEnumDescriptor(scope, ref) - if err != nil { - return 0, nil, nil, err - } - return k, ed, nil, nil - case protoreflect.MessageKind, protoreflect.GroupKind: - md, err := r.findMessageDescriptor(scope, ref) - if err != nil { - return 0, nil, nil, err - } - return k, nil, md, nil - case 0: - // Handle unspecified kinds (possible with parsers that operate - // on a per-file basis without knowledge of dependencies). - d, err := r.findDescriptor(scope, ref) - if err == protoregistry.NotFound && r.allowUnresolvable { - return k, filedesc.PlaceholderEnum(ref.FullName()), filedesc.PlaceholderMessage(ref.FullName()), nil - } else if err == protoregistry.NotFound { - return 0, nil, nil, errors.New("%q not found", ref.FullName()) - } else if err != nil { - return 0, nil, nil, err - } - switch d := d.(type) { - case protoreflect.EnumDescriptor: - return protoreflect.EnumKind, d, nil, nil - case protoreflect.MessageDescriptor: - return protoreflect.MessageKind, nil, d, nil - default: - return 0, nil, nil, errors.New("unknown kind") - } - default: - if ref != "" { - return 0, nil, nil, errors.New("target name cannot be specified for %v", k) - } - if !k.IsValid() { - return 0, nil, nil, errors.New("invalid kind: %d", k) - } - return k, nil, nil, nil - } -} - -// findDescriptor finds the descriptor by name, -// which may be a relative name within some scope. -// -// Suppose the scope was "fizz.buzz" and the reference was "Foo.Bar", -// then the following full names are searched: -// - fizz.buzz.Foo.Bar -// - fizz.Foo.Bar -// - Foo.Bar -func (r *resolver) findDescriptor(scope protoreflect.FullName, ref partialName) (protoreflect.Descriptor, error) { - if !ref.IsValid() { - return nil, errors.New("invalid name reference: %q", ref) - } - if ref.IsFull() { - scope, ref = "", ref[1:] - } - var foundButNotImported protoreflect.Descriptor - for { - // Derive the full name to search. - s := protoreflect.FullName(ref) - if scope != "" { - s = scope + "." + s - } - - // Check the current file for the descriptor. - if d, ok := r.local[s]; ok { - return d, nil - } - - // Check the remote registry for the descriptor. - d, err := r.remote.FindDescriptorByName(s) - if err == nil { - // Only allow descriptors covered by one of the imports. - if r.imports[d.ParentFile().Path()] { - return d, nil - } - foundButNotImported = d - } else if err != protoregistry.NotFound { - return nil, errors.Wrap(err, "%q", s) - } - - // Continue on at a higher level of scoping. - if scope == "" { - if d := foundButNotImported; d != nil { - return nil, errors.New("resolved %q, but %q is not imported", d.FullName(), d.ParentFile().Path()) - } - return nil, protoregistry.NotFound - } - scope = scope.Parent() - } -} - -func (r *resolver) findEnumDescriptor(scope protoreflect.FullName, ref partialName) (protoreflect.EnumDescriptor, error) { - d, err := r.findDescriptor(scope, ref) - if err == protoregistry.NotFound && r.allowUnresolvable { - return filedesc.PlaceholderEnum(ref.FullName()), nil - } else if err == protoregistry.NotFound { - return nil, errors.New("%q not found", ref.FullName()) - } else if err != nil { - return nil, err - } - ed, ok := d.(protoreflect.EnumDescriptor) - if !ok { - return nil, errors.New("resolved %q, but it is not an enum", d.FullName()) - } - return ed, nil -} - -func (r *resolver) findMessageDescriptor(scope protoreflect.FullName, ref partialName) (protoreflect.MessageDescriptor, error) { - d, err := r.findDescriptor(scope, ref) - if err == protoregistry.NotFound && r.allowUnresolvable { - return filedesc.PlaceholderMessage(ref.FullName()), nil - } else if err == protoregistry.NotFound { - return nil, errors.New("%q not found", ref.FullName()) - } else if err != nil { - return nil, err - } - md, ok := d.(protoreflect.MessageDescriptor) - if !ok { - return nil, errors.New("resolved %q, but it is not an message", d.FullName()) - } - return md, nil -} - -// partialName is the partial name. A leading dot means that the name is full, -// otherwise the name is relative to some current scope. -// See google.protobuf.FieldDescriptorProto.type_name. -type partialName string - -func (s partialName) IsFull() bool { - return len(s) > 0 && s[0] == '.' -} - -func (s partialName) IsValid() bool { - if s.IsFull() { - return protoreflect.FullName(s[1:]).IsValid() - } - return protoreflect.FullName(s).IsValid() -} - -const unknownPrefix = "*." - -// FullName converts the partial name to a full name on a best-effort basis. -// If relative, it creates an invalid full name, using a "*." prefix -// to indicate that the start of the full name is unknown. -func (s partialName) FullName() protoreflect.FullName { - if s.IsFull() { - return protoreflect.FullName(s[1:]) - } - return protoreflect.FullName(unknownPrefix + s) -} - -func unmarshalDefault(s string, fd protoreflect.FieldDescriptor, allowUnresolvable bool) (protoreflect.Value, protoreflect.EnumValueDescriptor, error) { - var evs protoreflect.EnumValueDescriptors - if fd.Enum() != nil { - evs = fd.Enum().Values() - } - v, ev, err := defval.Unmarshal(s, fd.Kind(), evs, defval.Descriptor) - if err != nil && allowUnresolvable && evs != nil && protoreflect.Name(s).IsValid() { - v = protoreflect.ValueOfEnum(0) - if evs.Len() > 0 { - v = protoreflect.ValueOfEnum(evs.Get(0).Number()) - } - ev = filedesc.PlaceholderEnumValue(fd.Enum().FullName().Parent().Append(protoreflect.Name(s))) - } else if err != nil { - return v, ev, err - } - if !fd.HasPresence() { - return v, ev, errors.New("cannot be specified with implicit field presence") - } - if fd.Kind() == protoreflect.MessageKind || fd.Kind() == protoreflect.GroupKind || fd.Cardinality() == protoreflect.Repeated { - return v, ev, errors.New("cannot be specified on composite types") - } - return v, ev, nil -} diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go deleted file mode 100644 index c343d9227b..0000000000 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package protodesc - -import ( - "strings" - "unicode" - - "google.golang.org/protobuf/encoding/protowire" - "google.golang.org/protobuf/internal/errors" - "google.golang.org/protobuf/internal/filedesc" - "google.golang.org/protobuf/internal/flags" - "google.golang.org/protobuf/internal/genid" - "google.golang.org/protobuf/internal/strs" - "google.golang.org/protobuf/reflect/protoreflect" - - "google.golang.org/protobuf/types/descriptorpb" -) - -func validateEnumDeclarations(es []filedesc.Enum, eds []*descriptorpb.EnumDescriptorProto) error { - for i, ed := range eds { - e := &es[i] - if err := e.L2.ReservedNames.CheckValid(); err != nil { - return errors.New("enum %q reserved names has %v", e.FullName(), err) - } - if err := e.L2.ReservedRanges.CheckValid(); err != nil { - return errors.New("enum %q reserved ranges has %v", e.FullName(), err) - } - if len(ed.GetValue()) == 0 { - return errors.New("enum %q must contain at least one value declaration", e.FullName()) - } - allowAlias := ed.GetOptions().GetAllowAlias() - foundAlias := false - for i := 0; i < e.Values().Len(); i++ { - v1 := e.Values().Get(i) - if v2 := e.Values().ByNumber(v1.Number()); v1 != v2 { - foundAlias = true - if !allowAlias { - return errors.New("enum %q has conflicting non-aliased values on number %d: %q with %q", e.FullName(), v1.Number(), v1.Name(), v2.Name()) - } - } - } - if allowAlias && !foundAlias { - return errors.New("enum %q allows aliases, but none were found", e.FullName()) - } - if !e.IsClosed() { - if v := e.Values().Get(0); v.Number() != 0 { - return errors.New("enum %q using open semantics must have zero number for the first value", v.FullName()) - } - // Verify that value names in open enums do not conflict if the - // case-insensitive prefix is removed. - // See protoc v3.8.0: src/google/protobuf/descriptor.cc:4991-5055 - names := map[string]protoreflect.EnumValueDescriptor{} - prefix := strings.Replace(strings.ToLower(string(e.Name())), "_", "", -1) - for i := 0; i < e.Values().Len(); i++ { - v1 := e.Values().Get(i) - s := strs.EnumValueName(strs.TrimEnumPrefix(string(v1.Name()), prefix)) - if v2, ok := names[s]; ok && v1.Number() != v2.Number() { - return errors.New("enum %q using open semantics has conflict: %q with %q", e.FullName(), v1.Name(), v2.Name()) - } - names[s] = v1 - } - } - - for j, vd := range ed.GetValue() { - v := &e.L2.Values.List[j] - if vd.Number == nil { - return errors.New("enum value %q must have a specified number", v.FullName()) - } - if e.L2.ReservedNames.Has(v.Name()) { - return errors.New("enum value %q must not use reserved name", v.FullName()) - } - if e.L2.ReservedRanges.Has(v.Number()) { - return errors.New("enum value %q must not use reserved number %d", v.FullName(), v.Number()) - } - } - } - return nil -} - -func validateMessageDeclarations(file *filedesc.File, ms []filedesc.Message, mds []*descriptorpb.DescriptorProto) error { - // There are a few limited exceptions only for proto3 - isProto3 := file.L1.Edition == fromEditionProto(descriptorpb.Edition_EDITION_PROTO3) - for i, md := range mds { - m := &ms[i] - - // Handle the message descriptor itself. - isMessageSet := md.GetOptions().GetMessageSetWireFormat() - if err := m.L2.ReservedNames.CheckValid(); err != nil { - return errors.New("message %q reserved names has %v", m.FullName(), err) - } - if err := m.L2.ReservedRanges.CheckValid(isMessageSet); err != nil { - return errors.New("message %q reserved ranges has %v", m.FullName(), err) - } - if err := m.L2.ExtensionRanges.CheckValid(isMessageSet); err != nil { - return errors.New("message %q extension ranges has %v", m.FullName(), err) - } - if err := (*filedesc.FieldRanges).CheckOverlap(&m.L2.ReservedRanges, &m.L2.ExtensionRanges); err != nil { - return errors.New("message %q reserved and extension ranges has %v", m.FullName(), err) - } - for i := 0; i < m.Fields().Len(); i++ { - f1 := m.Fields().Get(i) - if f2 := m.Fields().ByNumber(f1.Number()); f1 != f2 { - return errors.New("message %q has conflicting fields: %q with %q", m.FullName(), f1.Name(), f2.Name()) - } - } - if isMessageSet && !flags.ProtoLegacy { - return errors.New("message %q is a MessageSet, which is a legacy proto1 feature that is no longer supported", m.FullName()) - } - if isMessageSet && (isProto3 || m.Fields().Len() > 0 || m.ExtensionRanges().Len() == 0) { - return errors.New("message %q is an invalid proto1 MessageSet", m.FullName()) - } - if isProto3 { - if m.ExtensionRanges().Len() > 0 { - return errors.New("message %q using proto3 semantics cannot have extension ranges", m.FullName()) - } - } - - for j, fd := range md.GetField() { - f := &m.L2.Fields.List[j] - if m.L2.ReservedNames.Has(f.Name()) { - return errors.New("message field %q must not use reserved name", f.FullName()) - } - if !f.Number().IsValid() { - return errors.New("message field %q has an invalid number: %d", f.FullName(), f.Number()) - } - if !f.Cardinality().IsValid() { - return errors.New("message field %q has an invalid cardinality: %d", f.FullName(), f.Cardinality()) - } - if m.L2.ReservedRanges.Has(f.Number()) { - return errors.New("message field %q must not use reserved number %d", f.FullName(), f.Number()) - } - if m.L2.ExtensionRanges.Has(f.Number()) { - return errors.New("message field %q with number %d in extension range", f.FullName(), f.Number()) - } - if fd.Extendee != nil { - return errors.New("message field %q may not have extendee: %q", f.FullName(), fd.GetExtendee()) - } - if f.L1.IsProto3Optional { - if !isProto3 { - return errors.New("message field %q under proto3 optional semantics must be specified in the proto3 syntax", f.FullName()) - } - if f.Cardinality() != protoreflect.Optional { - return errors.New("message field %q under proto3 optional semantics must have optional cardinality", f.FullName()) - } - if f.ContainingOneof() != nil && f.ContainingOneof().Fields().Len() != 1 { - return errors.New("message field %q under proto3 optional semantics must be within a single element oneof", f.FullName()) - } - } - if f.IsPacked() && !isPackable(f) { - return errors.New("message field %q is not packable", f.FullName()) - } - if err := checkValidGroup(file, f); err != nil { - return errors.New("message field %q is an invalid group: %v", f.FullName(), err) - } - if err := checkValidMap(f); err != nil { - return errors.New("message field %q is an invalid map: %v", f.FullName(), err) - } - if isProto3 { - if f.Cardinality() == protoreflect.Required { - return errors.New("message field %q using proto3 semantics cannot be required", f.FullName()) - } - if f.Enum() != nil && !f.Enum().IsPlaceholder() && f.Enum().IsClosed() { - return errors.New("message field %q using proto3 semantics may only depend on open enums", f.FullName()) - } - } - if f.Cardinality() == protoreflect.Optional && !f.HasPresence() && f.Enum() != nil && !f.Enum().IsPlaceholder() && f.Enum().IsClosed() { - return errors.New("message field %q with implicit presence may only use open enums", f.FullName()) - } - } - seenSynthetic := false // synthetic oneofs for proto3 optional must come after real oneofs - for j := range md.GetOneofDecl() { - o := &m.L2.Oneofs.List[j] - if o.Fields().Len() == 0 { - return errors.New("message oneof %q must contain at least one field declaration", o.FullName()) - } - if n := o.Fields().Len(); n-1 != (o.Fields().Get(n-1).Index() - o.Fields().Get(0).Index()) { - return errors.New("message oneof %q must have consecutively declared fields", o.FullName()) - } - - if o.IsSynthetic() { - seenSynthetic = true - continue - } - if !o.IsSynthetic() && seenSynthetic { - return errors.New("message oneof %q must be declared before synthetic oneofs", o.FullName()) - } - - for i := 0; i < o.Fields().Len(); i++ { - f := o.Fields().Get(i) - if f.Cardinality() != protoreflect.Optional { - return errors.New("message field %q belongs in a oneof and must be optional", f.FullName()) - } - } - } - - if err := validateEnumDeclarations(m.L1.Enums.List, md.GetEnumType()); err != nil { - return err - } - if err := validateMessageDeclarations(file, m.L1.Messages.List, md.GetNestedType()); err != nil { - return err - } - if err := validateExtensionDeclarations(file, m.L1.Extensions.List, md.GetExtension()); err != nil { - return err - } - } - return nil -} - -func validateExtensionDeclarations(f *filedesc.File, xs []filedesc.Extension, xds []*descriptorpb.FieldDescriptorProto) error { - for i, xd := range xds { - x := &xs[i] - // NOTE: Avoid using the IsValid method since extensions to MessageSet - // may have a field number higher than normal. This check only verifies - // that the number is not negative or reserved. We check again later - // if we know that the extendee is definitely not a MessageSet. - if n := x.Number(); n < 0 || (protowire.FirstReservedNumber <= n && n <= protowire.LastReservedNumber) { - return errors.New("extension field %q has an invalid number: %d", x.FullName(), x.Number()) - } - if !x.Cardinality().IsValid() || x.Cardinality() == protoreflect.Required { - return errors.New("extension field %q has an invalid cardinality: %d", x.FullName(), x.Cardinality()) - } - if xd.JsonName != nil { - // A bug in older versions of protoc would always populate the - // "json_name" option for extensions when it is meaningless. - // When it did so, it would always use the camel-cased field name. - if xd.GetJsonName() != strs.JSONCamelCase(string(x.Name())) { - return errors.New("extension field %q may not have an explicitly set JSON name: %q", x.FullName(), xd.GetJsonName()) - } - } - if xd.OneofIndex != nil { - return errors.New("extension field %q may not be part of a oneof", x.FullName()) - } - if md := x.ContainingMessage(); !md.IsPlaceholder() { - if !md.ExtensionRanges().Has(x.Number()) { - return errors.New("extension field %q extends %q with non-extension field number: %d", x.FullName(), md.FullName(), x.Number()) - } - isMessageSet := md.Options().(*descriptorpb.MessageOptions).GetMessageSetWireFormat() - if isMessageSet && !isOptionalMessage(x) { - return errors.New("extension field %q extends MessageSet and must be an optional message", x.FullName()) - } - if !isMessageSet && !x.Number().IsValid() { - return errors.New("extension field %q has an invalid number: %d", x.FullName(), x.Number()) - } - } - if x.IsPacked() && !isPackable(x) { - return errors.New("extension field %q is not packable", x.FullName()) - } - if err := checkValidGroup(f, x); err != nil { - return errors.New("extension field %q is an invalid group: %v", x.FullName(), err) - } - if md := x.Message(); md != nil && md.IsMapEntry() { - return errors.New("extension field %q cannot be a map entry", x.FullName()) - } - if f.L1.Edition == fromEditionProto(descriptorpb.Edition_EDITION_PROTO3) { - switch x.ContainingMessage().FullName() { - case (*descriptorpb.FileOptions)(nil).ProtoReflect().Descriptor().FullName(): - case (*descriptorpb.EnumOptions)(nil).ProtoReflect().Descriptor().FullName(): - case (*descriptorpb.EnumValueOptions)(nil).ProtoReflect().Descriptor().FullName(): - case (*descriptorpb.MessageOptions)(nil).ProtoReflect().Descriptor().FullName(): - case (*descriptorpb.FieldOptions)(nil).ProtoReflect().Descriptor().FullName(): - case (*descriptorpb.OneofOptions)(nil).ProtoReflect().Descriptor().FullName(): - case (*descriptorpb.ExtensionRangeOptions)(nil).ProtoReflect().Descriptor().FullName(): - case (*descriptorpb.ServiceOptions)(nil).ProtoReflect().Descriptor().FullName(): - case (*descriptorpb.MethodOptions)(nil).ProtoReflect().Descriptor().FullName(): - default: - return errors.New("extension field %q cannot be declared in proto3 unless extended descriptor options", x.FullName()) - } - } - } - return nil -} - -// isOptionalMessage reports whether this is an optional message. -// If the kind is unknown, it is assumed to be a message. -func isOptionalMessage(fd protoreflect.FieldDescriptor) bool { - return (fd.Kind() == 0 || fd.Kind() == protoreflect.MessageKind) && fd.Cardinality() == protoreflect.Optional -} - -// isPackable checks whether the pack option can be specified. -func isPackable(fd protoreflect.FieldDescriptor) bool { - switch fd.Kind() { - case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind, protoreflect.GroupKind: - return false - } - return fd.IsList() -} - -// checkValidGroup reports whether fd is a valid group according to the same -// rules that protoc imposes. -func checkValidGroup(f *filedesc.File, fd protoreflect.FieldDescriptor) error { - md := fd.Message() - switch { - case fd.Kind() != protoreflect.GroupKind: - return nil - case f.L1.Edition == fromEditionProto(descriptorpb.Edition_EDITION_PROTO3): - return errors.New("invalid under proto3 semantics") - case md == nil || md.IsPlaceholder(): - return errors.New("message must be resolvable") - } - if f.L1.Edition < fromEditionProto(descriptorpb.Edition_EDITION_2023) { - switch { - case fd.FullName().Parent() != md.FullName().Parent(): - return errors.New("message and field must be declared in the same scope") - case !unicode.IsUpper(rune(md.Name()[0])): - return errors.New("message name must start with an uppercase") - case fd.Name() != protoreflect.Name(strings.ToLower(string(md.Name()))): - return errors.New("field name must be lowercased form of the message name") - } - } - return nil -} - -// checkValidMap checks whether the field is a valid map according to the same -// rules that protoc imposes. -// See protoc v3.8.0: src/google/protobuf/descriptor.cc:6045-6115 -func checkValidMap(fd protoreflect.FieldDescriptor) error { - md := fd.Message() - switch { - case md == nil || !md.IsMapEntry(): - return nil - case fd.FullName().Parent() != md.FullName().Parent(): - return errors.New("message and field must be declared in the same scope") - case md.Name() != protoreflect.Name(strs.MapEntryName(string(fd.Name()))): - return errors.New("incorrect implicit map entry name") - case fd.Cardinality() != protoreflect.Repeated: - return errors.New("field must be repeated") - case md.Fields().Len() != 2: - return errors.New("message must have exactly two fields") - case md.ExtensionRanges().Len() > 0: - return errors.New("message must not have any extension ranges") - case md.Enums().Len()+md.Messages().Len()+md.Extensions().Len() > 0: - return errors.New("message must not have any nested declarations") - } - kf := md.Fields().Get(0) - vf := md.Fields().Get(1) - switch { - case kf.Name() != genid.MapEntry_Key_field_name || kf.Number() != genid.MapEntry_Key_field_number || kf.Cardinality() != protoreflect.Optional || kf.ContainingOneof() != nil || kf.HasDefault(): - return errors.New("invalid key field") - case vf.Name() != genid.MapEntry_Value_field_name || vf.Number() != genid.MapEntry_Value_field_number || vf.Cardinality() != protoreflect.Optional || vf.ContainingOneof() != nil || vf.HasDefault(): - return errors.New("invalid value field") - } - switch kf.Kind() { - case protoreflect.BoolKind: // bool - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: // int32 - case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: // int64 - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: // uint32 - case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: // uint64 - case protoreflect.StringKind: // string - default: - return errors.New("invalid key kind: %v", kf.Kind()) - } - if e := vf.Enum(); e != nil && e.Values().Len() > 0 && e.Values().Get(0).Number() != 0 { - return errors.New("map enum value must have zero number for the first value") - } - return nil -} diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go b/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go deleted file mode 100644 index 697a61b290..0000000000 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package protodesc - -import ( - "fmt" - "os" - "sync" - - "google.golang.org/protobuf/internal/editiondefaults" - "google.golang.org/protobuf/internal/filedesc" - "google.golang.org/protobuf/internal/genid" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/descriptorpb" - "google.golang.org/protobuf/types/gofeaturespb" -) - -var defaults = &descriptorpb.FeatureSetDefaults{} -var defaultsCacheMu sync.Mutex -var defaultsCache = make(map[filedesc.Edition]*descriptorpb.FeatureSet) - -func init() { - err := proto.Unmarshal(editiondefaults.Defaults, defaults) - if err != nil { - fmt.Fprintf(os.Stderr, "unmarshal editions defaults: %v\n", err) - os.Exit(1) - } -} - -func fromEditionProto(epb descriptorpb.Edition) filedesc.Edition { - return filedesc.Edition(epb) -} - -func toEditionProto(ed filedesc.Edition) descriptorpb.Edition { - switch ed { - case filedesc.EditionUnknown: - return descriptorpb.Edition_EDITION_UNKNOWN - case filedesc.EditionProto2: - return descriptorpb.Edition_EDITION_PROTO2 - case filedesc.EditionProto3: - return descriptorpb.Edition_EDITION_PROTO3 - case filedesc.Edition2023: - return descriptorpb.Edition_EDITION_2023 - case filedesc.Edition2024: - return descriptorpb.Edition_EDITION_2024 - default: - panic(fmt.Sprintf("unknown value for edition: %v", ed)) - } -} - -func getFeatureSetFor(ed filedesc.Edition) *descriptorpb.FeatureSet { - defaultsCacheMu.Lock() - defer defaultsCacheMu.Unlock() - if def, ok := defaultsCache[ed]; ok { - return def - } - edpb := toEditionProto(ed) - if defaults.GetMinimumEdition() > edpb || defaults.GetMaximumEdition() < edpb { - // This should never happen protodesc.(FileOptions).New would fail when - // initializing the file descriptor. - // This most likely means the embedded defaults were not updated. - fmt.Fprintf(os.Stderr, "internal error: unsupported edition %v (did you forget to update the embedded defaults (i.e. the bootstrap descriptor proto)?)\n", edpb) - os.Exit(1) - } - fsed := defaults.GetDefaults()[0] - // Using a linear search for now. - // Editions are guaranteed to be sorted and thus we could use a binary search. - // Given that there are only a handful of editions (with one more per year) - // there is not much reason to use a binary search. - for _, def := range defaults.GetDefaults() { - if def.GetEdition() <= edpb { - fsed = def - } else { - break - } - } - fs := proto.Clone(fsed.GetFixedFeatures()).(*descriptorpb.FeatureSet) - proto.Merge(fs, fsed.GetOverridableFeatures()) - defaultsCache[ed] = fs - return fs -} - -// mergeEditionFeatures merges the parent and child feature sets. This function -// should be used when initializing Go descriptors from descriptor protos which -// is why the parent is a filedesc.EditionsFeatures (Go representation) while -// the child is a descriptorproto.FeatureSet (protoc representation). -// Any feature set by the child overwrites what is set by the parent. -func mergeEditionFeatures(parentDesc protoreflect.Descriptor, child *descriptorpb.FeatureSet) filedesc.EditionFeatures { - var parentFS filedesc.EditionFeatures - switch p := parentDesc.(type) { - case *filedesc.File: - parentFS = p.L1.EditionFeatures - case *filedesc.Message: - parentFS = p.L1.EditionFeatures - default: - panic(fmt.Sprintf("unknown parent type %T", parentDesc)) - } - if child == nil { - return parentFS - } - if fp := child.FieldPresence; fp != nil { - parentFS.IsFieldPresence = *fp == descriptorpb.FeatureSet_LEGACY_REQUIRED || - *fp == descriptorpb.FeatureSet_EXPLICIT - parentFS.IsLegacyRequired = *fp == descriptorpb.FeatureSet_LEGACY_REQUIRED - } - if et := child.EnumType; et != nil { - parentFS.IsOpenEnum = *et == descriptorpb.FeatureSet_OPEN - } - - if rfe := child.RepeatedFieldEncoding; rfe != nil { - parentFS.IsPacked = *rfe == descriptorpb.FeatureSet_PACKED - } - - if utf8val := child.Utf8Validation; utf8val != nil { - parentFS.IsUTF8Validated = *utf8val == descriptorpb.FeatureSet_VERIFY - } - - if me := child.MessageEncoding; me != nil { - parentFS.IsDelimitedEncoded = *me == descriptorpb.FeatureSet_DELIMITED - } - - if jf := child.JsonFormat; jf != nil { - parentFS.IsJSONCompliant = *jf == descriptorpb.FeatureSet_ALLOW - } - - // We must not use proto.GetExtension(child, gofeaturespb.E_Go) - // because that only works for messages we generated, but not for - // dynamicpb messages. See golang/protobuf#1669. - // - // Further, we harden this code against adversarial inputs: a - // service which accepts descriptors from a possibly malicious - // source shouldn't crash. - goFeatures := child.ProtoReflect().Get(gofeaturespb.E_Go.TypeDescriptor()) - if !goFeatures.IsValid() { - return parentFS - } - gf, ok := goFeatures.Interface().(protoreflect.Message) - if !ok { - return parentFS - } - // gf.Interface() could be *dynamicpb.Message or *gofeaturespb.GoFeatures. - fields := gf.Descriptor().Fields() - - if fd := fields.ByNumber(genid.GoFeatures_LegacyUnmarshalJsonEnum_field_number); fd != nil && - !fd.IsList() && - fd.Kind() == protoreflect.BoolKind && - gf.Has(fd) { - parentFS.GenerateLegacyUnmarshalJSON = gf.Get(fd).Bool() - } - - if fd := fields.ByNumber(genid.GoFeatures_StripEnumPrefix_field_number); fd != nil && - !fd.IsList() && - fd.Kind() == protoreflect.EnumKind && - gf.Has(fd) { - parentFS.StripEnumPrefix = int(gf.Get(fd).Enum()) - } - - if fd := fields.ByNumber(genid.GoFeatures_ApiLevel_field_number); fd != nil && - !fd.IsList() && - fd.Kind() == protoreflect.EnumKind && - gf.Has(fd) { - parentFS.APILevel = int(gf.Get(fd).Enum()) - } - - return parentFS -} - -// initFileDescFromFeatureSet initializes editions related fields in fd based -// on fs. If fs is nil it is assumed to be an empty featureset and all fields -// will be initialized with the appropriate default. fd.L1.Edition must be set -// before calling this function. -func initFileDescFromFeatureSet(fd *filedesc.File, fs *descriptorpb.FeatureSet) { - dfs := getFeatureSetFor(fd.L1.Edition) - // initialize the featureset with the defaults - fd.L1.EditionFeatures = mergeEditionFeatures(fd, dfs) - // overwrite any options explicitly specified - fd.L1.EditionFeatures = mergeEditionFeatures(fd, fs) -} diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go b/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go deleted file mode 100644 index 9b880aa8c9..0000000000 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package protodesc - -import ( - "fmt" - "strings" - - "google.golang.org/protobuf/internal/encoding/defval" - "google.golang.org/protobuf/internal/strs" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "google.golang.org/protobuf/types/descriptorpb" -) - -// ToFileDescriptorProto copies a [protoreflect.FileDescriptor] into a -// google.protobuf.FileDescriptorProto message. -func ToFileDescriptorProto(file protoreflect.FileDescriptor) *descriptorpb.FileDescriptorProto { - p := &descriptorpb.FileDescriptorProto{ - Name: proto.String(file.Path()), - Options: proto.Clone(file.Options()).(*descriptorpb.FileOptions), - } - if file.Package() != "" { - p.Package = proto.String(string(file.Package())) - } - for i, imports := 0, file.Imports(); i < imports.Len(); i++ { - imp := imports.Get(i) - p.Dependency = append(p.Dependency, imp.Path()) - if imp.IsPublic { - p.PublicDependency = append(p.PublicDependency, int32(i)) - } - } - for i, locs := 0, file.SourceLocations(); i < locs.Len(); i++ { - loc := locs.Get(i) - l := &descriptorpb.SourceCodeInfo_Location{} - l.Path = append(l.Path, loc.Path...) - if loc.StartLine == loc.EndLine { - l.Span = []int32{int32(loc.StartLine), int32(loc.StartColumn), int32(loc.EndColumn)} - } else { - l.Span = []int32{int32(loc.StartLine), int32(loc.StartColumn), int32(loc.EndLine), int32(loc.EndColumn)} - } - l.LeadingDetachedComments = append([]string(nil), loc.LeadingDetachedComments...) - if loc.LeadingComments != "" { - l.LeadingComments = proto.String(loc.LeadingComments) - } - if loc.TrailingComments != "" { - l.TrailingComments = proto.String(loc.TrailingComments) - } - if p.SourceCodeInfo == nil { - p.SourceCodeInfo = &descriptorpb.SourceCodeInfo{} - } - p.SourceCodeInfo.Location = append(p.SourceCodeInfo.Location, l) - - } - for i, messages := 0, file.Messages(); i < messages.Len(); i++ { - p.MessageType = append(p.MessageType, ToDescriptorProto(messages.Get(i))) - } - for i, enums := 0, file.Enums(); i < enums.Len(); i++ { - p.EnumType = append(p.EnumType, ToEnumDescriptorProto(enums.Get(i))) - } - for i, services := 0, file.Services(); i < services.Len(); i++ { - p.Service = append(p.Service, ToServiceDescriptorProto(services.Get(i))) - } - for i, exts := 0, file.Extensions(); i < exts.Len(); i++ { - p.Extension = append(p.Extension, ToFieldDescriptorProto(exts.Get(i))) - } - if syntax := file.Syntax(); syntax != protoreflect.Proto2 && syntax.IsValid() { - p.Syntax = proto.String(file.Syntax().String()) - } - if file.Syntax() == protoreflect.Editions { - desc := file - if fileImportDesc, ok := file.(protoreflect.FileImport); ok { - desc = fileImportDesc.FileDescriptor - } - - if editionsInterface, ok := desc.(interface{ Edition() int32 }); ok { - p.Edition = descriptorpb.Edition(editionsInterface.Edition()).Enum() - } - } - return p -} - -// ToDescriptorProto copies a [protoreflect.MessageDescriptor] into a -// google.protobuf.DescriptorProto message. -func ToDescriptorProto(message protoreflect.MessageDescriptor) *descriptorpb.DescriptorProto { - p := &descriptorpb.DescriptorProto{ - Name: proto.String(string(message.Name())), - Options: proto.Clone(message.Options()).(*descriptorpb.MessageOptions), - } - for i, fields := 0, message.Fields(); i < fields.Len(); i++ { - p.Field = append(p.Field, ToFieldDescriptorProto(fields.Get(i))) - } - for i, exts := 0, message.Extensions(); i < exts.Len(); i++ { - p.Extension = append(p.Extension, ToFieldDescriptorProto(exts.Get(i))) - } - for i, messages := 0, message.Messages(); i < messages.Len(); i++ { - p.NestedType = append(p.NestedType, ToDescriptorProto(messages.Get(i))) - } - for i, enums := 0, message.Enums(); i < enums.Len(); i++ { - p.EnumType = append(p.EnumType, ToEnumDescriptorProto(enums.Get(i))) - } - for i, xranges := 0, message.ExtensionRanges(); i < xranges.Len(); i++ { - xrange := xranges.Get(i) - p.ExtensionRange = append(p.ExtensionRange, &descriptorpb.DescriptorProto_ExtensionRange{ - Start: proto.Int32(int32(xrange[0])), - End: proto.Int32(int32(xrange[1])), - Options: proto.Clone(message.ExtensionRangeOptions(i)).(*descriptorpb.ExtensionRangeOptions), - }) - } - for i, oneofs := 0, message.Oneofs(); i < oneofs.Len(); i++ { - p.OneofDecl = append(p.OneofDecl, ToOneofDescriptorProto(oneofs.Get(i))) - } - for i, ranges := 0, message.ReservedRanges(); i < ranges.Len(); i++ { - rrange := ranges.Get(i) - p.ReservedRange = append(p.ReservedRange, &descriptorpb.DescriptorProto_ReservedRange{ - Start: proto.Int32(int32(rrange[0])), - End: proto.Int32(int32(rrange[1])), - }) - } - for i, names := 0, message.ReservedNames(); i < names.Len(); i++ { - p.ReservedName = append(p.ReservedName, string(names.Get(i))) - } - return p -} - -// ToFieldDescriptorProto copies a [protoreflect.FieldDescriptor] into a -// google.protobuf.FieldDescriptorProto message. -func ToFieldDescriptorProto(field protoreflect.FieldDescriptor) *descriptorpb.FieldDescriptorProto { - p := &descriptorpb.FieldDescriptorProto{ - Name: proto.String(string(field.Name())), - Number: proto.Int32(int32(field.Number())), - Label: descriptorpb.FieldDescriptorProto_Label(field.Cardinality()).Enum(), - Options: proto.Clone(field.Options()).(*descriptorpb.FieldOptions), - } - if field.IsExtension() { - p.Extendee = fullNameOf(field.ContainingMessage()) - } - if field.Kind().IsValid() { - p.Type = descriptorpb.FieldDescriptorProto_Type(field.Kind()).Enum() - } - if field.Enum() != nil { - p.TypeName = fullNameOf(field.Enum()) - } - if field.Message() != nil { - p.TypeName = fullNameOf(field.Message()) - } - if field.HasJSONName() { - // A bug in older versions of protoc would always populate the - // "json_name" option for extensions when it is meaningless. - // When it did so, it would always use the camel-cased field name. - if field.IsExtension() { - p.JsonName = proto.String(strs.JSONCamelCase(string(field.Name()))) - } else { - p.JsonName = proto.String(field.JSONName()) - } - } - if field.Syntax() == protoreflect.Proto3 && field.HasOptionalKeyword() { - p.Proto3Optional = proto.Bool(true) - } - if field.Syntax() == protoreflect.Editions { - // Editions have no group keyword, this type is only set so that downstream users continue - // treating this as delimited encoding. - if p.GetType() == descriptorpb.FieldDescriptorProto_TYPE_GROUP { - p.Type = descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum() - } - // Editions have no required keyword, this label is only set so that downstream users continue - // treating it as required. - if p.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_REQUIRED { - p.Label = descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum() - } - } - if field.HasDefault() { - def, err := defval.Marshal(field.Default(), field.DefaultEnumValue(), field.Kind(), defval.Descriptor) - if err != nil && field.DefaultEnumValue() != nil { - def = string(field.DefaultEnumValue().Name()) // occurs for unresolved enum values - } else if err != nil { - panic(fmt.Sprintf("%v: %v", field.FullName(), err)) - } - p.DefaultValue = proto.String(def) - } - if oneof := field.ContainingOneof(); oneof != nil { - p.OneofIndex = proto.Int32(int32(oneof.Index())) - } - return p -} - -// ToOneofDescriptorProto copies a [protoreflect.OneofDescriptor] into a -// google.protobuf.OneofDescriptorProto message. -func ToOneofDescriptorProto(oneof protoreflect.OneofDescriptor) *descriptorpb.OneofDescriptorProto { - return &descriptorpb.OneofDescriptorProto{ - Name: proto.String(string(oneof.Name())), - Options: proto.Clone(oneof.Options()).(*descriptorpb.OneofOptions), - } -} - -// ToEnumDescriptorProto copies a [protoreflect.EnumDescriptor] into a -// google.protobuf.EnumDescriptorProto message. -func ToEnumDescriptorProto(enum protoreflect.EnumDescriptor) *descriptorpb.EnumDescriptorProto { - p := &descriptorpb.EnumDescriptorProto{ - Name: proto.String(string(enum.Name())), - Options: proto.Clone(enum.Options()).(*descriptorpb.EnumOptions), - } - for i, values := 0, enum.Values(); i < values.Len(); i++ { - p.Value = append(p.Value, ToEnumValueDescriptorProto(values.Get(i))) - } - for i, ranges := 0, enum.ReservedRanges(); i < ranges.Len(); i++ { - rrange := ranges.Get(i) - p.ReservedRange = append(p.ReservedRange, &descriptorpb.EnumDescriptorProto_EnumReservedRange{ - Start: proto.Int32(int32(rrange[0])), - End: proto.Int32(int32(rrange[1])), - }) - } - for i, names := 0, enum.ReservedNames(); i < names.Len(); i++ { - p.ReservedName = append(p.ReservedName, string(names.Get(i))) - } - return p -} - -// ToEnumValueDescriptorProto copies a [protoreflect.EnumValueDescriptor] into a -// google.protobuf.EnumValueDescriptorProto message. -func ToEnumValueDescriptorProto(value protoreflect.EnumValueDescriptor) *descriptorpb.EnumValueDescriptorProto { - return &descriptorpb.EnumValueDescriptorProto{ - Name: proto.String(string(value.Name())), - Number: proto.Int32(int32(value.Number())), - Options: proto.Clone(value.Options()).(*descriptorpb.EnumValueOptions), - } -} - -// ToServiceDescriptorProto copies a [protoreflect.ServiceDescriptor] into a -// google.protobuf.ServiceDescriptorProto message. -func ToServiceDescriptorProto(service protoreflect.ServiceDescriptor) *descriptorpb.ServiceDescriptorProto { - p := &descriptorpb.ServiceDescriptorProto{ - Name: proto.String(string(service.Name())), - Options: proto.Clone(service.Options()).(*descriptorpb.ServiceOptions), - } - for i, methods := 0, service.Methods(); i < methods.Len(); i++ { - p.Method = append(p.Method, ToMethodDescriptorProto(methods.Get(i))) - } - return p -} - -// ToMethodDescriptorProto copies a [protoreflect.MethodDescriptor] into a -// google.protobuf.MethodDescriptorProto message. -func ToMethodDescriptorProto(method protoreflect.MethodDescriptor) *descriptorpb.MethodDescriptorProto { - p := &descriptorpb.MethodDescriptorProto{ - Name: proto.String(string(method.Name())), - InputType: fullNameOf(method.Input()), - OutputType: fullNameOf(method.Output()), - Options: proto.Clone(method.Options()).(*descriptorpb.MethodOptions), - } - if method.IsStreamingClient() { - p.ClientStreaming = proto.Bool(true) - } - if method.IsStreamingServer() { - p.ServerStreaming = proto.Bool(true) - } - return p -} - -func fullNameOf(d protoreflect.Descriptor) *string { - if d == nil { - return nil - } - if strings.HasPrefix(string(d.FullName()), unknownPrefix) { - return proto.String(string(d.FullName()[len(unknownPrefix):])) - } - return proto.String("." + string(d.FullName())) -} diff --git a/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.pb.go b/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.pb.go deleted file mode 100644 index 37e712b6b7..0000000000 --- a/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.pb.go +++ /dev/null @@ -1,311 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2023 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/protobuf/go_features.proto - -package gofeaturespb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -type GoFeatures_APILevel int32 - -const ( - // API_LEVEL_UNSPECIFIED results in selecting the OPEN API, - // but needs to be a separate value to distinguish between - // an explicitly set api level or a missing api level. - GoFeatures_API_LEVEL_UNSPECIFIED GoFeatures_APILevel = 0 - GoFeatures_API_OPEN GoFeatures_APILevel = 1 - GoFeatures_API_HYBRID GoFeatures_APILevel = 2 - GoFeatures_API_OPAQUE GoFeatures_APILevel = 3 -) - -// Enum value maps for GoFeatures_APILevel. -var ( - GoFeatures_APILevel_name = map[int32]string{ - 0: "API_LEVEL_UNSPECIFIED", - 1: "API_OPEN", - 2: "API_HYBRID", - 3: "API_OPAQUE", - } - GoFeatures_APILevel_value = map[string]int32{ - "API_LEVEL_UNSPECIFIED": 0, - "API_OPEN": 1, - "API_HYBRID": 2, - "API_OPAQUE": 3, - } -) - -func (x GoFeatures_APILevel) Enum() *GoFeatures_APILevel { - p := new(GoFeatures_APILevel) - *p = x - return p -} - -func (x GoFeatures_APILevel) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (GoFeatures_APILevel) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_go_features_proto_enumTypes[0].Descriptor() -} - -func (GoFeatures_APILevel) Type() protoreflect.EnumType { - return &file_google_protobuf_go_features_proto_enumTypes[0] -} - -func (x GoFeatures_APILevel) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *GoFeatures_APILevel) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = GoFeatures_APILevel(num) - return nil -} - -// Deprecated: Use GoFeatures_APILevel.Descriptor instead. -func (GoFeatures_APILevel) EnumDescriptor() ([]byte, []int) { - return file_google_protobuf_go_features_proto_rawDescGZIP(), []int{0, 0} -} - -type GoFeatures_StripEnumPrefix int32 - -const ( - GoFeatures_STRIP_ENUM_PREFIX_UNSPECIFIED GoFeatures_StripEnumPrefix = 0 - GoFeatures_STRIP_ENUM_PREFIX_KEEP GoFeatures_StripEnumPrefix = 1 - GoFeatures_STRIP_ENUM_PREFIX_GENERATE_BOTH GoFeatures_StripEnumPrefix = 2 - GoFeatures_STRIP_ENUM_PREFIX_STRIP GoFeatures_StripEnumPrefix = 3 -) - -// Enum value maps for GoFeatures_StripEnumPrefix. -var ( - GoFeatures_StripEnumPrefix_name = map[int32]string{ - 0: "STRIP_ENUM_PREFIX_UNSPECIFIED", - 1: "STRIP_ENUM_PREFIX_KEEP", - 2: "STRIP_ENUM_PREFIX_GENERATE_BOTH", - 3: "STRIP_ENUM_PREFIX_STRIP", - } - GoFeatures_StripEnumPrefix_value = map[string]int32{ - "STRIP_ENUM_PREFIX_UNSPECIFIED": 0, - "STRIP_ENUM_PREFIX_KEEP": 1, - "STRIP_ENUM_PREFIX_GENERATE_BOTH": 2, - "STRIP_ENUM_PREFIX_STRIP": 3, - } -) - -func (x GoFeatures_StripEnumPrefix) Enum() *GoFeatures_StripEnumPrefix { - p := new(GoFeatures_StripEnumPrefix) - *p = x - return p -} - -func (x GoFeatures_StripEnumPrefix) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (GoFeatures_StripEnumPrefix) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_go_features_proto_enumTypes[1].Descriptor() -} - -func (GoFeatures_StripEnumPrefix) Type() protoreflect.EnumType { - return &file_google_protobuf_go_features_proto_enumTypes[1] -} - -func (x GoFeatures_StripEnumPrefix) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *GoFeatures_StripEnumPrefix) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = GoFeatures_StripEnumPrefix(num) - return nil -} - -// Deprecated: Use GoFeatures_StripEnumPrefix.Descriptor instead. -func (GoFeatures_StripEnumPrefix) EnumDescriptor() ([]byte, []int) { - return file_google_protobuf_go_features_proto_rawDescGZIP(), []int{0, 1} -} - -type GoFeatures struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Whether or not to generate the deprecated UnmarshalJSON method for enums. - // Can only be true for proto using the Open Struct api. - LegacyUnmarshalJsonEnum *bool `protobuf:"varint,1,opt,name=legacy_unmarshal_json_enum,json=legacyUnmarshalJsonEnum" json:"legacy_unmarshal_json_enum,omitempty"` - // One of OPEN, HYBRID or OPAQUE. - ApiLevel *GoFeatures_APILevel `protobuf:"varint,2,opt,name=api_level,json=apiLevel,enum=pb.GoFeatures_APILevel" json:"api_level,omitempty"` - StripEnumPrefix *GoFeatures_StripEnumPrefix `protobuf:"varint,3,opt,name=strip_enum_prefix,json=stripEnumPrefix,enum=pb.GoFeatures_StripEnumPrefix" json:"strip_enum_prefix,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GoFeatures) Reset() { - *x = GoFeatures{} - mi := &file_google_protobuf_go_features_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GoFeatures) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GoFeatures) ProtoMessage() {} - -func (x *GoFeatures) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_go_features_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GoFeatures.ProtoReflect.Descriptor instead. -func (*GoFeatures) Descriptor() ([]byte, []int) { - return file_google_protobuf_go_features_proto_rawDescGZIP(), []int{0} -} - -func (x *GoFeatures) GetLegacyUnmarshalJsonEnum() bool { - if x != nil && x.LegacyUnmarshalJsonEnum != nil { - return *x.LegacyUnmarshalJsonEnum - } - return false -} - -func (x *GoFeatures) GetApiLevel() GoFeatures_APILevel { - if x != nil && x.ApiLevel != nil { - return *x.ApiLevel - } - return GoFeatures_API_LEVEL_UNSPECIFIED -} - -func (x *GoFeatures) GetStripEnumPrefix() GoFeatures_StripEnumPrefix { - if x != nil && x.StripEnumPrefix != nil { - return *x.StripEnumPrefix - } - return GoFeatures_STRIP_ENUM_PREFIX_UNSPECIFIED -} - -var file_google_protobuf_go_features_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.FeatureSet)(nil), - ExtensionType: (*GoFeatures)(nil), - Field: 1002, - Name: "pb.go", - Tag: "bytes,1002,opt,name=go", - Filename: "google/protobuf/go_features.proto", - }, -} - -// Extension fields to descriptorpb.FeatureSet. -var ( - // optional pb.GoFeatures go = 1002; - E_Go = &file_google_protobuf_go_features_proto_extTypes[0] -) - -var File_google_protobuf_go_features_proto protoreflect.FileDescriptor - -const file_google_protobuf_go_features_proto_rawDesc = "" + - "\n" + - "!google/protobuf/go_features.proto\x12\x02pb\x1a google/protobuf/descriptor.proto\"\xab\x05\n" + - "\n" + - "GoFeatures\x12\xbe\x01\n" + - "\x1alegacy_unmarshal_json_enum\x18\x01 \x01(\bB\x80\x01\x88\x01\x01\x98\x01\x06\x98\x01\x01\xa2\x01\t\x12\x04true\x18\x84\a\xa2\x01\n" + - "\x12\x05false\x18\xe7\a\xb2\x01[\b\xe8\a\x10\xe8\a\x1aSThe legacy UnmarshalJSON API is deprecated and will be removed in a future edition.R\x17legacyUnmarshalJsonEnum\x12t\n" + - "\tapi_level\x18\x02 \x01(\x0e2\x17.pb.GoFeatures.APILevelB>\x88\x01\x01\x98\x01\x03\x98\x01\x01\xa2\x01\x1a\x12\x15API_LEVEL_UNSPECIFIED\x18\x84\a\xa2\x01\x0f\x12\n" + - "API_OPAQUE\x18\xe9\a\xb2\x01\x03\b\xe8\aR\bapiLevel\x12|\n" + - "\x11strip_enum_prefix\x18\x03 \x01(\x0e2\x1e.pb.GoFeatures.StripEnumPrefixB0\x88\x01\x01\x98\x01\x06\x98\x01\a\x98\x01\x01\xa2\x01\x1b\x12\x16STRIP_ENUM_PREFIX_KEEP\x18\x84\a\xb2\x01\x03\b\xe9\aR\x0fstripEnumPrefix\"S\n" + - "\bAPILevel\x12\x19\n" + - "\x15API_LEVEL_UNSPECIFIED\x10\x00\x12\f\n" + - "\bAPI_OPEN\x10\x01\x12\x0e\n" + - "\n" + - "API_HYBRID\x10\x02\x12\x0e\n" + - "\n" + - "API_OPAQUE\x10\x03\"\x92\x01\n" + - "\x0fStripEnumPrefix\x12!\n" + - "\x1dSTRIP_ENUM_PREFIX_UNSPECIFIED\x10\x00\x12\x1a\n" + - "\x16STRIP_ENUM_PREFIX_KEEP\x10\x01\x12#\n" + - "\x1fSTRIP_ENUM_PREFIX_GENERATE_BOTH\x10\x02\x12\x1b\n" + - "\x17STRIP_ENUM_PREFIX_STRIP\x10\x03:<\n" + - "\x02go\x12\x1b.google.protobuf.FeatureSet\x18\xea\a \x01(\v2\x0e.pb.GoFeaturesR\x02goB/Z-google.golang.org/protobuf/types/gofeaturespb" - -var ( - file_google_protobuf_go_features_proto_rawDescOnce sync.Once - file_google_protobuf_go_features_proto_rawDescData []byte -) - -func file_google_protobuf_go_features_proto_rawDescGZIP() []byte { - file_google_protobuf_go_features_proto_rawDescOnce.Do(func() { - file_google_protobuf_go_features_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_protobuf_go_features_proto_rawDesc), len(file_google_protobuf_go_features_proto_rawDesc))) - }) - return file_google_protobuf_go_features_proto_rawDescData -} - -var file_google_protobuf_go_features_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_google_protobuf_go_features_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_google_protobuf_go_features_proto_goTypes = []any{ - (GoFeatures_APILevel)(0), // 0: pb.GoFeatures.APILevel - (GoFeatures_StripEnumPrefix)(0), // 1: pb.GoFeatures.StripEnumPrefix - (*GoFeatures)(nil), // 2: pb.GoFeatures - (*descriptorpb.FeatureSet)(nil), // 3: google.protobuf.FeatureSet -} -var file_google_protobuf_go_features_proto_depIdxs = []int32{ - 0, // 0: pb.GoFeatures.api_level:type_name -> pb.GoFeatures.APILevel - 1, // 1: pb.GoFeatures.strip_enum_prefix:type_name -> pb.GoFeatures.StripEnumPrefix - 3, // 2: pb.go:extendee -> google.protobuf.FeatureSet - 2, // 3: pb.go:type_name -> pb.GoFeatures - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 3, // [3:4] is the sub-list for extension type_name - 2, // [2:3] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_google_protobuf_go_features_proto_init() } -func file_google_protobuf_go_features_proto_init() { - if File_google_protobuf_go_features_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_protobuf_go_features_proto_rawDesc), len(file_google_protobuf_go_features_proto_rawDesc)), - NumEnums: 2, - NumMessages: 1, - NumExtensions: 1, - NumServices: 0, - }, - GoTypes: file_google_protobuf_go_features_proto_goTypes, - DependencyIndexes: file_google_protobuf_go_features_proto_depIdxs, - EnumInfos: file_google_protobuf_go_features_proto_enumTypes, - MessageInfos: file_google_protobuf_go_features_proto_msgTypes, - ExtensionInfos: file_google_protobuf_go_features_proto_extTypes, - }.Build() - File_google_protobuf_go_features_proto = out.File - file_google_protobuf_go_features_proto_goTypes = nil - file_google_protobuf_go_features_proto_depIdxs = nil -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 0bde2ce772..2f4f43da56 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -147,7 +147,6 @@ github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapp # github.com/Microsoft/go-winio v0.6.2 ## explicit; go 1.21 github.com/Microsoft/go-winio -github.com/Microsoft/go-winio/backuptar github.com/Microsoft/go-winio/internal/fs github.com/Microsoft/go-winio/internal/socket github.com/Microsoft/go-winio/internal/stringbuffer @@ -157,7 +156,6 @@ github.com/Microsoft/go-winio/vhd # github.com/Microsoft/hcsshim v0.13.0 ## explicit; go 1.23.0 github.com/Microsoft/hcsshim -github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options github.com/Microsoft/hcsshim/computestorage github.com/Microsoft/hcsshim/internal/cow github.com/Microsoft/hcsshim/internal/hcs @@ -182,7 +180,6 @@ github.com/Microsoft/hcsshim/internal/vmcompute github.com/Microsoft/hcsshim/internal/wclayer github.com/Microsoft/hcsshim/internal/winapi github.com/Microsoft/hcsshim/osversion -github.com/Microsoft/hcsshim/pkg/ociwclayer # github.com/ProtonMail/go-crypto v1.2.0 ## explicit; go 1.22.0 github.com/ProtonMail/go-crypto/bitcurves @@ -403,86 +400,25 @@ github.com/containerd/cgroups/v3/cgroup1/stats github.com/containerd/containerd/platforms # github.com/containerd/containerd/api v1.9.0 ## explicit; go 1.23.0 -github.com/containerd/containerd/api/runtime/sandbox/v1 -github.com/containerd/containerd/api/services/containers/v1 -github.com/containerd/containerd/api/services/content/v1 -github.com/containerd/containerd/api/services/diff/v1 -github.com/containerd/containerd/api/services/events/v1 -github.com/containerd/containerd/api/services/images/v1 -github.com/containerd/containerd/api/services/introspection/v1 -github.com/containerd/containerd/api/services/leases/v1 -github.com/containerd/containerd/api/services/namespaces/v1 -github.com/containerd/containerd/api/services/sandbox/v1 -github.com/containerd/containerd/api/services/snapshots/v1 -github.com/containerd/containerd/api/services/streaming/v1 -github.com/containerd/containerd/api/services/tasks/v1 -github.com/containerd/containerd/api/services/transfer/v1 -github.com/containerd/containerd/api/services/version/v1 github.com/containerd/containerd/api/types -github.com/containerd/containerd/api/types/runc/options -github.com/containerd/containerd/api/types/task -github.com/containerd/containerd/api/types/transfer # github.com/containerd/containerd/v2 v2.1.1 ## explicit; go 1.23.0 -github.com/containerd/containerd/v2/client github.com/containerd/containerd/v2/core/containers github.com/containerd/containerd/v2/core/content -github.com/containerd/containerd/v2/core/content/proxy -github.com/containerd/containerd/v2/core/diff -github.com/containerd/containerd/v2/core/diff/proxy -github.com/containerd/containerd/v2/core/events -github.com/containerd/containerd/v2/core/events/proxy github.com/containerd/containerd/v2/core/images -github.com/containerd/containerd/v2/core/images/archive -github.com/containerd/containerd/v2/core/images/usage -github.com/containerd/containerd/v2/core/introspection -github.com/containerd/containerd/v2/core/introspection/proxy -github.com/containerd/containerd/v2/core/leases -github.com/containerd/containerd/v2/core/leases/proxy github.com/containerd/containerd/v2/core/mount -github.com/containerd/containerd/v2/core/remotes -github.com/containerd/containerd/v2/core/remotes/docker -github.com/containerd/containerd/v2/core/remotes/docker/auth -github.com/containerd/containerd/v2/core/remotes/errors -github.com/containerd/containerd/v2/core/sandbox -github.com/containerd/containerd/v2/core/sandbox/proxy github.com/containerd/containerd/v2/core/snapshots -github.com/containerd/containerd/v2/core/snapshots/proxy -github.com/containerd/containerd/v2/core/streaming -github.com/containerd/containerd/v2/core/streaming/proxy -github.com/containerd/containerd/v2/core/transfer -github.com/containerd/containerd/v2/core/transfer/proxy -github.com/containerd/containerd/v2/core/transfer/streaming -github.com/containerd/containerd/v2/core/unpack -github.com/containerd/containerd/v2/defaults -github.com/containerd/containerd/v2/internal/cleanup -github.com/containerd/containerd/v2/internal/kmutex github.com/containerd/containerd/v2/internal/lazyregexp github.com/containerd/containerd/v2/internal/randutil -github.com/containerd/containerd/v2/internal/userns -github.com/containerd/containerd/v2/pkg/archive github.com/containerd/containerd/v2/pkg/archive/compression -github.com/containerd/containerd/v2/pkg/archive/tarheader github.com/containerd/containerd/v2/pkg/cap -github.com/containerd/containerd/v2/pkg/cio -github.com/containerd/containerd/v2/pkg/dialer -github.com/containerd/containerd/v2/pkg/epoch github.com/containerd/containerd/v2/pkg/filters github.com/containerd/containerd/v2/pkg/identifiers github.com/containerd/containerd/v2/pkg/kernelversion github.com/containerd/containerd/v2/pkg/labels github.com/containerd/containerd/v2/pkg/namespaces github.com/containerd/containerd/v2/pkg/oci -github.com/containerd/containerd/v2/pkg/protobuf -github.com/containerd/containerd/v2/pkg/protobuf/proto -github.com/containerd/containerd/v2/pkg/protobuf/types -github.com/containerd/containerd/v2/pkg/reference -github.com/containerd/containerd/v2/pkg/rootfs github.com/containerd/containerd/v2/pkg/sys -github.com/containerd/containerd/v2/pkg/tracing -github.com/containerd/containerd/v2/plugins -github.com/containerd/containerd/v2/plugins/services -github.com/containerd/containerd/v2/version # github.com/containerd/continuity v0.4.5 ## explicit; go 1.21 github.com/containerd/continuity/devices @@ -495,20 +431,15 @@ github.com/containerd/errdefs # github.com/containerd/errdefs/pkg v0.3.0 ## explicit; go 1.22 github.com/containerd/errdefs/pkg/errgrpc +github.com/containerd/errdefs/pkg/errhttp github.com/containerd/errdefs/pkg/internal/cause github.com/containerd/errdefs/pkg/internal/types -# github.com/containerd/fifo v1.1.0 -## explicit; go 1.18 -github.com/containerd/fifo # github.com/containerd/log v0.1.0 ## explicit; go 1.20 github.com/containerd/log # github.com/containerd/platforms v1.0.0-rc.1 ## explicit; go 1.20 github.com/containerd/platforms -# github.com/containerd/plugin v1.0.0 -## explicit; go 1.20 -github.com/containerd/plugin # github.com/containerd/stargz-snapshotter/estargz v0.16.3 ## explicit; go 1.22.0 github.com/containerd/stargz-snapshotter/estargz @@ -538,12 +469,13 @@ github.com/docker/cli/cli/config/types ## explicit github.com/docker/distribution github.com/docker/distribution/registry/client/auth/challenge -# github.com/docker/docker v28.1.1+incompatible +# github.com/docker/docker v28.2.2+incompatible ## explicit github.com/docker/docker/api github.com/docker/docker/api/types github.com/docker/docker/api/types/backend github.com/docker/docker/api/types/blkiodev +github.com/docker/docker/api/types/build github.com/docker/docker/api/types/checkpoint github.com/docker/docker/api/types/common github.com/docker/docker/api/types/container @@ -552,7 +484,6 @@ github.com/docker/docker/api/types/filters github.com/docker/docker/api/types/image github.com/docker/docker/api/types/mount github.com/docker/docker/api/types/network -github.com/docker/docker/api/types/plugins/logdriver github.com/docker/docker/api/types/registry github.com/docker/docker/api/types/storage github.com/docker/docker/api/types/strslice @@ -568,55 +499,32 @@ github.com/docker/docker/builder/remotecontext github.com/docker/docker/builder/remotecontext/git github.com/docker/docker/builder/remotecontext/urlutil github.com/docker/docker/client -github.com/docker/docker/container -github.com/docker/docker/container/stream -github.com/docker/docker/container/stream/bytespipe github.com/docker/docker/daemon/cluster/provider github.com/docker/docker/daemon/graphdriver -github.com/docker/docker/daemon/logger -github.com/docker/docker/daemon/logger/jsonfilelog -github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog -github.com/docker/docker/daemon/logger/local -github.com/docker/docker/daemon/logger/loggerutils -github.com/docker/docker/daemon/logger/loggerutils/cache -github.com/docker/docker/daemon/logger/templates github.com/docker/docker/daemon/network github.com/docker/docker/dockerversion github.com/docker/docker/errdefs github.com/docker/docker/image -github.com/docker/docker/internal/cleanups github.com/docker/docker/internal/lazyregexp github.com/docker/docker/internal/multierror github.com/docker/docker/internal/platform -github.com/docker/docker/internal/safepath -github.com/docker/docker/internal/unix_noeintr github.com/docker/docker/internal/usergroup github.com/docker/docker/layer -github.com/docker/docker/libcontainerd/types github.com/docker/docker/oci github.com/docker/docker/oci/caps github.com/docker/docker/pkg/archive -github.com/docker/docker/pkg/homedir github.com/docker/docker/pkg/idtools github.com/docker/docker/pkg/ioutils github.com/docker/docker/pkg/jsonmessage github.com/docker/docker/pkg/longpath github.com/docker/docker/pkg/parsers/kernel -github.com/docker/docker/pkg/plugingetter -github.com/docker/docker/pkg/plugins -github.com/docker/docker/pkg/plugins/transport github.com/docker/docker/pkg/pools github.com/docker/docker/pkg/progress -github.com/docker/docker/pkg/rootless github.com/docker/docker/pkg/streamformatter github.com/docker/docker/pkg/stringid github.com/docker/docker/pkg/system -github.com/docker/docker/pkg/tailfile github.com/docker/docker/pkg/tarsum github.com/docker/docker/pkg/useragent -github.com/docker/docker/restartmanager -github.com/docker/docker/volume -github.com/docker/docker/volume/mounts # github.com/docker/docker-credential-helpers v0.9.3 ## explicit; go 1.21 github.com/docker/docker-credential-helpers/client @@ -626,9 +534,6 @@ github.com/docker/docker-credential-helpers/credentials github.com/docker/go-connections/nat github.com/docker/go-connections/sockets github.com/docker/go-connections/tlsconfig -# github.com/docker/go-events v0.0.0-20250114142523-c867878c5e32 -## explicit -github.com/docker/go-events # github.com/docker/go-metrics v0.0.1 ## explicit; go 1.11 github.com/docker/go-metrics @@ -772,11 +677,7 @@ github.com/go-logr/logr/funcr github.com/go-logr/stdr # github.com/gogo/protobuf v1.3.2 ## explicit; go 1.15 -github.com/gogo/protobuf/gogoproto github.com/gogo/protobuf/proto -github.com/gogo/protobuf/protoc-gen-gogo/descriptor -github.com/gogo/protobuf/sortkeys -github.com/gogo/protobuf/types # github.com/golang-jwt/jwt/v4 v4.5.2 ## explicit; go 1.16 github.com/golang-jwt/jwt/v4 @@ -786,9 +687,6 @@ github.com/golang/groupcache/lru # github.com/golang/mock v1.6.0 ## explicit; go 1.11 github.com/golang/mock/gomock -# github.com/golang/protobuf v1.5.4 -## explicit; go 1.17 -github.com/golang/protobuf/proto # github.com/google/go-cmp v0.7.0 ## explicit; go 1.21 github.com/google/go-cmp/cmp @@ -879,15 +777,6 @@ github.com/googleapis/gax-go/v2/internallog github.com/googleapis/gax-go/v2/internallog/grpclog github.com/googleapis/gax-go/v2/internallog/internal github.com/googleapis/gax-go/v2/iterator -# github.com/hashicorp/go-immutable-radix v1.3.1 -## explicit -github.com/hashicorp/go-immutable-radix -# github.com/hashicorp/go-memdb v1.3.5 -## explicit; go 1.13 -github.com/hashicorp/go-memdb -# github.com/hashicorp/golang-lru v1.0.2 -## explicit; go 1.12 -github.com/hashicorp/golang-lru/simplelru # github.com/hashicorp/hcl v1.0.0 ## explicit github.com/hashicorp/hcl @@ -962,16 +851,6 @@ github.com/moby/locker ## explicit; go 1.19 github.com/moby/patternmatcher github.com/moby/patternmatcher/ignorefile -# github.com/moby/swarmkit/v2 v2.0.0-20250103191802-8c1959736554 -## explicit; go 1.18 -github.com/moby/swarmkit/v2/agent/exec -github.com/moby/swarmkit/v2/api -github.com/moby/swarmkit/v2/api/deepcopy -github.com/moby/swarmkit/v2/api/equality -github.com/moby/swarmkit/v2/log -github.com/moby/swarmkit/v2/manager/raftselector -github.com/moby/swarmkit/v2/protobuf/plugin -github.com/moby/swarmkit/v2/protobuf/ptypes # github.com/moby/sys/atomicwriter v0.1.0 ## explicit; go 1.18 github.com/moby/sys/atomicwriter @@ -1015,18 +894,11 @@ github.com/opencontainers/go-digest github.com/opencontainers/go-digest/digestset # github.com/opencontainers/image-spec v1.1.1 ## explicit; go 1.18 -github.com/opencontainers/image-spec/identity github.com/opencontainers/image-spec/specs-go github.com/opencontainers/image-spec/specs-go/v1 # github.com/opencontainers/runtime-spec v1.2.1 ## explicit github.com/opencontainers/runtime-spec/specs-go -github.com/opencontainers/runtime-spec/specs-go/features -# github.com/opencontainers/selinux v1.12.0 -## explicit; go 1.19 -github.com/opencontainers/selinux/go-selinux -github.com/opencontainers/selinux/go-selinux/label -github.com/opencontainers/selinux/pkg/pwalkdir # github.com/otiai10/copy v1.14.1 ## explicit; go 1.18 github.com/otiai10/copy @@ -1155,9 +1027,6 @@ github.com/xanzy/ssh-agent # github.com/zeebo/errs v1.4.0 ## explicit; go 1.12 github.com/zeebo/errs -# go.etcd.io/etcd/raft/v3 v3.5.21 -## explicit; go 1.23.0 -go.etcd.io/etcd/raft/v3/raftpb # go.opencensus.io v0.24.0 ## explicit; go 1.13 go.opencensus.io @@ -1194,7 +1063,6 @@ go.opentelemetry.io/otel/internal/global go.opentelemetry.io/otel/propagation go.opentelemetry.io/otel/semconv/v1.17.0 go.opentelemetry.io/otel/semconv/v1.20.0 -go.opentelemetry.io/otel/semconv/v1.21.0 go.opentelemetry.io/otel/semconv/v1.24.0 go.opentelemetry.io/otel/semconv/v1.26.0 # go.opentelemetry.io/otel/metric v1.36.0 @@ -1390,7 +1258,6 @@ google.golang.org/grpc/experimental/opentelemetry google.golang.org/grpc/experimental/stats google.golang.org/grpc/grpclog google.golang.org/grpc/grpclog/internal -google.golang.org/grpc/health/grpc_health_v1 google.golang.org/grpc/internal google.golang.org/grpc/internal/admin google.golang.org/grpc/internal/backoff @@ -1497,7 +1364,6 @@ google.golang.org/protobuf/internal/descfmt google.golang.org/protobuf/internal/descopts google.golang.org/protobuf/internal/detrand google.golang.org/protobuf/internal/editiondefaults -google.golang.org/protobuf/internal/editionssupport google.golang.org/protobuf/internal/encoding/defval google.golang.org/protobuf/internal/encoding/json google.golang.org/protobuf/internal/encoding/messageset @@ -1517,13 +1383,11 @@ google.golang.org/protobuf/internal/strs google.golang.org/protobuf/internal/version google.golang.org/protobuf/proto google.golang.org/protobuf/protoadapt -google.golang.org/protobuf/reflect/protodesc google.golang.org/protobuf/reflect/protoreflect google.golang.org/protobuf/reflect/protoregistry google.golang.org/protobuf/runtime/protoiface google.golang.org/protobuf/runtime/protoimpl google.golang.org/protobuf/types/descriptorpb -google.golang.org/protobuf/types/gofeaturespb google.golang.org/protobuf/types/known/anypb google.golang.org/protobuf/types/known/durationpb google.golang.org/protobuf/types/known/emptypb